0

I'm trying to figure out parameters passed to a libc function, e.g

break XXX
command
printf "a=%p, b=%d ...\n", a, b
end 

It's kinda lame, I had to write such thing for lots of functions.

Now I'm wondering if there's any helper script or any better way to see these functions in gdb? Just like how strace works

BenMorel
  • 34,448
  • 50
  • 182
  • 322
daisy
  • 22,498
  • 29
  • 129
  • 265
  • Recent GDB is scriptable in Python – Basile Starynkevitch Jul 07 '14 at 16:15
  • 1
    You can run **info args** at the breakpoint, if your distro/development system includes debugging symbols for the library. – Mark Plotnick Jul 08 '14 at 19:06
  • I tried [this](http://stackoverflow.com/questions/10000335/how-to-use-debug-version-of-libc)+the gdb command `info args` when I saw this interesting question. You need to install libc6-dbg and configure gdb such that it finds de libc symbols. I gave it a try but for some reason my gdb does not load the symbols... – Emilien Jul 09 '14 at 12:50

0 Answers0