Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion Groups
General
GeneralPortable MacsHardwareNetworking
Applications
Mac ApplicationsEudoraFirefox / MozillaInternet ExplorerOutlook ExpressMS OfficeEntourageExcelPowerPointWordVirtual PCMedia PlayerOther MS Products
Programming
Mac ProgrammingCodeWarriorPerl
Country Specific
Australian Mac GroupUK Mac Group

Mac Forum / Programming / CodeWarrior / August 2004



Tip: Looking for answers? Try searching our database.

How do I debug an API?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Kevin Hoyt - 27 Aug 2004 18:06 GMT
Hi all,
I have an API I'd like to debug.  What I have is two projects, one
that builds the API, the other that is a sample application that uses
the API.

It's my understanding that in the API project, I point the "Host
application for Libraries & code resources' to the sample application.

This does allow me to run the debugger from the API project.  When it
starts up, I wind up in main() for the sample application.

However, when I try to step into an API function, all I get is
assembler and none of the breakpoints work.

If I take the other approach and start with the sample program
project, I also wind up in main() and can not step into any API
function.  This is what I would expect...

What am I doing wrong?

I'm using CW 9.3 on Mac OS 10.3.4.  I do not have any problems
debugging my other projects, just the API...

As always, any help is appreciated.
Sean McBride - 27 Aug 2004 23:25 GMT
> It's my understanding that in the API project, I point the "Host

What kind of project is your 'API project'?  A framework?

Try just debugging the app and opening the 'API project's SYM file.
Kevin Hoyt - 30 Aug 2004 16:29 GMT
> > It's my understanding that in the API project, I point the "Host
>
> What kind of project is your 'API project'?  A framework?
>
> Try just debugging the app and opening the 'API project's SYM file.

Hmm...
That didn't seem to work either.  I still get assembler :-(

The API is a framework, but it could be done as a dylib instead...
however, I'd like to have a choice.
Does the debug setup depend upon this?
f.toso - 30 Aug 2004 16:44 GMT
> The API is a framework, but it could be done as a dylib instead...
> however, I'd like to have a choice.
> Does the debug setup depend upon this?

With CW 9.2 I am able to debug using the "launch xSYM file of the app,
then launch xSYM file of the 'framework'" or viceversa... I don't have
projects because I use the command line tools. Don't know yet if it is
the same with CW 9.3, before I upgrade to 9.3 I have to solve a problem
with the linker.

BTW I thought that a framework is just a dylib with a directory
structure on top... what's the difference between a framework and a
dylib?

Fabrizio
Kevin Hoyt - 30 Aug 2004 23:28 GMT
> > The API is a framework, but it could be done as a dylib instead...
> > however, I'd like to have a choice.
[quoted text clipped - 11 lines]
>
> Fabrizio

From my point of view, they accomplish the same thing...  my code can
be used by others.
From an end user point of view, they may have a preference for a
framework over a dylib...

Technically, they are different.  I don't know what they all are, but
at the very least, a framework has built in versioning that is more
difficult to accomplish with a dylib.

So you open the xSYM files and can debug from there?  Do you have to
tell the API where the sample application is?  Are both xSYM files in
the same folder?

... this is frustrating... seems to me that this is one of those
things that should just work :-(
Brad Oliver - 31 Aug 2004 03:35 GMT
> So you open the xSYM files and can debug from there?  Do you have to
> tell the API where the sample application is?  Are both xSYM files in
> the same folder?

I guess I'm partially confused by your using the term API to refer to a
shared library.

I debug shared libraries all the time. The only catch I find is that I
have to add the .xSYM file to the debugger settings for the main app
that will be loading the library. When I do that, the libraries seem to
work fine for me in CW consistently.

Signature

Brad Oliver
bradman@pobox.com.AM_SPAY

f.toso - 31 Aug 2004 10:39 GMT
> So you open the xSYM files and can debug from there?

Yes

> Do you have to
> tell the API where the sample application is?

No

> Are both xSYM files in
> the same folder?

Yes, but it works even if they are in different folders.

When you double-click the xSYM file of the dylib, do you see the source
file names in the symbolics window? And, if Yes,  if you click on the
name of a file, do you see the symbol names in the "Functions" list?

Fabrizio
f.toso - 31 Aug 2004 10:52 GMT
> > So you open the xSYM files and can debug from there?

BTW I am using mach-o... It could be different if you are using PEF...

Fabrizio
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.