aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2018-05-21Fix AArch64 debug trace buildgdb-8.0-branchTamar Christina2-2/+8
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)
2018-01-24Fix GCC PR83906 - [8 Regression] Random FAIL: ↵Pedro Alves3-2/+72
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.
2018-01-15Fix scm-ports.exp regressionTom Tromey2-1/+6
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.
2018-01-05Automatic date update in version.inGDB Administrator1-1/+1
2018-01-04Automatic date update in version.inGDB Administrator1-1/+1
2018-01-03Fix PR19061, gdb hangs/spins-on-cpu when debugging any program on AlphaRichard Henderson3-7/+28
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.
2018-01-03Automatic date update in version.inGDB Administrator1-1/+1
2018-01-02Automatic date update in version.inGDB Administrator1-1/+1
2018-01-01Automatic date update in version.inGDB Administrator1-1/+1
2017-12-31Automatic date update in version.inGDB Administrator1-1/+1
2017-12-30Automatic date update in version.inGDB Administrator1-1/+1
2017-12-29Automatic date update in version.inGDB Administrator1-1/+1
2017-12-28Automatic date update in version.inGDB Administrator1-1/+1
2017-12-27Automatic date update in version.inGDB Administrator1-1/+1
2017-12-26Automatic date update in version.inGDB Administrator1-1/+1
2017-12-25Automatic date update in version.inGDB Administrator1-1/+1
2017-12-24Automatic date update in version.inGDB Administrator1-1/+1
2017-12-23Automatic date update in version.inGDB Administrator1-1/+1
2017-12-22Automatic date update in version.inGDB Administrator1-1/+1
2017-12-21Automatic date update in version.inGDB Administrator1-1/+1
2017-12-20Automatic date update in version.inGDB Administrator1-1/+1
2017-12-19Automatic date update in version.inGDB Administrator1-1/+1
2017-12-18Automatic date update in version.inGDB Administrator1-1/+1
2017-12-17Automatic date update in version.inGDB Administrator1-1/+1
2017-12-16Automatic date update in version.inGDB Administrator1-1/+1
2017-12-15Automatic date update in version.inGDB Administrator1-1/+1
2017-12-14Automatic date update in version.inGDB Administrator1-1/+1
2017-12-13Automatic date update in version.inGDB Administrator1-1/+1
2017-12-12Automatic date update in version.inGDB Administrator1-1/+1
2017-12-11Automatic date update in version.inGDB Administrator1-1/+1
2017-12-10Automatic date update in version.inGDB Administrator1-1/+1
2017-12-09Automatic date update in version.inGDB Administrator1-1/+1
2017-12-08Automatic date update in version.inGDB Administrator1-1/+1
2017-12-07Automatic date update in version.inGDB Administrator1-1/+1
2017-12-06Automatic date update in version.inGDB Administrator1-1/+1
2017-12-05Automatic date update in version.inGDB Administrator1-1/+1
2017-12-04Automatic date update in version.inGDB Administrator1-1/+1
2017-12-03Automatic date update in version.inGDB Administrator1-1/+1
2017-12-02Automatic date update in version.inGDB Administrator1-1/+1
2017-12-01Automatic date update in version.inGDB Administrator1-1/+1
2017-11-30Automatic date update in version.inGDB Administrator1-1/+1
2017-11-29Automatic date update in version.inGDB Administrator1-1/+1
2017-11-28Automatic date update in version.inGDB Administrator1-1/+1
2017-11-27Automatic date update in version.inGDB Administrator1-1/+1
2017-11-26Automatic date update in version.inGDB Administrator1-1/+1
2017-11-25Automatic date update in version.inGDB Administrator1-1/+1
2017-11-24Automatic date update in version.inGDB Administrator1-1/+1
2017-11-23Automatic date update in version.inGDB Administrator1-1/+1
2017-11-22Automatic date update in version.inGDB Administrator1-1/+1
2017-11-21Automatic date update in version.inGDB Administrator1-1/+1