Hi, I just want to try to open a wxPython window from GDB's python interface, so I create a simple python script, and use the "source sim.py" command to load it. I'm using gdb with python enabled build myself, and under WinXP.
Here is the sim.py
import wx
app = wx.App()
frame = wx.Frame(None, -1, 'simple.py')
frame.Show()
app.MainLoop()
When I start GDB.exe from the command line, and type this command, I can see a window shown up, see the screen shot below:
But if I start the GDB.exe from C::B's debugger plugin, and type the command "source sim.py" there, no window will be shown, here is the log:
electing target:
Debug
Adding source dir: E:\code\gdb\large-mem\test\
Adding source dir: E:\code\gdb\large-mem\test\
Adding file: E:\code\gdb\large-mem\test\bin\Debug\test.exe
Changing directory to: E:/code/gdb/large-mem/test/.
Set variable: PATH=.;D:\mingw-builds\473\mingw32\bin;D:\mingw-builds\473\mingw32;E:\code\msys\PortableGit-1.9.4-preview20140611\cmd;E:\code\common_bin;D:\opencv246build\build-gcc482-release\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\system32\wbem;D:\Program Files\TortoiseSVN\bin;E:\code\DrMemory-Windows-1.6.1-2\bin;E:\code\wx-mingw-build-481-dw2\wxWidgets-2.8.12\lib\gcc_dll
[debug]Command-line: E:\code\gdb\mybuild\bin\gdb.exe -nx -fullname -quiet -iex "set auto-load safe-path /" -args E:/code/gdb/large-mem/test/bin/Debug/test.exe
[debug]Working dir : E:\code\gdb\large-mem\test
Starting debugger: E:\code\gdb\mybuild\bin\gdb.exe -nx -fullname -quiet -iex "set auto-load safe-path /" -args E:/code/gdb/large-mem/test/bin/Debug/test.exe
done
[debug]> set prompt >>>>>>cb_gdb:
[debug]Skip initializing the scripting!
Setting breakpoints
[debug]Reading symbols from E:/code/gdb/large-mem/test/bin/Debug/test.exe...done.
[debug](gdb) >>>>>>cb_gdb:
[debug]> show version
[debug]GNU gdb (GDB) 7.8.50.20140717-cvs
[debug]Copyright (C) 2014 Free Software Foundation, Inc.
[debug]License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
[debug]This is free software: you are free to change and redistribute it.
[debug]There is NO WARRANTY, to the extent permitted by law. Type "show copying"
[debug]and "show warranty" for details.
[debug]This GDB was configured as "mingw32".
[debug]Type "show configuration" for configuration details.
[debug]For bug reporting instructions, please see:
[debug]<http://www.gnu.org/software/gdb/bugs/>.
[debug]Find the GDB manual and other documentation resources online at:
[debug]<http://www.gnu.org/software/gdb/documentation/>.
[debug]For help, type "help".
[debug]Type "apropos word" to search for commands related to "word".
[debug]>>>>>>cb_gdb:
[debug]> set confirm off
Debugger name and version: GNU gdb (GDB) 7.8.50.20140717-cvs
[debug]>>>>>>cb_gdb:
[debug]> set width 0
[debug]>>>>>>cb_gdb:
[debug]> set height 0
[debug]>>>>>>cb_gdb:
[debug]> set breakpoint pending on
[debug]>>>>>>cb_gdb:
[debug]> set print asm-demangle on
[debug]>>>>>>cb_gdb:
[debug]> set unwindonsignal on
[debug]>>>>>>cb_gdb:
[debug]> set print elements 0
[debug]>>>>>>cb_gdb:
[debug]> set new-console on
[debug]>>>>>>cb_gdb:
[debug]> set disassembly-flavor intel
[debug]>>>>>>cb_gdb:
[debug]> catch throw
[debug]Catchpoint 1 (throw)
[debug]>>>>>>cb_gdb:
[debug]> source E:\code\gdb\mybuild\bin\my.gdb
[debug]>>>>>>cb_gdb:
[debug]> directory E:/code/gdb/large-mem/test/
[debug]Source directories searched: E:/code/gdb/large-mem/test;$cdir;$cwd
[debug]>>>>>>cb_gdb:
> source sim.py
[debug]> source sim.py
Note that I even not run the debugee, just load it.
Not sure why there is difference between running a command in the gdb command line and in C::B.
I even try to run all the command like "set new-console on" in the gdb command line, this don't change the behavior. In-short, running command from C::B does not work quite well.
Any hints?
BTW: is it the wxExecute issue?
int DebuggerGDB::LaunchProcess(const wxString& cmd, const wxString& cwd)
{
if (m_pProcess)
return -1;
// start the gdb process
m_pProcess = new PipedProcess(&m_pProcess, this, idGDBProcess, true, cwd);
Log(_("Starting debugger: ") + cmd);
m_Pid = wxExecute(cmd, wxEXEC_ASYNC, m_pProcess);