Developer forums (C::B DEVELOPMENT STRICTLY!) > Development

debugger plugin feature request about the initial command of GDB

(1/5) > >>

ollydbg:
Under Windows, it seems the GDB can't find it's mingw/share/gdb files, so as a workaround, I would like to start gdb using this command:


--- Code: ---gdb --data-directory=e:/test/unix_gdb/install/mingw/share/gdb

--- End code ---
the above code will tell gdb that absolute path of "share/gdb", currently, if you install a more recent G++ or GDB, you will find that under "share/gdb", there are python pretty printres for "std c++ library" and the "gdb command support for pretty printer".

In Codelblocks, we have no such way to run GDB, There is a "debugger initializtion commands" edit control, but it can't set the parameters when gdb started. what I want is something like:

--- Code: ---gdb --data-directory=$(TARGET_COMPILER_DIR)/share/gdb

--- End code ---

But I found that currently, the GDB start command is hard coded in file:

--- Code: ---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;
}
--- End code ---

So, is it possible to add an extra option on the start up command??

such as:


--- Code: ---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;
}

--- End code ---
Then, I would simply add extraStartupCommand with below string

--- Code: -----data-directory=$(TARGET_COMPILER_DIR)/share/gdb
--- End code ---

thanks.

oBFusCATed:
As far as I know the correct place for the pretty printers is next to the headers of the stl.
Also I think after gcc 4.5 the pretty printers are included with the stl distribution (at least on linux).

ollydbg:
the stl pretty printer for 4.6.1 under Windows is installed in:

--- Code: ---MinGW_gcc4.6.1release_static_win32\share\gcc-4.6.1\python\libstdcxx
--- End code ---

Also, the gdb command support python scripts is installed in:

--- Code: ---MinGW_gcc4.6.1release_static_win32\share\gdb\python\gdb
--- End code ---


reckless:
the reason is that gdb expects a posix emultion shell eg. bash or sh to get its environment. in say msys or cygwin shell it works mostly (allthough i had a few problems with some projects under msys).

most gnu utils use getenv("somepath") to get there install location but getenv does not work under a windows environment instead you need to put the files in the same dir as gdb eg c:\gdb\gdb.exe\share\gdb files. or if the files are in lib then its c:\gdb\lib\gdb files. an example of the directory structure for windows use can be seen in the xmms2 project. its some times different than what i explained so you need to expperiment a bit.

oBFusCATed:
reckless: I'm not sure I've understand the second part of your post...

Navigation

[0] Message Index

[#] Next page

Go to full version