Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: Ed Peschko <esp5@pge.com>
To: gdb@sourceware.org
Cc: esp5@pge.com
Subject: Re: tracing, attaching to gdb processes
Date: Wed, 15 Mar 2006 05:09:00 -0000	[thread overview]
Message-ID: <20060315041618.GB12493@mdssdev05> (raw)
In-Reply-To: <20060315034420.GA1616@nevyn.them.org>

> > I don't understand..
> > 
> > Are you suggesting that I make an expect script to control gdb, and then have
> > that control script pass characters to the underlying process? Or something
> > more exotic?
> 
> The GDB CLI scripting language has "while".  See the manual.
> 
> It won't work very well though.  The C-c will stop the sleep, but not
> the while.

exactly...

> > And why can't this be built into gdb in the form of a 'set' variable?  Either that,
> > or a built-in high-resolution 'sleep' call that doesn't require spawning a shell?
> 
> You asked if GDB could do what you wanted; this is how it can.  I
> don't know whether it should have a built in command to do this or not.
> 
> > Or best yet, a builtin non-blocking read call that waits for a person's input?
> 
> I fail to see how this relates to what you wanted.

while 1;
> set end_on_input
> step;
> gdb_sleep .1

'set stop_on_input' would make it so that the user could interrupt the script with
the press of a key via a non-blocking read.. ie: exactly what I would want. 
gdb_sleep would be a high res sleep call that slept fractional amounts of a second.

Also, I note that when you do do something like this, you get a 'press <return> to
coninue, q<return> to quit'. It would be nice if there was a way to override this.


> > It would be very cool, for example, if you could somehow trigger gdb to run with
> > an instantiated call, say:
> > 
> > /* my code here */
> > spawn_gdb()
> > /* my code here */
> > 
> > and then a gdb would be spawned automatically and attached to the process at the
> > point right following the spawn_gdb call. 
> 
> GDK/GTK already have code to do this.  So do lots of other libraries. 
> It's not something that needs to be distributed with GDB; it's just
>   if (fork () == 0)
>     execlp ("gdb", argv[0], getppid (), NULL);

well, cool.. then simply add that as a hook inside the library. Which would 
you rather write (continuously), the first one, or the second? And isn't it useful
to have it just for suggesting ideas to end users of gdb?

Anyways, if this isn't the place to request gdb features, what *is* the correct
place?

Ed


  reply	other threads:[~2006-03-15  4:16 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-03-06  5:28 Ed Peschko
2006-03-06 11:55 ` Bob Rossi
2006-03-06 12:01   ` Dave Korn
2006-03-06 20:10     ` Ed Peschko
2006-03-14  2:28 ` Daniel Jacobowitz
2006-03-15  3:44   ` Ed Peschko
2006-03-15  3:45     ` Daniel Jacobowitz
2006-03-15  5:09       ` Ed Peschko [this message]
2006-03-15 14:23         ` Daniel Jacobowitz
2006-03-15 23:37           ` Ed Peschko
2006-03-16  0:53             ` Daniel Jacobowitz
2006-03-16  3:08               ` Ed Peschko
2006-03-16  7:04                 ` Daniel Jacobowitz

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20060315041618.GB12493@mdssdev05 \
    --to=esp5@pge.com \
    --cc=gdb@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox