[Pythonmac-SIG] Debugging Extensions on Mac

2006-09-06 Thread Gustavo Tabares
Hello all,

Sorry if this isn't the right forum for this, but I have been searching 
Google for a couple days without finding any close answers.

I am trying to debug Python extensions on the Mac. I am already able to 
compile/link both debug and release versions of my extension using both 
Xcode and distutils. The extension fully works in Release mode. I copied 
down the source for Python-2.4.3 and made a debug version of the Python 
interpreter.

The problem comes when I try to import the debug version of my extension 
in the debug Python interpreter. I get the following:

Traceback (most recent call last):
  File "", line 1, in ?
ImportError: Failure linking new module: extension.so: Symbol not found: 
_Py_InitModule4
  Referenced from: extension.so
  Expected in: dynamic lookup


I'm trying to avoid debugging using printfs because this can get tedious 
when working with complex code. This particular extension above doesn't 
really do much of importance except read/write a file, but I made it for 
testing purposes.

Anyone have any experience stepping through Python extension code on Mac 
and have seen this?


Thanks,
Gustavo

___
Pythonmac-SIG maillist  -  Pythonmac-SIG@python.org
http://mail.python.org/mailman/listinfo/pythonmac-sig


Re: [Pythonmac-SIG] Debugging Extensions on Mac

2006-09-06 Thread Gustavo Tabares
Bob Ippolito wrote:
> On 9/6/06, Gustavo Tabares <[EMAIL PROTECTED]> wrote:
>> Hello all,
>>
>> Sorry if this isn't the right forum for this, but I have been searching
>> Google for a couple days without finding any close answers.
>>
>> I am trying to debug Python extensions on the Mac. I am already able to
>> compile/link both debug and release versions of my extension using both
>> Xcode and distutils. The extension fully works in Release mode. I copied
>> down the source for Python-2.4.3 and made a debug version of the Python
>> interpreter.
>>
>> The problem comes when I try to import the debug version of my extension
>> in the debug Python interpreter. I get the following:
>>
>> Traceback (most recent call last):
>>   File "", line 1, in ?
>> ImportError: Failure linking new module: extension.so: Symbol not found:
>> _Py_InitModule4
>>   Referenced from: extension.so
>>   Expected in: dynamic lookup
>
> Try building the extension with the debug interpreter.
>
> -bob
>
I tried this via distutils (thats what I assume you were talking about). 
Unfortunately I am still getting the same error.

Thanks for the response,
Gustavo
___
Pythonmac-SIG maillist  -  Pythonmac-SIG@python.org
http://mail.python.org/mailman/listinfo/pythonmac-sig


Re: [Pythonmac-SIG] Debugging Extensions on Mac

2006-09-06 Thread Gustavo Tabares
Bob Ippolito wrote:
> On 9/6/06, Gustavo Tabares <[EMAIL PROTECTED]> wrote:
>> Hello all,
>>
>> Sorry if this isn't the right forum for this, but I have been searching
>> Google for a couple days without finding any close answers.
>>
>> I am trying to debug Python extensions on the Mac. I am already able to
>> compile/link both debug and release versions of my extension using both
>> Xcode and distutils. The extension fully works in Release mode. I copied
>> down the source for Python-2.4.3 and made a debug version of the Python
>> interpreter.
>>
>> The problem comes when I try to import the debug version of my extension
>> in the debug Python interpreter. I get the following:
>>
>> Traceback (most recent call last):
>>   File "", line 1, in ?
>> ImportError: Failure linking new module: extension.so: Symbol not found:
>> _Py_InitModule4
>>   Referenced from: extension.so
>>   Expected in: dynamic lookup
>
> Try building the extension with the debug interpreter.
>
> -bob
>
Oops! Ignore my previous message. This /did/ work. I was pointing my 
include paths to the wrong location.


Thanks for the help!


Gustavo
___
Pythonmac-SIG maillist  -  Pythonmac-SIG@python.org
http://mail.python.org/mailman/listinfo/pythonmac-sig