Mirror of the gdb mailing list
 help / color / mirror / Atom feed
* Re: how to call gdb_test "" ... ?
@ 2002-02-18 15:33 Michael Elizabeth Chastain
  2002-02-18 16:19 ` Daniel Jacobowitz
  0 siblings, 1 reply; 7+ messages in thread
From: Michael Elizabeth Chastain @ 2002-02-18 15:33 UTC (permalink / raw)
  To: drow; +Cc: gdb

Daniel Jacobowitz writes:
> Does gdb_test work with "\n"?  I think it will.  In fact, it appears to
> in casual testing.

Alas, gdb_test "\n" sends two carriage returns.

Michael C


^ permalink raw reply	[flat|nested] 7+ messages in thread
* Re: how to call gdb_test "" ... ?
@ 2002-02-18 16:28 Michael Elizabeth Chastain
  0 siblings, 0 replies; 7+ messages in thread
From: Michael Elizabeth Chastain @ 2002-02-18 16:28 UTC (permalink / raw)
  To: keiths; +Cc: gdb

Okay, it is patch submission time, I am submitting this:

  send_gdb "\n"
  gdb_test "" "..."

Michael C


^ permalink raw reply	[flat|nested] 7+ messages in thread
* Re: how to call gdb_test "" ... ?
@ 2002-02-18 15:46 Michael Elizabeth Chastain
  0 siblings, 0 replies; 7+ messages in thread
From: Michael Elizabeth Chastain @ 2002-02-18 15:46 UTC (permalink / raw)
  To: keiths; +Cc: gdb

Keith Seitz writes:
> Actually, I don't see from reading the code for gdb_test why "" would be
> disallowed. Is it giving you some sort of error?

gdb_test "" hangs and does not return until some 60-second timer
kicks it out.  That's probably related to the special check for "":

  set result -1
  set string "${command}\n";
  if { $command != "" } {
    ...
  }

Hmmm, this is actually documented behavior:

  # COMMAND is the command to execute, send to GDB with send_gdb.  If
      this is the null string no command is sent.

I suppose I could do this:

  send_gdb "\n"
  gdb_test "" "..."

How does that sound, Keith?  Or would you prefer me to stick with
send_gdb/gdb_expect?  Gross choice, eh?

I can't modify gdb_test; that would take me too far afield from fixing
the real problems in list.exp.

Michael C


^ permalink raw reply	[flat|nested] 7+ messages in thread
* how to call gdb_test "" ... ?
@ 2002-02-18 14:37 Michael Elizabeth Chastain
  2002-02-18 15:16 ` Daniel Jacobowitz
  2002-02-18 15:32 ` Keith Seitz
  0 siblings, 2 replies; 7+ messages in thread
From: Michael Elizabeth Chastain @ 2002-02-18 14:37 UTC (permalink / raw)
  To: gdb

I am reworking gdb.base/list.exp and in the process I'm converting a lot
of send_gdb calls to gdb_test.  (If you want to know why I'm reworking it,
I'm getting rid of the "testcnt" mechanism, which list.exp uses instead
of just issuing a PASS when a test succeeds).

In one place I want to do this:

  gdb_test "list list0.c:10" "..."
  gdb_test "" "..."
  gdb_test "" "..."
  gdb_test "" "..."

That is to say, I want to send a "list" command, and then send some
empty commands and look at the results as usual.

gdb_test does not work with an argument of "".

Is there an easy way to do this, or should I just stick with send_gdb "\n"?
The test script already calls send_gdb "\n" and I don't mind keeping it
that way.  I'm just wondering if someone knows a better idiom.

Michael C


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

end of thread, other threads:[~2002-02-19  0:28 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-02-18 15:33 how to call gdb_test "" ... ? Michael Elizabeth Chastain
2002-02-18 16:19 ` Daniel Jacobowitz
  -- strict thread matches above, loose matches on Subject: below --
2002-02-18 16:28 Michael Elizabeth Chastain
2002-02-18 15:46 Michael Elizabeth Chastain
2002-02-18 14:37 Michael Elizabeth Chastain
2002-02-18 15:16 ` Daniel Jacobowitz
2002-02-18 15:32 ` Keith Seitz

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