From: Joel Brobecker Date: Wed, 4 Jan 2012 13:23:10 +0000 (+0000) Subject: Ignore data minimal symbols for breakpoint linespecs X-Git-Tag: gdb_7_4-2012-01-24-release~41 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=e7b5a4c691a8d388e1de190e49d63a004ea0f131;p=thirdparty%2Fbinutils-gdb.git 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. --- diff --git a/gdb/ChangeLog b/gdb/ChangeLog index d8837a81813..0414bfd2f33 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,9 @@ +2012-01-04 Joel Brobecker + + * 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. + 2012-01-04 Ulrich Weigand * breakpoint.c (all_locations_are_pending): Consider locations diff --git a/gdb/linespec.c b/gdb/linespec.c index 47e66a23df1..da3768cb566 100644 --- a/gdb/linespec.c +++ b/gdb/linespec.c @@ -2720,6 +2720,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; }; @@ -2770,6 +2773,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); @@ -2800,6 +2816,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); diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog index d0d5dcaf752..e4bbe0b9c57 100644 --- a/gdb/testsuite/ChangeLog +++ b/gdb/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2011-12-27 Joel Brobecker + + * gdb.base/dmsym.c, gdb.base/dmsym_main.c, gdb.base/dmsym.exp: + New files. + 2012-01-02 Ulrich Weigand * gdb.cell/fork.exp: Delete breakpoints after reaching main. diff --git a/gdb/testsuite/gdb.base/dmsym.c b/gdb/testsuite/gdb.base/dmsym.c index 002ca4f1f9c..889e800b3aa 100644 --- a/gdb/testsuite/gdb.base/dmsym.c +++ b/gdb/testsuite/gdb.base/dmsym.c @@ -1,6 +1,6 @@ /* This testcase is part of GDB, the GNU debugger. - Copyright 2011-2012 Free Software Foundation, Inc. + Copyright 2011 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/gdb/testsuite/gdb.base/dmsym.exp b/gdb/testsuite/gdb.base/dmsym.exp index 7472d1b615b..2c27f259a11 100644 --- a/gdb/testsuite/gdb.base/dmsym.exp +++ b/gdb/testsuite/gdb.base/dmsym.exp @@ -1,4 +1,4 @@ -# Copyright (C) 2011-2012 Free Software Foundation, Inc. +# Copyright (C) 2011 Free Software Foundation, Inc. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/gdb/testsuite/gdb.base/dmsym_main.c b/gdb/testsuite/gdb.base/dmsym_main.c index 4f867b4c85d..02cfcb74217 100644 --- a/gdb/testsuite/gdb.base/dmsym_main.c +++ b/gdb/testsuite/gdb.base/dmsym_main.c @@ -1,6 +1,6 @@ /* This testcase is part of GDB, the GNU debugger. - Copyright 2011-2012 Free Software Foundation, Inc. + Copyright 2011 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by