Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: Tom Tromey <tromey@redhat.com>
To: Steffen Dettmer <steffen.dettmer@googlemail.com>
Cc: gdb@sourceware.org
Subject: Re: gdb "automation" question
Date: Mon, 28 Jun 2010 20:25:00 -0000	[thread overview]
Message-ID: <m3sk46x5tt.fsf@fleche.redhat.com> (raw)
In-Reply-To: <AANLkTinwuC3Qx6TceKtDvP7sTfVbPpV_EsRkF0SL7uwy@mail.gmail.com>	(Steffen Dettmer's message of "Mon, 28 Jun 2010 17:11:44 +0200")

>>>>> "Steffen" == Steffen Dettmer <steffen.dettmer@googlemail.com> writes:

Steffen> thanks to Tom and others I made progress to automatically display
Steffen> my remote log messages using python-enabled gdb-7.1.

Steffen> #1 When several messages were printed, I get
Steffen>      ---Type <return> to continue, or q <return> to quit---
Steffen>    is there a way to avoid it?

"set pagination off".

If you're referring to script-generated output, I don't think we
currently have a way to print unfiltered.

Steffen> #2 How do I write show_log in Python? According to the online manual
Steffen>    `Python representation of symbols' I understood that I have to
Steffen>    use gdb.lookup_symbol. Is this right? I tried
Steffen>      gdb.lookup_symbol("logStaticLogBuffer")
Steffen>    but this only leads to
Steffen>      AttributeError: 'module' object has no attribute 'lookup_symbol'

You need a newer gdb.  lookup_symbol was added after 7.1.

Steffen> #3 my connect command has to disable breakpoints.
Steffen>    I cannot re-enable them, because it does not know which
Steffen>    breakpoints were enabled and which not.

I think with a newer gdb you could compute this info from Python.

Steffen> #4 How do I source ~/.gdbinit.py if and only if I have a python-enabled
Steffen>    gdb?
Steffen>    If not possible:
Steffen>    Would it be an idea for a future version to add such a feature?

I don't think there is a way.
It would be reasonable to add something.

I think question #5 is implicitly answered by the above...

Steffen> #6 BTW, why does `source ~/.gdbinit.py' work? Is the file name
Steffen>    extension telling that it contains Python syntax?

Yes, see "set script-extension".

Tom


      parent reply	other threads:[~2010-06-28 20:25 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-06-22 14:51 Steffen Dettmer
2010-06-22 16:09 ` Tom Tromey
2010-06-23 17:12   ` Steffen Dettmer
2010-06-23 20:59     ` Tom Tromey
2010-06-23 18:21   ` Steffen Dettmer
2010-06-23 21:01     ` Tom Tromey
2010-06-24 10:33       ` Steffen Dettmer
2010-06-24 18:19         ` Tom Tromey
2010-06-28 15:11 ` Steffen Dettmer
2010-06-28 15:21   ` Pedro Alves
2010-06-28 20:25   ` Tom Tromey [this message]

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=m3sk46x5tt.fsf@fleche.redhat.com \
    --to=tromey@redhat.com \
    --cc=gdb@sourceware.org \
    --cc=steffen.dettmer@googlemail.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