Debugging Memory Allocation in a Shared Library
Debugging Memory Allocation in a Shared Library
- Subject: Debugging Memory Allocation in a Shared Library
- From: Bob Cave <email@hidden>
- Date: Fri, 14 Jul 2006 11:32:12 -0700 (PDT)
Hello,
I am running into a problem when I use the Xcode debugger to debug code that is in a shared library. Here is the scenario:
My program loads a dylib (using _dlopen(), _dlsym(), etc.) and calls an exported dylib function that returns a pointer to a proxy object. My program then calls a method on the proxy object to create an instance of another object, which I will call objX. Up to this point, everything is fine. Then I call objX->init(), which needs to allocate some memory, so it calls "new CHelperObj()". At this point, Xcode seems to become confused. When I try to step into, or step over, the "new CHelperObj" statement, the next line displayed is in another file. It is almost as if an exception has been thrown and control has transferred to the catch block, but the code where we end up is not in a catch block.
To make things more confusing, if I run the same program from a command shell on its own, or
using command-line gdb, the same memory allocation succeeds, and the program continues as expected.
Does anyone have any ideas what might be going on here? I am new to Xcode and OS X programming, but I've been programming in Windows and a few other environments for over 20 years. The code I am working on is a cross-platform project, and it works fine on Windows XP.
I am using Xcode 2.3 on OS X 10.4.6.
Thanks for your help.
Bob
Yahoo! Music Unlimited - Access over 1 million songs.
Try it free. _______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden