Help | Site Map
Connecting Tech Pros Worldwide
 
 
LinkBack Thread Tools
  #1  
Old August 19th, 2005, 02:35 PM
Roy Smith
Guest
 
Posts: n/a
Default dbx question: how to trace deletion of specific object?

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?
  #2  
Old August 19th, 2005, 05:05 PM
Seongbae Park
Guest
 
Posts: n/a
Default 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/"
 

Bookmarks

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over network members.
Post your question now . . .
It's fast and it's free

Popular Articles