This is the mail archive of the gdb@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: gdb "automation" question


>>>>> "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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]