Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: "John R. Moore" <jmoore@cygnus.com>
To: Mo DeJong <mdejong@cygnus.com>
Cc: <gdb@sourceware.cygnus.com>
Subject: Re: GDB needs a --cmdline option
Date: Mon, 12 Feb 2001 07:02:00 -0000	[thread overview]
Message-ID: <Pine.GSO.4.31.0102120658240.13686-100000@cse.cygnus.com> (raw)
In-Reply-To: <Pine.SOL.3.91.1010211172713.7626H-100000@cse.cygnus.com>

For 1. below, would an expect script do ?

------ cut runGdb ----
#!/bin/sh
# the next line restarts using expect \
exec tclsh "$0" "$@"

package require Expect

log_user 0
set timeout 5

spawn gdb

if { [llength $argv] > 0} \
  {
    expect "(gdb) " \
      {
        send " [ lrange $argv 0 end ] \r"
      }
  }
interact

exit
------- end runGdb -----

A similar script could be written for 2.

John

On Sun, 11 Feb 2001, Mo DeJong wrote:

> Hi all. I was just going through the pain of creating
> --command files to run my program when it struck me (again)
> that gdb should be able to handle this. Last year, I
> posted a note about this, it generated some discussion
> of how it could be implemented:
>
> http://sources.redhat.com/ml/gdb-patches/2000-05/msg00111.html
>
> As far as I know, nothing has happened on this front so
> I am back in an attempt to get it done or die trying.
>
> I am willing to jump in the code and do some hacking
> if folks could point me in the right direction and
> tell me what bits to avoid. The features I need are:
>
> 1. The ability to pass program args on the command line.
>
> Currently, I run `echo "set args arg1 arg2' > gdb.run ; gdb ...
> --command=gdb.run`
>
> 2. The ability to have GDB run in a pipeline, if the
>    program does nothing wrong then gdb would do nothing
>    and return the exit() code of the program.
>
> Currently, I need to go in by hand and figure out what
> the stdin and cmd line args are for the Nth command
> in a pipeline, it is really quite painful.
>
> Mo DeJong
> Red Hat Inc
>


  reply	other threads:[~2001-02-12  7:02 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-02-11 17:31 Mo DeJong
2001-02-12  7:02 ` John R. Moore [this message]
2001-02-12 13:01   ` Mo DeJong

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=Pine.GSO.4.31.0102120658240.13686-100000@cse.cygnus.com \
    --to=jmoore@cygnus.com \
    --cc=gdb@sourceware.cygnus.com \
    --cc=mdejong@cygnus.com \
    /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