• R/O
  • HTTP
  • SSH
  • HTTPS

List of commits

Tags
No Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

GNU Binutils with patches for OS216


gdb-8.0-branch
RSS
Rev. Tiempo Autor
378272c gdb-8.0-branch 2018-05-21 18:43:40 Tamar Christina

Fix AArch64 debug trace build

The build with debug tracing enabled (`-DDEBUG_AARCH64`)
is currently broken. A variable that no longer exists is being
referenced from the debug statement.

* aarch64-opc.c (aarch64_logical_immediate_p): Update DEBUG_TRACE
arguments.

(cherry picked from commit 957f6b39cab6cac0e4c54e650c7f75109544ac1d)

621a88c 2018-01-25 04:13:31 Pedro Alves

Fix GCC PR83906 - [8 Regression] Random FAIL: libstdc++-prettyprinters/80276.cc whatis p4

GCC PR83906 [1] is about a GCC/libstdc++ GDB/Python type printer
testcase failing randomly, as shown by running (in libstdc++'s
testsuite):

make check RUNTESTFLAGS=prettyprinters.exp=80276.cc

in a loop. Sometimes you get this:

FAIL: libstdc++-prettyprinters/80276.cc whatis p4

I.e., this:
type = std::unique_ptr<std::vector<std::unique_ptr<std::list<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >>[]>>[99]>

instead of this:
type = std::unique_ptr<std::vector<std::unique_ptr<std::list<std::string>[]>>[99]>

Jonathan Wakely tracked it on the printer side to this bit in
libstdc++'s type printer:

if self.type_obj == type_obj:
return strip_inline_namespaces(self.name)

This assumes the two types resolve to the same gdb.Type but some times
the comparison unexpectedly fails.

Running the testcase manually under Valgrind finds the problem in GDB:

~~~~~~~~~~~~~~~~~~~~~~~~~~~~
==6118== Conditional jump or move depends on uninitialised value(s)
==6118== at 0x4C35CB0: bcmp (vg_replace_strmem.c:1100)
==6118== by 0x6F773A: check_types_equal(type*, type*, VEC_type_equality_entry_d**) (gdbtypes.c:3515)
==6118== by 0x6F7B00: check_types_worklist(VEC_type_equality_entry_d**, bcache*) (gdbtypes.c:3618)
==6118== by 0x6F7C03: types_deeply_equal(type*, type*) (gdbtypes.c:3655)
==6118== by 0x4D5B06: typy_richcompare(_object*, _object*, int) (py-type.c:1007)
==6118== by 0x63D7E6C: PyObject_RichCompare (object.c:961)
==6118== by 0x646EAEC: PyEval_EvalFrameEx (ceval.c:4960)
==6118== by 0x646DC08: PyEval_EvalFrameEx (ceval.c:4519)
==6118== by 0x646DC08: PyEval_EvalFrameEx (ceval.c:4519)
==6118== by 0x646DC08: PyEval_EvalFrameEx (ceval.c:4519)
==6118== by 0x646DC08: PyEval_EvalFrameEx (ceval.c:4519)
==6118== by 0x646DC08: PyEval_EvalFrameEx (ceval.c:4519)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~

That "bcmp" call is really a memcmp call in check_types_equal. The
problem is that gdb is memcmp'ing two objects that are equal in value:

(top-gdb) p *TYPE_RANGE_DATA (type1)
$1 = {low = {kind = PROP_CONST, data = {const_val = 0, baton = 0x0}}, high = {kind = PROP_CONST, data = {const_val = 15, baton = 0xf}}, flag_upper_bound_is_count = 0,
flag_bound_evaluated = 0}
(top-gdb) p *TYPE_RANGE_DATA (type2)
$2 = {low = {kind = PROP_CONST, data = {const_val = 0, baton = 0x0}}, high = {kind = PROP_CONST, data = {const_val = 15, baton = 0xf}}, flag_upper_bound_is_count = 0,
flag_bound_evaluated = 0}

but differ in padding. Notice the 4-byte hole:

