aboutsummaryrefslogtreecommitdiff
path: root/gdb/linespec.c
diff options
context:
space:
mode:
authorJoel Brobecker <brobecker@gnat.com>2011-12-27 04:07:04 +0000
committerJoel Brobecker <brobecker@gnat.com>2011-12-27 04:07:04 +0000
commit095bcf5ed385469a25e1f8eb0bd0d408a69c93a7 (patch)
tree2e2c3e8dd218f4af450cfd0a475da4a108adfdec /gdb/linespec.c
parent9c5e43861d58bff3581fcd76db1b23639877838c (diff)
downloadgdb-095bcf5ed385469a25e1f8eb0bd0d408a69c93a7.zip
gdb-095bcf5ed385469a25e1f8eb0bd0d408a69c93a7.tar.gz
gdb-095bcf5ed385469a25e1f8eb0bd0d408a69c93a7.tar.bz2
Ignore data minimal symbols for breakpoint linespecs
gdb/ChangeLog: * linespec.c (struct collect_minsyms) [list_mode]: New field. (add_minsym): Ignore data symbols if not in list mode. (search_minsyms_for_name): Set local.list_mode. gdb/testsuite/ChangeLog: * gdb.base/dmsym.c, gdb.base/dmsym_main.c, gdb.base/dmsym.exp: New files.
Diffstat (limited to 'gdb/linespec.c')
-rw-r--r--gdb/linespec.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/gdb/linespec.c b/gdb/linespec.c
index 5ad3253..8521851 100644
--- a/gdb/linespec.c
+++ b/gdb/linespec.c
@@ -2738,6 +2738,9 @@ struct collect_minsyms
/* The funfirstline setting from the initial call. */
int funfirstline;
+ /* The list_mode setting from the initial call. */
+ int list_mode;
+
/* The resulting symbols. */
VEC (minsym_and_objfile_d) *msyms;
};
@@ -2788,6 +2791,19 @@ add_minsym (struct minimal_symbol *minsym, void *d)
struct collect_minsyms *info = d;
minsym_and_objfile_d mo;
+ /* Exclude data symbols when looking for breakpoint locations. */
+ if (!info->list_mode)
+ switch (minsym->type)
+ {
+ case mst_slot_got_plt:
+ case mst_data:
+ case mst_bss:
+ case mst_abs:
+ case mst_file_data:
+ case mst_file_bss:
+ return;
+ }
+
mo.minsym = minsym;
mo.objfile = info->objfile;
VEC_safe_push (minsym_and_objfile_d, info->msyms, &mo);
@@ -2818,6 +2834,7 @@ search_minsyms_for_name (struct collect_info *info, const char *name,
memset (&local, 0, sizeof (local));
local.funfirstline = info->state->funfirstline;
+ local.list_mode = info->state->list_mode;
cleanup = make_cleanup (VEC_cleanup (minsym_and_objfile_d),
&local.msyms);