This is the mail archive of the gdb-patches@sourceware.org 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]

Re: [RFA] massively speed up "info var foo" on large programs


Andreas Schwab writes:
 > Doug Evans <dje@google.com> writes:
 > 
 > > +    set match_str {All functions matching regular expression "foo":[\r\n]*}
 > > +    if { "$libsepdebug" != "NO"  } {
 > > +	append match_str {File .*/info-fun-solib[.]c:[\r\n]*}
 > > +	append match_str {int foo\(void\);[\r\n]*}
 > > +    }
 > > +    append match_str {Non-debugging symbols:[\r\n]*}
 > > +    append match_str "$hex *foo(@plt)?\[\r\n\]*"
 > > +    if { "$libsepdebug" == "NO"  } {
 > > +	append match_str "$hex *foo\[\r\n\]*"
 > > +    }
 > > +
 > > +    gdb_test "info fun foo" "$match_str"
 > > +}}
 > 
 > (gdb) info fun foo
 > All functions matching regular expression "foo":
 > 
 > Non-debugging symbols:
 > 0x0000000010000578  00000011.plt_call.foo+0
 > 0x00000000100008e8  foo@plt
 > 0x00000fffb7fae73c  .foo
 > (gdb) FAIL: gdb.base/info-fun.exp: NO: info fun foo
 > 
 > (gdb) info fun foo
 > All functions matching regular expression "foo":
 > 
 > File ./gdb.base/info-fun-solib.c:
 > int foo(void);
 > 
 > Non-debugging symbols:
 > 0x0000000010000578  00000011.plt_call.foo+0
 > 0x00000000100008e8  foo@plt
 > (gdb) FAIL: gdb.base/info-fun.exp: IN: info fun foo
 > 
 > (gdb) info fun foo
 > All functions matching regular expression "foo":
 > 
 > File ./gdb.base/info-fun-solib.c:
 > int foo(void);
 > 
 > Non-debugging symbols:
 > 0x0000000010000578  00000011.plt_call.foo+0
 > 0x00000000100008e8  foo@plt
 > (gdb) FAIL: gdb.base/info-fun.exp: SEP: info fun foo
 > 
 > Andreas.
 > 
 > -- 
 > Andreas Schwab, schwab@linux-m68k.org
 > GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
 > "And now for something completely different."

Hi.

I'm not sure how much effort to put into handling all the variations here.
I'm happy with this, but I'm also happy with anything that fixes your regression.

This is regression tested on amd64-linux.
Can you try this on m68k-linux?  Thanks.

2012-07-30  Doug Evans  <dje@google.com>

	* gdb.base/info-fun.exp: Fix failures on m68k-linux.

Index: info-fun.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.base/info-fun.exp,v
retrieving revision 1.2
diff -u -p -r1.2 info-fun.exp
--- info-fun.exp	21 Jun 2012 20:46:22 -0000	1.2
+++ info-fun.exp	30 Jul 2012 17:23:47 -0000
@@ -67,9 +67,16 @@ foreach libsepdebug {NO IN SEP} { with_t
 	append match_str {int foo\(void\);[\r\n]*}
     }
     append match_str {Non-debugging symbols:[\r\n]*}
+    # Note: Targets like m68k-linux also have, e.g., 00000011.plt_call.foo+0.
+    set plt_foo_match "($hex \[^\r\n\]*plt\[^\r\n\]*foo\[^\r\n\]*\[\r\n\]*)?"
+    append match_str $plt_foo_match
+    # This text we want to match more precisely.
     append match_str "$hex *foo(@plt)?\[\r\n\]*"
+    # Watch for again to not have to worry about the order of appearance.
+    append match_str $plt_foo_match
     if { "$libsepdebug" == "NO"  } {
-	append match_str "$hex *foo\[\r\n\]*"
+	# Note: The ".?" is for targets like m68k-linux that have ".foo" here.
+	append match_str "$hex *.?foo\[\r\n\]*"
     }
 
     gdb_test "info fun foo" "$match_str"


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