Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Carbon Debugger Services API




On Nov 16, 2004, at 11:02 AM, email@hidden wrote:


On Nov 16, 2004, at 9:52 AM, Martin Payne wrote:

The Apple documentation says that you cannot use MPRegisterDebugger
anymore wth OSX, you have to call the Carbon Debugger Services
instead.

This is probably out of date

Do you that the MPRegisterDebugger function is out of date or that my comment was out of date?

I mean that any documentation that recommends that you use MPRegisterDebugger or Carbon Debugger Services is probably out of date. On Mac OS X, you should definitely be using the BSD Unix APIs to implement a debugger.

Sadly, it's not as simple as that. The Mac OS X version of ptrace doesn't implement the full set of ptrace calls - so for instance you can't get registers & memory through ptrace. Moreover, not all Mach Exceptions you might want to catch have ptrace equivalents. AND... we only have ptrace, not ttrace, so you can't get thread information from ptrace. You have to use an somewhat contorted mix of ptrace & mach calls to get the job done, though on 10.3 and later you can get away with using the mach interface almost exclusively.


The gdb sources are available to look at - if you want an example of how this is done. But of course you can't copy and use the code straight out unless you are willing to GPL your application, 'cause gdb is released under the GPL license itself.

Jim


-eric
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Carbon-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/carbon-dev/email@hidden

This email sent to email@hidden


Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.