Debugging Python extensions with gdb

Discussion in 'Python' started by Andrew Wilkinson, Jul 9, 2004.

  1. Hi,

    Below is a back trace from a gdb session. If you look at you'll see that
    there are some function calls where gdb can't find the name of the
    function. I'm pretty sure that those functions are in my extension. I've
    got everything compiled with debugging info turned on, so I'm pretty sure
    it is related to the "Unable to find dynamic linker breakpoint function"
    message. Does anyone know how to get rid of this message? I tried googling,
    but nothing useful turned up.

    Thanks in advance for any help,
    Regards,
    Andrew Wilkinson

    andrew@andrew tests $ gdb --args python cg.py
    GNU gdb 6.1.1
    Copyright 2004 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 "i686-pc-linux-gnu"...Using host libthread_db
    library "/lib/libthread_db.so.1".

    (gdb) run
    Starting program: /usr/bin/python cg.py
    warning: Unable to find dynamic linker breakpoint function.
    GDB will be unable to debug shared library initializers
    and track explicitly loaded dynamic code.
    about to init Devil
    No error

    Program received signal SIGSEGV, Segmentation fault.
    0x4006ea73 in PyObject_GetAttrString () from /usr/lib/libpython2.3.so.1.0
    (gdb) bt
    #0 0x4006ea73 in PyObject_GetAttrString ()
    from /usr/lib/libpython2.3.so.1.0
    #1 0x404dc1ed in ?? ()
    #2 0x00000000 in ?? ()
    #3 0x404eb6cd in ?? ()
    #4 0xbfffef5c in ?? ()
    #5 0x400f2fbc in __JCR_LIST__ () from /usr/lib/libpython2.3.so.1.0
    #6 0x4006a928 in lookdict_string () from /usr/lib/libpython2.3.so.1.0
    #7 0x404c7aba in ?? ()
    #8 0xbffff07c in ?? ()
    #9 0xbffff0ac in ?? ()
    #10 0x00000007 in ?? ()
    #11 0xbffff07c in ?? ()
    #12 0x40061579 in function_call () from /usr/lib/libpython2.3.so.1.0
    #13 0x4006cd58 in PyCFunction_Call () from /usr/lib/libpython2.3.so.1.0
    #14 0x40094bc3 in call_function () from /usr/lib/libpython2.3.so.1.0
    #15 0x40092f8d in eval_frame () from /usr/lib/libpython2.3.so.1.0
    #16 0x40093d5f in PyEval_EvalCodeEx () from /usr/lib/libpython2.3.so.1.0
    #17 0x40091277 in PyEval_EvalCode () from /usr/lib/libpython2.3.so.1.0
    #18 0x400aaf8f in run_node () from /usr/lib/libpython2.3.so.1.0
    #19 0x400aa2fe in PyRun_SimpleFileExFlags ()
    from /usr/lib/libpython2.3.so.1.0
    #20 0x400a9df4 in PyRun_AnyFileExFlags () from /usr/lib/libpython2.3.so.1.0
    #21 0x400af3b5 in Py_Main () from /usr/lib/libpython2.3.so.1.0
    #22 0x0804867e in main ()

    --
    Tis better to be silent and thought a fool, than to open
    your mouth and remove all doubt -- Abraham Lincoln
     
    Andrew Wilkinson, Jul 9, 2004
    #1
    1. Advertising

  2. Andrew Wilkinson wrote:

    > Hi,


    I sorted the problem - all I needed to do was use the 'share' command in gdb
    to update the symbol tables before I did a backtrace.

    Andrew

    --
    Life's too short for chess.
     
    Andrew Wilkinson, Jul 9, 2004
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Hug
    Replies:
    6
    Views:
    13,960
  2. Codas obfuscatus

    NAN error and debugging with GDB

    Codas obfuscatus, Jan 6, 2004, in forum: C Programming
    Replies:
    10
    Views:
    1,281
    Peter Nilsson
    Jan 8, 2004
  3. Surendra
    Replies:
    0
    Views:
    514
    Surendra
    Mar 23, 2006
  4. seba
    Replies:
    1
    Views:
    1,454
    mlimber
    Mar 22, 2007
  5. Timothy Madden
    Replies:
    1
    Views:
    1,643
    Timothy Madden
    Sep 17, 2009
Loading...

Share This Page