public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] Relax the pattern in dwzbuildid.exp
@ 2014-05-06 13:58 Yao Qi
  2014-05-06 14:50 ` Joel Brobecker
  0 siblings, 1 reply; 3+ messages in thread
From: Yao Qi @ 2014-05-06 13:58 UTC (permalink / raw)
  To: gdb-patches

Hi,
I recently see the fail in dwzbuildid.exp below on some targets,

(gdb) print the_int
No symbol "the_int" in current context.
(gdb) FAIL: gdb.dwarf2/dwzbuildid.exp: mismatch: print the_int

Looks the pattern expects to see "No symbol table is loaded", which
is emitted in c-exp.y,

variable:       name_not_typename
....
                              if (msymbol.minsym != NULL)
                                write_exp_msymbol (pstate, msymbol);
                              else if (!have_full_symbols () && !have_partial_symbols ())
                                error (_("No symbol table is loaded.  Use the \"file\" command."));
                              else
                                error (_("No symbol \"%s\" in current context."),
                                       copy_name ($1.stoken));

it is expected to have no full symbols nor partial symbols, but something
brings full symbols or partial symbols in.  I added "maint info symtabs"
and "maint info psymtabs" in dwzbuildid.exp, and it shows symbols are from
ld.so, which has debug information.  Then, I reproduce the fail like this,

$ make check RUNTESTFLAGS="CFLAGS_FOR_TARGET='-Wl,-rpath=${glibc_build}:${glibc_build}/math  -Wl,--dynamic-linker=${glibc_build}/elf/ld.so' dwzbuildid.exp"

${glibc_build} is the glibc build tree.  Debug information is not striped,
so the test fail.  However, if I strip debug information from libc.so, libm.so
and ld.so.  The test passes.

This patch is to relax the pattern to match the both cases that glibc build
has and has not debug information.

gdb/testsuite:

2014-05-06  Yao Qi  <yao@codesourcery.com>

	* gdb.dwarf2/dwzbuildid.exp: Match output "No symbol "the_int" in
	current context" too.
---
 gdb/testsuite/gdb.dwarf2/dwzbuildid.exp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gdb/testsuite/gdb.dwarf2/dwzbuildid.exp b/gdb/testsuite/gdb.dwarf2/dwzbuildid.exp
index af8e5d3..7bf0d5c 100644
--- a/gdb/testsuite/gdb.dwarf2/dwzbuildid.exp
+++ b/gdb/testsuite/gdb.dwarf2/dwzbuildid.exp
@@ -162,7 +162,7 @@ foreach testname {ok mismatch fallback} {
 	if {[runto_main]} {
 	    if {$testname == "mismatch"} {
 		gdb_test "print the_int" \
-		    "No symbol table is loaded.*"
+		    "(No symbol table is loaded|No symbol \"the_int\" in current context).*"
 	    } else {
 		gdb_test "print the_int" " = 99"
 	    }
-- 
1.9.0

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] Relax the pattern in dwzbuildid.exp
  2014-05-06 13:58 [PATCH] Relax the pattern in dwzbuildid.exp Yao Qi
@ 2014-05-06 14:50 ` Joel Brobecker
  2014-05-07  3:14   ` Yao Qi
  0 siblings, 1 reply; 3+ messages in thread
From: Joel Brobecker @ 2014-05-06 14:50 UTC (permalink / raw)
  To: Yao Qi; +Cc: gdb-patches

> 2014-05-06  Yao Qi  <yao@codesourcery.com>
> 
> 	* gdb.dwarf2/dwzbuildid.exp: Match output "No symbol "the_int" in
> 	current context" too.

LGTM, thanks!

-- 
Joel

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] Relax the pattern in dwzbuildid.exp
  2014-05-06 14:50 ` Joel Brobecker
@ 2014-05-07  3:14   ` Yao Qi
  0 siblings, 0 replies; 3+ messages in thread
From: Yao Qi @ 2014-05-07  3:14 UTC (permalink / raw)
  To: Joel Brobecker; +Cc: gdb-patches

On 05/06/2014 10:50 PM, Joel Brobecker wrote:
>> 2014-05-06  Yao Qi  <yao@codesourcery.com>
>>
>> 	* gdb.dwarf2/dwzbuildid.exp: Match output "No symbol "the_int" in
>> 	current context" too.
> 
> LGTM, thanks!
> 

Thanks, patch is pushed in.

-- 
Yao (齐尧)

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2014-05-07  3:14 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-05-06 13:58 [PATCH] Relax the pattern in dwzbuildid.exp Yao Qi
2014-05-06 14:50 ` Joel Brobecker
2014-05-07  3:14   ` Yao Qi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).