diff options
author | Tom Tromey <tromey@redhat.com> | 2013-08-07 19:52:15 +0000 |
---|---|---|
committer | Tom Tromey <tromey@redhat.com> | 2013-08-07 19:52:15 +0000 |
commit | 17db83e3ba28f9ad4b6fc99d12fb0537644f8a8e (patch) | |
tree | 14b86a0f3b0fe8bd8ac5de3a9f221c7ce8d19731 | |
parent | 4e61835a7ec83ec5527451d0dc38281f8f4d4837 (diff) | |
download | gdb-17db83e3ba28f9ad4b6fc99d12fb0537644f8a8e.tar.gz |
also filter label symbols
The bug here is that, with dwz -m, a function (and a label) appear in
both a PU and a CU when running cplabel.exp. So, a breakpoint gets
two locations:
(gdb) break foo::bar:to_the_top
Breakpoint 2 at 0x400503: foo::bar:to_the_top. (2 locations)
What is especially wacky is that both locations are at the same place:
(gdb) info b
Num Type Disp Enb Address What
1 breakpoint keep y <MULTIPLE>
1.1 y 0x000000000040051c foo::bar:get_out_of_here
1.2 y 0x000000000040051c foo::bar:get_out_of_here
This happens due to the weird way we run "dwz -m".
It's unclear to me that this would ever happen for real code.
While I think this borders on "diminishing returns" territory, the fix
is pretty straightforward: use the existing address-filtering function
in linespec to also filter when looking at labels.
Built and regtested (both ways) on x86-64 Fedora 18.
* linespec.c (convert_linespec_to_sals): Use maybe_add_address
when adding label symbols.
-rw-r--r-- | gdb/ChangeLog | 5 | ||||
-rw-r--r-- | gdb/linespec.c | 5 |
2 files changed, 9 insertions, 1 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 2ad89eec1da..eafdee4209d 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,8 @@ +2013-08-07 Tom Tromey <tromey@redhat.com> + + * linespec.c (convert_linespec_to_sals): Use maybe_add_address + when adding label symbols. + 2013-08-07 Raunaq Bathija <raunaq12@in.ibm.com> Ulrich Weigand <uweigand@de.ibm.com> diff --git a/gdb/linespec.c b/gdb/linespec.c index 2f2a1a39104..019a9f80a3f 100644 --- a/gdb/linespec.c +++ b/gdb/linespec.c @@ -1996,7 +1996,10 @@ convert_linespec_to_sals (struct linespec_state *state, linespec_p ls) for (i = 0; VEC_iterate (symbolp, ls->labels.label_symbols, i, sym); ++i) { - if (symbol_to_sal (&sal, state->funfirstline, sym)) + struct program_space *pspace = SYMTAB_PSPACE (SYMBOL_SYMTAB (sym)); + + if (symbol_to_sal (&sal, state->funfirstline, sym) + && maybe_add_address (state->addr_set, pspace, sal.pc)) add_sal_to_sals (state, &sals, &sal, SYMBOL_NATURAL_NAME (sym), 0); } |