Problem with gdbinit.py

850 views
Skip to first unread message

Daniel Pfefferkorn

unread,
Jan 24, 2014, 7:38:53 AM1/24/14
to omn...@googlegroups.com
Hi everyone!

When trying to debug my simulation, I get the following error:


Error in final launch sequence
Failed to execute MI command:
source /opt/omnetpp/omnetpp-4.4/i686//misc/gdb/gdbinit.py
Error message from debugger back end:
/opt/omnetpp/omnetpp-4.4/i686/misc/gdb/gdbinit.py:2: Error in sourced
command file:\nUndefined command: "import". Try "help".
/opt/omnetpp/omnetpp-4.4/i686/misc/gdb/gdbinit.py:2: Error in sourced
command file:\nUndefined command: "import". Try "help".

It seems that the python script is not run through python, but
interpreted by gdb itself. So I added "python" to the beginning of the
script, which results in the following error:

Error in final launch sequence
Failed to execute MI command:
source /opt/omnetpp/omnetpp-4.4/i686//misc/gdb/gdbinit.py
Error message from debugger back end:
/opt/omnetpp/omnetpp-4.4/i686/misc/gdb/gdbinit.py:35: Error in sourced
command file:\nError while executing Python code.
/opt/omnetpp/omnetpp-4.4/i686/misc/gdb/gdbinit.py:35: Error in sourced
command file:\nError while executing Python code.

I am guessing there is something wrong with the GDB integration of CDT.

Has anyone ever experiencedthis problem before? How was it solved?

Thank you all very much!

-- Daniel

Daniel Pfefferkorn

unread,
Jan 24, 2014, 7:44:18 AM1/24/14
to omn...@googlegroups.com
I just found a workaround. :D
Just delete the value for 'GDB command file' in the Debugger ribbon for
your debug configuration.

Could one of the devs clarify the meaning of this gdb command file and
the consequences of not using it?

Thank you very much!
-- Daniel

Rudolf Hornig

unread,
Jan 27, 2014, 5:25:01 AM1/27/14
to omn...@googlegroups.com
The .gdbinit file is used only to load the pretty printers that are implementid in python. Of course this needs tha tthe GDB itself was build using python support. If you leave it out, the pretty printers will not work. (not that there are so useful). We only have pretty printer for simtime and some basic omnetpp types. The gerneral gdb functionality will not be affected. (on mac os gdb is so old that there is no python support at all)

Rudolf

Daniel Pfefferkorn

unread,
Jan 27, 2014, 8:17:32 AM1/27/14
to omn...@googlegroups.com
Thank you for the explanation.

We are using GNU gdb 7.0.1-debian. It seems that the package for Debian
Squeeze (LTS version) was NOT build with python support.

-- Daniel
> --
> You received this message because you are subscribed to the Google
> Groups "omnetpp" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to omnetpp+u...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.


Rudolf Hornig

unread,
Jan 27, 2014, 10:35:57 AM1/27/14
to omn...@googlegroups.com
Yep, if memory serves python support was added in gdb 7.3
Reply all
Reply to author
Forward
0 new messages