This is the mail archive of the mailing list for the GDB project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RFC: filter minsyms more aggressively in linespec

I'd appreciate some comments on this.

On PPC I get a surprising number of extra locations, even after the
filtering that is being done now.

One idea I had is the appended: exclude "weird" minimal symbols from
consideration if we have already seen some normal debuginfo matches.
This filters out some ".data" symbols on PPC; e.g., dw2-ifort-parameter
before the patch has:

(gdb) info b
Num     Type           Disp Enb Address            What
2       breakpoint     keep y   <MULTIPLE>
2.1                         y     0x0000000010010ad8 <func>
2.2                         y     0x0000000010000558 <.func+12>

But, I really don't know if this makes any sense.
I'll try to learn some more next week to see.
Meanwhile, your opinion is solicited.

With this patch I see no regressions on x86-64, and the PPC regressions
are down to 6 or so.  So, progress, but not total victory.


2011-12-16  Tom Tromey  <>

	* linespec.c (search_minsyms_for_name): Reject some minsyms if a
	full symbol was already found.

>From ba8da5d27f6025d7d5a23efaafe11c2a1aff68d3 Mon Sep 17 00:00:00 2001
From: Tom Tromey <>
Date: Fri, 16 Dec 2011 12:55:16 -0800
Subject: [PATCH 4/4] somewhat ill-advised linespec change reject some minsyms
 if we already found debuginfo

 gdb/ChangeLog  |    5 +++++
 gdb/linespec.c |   16 +++++++++++++++-
 2 files changed, 20 insertions(+), 1 deletions(-)

diff --git a/gdb/linespec.c b/gdb/linespec.c
index 4d44478..2abd117 100644
--- a/gdb/linespec.c
+++ b/gdb/linespec.c
@@ -2815,6 +2815,7 @@ search_minsyms_for_name (struct collect_info *info, const char *name,
 	int classification;
 	int ix;
 	minsym_and_objfile_d *item;
+	int found_already = info->result.nelts > 0;
 	qsort (VEC_address (minsym_and_objfile_d, local.msyms),
 	       VEC_length (minsym_and_objfile_d, local.msyms),
@@ -2831,7 +2832,20 @@ search_minsyms_for_name (struct collect_info *info, const char *name,
 	     VEC_iterate (minsym_and_objfile_d, local.msyms, ix, item);
-	    if (classify_mtype (MSYMBOL_TYPE (item->minsym)) != classification)
+	    enum minimal_symbol_type t = MSYMBOL_TYPE (item->minsym);
+	    if (classify_mtype (t) != classification)
+	      break;
+	    /* If we are looking for functions, and if we already
+	       found some in the debug info, then exclude some oddball
+	       ones here.  */
+	    if (info->state->funfirstline
+		&& found_already
+		&& t != mst_text
+		&& t != mst_text_gnu_ifunc
+		&& t != mst_file_text
+		&& t != mst_solib_trampoline)
 	    minsym_found (info->state, item->objfile, item->minsym,

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]