libc functions in gdb expressions

Daniel Jacobowitz drow@false.org
Wed Sep 28 21:58:00 GMT 2005


On Wed, Sep 28, 2005 at 01:49:45PM -0700, Thomas Covenant wrote:
> I've noticed that functions like strlen and strcmp are
> available for use in expressions like
> 
>    (gdb) print strcmp(s, "foo!")
> 
> during my debugging sessions with GDB.
> 
> Is the entire C library available for expressions?

I've just answered this one, so I have it handy...

  > Is there anywhere a list of allowed functions from gdb script (I know
  > that printf, strcmp... are allowed) ?

  They aren't "allowed" per se.  You're calling functions in the program
  you're debugging when you do this.

So, in short, whatever functions are linked in to the program you're
debugging are available.

-- 
Daniel Jacobowitz
CodeSourcery, LLC



More information about the Gdb mailing list