Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Python: Dev
Pep 393 and debugging
 

Index | Next | Previous | View Flat


kristjan at ccpgames

Apr 6, 2012, 6:27 AM


Views: 190
Permalink
Pep 393 and debugging

I just had my first fun with Pep 393 strings and debuggers. Trying to debug a deadlocked python program, I'm trying to figure out the callstack of the thread in the debugger.

I ended up with something like:



(char*)&((PyASCIIObject*)(tstate->frame->f_code->co_filename))[1]



while previously, it was sufficient to do

(PyUnicodeObject*)(tstate->frame->f_code->co_filename)



Obviously this won't work for non-ASCII objects.

I wonder if there is a way to make this situation easier? Perhaps for "debug" builds, we can store some debug information in the frame object, e.g. utf8 encoding of the filename and function?



K

Subject User Time
Pep 393 and debugging kristjan at ccpgames Apr 6, 2012, 6:27 AM
    Re: Pep 393 and debugging benjamin at python Apr 6, 2012, 7:26 AM
    Re: Pep 393 and debugging martin at v Apr 7, 2012, 2:08 AM
        Re: Pep 393 and debugging kristjan at ccpgames Apr 7, 2012, 5:49 PM

  Index | Next | Previous | View Flat
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.