[Pythonmac-SIG] PythonCore + debugger

Jack Jansen jack@oratrix.nl
Wed, 20 Sep 2000 10:56:43 +0200


The main problem with debugging PythonCorePPC is that by the time it is packed 
up in PythonCore MetroNub won't recognize it anymore.

What I usually do is one of the following:
- Debug in a static Python. The PythonStandSmall and PythonStandalone projects 
are fine for this.
- Temporarily change the PythonCorePPC.prj project to make it generate 
something called PythonCore directly (in stead of generating PythonCorePPC 
which is then used by PythonCore.prj), and generate it in the correct place 
(Python home folder). If you do this MetroNub will be happy again when you 
press "debug".

> Refer to the Targeting Mac Os reference from the Metrowerks documentation.
> There you will find a discussion about Monolithic verses multi-fragment
> libraries. The key difference is monolithic are stand-alone libraries and
> must handle their own exceptions. A multi-fragment shared library has a
> shared library that handles all exceptions for what ever other shared
> library that is part of your project.

The key point in handling exceptions correctly is that you should set your 
correct __initialize and __terminate entries. And, of course, you should use 
the C++ runtime libraries everywhere. You may also have to make sure that the 
"enable exceptions" compiletime option is enabled everywhere, but it could be 
that that doesn't matter.

> In looking at the PythonCorePPC.prj it appears to be using the wrong
> library. The table 5.2 in Targeting Mac OS states that 
> "MSL ShLib-Runtime.Lib" should be used for a c or c++ Multi-fragment share
> library. It appears the project uses "MSL App-Runtime.Lib" with should be
> used for a c or c++ Multi-fragment Application. Or Am I missing something.

There was a good reason for this, and at the time I did it I compared the two 
runtime libraries (MW gives you source and projects to everything) and it 
appeared that the library PythonCore uses is a superset of the one MW suggests.

--
Jack Jansen             | ++++ stop the execution of Mumia Abu-Jamal ++++
Jack.Jansen@oratrix.com | ++++ if you agree copy these lines to your sig ++++
www.oratrix.nl/~jack    | see http://www.xs4all.nl/~tank/spg-l/sigaction.htm