Re: Interfacing gdb

2009-02-22 Thread Charles Manning
On Saturday 21 February 2009 06:06:56 Sam Steingold wrote:
> Charles Manning wrote:
> > On Saturday 14 February 2009 06:04:21 Maciej Piechotka wrote:
> >> Is it possible to write a plugin to gdb (i.e. program which may examin
> >> data provided by gdb - possibly from gdb)? Preferably in some sort of
> >> scripting language.
> >
> > You don't really need a plug in.
> >
> > gdb has a a very flexible built-in  macro language that allows you to
> > write a lot of very useful scripts that can do all sorts of things.
>
> "flexible"?!
> gdb is a great debugger, but to say that the macro system is lacking is to
> make a gross understatement.
>
> e.g., http://article.gmane.org/gmane.comp.gdb.general/445:
>
> the following:
>
> define break_foo_bar
>break foo
>commands
>  print x
>end
>break bar
>commands
>  print y
>end
> end
>
> does not work because, apparently, the first "end" closes both
> "commands" and "define" and there is no file loaded at this time, so I
> get this error:
> .gdbinit:97: Error in sourced command file:
> No symbol table is loaded.  Use the "file" command.
>
> Is there a way around this problem?

There are some ugly things like this.

How about this...

Instead of creating a break_foo_bar macro you instead make a break_foo_bar 
command file (let's say break_foo_bar.cmd) containing:
break foo
commands
  print x
end
break bar
commands
  print y
end

When you want to run this, you type

source break_foo_bar.cmd

If you want, you should be able to maco-ize that:

define break_foo_bar
  source break_foo_bar.cmd
end

and then have a macro





Re: Interfacing gdb

2009-02-20 Thread Sam Steingold

Charles Manning wrote:

On Saturday 14 February 2009 06:04:21 Maciej Piechotka wrote:

Is it possible to write a plugin to gdb (i.e. program which may examin
data provided by gdb - possibly from gdb)? Preferably in some sort of
scripting language.


You don't really need a plug in.

gdb has a a very flexible built-in  macro language that allows you to write a 
lot of very useful scripts that can do all sorts of things.


"flexible"?!
gdb is a great debugger, but to say that the macro system is lacking is to make 
a gross understatement.


e.g., http://article.gmane.org/gmane.comp.gdb.general/445:

the following:

define break_foo_bar
  break foo
  commands
print x
  end
  break bar
  commands
print y
  end
end

does not work because, apparently, the first "end" closes both
"commands" and "define" and there is no file loaded at this time, so I
get this error:
.gdbinit:97: Error in sourced command file:
No symbol table is loaded.  Use the "file" command.

Is there a way around this problem?






Re: Interfacing gdb

2009-02-18 Thread Maciej Piechotka
Charles Manning  writes:

> On Saturday 14 February 2009 06:04:21 Maciej Piechotka wrote:
>> Is it possible to write a plugin to gdb (i.e. program which may examin
>> data provided by gdb - possibly from gdb)? Preferably in some sort of
>> scripting language.
>
> You don't really need a plug in.
>
> gdb has a a very flexible built-in  macro language that allows you to write a 
> lot of very useful scripts that can do all sorts of things.
>
> Google for gdb macro and you will find such interesting things as:
> http://www.ibm.com/developerworks/aix/library/au-gdb.html
>

Thanks. But I AFAIR the built-in macro language does not have bindings
to any GUI widget library...

Regards
-- 
I've probably left my head... somewhere. Please wait untill I find it.
Homepage (pl_PL): http://uzytkownik.jogger.pl/
(GNU/)Linux User: #425935 (see http://counter.li.org/)





Re: Interfacing gdb

2009-02-15 Thread Charles Manning
On Saturday 14 February 2009 06:04:21 Maciej Piechotka wrote:
> Is it possible to write a plugin to gdb (i.e. program which may examin
> data provided by gdb - possibly from gdb)? Preferably in some sort of
> scripting language.

You don't really need a plug in.

gdb has a a very flexible built-in  macro language that allows you to write a 
lot of very useful scripts that can do all sorts of things.

Google for gdb macro and you will find such interesting things as:
http://www.ibm.com/developerworks/aix/library/au-gdb.html