gdb --data-directory=e:/test/unix_gdb/install/mingw/share/gdb
gdb --data-directory=$(TARGET_COMPILER_DIR)/share/gdb
wxString GDB_driver::GetCommandLine(const wxString& debugger, const wxString& debuggee)
{
wxString cmd;
cmd << debugger;
cmd << _T(" -nx"); // don't run .gdbinit
cmd << _T(" -fullname "); // report full-path filenames when breaking
cmd << _T(" -quiet"); // don't display version on startup
cmd << _T(" -args ") << debuggee;
return cmd;
}
wxString GDB_driver::GetCommandLine(const wxString& debugger, int pid)
{
wxString cmd;
cmd << debugger;
cmd << _T(" -nx"); // don't run .gdbinit
cmd << _T(" -fullname "); // report full-path filenames when breaking
cmd << _T(" -quiet"); // don't display version on startup
cmd << _T(" -pid=") << wxString::Format(_T("%d"), pid);
return cmd;
}
wxString GDB_driver::GetCommandLine(const wxString& debugger, const wxString& debuggee)
{
wxString cmd;
cmd << debugger;
cmd << _T(" -nx"); // don't run .gdbinit
cmd << _T(" -fullname "); // report full-path filenames when breaking
cmd << _T(" -quiet"); // don't display version on startup
cmd << extraStartupCommand; //************************************
cmd << _T(" -args ") << debuggee;
return cmd;
}
--data-directory=$(TARGET_COMPILER_DIR)/share/gdb
MinGW_gcc4.6.1release_static_win32\share\gcc-4.6.1\python\libstdcxx
MinGW_gcc4.6.1release_static_win32\share\gdb\python\gdb
PathToMinGW\bin
PathToMinGW\share\gdb
Yes, gdb was not friendly handle windows style path.
I have manually hack the GDB's source code, and adjust the "data-directory" under Win32. Now, it works OK.
I suppose that we have such file structure
gdb executable is located under:Codeand the python script was located underPathToMinGW\bin
CodePathToMinGW\share\gdb
the patch can be found in gdb2011-08-08.patch (http://code.google.com/p/qp-gcc/downloads/detail?name=gdb2011-08-08.patch&can=2&q=), it includes other windows path handling problem fix.
reckless: I'm not sure I've understand the second part of your post...
set data-directory E:\MyPack\MinGW\share\gdb
I have an another method.
Create a new file named ".gdbinit" at the gdb.exe directory.
Content:CodeThen gdb will use this data directory.set data-directory E:\MyPack\MinGW\share\gdb
so we can use the command :I have an another method.
Create a new file named ".gdbinit" at the gdb.exe directory.
Content:CodeThen gdb will use this data directory.set data-directory E:\MyPack\MinGW\share\gdb
Unfortunately this won't help due to how gdb is started within C::B. As per ollydbg's original post, gdb is started with "-nx" meaning .gdbinit is not sourced.
I test this, this method can modify the gdb's data directory, but not python's.so we can use the command :I have an another method.
Create a new file named ".gdbinit" at the gdb.exe directory.
Content:CodeThen gdb will use this data directory.set data-directory E:\MyPack\MinGW\share\gdb
Unfortunately this won't help due to how gdb is started within C::B. As per ollydbg's original post, gdb is started with "-nx" meaning .gdbinit is not sourced.
gdb -ex "set data-directory e:\mypack\mingw\share\gdb"
?
but I try to use "info pretty-printer", and this doesn't work.
Unfortunately this won't help due to how gdb is started within C::B. As per ollydbg's original post, gdb is started with "-nx" meaning .gdbinit is not sourced.You can source ~/.gdbinit manually.
so we can use the command :Why would you do this instead of passing --data-dir?
gdb -ex "set data-directory e:\mypack\mingw\share\gdb"
E:\test\unix_gdb\install\mingw\bin>gdb --data-directory=e:/test/unix_gdb/install
/mingw/share/gdb
GNU gdb (GDB) 7.3.50.20110808-cvs
Copyright (C) 2011 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "mingw32".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
(gdb) info pretty-printer
(gdb) q
E:\test\unix_gdb\install\mingw\bin>gdb
GNU gdb (GDB) 7.3.50.20110808-cvs
Copyright (C) 2011 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "mingw32".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
(gdb) info pretty-printer
Undefined info command: "pretty-printer". Try "help info".
(gdb)
so we can use the command :Why would you do this instead of passing --data-dir?
gdb -ex "set data-directory e:\mypack\mingw\share\gdb"
Can we redefine gdb.PYTHONDIR to gdb's data directory in python.c?
the gdb's shared folder is used when it's python module is initialized. but the python module is running before you "set-directory" command.
so the only way to set the data-directory is setting that path as gdb parameters, like "gdb --data-directory=XXX"
the other way such as “set data-directory XXX” can not work.
I've added an option to set custom arguments to gdb, please test it and report if it really works.I will test it ASAP, currently I can't synchonize SVN now due to network issue. :)
I've added an option to set custom arguments to gdb, please test it and report if it really works.