(top-gdb) ptype /o range_bounds
/* offset | size */ type = struct range_bounds {
/* 0 | 16 */ struct dynamic_prop {
/* 0 | 4 */ dynamic_prop_kind kind;
/* XXX 4-byte hole */
/* 8 | 8 */ union dynamic_prop_data {
/* 8 */ LONGEST const_val;
/* 8 */ void *baton;

/* total size (bytes): 8 */
} data;

which is filled with garbage:

(top-gdb) x /40bx TYPE_RANGE_DATA (type1)
0x2fa7ea0: 0x01 0x00 0x00 0x00 0x43 0x01 0x00 0x00
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
0x2fa7ea8: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
0x2fa7eb0: 0x01 0x00 0x00 0x00 0xfe 0x7f 0x00 0x00
0x2fa7eb8: 0x0f 0x00 0x00 0x00 0x00 0x00 0x00 0x00
0x2fa7ec0: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
(top-gdb) x /40bx TYPE_RANGE_DATA (type2)
0x20379b0: 0x01 0x00 0x00 0x00 0xfe 0x7f 0x00 0x00
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
0x20379b8: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
0x20379c0: 0x01 0x00 0x00 0x00 0xfe 0x7f 0x00 0x00
0x20379c8: 0x0f 0x00 0x00 0x00 0x00 0x00 0x00 0x00
0x20379d0: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00

(top-gdb) p memcmp (TYPE_RANGE_DATA (type1), TYPE_RANGE_DATA (type2), sizeof (*TYPE_RANGE_DATA (type1)))
$3 = -187

In some cases objects of type range_bounds are memset when allocated,
but then their dynamic_prop low/high fields are copied over from some
template dynamic_prop object that wasn't memset. E.g.,
create_static_range_type's low/high locals are left with garbage in
the padding, and then that padding is copied over to the range_bounds
object's low/high fields.

At first, I considered making sure to always memset range_bounds
objects, thinking that maybe type objects are being put in some bcache
instance somewhere. But then I hacked bcache/bcache_full to poison
non-pod types, and made dynamic_prop a non-pod, and GDB still
compiled.

So given that, it seems safest to not assume padding will always be
memset, and instead treat them as regular value types, implementing
(in)equality operators and using those instead of memcmp.

This fixes the random FAILs in GCC's testcase.

[1] https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83906

gdb/ChangeLog:
2018-01-24 Pedro Alves <palves@redhat.com>

GCC PR libstdc++/83906
* gdbtypes.c (operator==(const dynamic_prop &,
const dynamic_prop &)): New.
(operator==(const range_bounds &, const range_bounds &)): New.
(check_types_equal): Use them instead of memcmp.
* gdbtypes.h (operator==(const dynamic_prop &,
const dynamic_prop &)): Declare.
(operator!=(const dynamic_prop &, const dynamic_prop &)): Declare.
(operator==(const range_bounds &, const range_bounds &)): Declare.
(operator!=(const range_bounds &, const range_bounds &)): Declare.

92533dc 2018-01-16 03:49:35 Tom Tromey

Fix scm-ports.exp regression

In https://sourceware.org/ml/gdb-patches/2017-12/msg00215.html, Jan
pointed out that the scalar printing patches caused a regression in
scm-ports.exp on x86.

What happens is that on x86, this:

set sp_reg [get_integer_valueof "\$sp" 0]

... ends up setting sp_reg to a negative value, because
get_integer_valueof uses "print/d":

print /d $sp
$1 = -11496

Then later the test suite does:

gdb_test "guile (print (seek rw-mem-port (value->integer sp-reg) SEEK_SET))" \
"= $sp_reg" \
"seek to \$sp"

... expecting this value to be identical to the saved $sp_reg value.
However it gets:

guile (print (seek rw-mem-port (value->integer sp-reg) SEEK_SET))
= 4294955800

"print" is just a wrapper for guile's format:

gdb_test_no_output "guile (define (print x) (format #t \"= ~A\" x) (newline))"

The seek function returns a scm_t_off, the printing of which is
handled by guile, not by gdb.

Tested on x86-64 Fedora 26 using an ordinary build and also a -m32
build.

2018-01-15 Tom Tromey <tom@tromey.com>

* gdb.guile/scm-ports.exp (test_mem_port_rw): Use get_valueof to
compute sp_reg.

ea3b3ed 2018-01-05 09:01:02 GDB Administrator

Automatic date update in version.in

2918401 2018-01-04 09:00:50 GDB Administrator

Automatic date update in version.in

bd49606 2018-01-04 00:14:12 Richard Henderson

Fix PR19061, gdb hangs/spins-on-cpu when debugging any program on Alpha

This fixes PR19061, where gdb hangs/spins-on-cpu when debugging any
program on Alpha.

(This patch is Uros' forward port of the patch from comment #5
of the PR [1].)

Patch was tested on alphaev68-linux-gnu, also tested with gcc's
testsuite, where it fixed all hangs in guality.exp and
simulate-thread.exp testcases.

[1] https://sourceware.org/bugzilla/show_bug.cgi?id=19061#c5

gdb/ChangeLog:
2018-01-03 Richard Henderson <rth@redhat.com>
Uros Bizjak <ubizjak@gmail.com>

PR gdb/19061
* alpha-tdep.c (alpha_deal_with_atomic_sequence): Change
prototype.
(alpha_software_single_step): Call alpha_deal_with_atomic_sequence
here.
(set_gdbarch_software_single_step): Set to
alpha_software_single_step.
* nat/linux-ptrace.h [__alpha__]: Define GDB_ARCH_IS_TRAP_BRKPT
and GDB_ARCH_IS_TRAP_HWBKPT.

8f10842 2018-01-03 09:00:58 GDB Administrator

Automatic date update in version.in

516fba6 2018-01-02 09:01:03 GDB Administrator

Automatic date update in version.in

589db8d 2018-01-01 09:01:04 GDB Administrator

Automatic date update in version.in

769571f 2017-12-31 09:00:50 GDB Administrator

Automatic date update in version.in

fc66b51 2017-12-30 09:01:10 GDB Administrator

Automatic date update in version.in

8734d11 2017-12-29 09:01:12 GDB Administrator

Automatic date update in version.in

0b5050c 2017-12-28 09:00:55 GDB Administrator

Automatic date update in version.in

a56013a 2017-12-27 09:00:42 GDB Administrator

Automatic date update in version.in

a614acd 2017-12-26 09:00:55 GDB Administrator

Automatic date update in version.in

feca8a9 2017-12-25 09:00:58 GDB Administrator

Automatic date update in version.in

894e9a8 2017-12-24 09:01:08 GDB Administrator

Automatic date update in version.in

34fb69e 2017-12-23 09:01:06 GDB Administrator

Automatic date update in version.in

9ecbb55 2017-12-22 09:01:04 GDB Administrator

Automatic date update in version.in

ac8f263 2017-12-21 09:01:04 GDB Administrator

Automatic date update in version.in

5fb0a80 2017-12-20 09:01:01 GDB Administrator

Automatic date update in version.in

d137f15 2017-12-19 09:01:07 GDB Administrator

Automatic date update in version.in

8667a4f 2017-12-18 09:00:44 GDB Administrator

Automatic date update in version.in

7e0f6e7 2017-12-17 09:01:02 GDB Administrator

Automatic date update in version.in

05e4c91 2017-12-16 09:01:04 GDB Administrator

Automatic date update in version.in

e83371b 2017-12-15 09:01:04 GDB Administrator

Automatic date update in version.in

b0f00d3 2017-12-14 09:01:03 GDB Administrator

Automatic date update in version.in

1db9ac4 2017-12-13 09:00:55 GDB Administrator

Automatic date update in version.in

73894ae 2017-12-12 09:01:05 GDB Administrator

Automatic date update in version.in

1570a34 2017-12-11 09:00:51 GDB Administrator

Automatic date update in version.in