public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* [PATCH][gdb/testsuite] Fix PATH error in gdb_file_cmd
@ 2020-06-04 10:24 Tom de Vries
  2020-06-04 10:45 ` [gdb/testsuite] Fix error handling " Tom de Vries
  2020-06-04 11:43 ` [PATCH][gdb/testsuite] Fix PATH error " Pedro Alves
  0 siblings, 2 replies; 12+ messages in thread
From: Tom de Vries @ 2020-06-04 10:24 UTC (permalink / raw)
  To: gdb-patches

Hi,

When building gdb using this patch:
...
 static void
 file_command (const char *arg, int from_tty)
 {
+  gdb_assert (0);
   /* FIXME, if we lose on reading the symbol file, we should revert
      the exec file, but that's rough.  */
   exec_file_command (arg, from_tty);
...
and running the testsuite, we run into:
...
Running src/gdb/testsuite/gdb.ada/O2_float_param.exp ...
PASS: gdb.ada/O2_float_param.exp: compilation foo.adb
FAIL: gdb.ada/O2_float_param.exp: (outputs/gdb.ada/O2_float_param/foo) \
  (GDB internal error)
PATH: gdb.ada/O2_float_param.exp: (outputs/gdb.ada/O2_float_param/foo) \
  (GDB internal error)
...

Fix this by using the basename in the FAIL message, such that we have:
...
Running src/gdb/testsuite/gdb.ada/O2_float_param.exp ...
PASS: gdb.ada/O2_float_param.exp: compilation foo.adb
FAIL: gdb.ada/O2_float_param.exp: (foo) (GDB internal error)
...

Tested on x86_64-linux.

Any comments?

Thanks,
- Tom

[gdb/testsuite] Fix PATH error in gdb_file_cmd

gdb/testsuite/ChangeLog:

2020-06-04  Tom de Vries  <tdevries@suse.de>

	* lib/gdb.exp (gdb_file_cmd): Only use basename of loaded file in fail
	message.

---
 gdb/testsuite/lib/gdb.exp | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp
index 444cea01c3..71884b2b81 100644
--- a/gdb/testsuite/lib/gdb.exp
+++ b/gdb/testsuite/lib/gdb.exp
@@ -1761,6 +1761,7 @@ proc gdb_file_cmd { arg } {
     }
 
     send_gdb "file $arg\n"
+    set basename [file tail $arg]
     gdb_expect 120 {
 	-re "Reading symbols from.*LZMA support was disabled.*$gdb_prompt $" {
 	    verbose "\t\tLoaded $arg into $GDB; .gnu_debugdata found but no LZMA available"
@@ -1800,7 +1801,7 @@ proc gdb_file_cmd { arg } {
 	    return -1
         }
 	-re "A problem internal to GDB has been detected" {
-	    fail "($arg) (GDB internal error)"
+	    fail "($basename) (GDB internal error)"
 	    gdb_internal_error_resync
 	    return -1
 	}

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

end of thread, other threads:[~2020-06-04 15:27 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-06-04 10:24 [PATCH][gdb/testsuite] Fix PATH error in gdb_file_cmd Tom de Vries
2020-06-04 10:45 ` [gdb/testsuite] Fix error handling " Tom de Vries
2020-06-04 11:51   ` Pedro Alves
2020-06-04 14:38     ` Tom de Vries
2020-06-04 11:43 ` [PATCH][gdb/testsuite] Fix PATH error " Pedro Alves
2020-06-04 11:51   ` Tom de Vries
2020-06-04 12:18     ` Pedro Alves
2020-06-04 13:05       ` Tom de Vries
2020-06-04 13:22         ` Pedro Alves
2020-06-04 14:18           ` [committed][gdb/testsuite] Fix use of fail in gdb_cmd_file Tom de Vries
2020-06-04 15:14             ` [PATCH][gdb/testsuite] Remove path names from error messages in gdb_file_cmd Tom de Vries
2020-06-04 15:27               ` Pedro Alves

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).