• 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: Richard Schreyer <email@hidden>
  • Date: Mon, 13 Aug 2001 20:10:20 -0700

Regarding OA, is there a tutorial describing how to use it somewhere?

I tried to figure it out, but couldn't really figure out how to work it at all.

Richard Schreyer

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
_______________________________________________
cocoa-dev mailing list
email@hidden
http://www.lists.apple.com/mailman/listinfo/cocoa-dev


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

  • Prev by Date: Re: ObjectAlloc -- not able to use with debugger launched app?
  • Next by Date: Re: ObjC newbie - simple NSString question
  • Previous by thread: Re: ObjectAlloc -- not able to use with debugger launched app?
  • Next by thread: Re: ObjectAlloc -- not able to use with debugger launched app?
  • Index(es):
    • Date
    • Thread