]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
Ignore data minimal symbols for breakpoint linespecs
authorJoel Brobecker <brobecker@gnat.com>
Wed, 4 Jan 2012 13:23:10 +0000 (13:23 +0000)
committerJoel Brobecker <brobecker@gnat.com>
Wed, 4 Jan 2012 13:23:10 +0000 (13:23 +0000)
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.

gdb/ChangeLog
gdb/linespec.c
gdb/testsuite/ChangeLog
gdb/testsuite/gdb.base/dmsym.c
gdb/testsuite/gdb.base/dmsym.exp
gdb/testsuite/gdb.base/dmsym_main.c

index d8837a81813940093564d6675688ff14d9d396aa..0414bfd2f335cbd66841c2d1b7403652ff0bc3f4 100644 (file)
@@ -1,3 +1,9 @@
+2012-01-04  Joel Brobecker  <brobecker@adacore.com>
+
+       * 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  <uweigand@de.ibm.com>
 
        * breakpoint.c (all_locations_are_pending): Consider locations
index 47e66a23df19cf7873157cd33e9dfeb0423fff52..da3768cb566b0b7ab52e431f7d8118c9ef13b940 100644 (file)
@@ -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);
index d0d5dcaf7529b080a727f6d0fd87a4c771c3c496..e4bbe0b9c57de610a51b67750022343de0bc4fff 100644 (file)
@@ -1,3 +1,8 @@
+2011-12-27  Joel Brobecker  <brobecker@adacore.com>
+
+       * gdb.base/dmsym.c, gdb.base/dmsym_main.c, gdb.base/dmsym.exp:
+       New files.
+
 2012-01-02  Ulrich Weigand  <uweigand@de.ibm.com>
 
        * gdb.cell/fork.exp: Delete breakpoints after reaching main.
index 002ca4f1f9cce1e9fc47192dd7b3e809670e666f..889e800b3aa5424793e2adebfbac00d84cc26708 100644 (file)
@@ -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
index 7472d1b615b64d53e110f72cb5c19fe4f53b15f0..2c27f259a117a11823f4a8cf767871538d533e5f 100644 (file)
@@ -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
index 4f867b4c85d7b82b9a7f553966f13527682d0575..02cfcb7421704126eccbb6ac7468be17ccd37e92 100644 (file)
@@ -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