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: working around batch mode command errors


On 10/28/2012 10:28 PM, Maucci, Cyrille wrote:

> One of the problem I have is that when frame 0 is not C++ code, "print *this" fails and the script aborts with the following error
> 
> Error in sourced command file:
> No symbol "this" in current context.
> 
> And therefore all subsequent commands are not executed.
> I wanted to know if there would be any possiblity to avoid halting on such errors.

There's no try/catch mechanism in the CLI unfortunately, but I think you could
come up with one in python gdb.  ISTR Tromey had a python command wrapper that
swallows CLI errors?

> An aside question would be is there any built-in commands allowing to do something like
> 
> for each frame do
> info source
> info args
> info locals
> info frame
> info all-registers
> print *this
> done  

Nope.  But could construct something like that using gdb's builtin python support.

-- 
Pedro Alves


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