• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: ObjectAlloc -- not able to use with debugger launched app?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: ObjectAlloc -- not able to use with debugger launched app?


  • Subject: Re: ObjectAlloc -- not able to use with debugger launched app?
  • From: tyler <email@hidden>
  • Date: Tue, 14 Aug 2001 10:18:23 -0700

Chris -- thanks for being on the net and taking the time to respond. I'll try what you suggest. I really appreciate the tip.

peace,
tyler

On Monday, August 13, 2001, at 07:31 PM, Chris Kane wrote:

On Monday, August 13, 2001, at 02:03 PM, tyler wrote:
I was trying to use the nifty ObjectAlloc tool and attach it to a running process, but had no luck. Anyone care to share the trick on how to do this?

I really want to be able to step through my application in the PB and watch the allocations/deallocations my app makes -- Can this be done with ObjectAlloc?

Currently it is simplest to run the app under ObjectAlloc, then attach to it in the debugger. This is what I do at any rate. That way you have complete information in OA -- if you attached with OA, it would only have information about things that happened after that.

I've actually never tried to attach the debugger in PB to a running process, so I don't know how you go about that off-hand (I'm too lazy to launch it to see). I run gdb on the command-line when I want to attach to something; run it without arguments in this case.

To attach, you use the "attach <pid>" command, where you've gotten <pid> from 'ps' after launching the app under ObjectAlloc. If you want your app to wait a while at startup for you to get attached, there are a few techniques, but the simplest is to 'sleep(15);'. gdb will figure out the executable involved. After the debugger has attached, "continue" or whatever.

So: 1) launch app under ObjectAlloc, 2) 'ps' in a Terminal window, look for your app, pid is on the left, 3) 'gdb', 4) "attach pid".


Chris Kane
Cocoa Frameworks, Apple


References: 
 >Re: ObjectAlloc -- not able to use with debugger launched app? (From: Chris Kane <email@hidden>)

  • Prev by Date: Re: Accessing Hardware
  • Next by Date: Digital Librarian Replacement MTLibrarian - Was Re: Enabling/Disabling Buttons
  • Previous by thread: Re: ObjectAlloc -- not able to use with debugger launched app?
  • Next by thread: saing files in carbon(QT) from cocoa. help!
  • Index(es):
    • Date
    • Thread