Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [RFC] Add another "Are you sure..." case to gdb_unload in  lib/gdb.exp
@ 2007-07-14  1:41 Kevin Buettner
  2007-07-14  5:16 ` Daniel Jacobowitz
  0 siblings, 1 reply; 4+ messages in thread
From: Kevin Buettner @ 2007-07-14  1:41 UTC (permalink / raw)
  To: gdb-patches

During my recent testing of a mep-elf toolchain, I ran across a problem
in gdb.base/opaque.exp (and perhaps some other tests too) in which
GDB asks "Are you sure you want to change the file?" The test
machinery is not expecting this message from GDB and ends up getting
hopelessly confused.

Here's a bit of the log file from gdb.base/opaque.exp which demonstrates
this confusion:

(gdb) PASS: gdb.base/opaque.exp: ptype on opaque struct tagname (statically)
dir
Reinitialize source path to empty? (y or n) y
Source directories searched: $cdir:$cwd
(gdb) dir /ironwood1/toshmep-070403-branch/mep-elf/bld/../../devo/gdb/testsuite/ \rgdb.base
Source directories searched: /ironwood1/toshmep-070403-branch/mep-elf/bld/../../devo/gdb/testsuite/gdb.base:$cdir:$cwd
(gdb) file
A program is being debugged already.
Are you sure you want to change the file? (y or n) ERROR: couldn't unload file in /ironwood1/toshmep-070403-branch/mep-elf/bld/gdb/testsuite/../../gdb/gdb (timed out).
kill
Please answer y or n.
A program is being debugged already.
Are you sure you want to change the file? (y or n) file /ironwood1/toshmep-070403-branch/mep-elf/bld/gdb/testsuite/gdb.base/opaque
Please answer y or n.
A program is being debugged already.
Are you sure you want to change the file? (y or n) ERROR: couldn't load /ironwood1/toshmep-070403-branch/mep-elf/bld/gdb/testsuite/gdb.base/opaque into /ironwood1/toshmep-070403-branch/mep-elf/bld/gdb/testsuite/../../gdb/gdb (timed out).
delete breakpoints
Please answer y or n.
A program is being debugged already.
Are you sure you want to change the file? (y or n) ERROR: Delete all breakpoints in delete_breakpoints (timeout)
break main
Please answer y or n.
A program is being debugged already.
Are you sure you want to change the file? (y or n) UNRESOLVED: gdb.base/opaque.exp: setting breakpoint at main (timeout)
ERROR: cannot run to breakpoint at main
ERROR: Got interactive prompt.
UNRESOLVED: gdb.base/opaque.exp: whatis on opaque struct pointer (dynamically)
ERROR: Got interactive prompt.
...

My patch below adds a suitable case to gdb_unload in lib/gdb.exp.

Comments?


	* lib/gdb.exp (gdb_unload): Add case which checks for GDB's
	"Are you sure you want to change the file?" message.

Index: ./testsuite/lib/gdb.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/lib/gdb.exp,v
retrieving revision 1.83
diff -u -p -r1.83 gdb.exp
--- ./testsuite/lib/gdb.exp	2 Jul 2007 21:29:28 -0000	1.83
+++ ./testsuite/lib/gdb.exp	14 Jul 2007 01:11:25 -0000
@@ -133,6 +133,11 @@ proc gdb_unload {} {
 		verbose "\t\tKilling previous program being debugged"
 	    exp_continue
 	}
+	-re "A program is being debugged already..*Are you sure you want to change the file.*y or n. $"\
+	    { send_gdb "y\n"
+		verbose "\t\tChanging the file being debugged"
+	    exp_continue
+	}
 	-re "Discard symbol table from .*y or n.*$" {
 	    send_gdb "y\n"
 	    exp_continue


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

* Re: [RFC] Add another "Are you sure..." case to gdb_unload in  lib/gdb.exp
  2007-07-14  1:41 [RFC] Add another "Are you sure..." case to gdb_unload in lib/gdb.exp Kevin Buettner
@ 2007-07-14  5:16 ` Daniel Jacobowitz
  2007-07-15  1:01   ` Kevin Buettner
  2007-07-19  0:45   ` Kevin Buettner
  0 siblings, 2 replies; 4+ messages in thread
