Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: Tom Tromey <tromey@redhat.com>
To: "Kenneth Rose" <gdb@kenrose.org>
Cc: gdb@sourceware.org
Subject: Re: Cast to result of whatis expression
Date: Fri, 10 Sep 2010 19:57:00 -0000	[thread overview]
Message-ID: <m34odxmkxm.fsf@fleche.redhat.com> (raw)
In-Reply-To: <35cb13dde5f183ce57b117e677709dd0.squirrel@webmail.kenrose.org>	(Kenneth Rose's message of "Fri, 10 Sep 2010 14:09:27 -0400")

Kenneth> Thanks Tom.  Unfortunately, this is for a bunch of developers
Kenneth> and I can't make everyone upgrade to GDB 7.2.  That said, when
Kenneth> I was researching how to do this, the Python stuff looked uber
Kenneth> sexy (and uber practical).

Yeah.  Try harder to upgrade!

Kenneth> I played around with sending the result of "whatis foo" to a shell
Kenneth> command, but couldn't figure out how to actually pass an
Kenneth> argument to the inferior shell with gdb.

The way to do complicated scripting in pre-python gdb is horrible:

1. Use set logging to write to a temporary file.
2. Run a gdb command that generates the output you need.
3. Use "shell" (and the scripting of your choice: sed, awk, perl...)
   to rewrite the temp file to a second temp file that is in
   gdb CLI syntax.
4. "source" the second temp file

Kenneth> I just need to manually copy and paste it myself as an argument
Kenneth> to pvector.  Since I run gdb in emacs, this is pretty easy.

Of course, you could hack gud-mode to do this automatically :-)

Tom


  reply	other threads:[~2010-09-10 19:57 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-09-07 22:04 Kenneth Rose
2010-09-07 22:16 ` Tom Tromey
2010-09-10 18:09   ` Kenneth Rose
2010-09-10 19:57     ` Tom Tromey [this message]
2010-09-07 22:04 Kenneth Rose

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=m34odxmkxm.fsf@fleche.redhat.com \
    --to=tromey@redhat.com \
    --cc=gdb@kenrose.org \
    --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