FAQ
Python is embedded into my application. I have a custom module that
is part of the application - it is not loaded as a shared library - rather
the object files are incorporated into the final binary at link time.

The problem I am having is that I can set breakpoints in my module only
when gdb is first started. Once my app exits I am no longer able to set
breakpoints on functions in my module.

I suspect that python is somehow changing the mapping of the text segment,
but that just a guess.

My question: What is python doing that prevents gdb from setting breakpoints
after the program exits the first time? How can I prevent this?


Thanks for any info.
-Ram

Search Discussions

  • Ram Bhamidipaty at Feb 25, 2002 at 6:46 pm
    I found that this same behavior happens with python without my application:

    $ gdb /usr/local/bin/python
    GNU gdb 5.0
    ...
    This GDB was configured as "i386-redhat-linux"...
    (gdb) break PyImport_GetMagicNumber
    Breakpoint 1 at 0x8098263: file Python/import.c, line 374.
    (gdb) run
    Type "help", "copyright", "credits" or "license" for more information.
    import sys
    sys.exit(0)
    Program exited normally.


    (gdb) run
    warning: Cannot insert breakpoint -7:
    Cannot access memory at address 0x4002dd24
    (gdb) q


    In order to place more breakpoints I would need to exit gdb and restart
    the whole gdb run.

    -Ram





    Ram Bhamidipaty <ramb at synopsys.com> writes:
    Python is embedded into my application. I have a custom module that
    is part of the application - it is not loaded as a shared library - rather
    the object files are incorporated into the final binary at link time.

    The problem I am having is that I can set breakpoints in my module only
    when gdb is first started. Once my app exits I am no longer able to set
    breakpoints on functions in my module.

    I suspect that python is somehow changing the mapping of the text segment,
    but that just a guess.

    My question: What is python doing that prevents gdb from setting breakpoints
    after the program exits the first time? How can I prevent this?


    Thanks for any info.
    -Ram
  • Nick Arnett at Feb 25, 2002 at 7:06 pm
    I'm just bringing myself up to speed with Python, so forgive what I think is
    an simple question. I'm building a UI that has a bunch of checkbuttons,
    which also includes buttons to turn all the checkbuttons on or off. I see
    how to turn them off individually, but it seems to me that there must be a
    more elegant way.

    The checkbuttons are created in __init__. I'm thinking that there must be a
    way to filter or iterate through the objects in __init__, and for each one,
    if it's a button, select or deselect as appropriate. I see how to get the
    namespace as a dictionary, but that hasn't helped.

    I've searched the archives of this group and found lots of hints, but not
    the answer I'm looking for. I suspect it lies in parts of the language I
    haven't yet explored... I started with the UI, since that's where I'm
    weakest.

    Thanks,

    Nick Arnett
    narnett at mccmedia.com

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouppython-list @
categoriespython
postedFeb 25, '02 at 6:16p
activeFeb 25, '02 at 7:06p
posts3
users2
websitepython.org

2 users in discussion

Ram Bhamidipaty: 2 posts Nick Arnett: 1 post

People

Translate

site design / logo © 2022 Grokbase