Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: "Shawn McCarney" <shawnmm@us.ibm.com>
To: gdb@sources.redhat.com
Subject: Passing data to a shell'ed command
Date: Tue, 03 Jul 2001 14:58:00 -0000	[thread overview]
Message-ID: <OFC971F616.9B0387A0-ON86256A7E.00773814@rchland.ibm.com> (raw)

I need to create a user-defined command that reads some memory and then
passes it a formatting program.  I am assuming the formatting program would
be run via the 'shell' command'.  Is there any way to do this?

Below is a list of the things that I have thought of.  None of them seem to
be possible:

* Writing the command output to a file (this is my preferred approach)
* Passing output as stdin to a child process
* Setting an environment variable which contains the output
* Passing output as command line parameters to a child process

The data could be passed as command parameters if the 'shell' command
expanded convenience variables.  However, it doesn't seem to.

The only solution I have found so far is to require the user to run DDD and
then parse the ~/.ddd/log file.  However, this is a strange restriction on
the users.  It also might not work reliably due to buffered I/O.

Another possible solution would be to call C runtime I/O functions as part
an expression in a 'set' command.  However, these functions would be
running on the target, not the gdb host machine right?

Any other ideas?  Someone must have solved this already...

Shawn McCarney (shawnmm@us.ibm.com)


             reply	other threads:[~2001-07-03 14:58 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-07-03 14:58 Shawn McCarney [this message]
2001-07-03 23:56 ` Eli Zaretskii

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=OFC971F616.9B0387A0-ON86256A7E.00773814@rchland.ibm.com \
    --to=shawnmm@us.ibm.com \
    --cc=gdb@sources.redhat.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