Debugging with Mac OS X and GDB

Hello guy’s!

I’m a new user of SDL. We’re building a kind of cross-platform game…

My first problem with SDL concerns the debugging : when I launch the
debugger from Project Builder, under Mac OS X, GDB says :========================
warning: Unable to read symbols from
"@executable_path/…/Frameworks/SDL.framework/Versions/A/SDL"; reading
from memory.
/SourceCache/gdb/gdb-250/src/gdb/macosx/macosx-nat-dyld-process.c:505:
internal-error: assertion failure in function “dyld_load_library”:
e->dyld_valid

The solution I found is to copy all SDL frameworks (manually) in the
".app" directory. But, the problem is that when I clean up the target,
the frameworks are suppressed in the “.app” directory. So, how can I
have them copied at the right place when I build my application??

Thanks in advance,
Mathieu

PS : I’m french, so excuse my poor english! :wink:

As mentioned in a previous reply, this is a known bug in GDB that came
with the Dec 2002 developer tools. Here are the workarounds (pick which
one you like):

  1. Compile SDL yourself, removing the “installation location” string
    from the framework
  2. Copy SDL.framework to YourApp.app/Contents/Frameworks before
    debugging
  3. Use gdb’s attach command to attach to your running program after it
    startsOn Thursday, March 20, 2003, at 03:01 PM, sdl-request at libsdl.org wrote:

Hello guy’s!

I’m a new user of SDL. We’re building a kind of cross-platform game…

My first problem with SDL concerns the debugging : when I launch the=20
debugger from Project Builder, under Mac OS X, GDB says :

Hello guy’s!

I’m a new user of SDL. We’re building a kind of cross-platform game…

My first problem with SDL concerns the debugging : when I launch the=20
debugger from Project Builder, under Mac OS X, GDB says :

As mentioned in a previous reply, this is a known bug in GDB that came
with the Dec 2002 developer tools. Here are the workarounds (pick which
one you like):

  1. Compile SDL yourself, removing the “installation location” string
    from the framework
  2. Copy SDL.framework to YourApp.app/Contents/Frameworks before
    debugging
  3. Use gdb’s attach command to attach to your running program after it
    starts

Darrel… if you look at the rest of his e-mail… he figured out that
copying the Frameworks into the .app worked…

The solution I found is to copy all SDL frameworks (manually) in the
".app" directory. But, the problem is that when I clean up the target,
the frameworks are suppressed in the “.app” directory. So, how can I
have them copied at the right place when I build my applicationt?

What he asked is a question I would love answered also. The clarified
question is… from within’ Project Builder, how do you automatically
include a Framework in the .app when you Build an application. If you
have to manually copy the framework, then you have to do it every time
you rebuild your application, or write yourself a script and then execute
it every time after you build. Either way is one extra step you
shouldn’t have to take. Does anyone know how to automatically include
the frameworks in the .app automatically from Project Builder? I know I
would appreciate the answer, I’m sure Mathieu and others would also.
Thanks guys…

  • Andrew>On Thursday, March 20, 2003, at 03:01 PM, sdl-request at libsdl.org wrote:

Le jeudi, 20 mars 2003, ? 21:24 Europe/Paris, Darrell Walisser a ?crit :

  1. Copy SDL.framework to YourApp.app/Contents/Frameworks before
    debugging

Thanks!

I also found this (to copy automatically the Framework) :

“1. In the project window, click the Targets tab, open the target,
select an existing build phase, and choose Project > New Build Phase >
New Copy Files Build Phase.”

From PB help, but really hidden.

Bye,
Mathieu

The solution I found is to copy all SDL frameworks (manually) in the
".app" directory. But, the problem is that when I clean up the target,
the frameworks are suppressed in the “.app” directory. So, how can I
have them copied at the right place when I build my applicationt?

What he asked is a question I would love answered also. The clarified
question is… from within’ Project Builder, how do you automatically
include a Framework in the .app when you Build an application. If you
have to manually copy the framework, then you have to do it every time
you rebuild your application, or write yourself a script and then
execute
it every time after you build. Either way is one extra step you
shouldn’t have to take. Does anyone know how to automatically include
the frameworks in the .app automatically from Project Builder? I know
I
would appreciate the answer, I’m sure Mathieu and others would also.
Thanks guys…

You can create a “Copy Files” build phase. Here’s how:

  1. Drag “SDL.framework” from the Finder into your project
  2. Go to the target settings (command-option-e).
  3. Control-click on the Build Phases and select “New Build Phase->New
    Copy Files Build Phase”.
  4. For “Where” enter “Frameworks”
  5. For “Files:” drag the framework from the Groups & Files pane to the
    text box

You can also create “Shell Script” build phase, to avoid copying the
framework to your project (If the framework is in ~/Library/Frameworks
this might be a pain when you share the project).

  1. Go to the target settings (command-option-e).
  2. Control-click on the Build Phases and select “New Build Phase->New
    Shell Script Build Phase”.
  3. Enter this script:

DST="build/$PRODUCT_NAME.app/Contents/Frameworks"
mkdir -p “$DST”
/Developer/Tools/CpMac -r ~/Library/Frameworks/SDL.framework “$DST”

HTH,
DarrellOn Friday, March 21, 2003, at 03:01 PM, Andrew1300 at aol.com wrote: