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: breaking on open(2) on linux


On Sun, Apr 13, 2008 at 11:12:05AM +1200, Nick Roberts wrote:
> Marty Leisner writes:
>  > I've used gdb for 20 years...I've found the ability to 
>  > break on a system call and then backtrace very useful when
>  > reverse engineering code
>  > 
>  > Now, I can't do it (not sure when I last could -- I recall its been
>  > a problem before, but I worked around it).
>  > 
>  > strace shows open(2) calls...
> 
> The breakpoint is probably being set elsewhere, e.g. open in libpthread.so

Nowadays (6.8) you'll get a breakpoint at every copy so it should work
OK.

Glibc is not good about passing all calls to e.g. open through the
"open" function.  Many will be inlined.  GDB does not support stopping
on system calls, though I hope it will some day (someone tried to
contribute this, but the assignment paperwork never went through and I
can no longer reach him).

-- 
Daniel Jacobowitz
CodeSourcery


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