From: Daniel Jacobowitz @ 2007-07-14  5:16 UTC (permalink / raw)
  To: Kevin Buettner; +Cc: gdb-patches

On Fri, Jul 13, 2007 at 06:25:35PM -0700, Kevin Buettner wrote:
> (gdb) file
> A program is being debugged already.
> Are you sure you want to change the file? (y or n) ERROR: couldn't unload file in /ironwood1/toshmep-070403-branch/mep-elf/bld/gdb/testsuite/../../gdb/gdb (timed out).
> kill

Hmm.  Maybe this is a bug in gdb, actually:

>  	-re "Discard symbol table from .*y or n.*$" {
>  	    send_gdb "y\n"
>  	    exp_continue

That question (generated elsewhere) might be all we should ask.

However, for the testsuite's purpose you can go even further.  I don't
think you need gdb_unload at all, and sid is the only remaining caller
of it.  It's followed by a new gdb_file_cmd, which should suffice.

-- 
Daniel Jacobowitz
CodeSourcery


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

* Re: [RFC] Add another "Are you sure..." case to gdb_unload in  lib/gdb.exp
  2007-07-14  5:16 ` Daniel Jacobowitz
@ 2007-07-15  1:01   ` Kevin Buettner
  2007-07-19  0:45   ` Kevin Buettner
  1 sibling, 0 replies; 4+ messages in thread
From: Kevin Buettner @ 2007-07-15  1:01 UTC (permalink / raw)
  To: gdb-patches

On Fri, 13 Jul 2007 21:41:23 -0400
Daniel Jacobowitz <drow@false.org> wrote:

> On Fri, Jul 13, 2007 at 06:25:35PM -0700, Kevin Buettner wrote:
> > (gdb) file
> > A program is being debugged already.
> > Are you sure you want to change the file? (y or n) ERROR: couldn't unload file in /ironwood1/toshmep-070403-branch/mep-elf/bld/gdb/testsuite/../../gdb/gdb (timed out).
> > kill
> 
> Hmm.  Maybe this is a bug in gdb, actually:
> 
> >  	-re "Discard symbol table from .*y or n.*$" {
> >  	    send_gdb "y\n"
> >  	    exp_continue
> 
> That question (generated elsewhere) might be all we should ask.
> 
> However, for the testsuite's purpose you can go even further.  I don't
> think you need gdb_unload at all, and sid is the only remaining caller
> of it.  It's followed by a new gdb_file_cmd, which should suffice.

Okay, I'll dig into this a bit more.  Thanks for looking this over!

Kevin


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

* Re: [RFC] Add another "Are you sure..." case to gdb_unload in  lib/gdb.exp
  2007-07-14  5:16 ` Daniel Jacobowitz
  2007-07-15  1:01   ` Kevin Buettner
@ 2007-07-19  0:45   ` Kevin Buettner
  1 sibling, 0 replies; 4+ messages in thread
From: Kevin Buettner @ 2007-07-19  0:45 UTC (permalink / raw)
  To: gdb-patches

On Fri, 13 Jul 2007 21:41:23 -0400
Daniel Jacobowitz <drow@false.org> wrote:

> However, for the testsuite's purpose you can go even further.  I don't
> think you need gdb_unload at all, and sid is the only remaining caller
> of it.  It's followed by a new gdb_file_cmd, which should suffice.

You're right.  This patch is withdrawn.

Kevin


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

end of thread, other threads:[~2007-07-19  0:34 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-07-14  1:41 [RFC] Add another "Are you sure..." case to gdb_unload in lib/gdb.exp Kevin Buettner
2007-07-14  5:16 ` Daniel Jacobowitz
2007-07-15  1:01   ` Kevin Buettner
2007-07-19  0:45   ` Kevin Buettner

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox