Connecting Tech Pros Worldwide Forums | Help | Site Map

dbx question: how to trace deletion of specific object?

Roy Smith
Guest
 
Posts: n/a
#1: Aug 19 '05
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?

Seongbae Park
Guest
 
Posts: n/a
#2: Aug 19 '05

re: dbx question: how to trace deletion of specific object?


Roy Smith <roy@panix.com> wrote:[color=blue]
> 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?[/color]

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.
--
#pragma ident "Seongbae Park, compiler, http://blogs.sun.com/seongbae/"
Closed Thread