The problem is trying to unwind from a function where %ebp is NOT
used as the frame pointer, and the size of the frame changes over
the lifetime of that function.
For instance, trying to unwind past the GNAT runtime function
called system.tasking.rendezvous.timed_selective_wait on x86-linux,
one can get:
(gdb) bt
[...]
#3 0x0805364b in system.tasking.rendezvous.timed_selective_wait ()
#4 0xb7fe5068 in ?? ()
Backtrace stopped: previous frame inner to this frame (corrupt stack?)
Looking at the CFI, we find the following initial instructions...
> DW_CFA_def_cfa: %esp+4 (r4 ofs 4)
> DW_CFA_offset: %eip at cfa-4 (r8 = %eip)
... and the associated FDE:
> 00001be4 00000054 00001be8 FDE cie=00000000 pc=08053310..08053951
[...]
> DW_CFA_advance_loc: 8 to 080534ad
> DW_CFA_def_cfa_offset: 112
> DW_CFA_advance_loc2: 414 to 0805364b
> DW_CFA_def_cfa_offset: 108
[...]
The problem is that the DWARF frame unwinder executed the FDE until
the row for PC == 0x0805364b. But in reality, our program hasn't
executed the instruction at that address yet (it is the return address).
So GDB executed a little too much of the FDE, giving us the wrong
offset for the frame base, and thus the wrong address where %eip
got saved.
This patch fixes the problem by using a more correct PC as the bound
for executing the FDE.
gdb/ChangeLog:
* dwarf2-frame.c (dwarf2_frame_cache): Use
get_frame_address_in_block instead of get_frame_pc as
the bound for executing the frame's FDE.
gdb/testsuite/ChangeLog:
* gdb.ada/rdv_wait: New testcase.
(gdb_bfd_ref): Initialize new field.
(gdb_bfd_unref): Unref the archive BFD.
(gdb_bfd_openr_next_archived_file): Acquire a reference to the
parent archive.
This adds Usage strings to a bunch of commands, tweaks the grammar in a
few, and improves the help text for the handle command.
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
(_initialize_values): Mention convenience functions in the help text
for "show convenience".
doc/
* gdb.texinfo (Convenience Vars): Update text for "show convenience"
to include functions.
testsuite/
* gdb.base/default.exp: Update expected output of "show convenience".
The command line completion has spoiled me. Thus the lack of completion with
the "handle" command annoys me. Patch!
This does a few things:
- adds a VEC_merge helper
- adds a generic signal completer
- adds a completion handler for the "handle" command
- sets the completion handler for the "signal" command
URL: http://sourceware.org/bugzilla/show_bug.cgi?id=10436
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* cli/cli-cmds.c (enablebreaklist): Move it to breakpoint.c.
(skiplist): Move it to skip.c.
(init_cmd_lists): Remove code setting enablebreaklist and
skiplist to NULL.
* breakpoint.c (enablebreaklist): Moved from cli/cli-cmds.c.
* cli/cli-cmds.h: Remove declaration of enablebreaklist and
skiplist.
* gdbcmd.h: Likewise.
* skip.c (_initialize_step_skip): Move 'skiplist' from
cli/cli-cmds.c.
(make_command_stats_cleanup): Initialize it.
(report_command_stats): Subtract time waiting for user.
(prompt_for_continue): Track time waiting for user.
(defaulted_query): Track time waiting for user.
UNOP_MEMVAL_TYPE.
* expprint.c (print_subexp_standard, case OP_TYPE): New.
(print_subexp_standard, case UNOP_CAST_TYPE): Don't increment pos.
(print_subexp_standard, case UNOP_DYNAMIC_CAST): Ditto.
(print_subexp_standard, case UNOP_REINTERPRET_CAST): Ditto.
(print_subexp_standard, case UNOP_MEMVAL_TYPE): Ditto.
(dump_subexp_body_standard, case UNOP_DYNAMIC_CAST): Don't increment
elt.
(dump_subexp_body_standard, case UNOP_REINTERPRET_CAST): Ditto.
(dump_subexp_body_standard, case UNOP_CAST_TYPE): Ditto.
(dump_subexp_body_standard, case UNOP_MEMVAL_TYPE): Ditto.
(dump_prefix_expression): Handle OP_TYPE.
testsuite/
* gdb.base/debug-expr.c: New file.
* gdb.base/debug-expr.exp: New file.
* gdb.base/exprs.exp: Test {type} casts.
* gdb.cp/debug-expr.exp: New file.
* common/gdb_string.h: ... here.
* common/vec.h: Remove #ifndef GDBSERVER conditional inclusion of
gdb_string.h and gdb_assert.h.
gdbserver/
* configure.ac: Add check for strstr.
* config.in: Regenerate.
* configure: Regenerate.
* linux-thread-db.c: #include "gdb_vecs.h".
(try_thread_db_load_from_pdir_1): New arg "subdir". All callers
updated.
(try_thread_db_load_from_pdir): New arg "subdir". All callers updated.
(thread_db_load_search): Use a vector to iterate over path elements.
Handle text appearing after "$pdir".
gdbserver/
* Makefile.in (SFILES): Add gdb_vecs.c.
(OBS): Add gdb_vecs.o.
(gdb_vecs_h, host_defs_h): New variables.
(thread-db.o): Add $(gdb_vecs_h) dependency.
(gdb_vecs.o): New rule.
* thread-db.c: #include "gdb_vecs.h".
(thread_db_load_search): Use a vector to iterate over path elements.
Handle text appearing after "$pdir".
* gdb.base/valgrind-infcall.exp (continue #$continue_count): Use
global variable loop, not a 'break'. Add loop count limit to 100.
Add new fail case for terminated vgdb.
PR 11804
* defs.h (find_memory_region_ftype): New comment. New arg modified.
* fbsd-nat.c (fbsd_find_memory_regions): Add the passed modified value.
* gcore.c (gcore_create_callback): New function comment. Add modified
parameter. Only write modified regions. Set SEC_READONLY exactly
according to MODIFIED.
(objfile_find_memory_regions): Ignore separate debug info files. Ass
the passed modified value to FUNC.
* gnu-nat.c (gnu_find_memory_regions): Add the passed modified value.
* linux-tdep.c (linux_find_memory_regions): Try to reads smaps file
first. New variables modified and has_anonymous. Parse the lines of
smaps file. Add the passed MODIFIED value to FUNC.
* procfs.c (find_memory_regions_callback): Add the passed modified
value.
gdb/testsuite/
PR 11804
* gdb.base/gcore-relro.exp: New file.
* gdb.base/gcore-relro-main.c: New file.
* gdb.base/gcore-relro-lib.c: New file.