Can you even use Guard Malloc with CFM applications?
You definitely can. I do it all the time (but not with CodeWarrior).
Thanks for the scripts, but I still can't get a CFM app to work with
Guard Malloc. I've now tried on both my G5 Dual 2.0 GHz and my
PowerBook G4 800 MHz and I get the same output on each. I'm running
Mac OS X 10.3.5 (Build 7M34) with Xcode 1.5 installed. Here's what I
run through gdb (using the scripts you provided me):
----------------------------------------------
dave% DebugCFM Carbon\ Toolbox\ Debug
GNU gdb 5.3-20030128 (Apple version gdb-330.1) (Fri Jul 16 21:42:28 GMT
2004)
Copyright 2003 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and
you are
welcome to change it and/or distribute copies of it under certain
conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB. Type "show warranty" for
details.
This GDB was configured as "powerpc-apple-darwin".
Reading symbols for shared libraries .... done
(gdb) guardmalloc
(gdb) run
Starting program:
/System/Library/Frameworks/Carbon.framework/Versions/A/Support/
LaunchCFMApp "Carbon Toolbox Debug"
Allocations will be placed on word (4 byte) boundaries.
- Small buffer overruns may not be noticed.
- Applications using AltiVec instructions may fail.
GuardMalloc-8
Reading symbols for shared libraries
.................................................... done
Allocations will be placed on word (4 byte) boundaries.
- Small buffer overruns may not be noticed.
- Applications using AltiVec instructions may fail.
GuardMalloc-8
Program received signal EXC_BAD_ACCESS, Could not access memory.
0xffff8acc in __memcpy ()
(gdb) bt
#0 0xffff8acc in __memcpy ()
#1 0x902b0270 in AllocateAndRememberCfrgRecord ()
#2 0x902c747c in ProcessRegisteredFile ()
#3 0x902c0ff4 in PCFragRegisterFile ()
#4 0x902b6b78 in RegisterOneFile ()
#5 0x902b1274 in RegisterLibraryFiles ()
#6 0x902cf938 in CCFM_InitializeCrutchCFM ()
#7 0x00008804 in main ()
#8 0x00008408 in _start ()
#9 0x0000827c in start ()
----------------------------------------------
The application I'm running it on is built from the CodeWarrior Mac OS
X C++ Stationary, Mac OS Carbon->Mac OS Toolbox->C++ Toolbox Carbon
template. It really doesn't do anything but show an alert. I've also
tried it on other simple applications and I can never get it to work.
I always get the same output like above. What might I be doing wrong?