Mirror of the gdb mailing list
 help / color / mirror / Atom feed
* LD_PRELOAD, SIGTRAP and step/next
@ 2005-03-17 12:45 David Lecomber
  2005-03-17 14:12 ` Daniel Jacobowitz
  0 siblings, 1 reply; 4+ messages in thread
From: David Lecomber @ 2005-03-17 12:45 UTC (permalink / raw)
  To: gdb

Dear all,

I am debugging using a memory checking library -- dmalloc -- this does
the usual things via an LD_PRELOAD over the malloc.  I am getting
SIGTRAP when trying to call a function in this library -- but only after
a step or a next; after a user-defined breakpoint behaviour is correct!

Can anyone explain/resolve the behaviour:

(gdb) set environment LD_PRELOAD=lib/libdmalloc.so
(gdb) b main
(gdb) run
Starting program: /home/david/projects/code/ddt/examples/a.out

Breakpoint 1, main (argc=1, argv=0xbffff604, environ=0xbffff60c) at
hello.c:65
65              int tag = 50;           /* Tag for messages */
(gdb) print dmalloc_message("hello")ne}
void
(gdb) step
79              t2 = malloc(sizeof(typeThree));
(gdb) p dmalloc_message ("ho")
Program received signal SIGTRAP, Trace/breakpoint trap.
0xb7f831c3 in dmalloc_message (format=0x0) at malloc.c:2079
2079    {
The program being debugged was signaled while in a function called from
GDB.
GDB remains in the frame where the signal was received.
To change this behavior use "set unwindonsignal on"
Evaluation of the expression containing the function (dmalloc_message) 
[..]

Very odd indeed!


d.

-- 
David Lecomber <david@allinea.com>


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2005-03-17 18:09 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-03-17 12:45 LD_PRELOAD, SIGTRAP and step/next David Lecomber
2005-03-17 14:12 ` Daniel Jacobowitz
2005-03-17 14:17   ` David Lecomber
2005-03-17 18:09     ` Daniel Jacobowitz

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox