dbx question: how to trace deletion of specific object?

R

Roy Smith

Yesterday, I was trying to track down a memory corruption problem in a
multi-threaded C++ solaris app. We knew an object was being deleted at the
wrong time, and needed to figure out where. We could trace all the calls
to operator delete with (IIRC):

when in operator delete { where; }

but that produced a huge amount of output. We did eventually find out
problem by wading through the huge output that produced, but I'm looking
for a better way. What we really wanted to do was something like:

when in operator delete and first argument == 0x9be40 { where; }

Is this possible in dbx?
 
S

Seongbae Park

Roy Smith said:
Yesterday, I was trying to track down a memory corruption problem in a
multi-threaded C++ solaris app. We knew an object was being deleted at the
wrong time, and needed to figure out where. We could trace all the calls
to operator delete with (IIRC):

when in operator delete { where; }

but that produced a huge amount of output. We did eventually find out
problem by wading through the huge output that produced, but I'm looking
for a better way. What we really wanted to do was something like:

when in operator delete and first argument == 0x9be40 { where; }

Is this possible in dbx?

On SPARC:

when in operator delete -if $o0 == 0x9be40 { where; }

On x86 or x64, replace $o0 with appropriate stack location/register
where the first parameter is.

Do "help event specification" on dbx command line for more detail.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,436
Messages
2,571,696
Members
48,796
Latest member
Greg L.
Top