aboutsummaryrefslogtreecommitdiff
path: root/gdb/linespec.c
diff options
context:
space:
mode:
authorJoel Brobecker <brobecker@gnat.com>2012-09-18 16:52:19 +0000
committerJoel Brobecker <brobecker@gnat.com>2012-09-18 16:52:19 +0000
commit4ae24af054894eef0a5a45ab48aeef263d2739ec (patch)
tree7c96c2182424884dc8ab96e6d8edb90d45f79290 /gdb/linespec.c
parent4b8c8c02e917d8509100cfe2f5292d3f18cb43d9 (diff)
downloadgdb-4ae24af054894eef0a5a45ab48aeef263d2739ec.zip
gdb-4ae24af054894eef0a5a45ab48aeef263d2739ec.tar.gz
gdb-4ae24af054894eef0a5a45ab48aeef263d2739ec.tar.bz2
wrong language used when re-setting breakpoint
The debugger sometimes fails to re-set a breakpoint as follow, causing it to become disabled: (gdb) b nested_sub Breakpoint 1 at 0x401cec: file foo.adb, line 7. (gdb) b do_nothing Breakpoint 2 at 0x401cdc: file pck.adb, line 4. (gdb) run Starting program: /[...]/foo Error in re-setting breakpoint 1: Function "nested_sub" not defined. Breakpoint 2, pck.do_nothing () at pck.adb:4 4 null; This only happens on machines where the debug-file-directory is a valid directory name. The reason behind the error is that the linespec code that re-sets the breakpoints uses the current_language global when iterating over a symtab's symbols. However, the that global gets switched from Ada to C during the startup phase, probably as a side-effect of stopping in some system code for which debugging info is available. The fix is to make sure that we use the correct language. gdb/ChangeLog: * linespec.c (iterate_over_all_matching_symtabs): Use the correct language when iterating over symbols. gdb/testsuite/ChangeLog: * gdb.ada/bp_reset: New testcase.
Diffstat (limited to 'gdb/linespec.c')
-rw-r--r--gdb/linespec.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/gdb/linespec.c b/gdb/linespec.c
index 86239c9..f7ff54e 100644
--- a/gdb/linespec.c
+++ b/gdb/linespec.c
@@ -1010,7 +1010,8 @@ iterate_over_all_matching_symtabs (struct linespec_state *state,
struct block *block;
block = BLOCKVECTOR_BLOCK (BLOCKVECTOR (symtab), STATIC_BLOCK);
- LA_ITERATE_OVER_SYMBOLS (block, name, domain, callback, data);
+ state->language->la_iterate_over_symbols (block, name, domain,
+ callback, data);
if (include_inline)
{
@@ -1021,8 +1022,8 @@ iterate_over_all_matching_symtabs (struct linespec_state *state,
i < BLOCKVECTOR_NBLOCKS (BLOCKVECTOR (symtab)); i++)
{
block = BLOCKVECTOR_BLOCK (BLOCKVECTOR (symtab), i);
- LA_ITERATE_OVER_SYMBOLS (block, name, domain,
- iterate_inline_only, &cad);
+ state->language->la_iterate_over_symbols
+ (block, name, domain, iterate_inline_only, &cad);
}
}
}