Author Topic: DebuggerGDB bugfix  (Read 8032 times)

Offline EricBurnett

  • Multiple posting newcomer
  • *
  • Posts: 20
    • http://
DebuggerGDB bugfix
« on: April 19, 2005, 08:12:24 am »
I do not know whether it is strictly win32 or linux as well, but the interface with the GDB debugger has problems.


Specifically: the cd command in gdb does not accept quotes, but will accept paths that include spaces

To verify: open command (file->run), then type gdb. in the gdb command line, type cd "C:/Windows", and see the error message it results in. You can also verify paths with spaces this way.

To fix:

in debuggergdb.h, add this line under protected:
Code
void StripQuotes(wxString& str);


in debuggergdb.cpp, add above the cd command (line 501)
Code
StripQuotes(path);			//GDB doesn't accept quotes in cd commands...spaces work fine
msgMan->Log(m_PageIndex, _("Changing directory to: %s"), path.c_str());


and later, add the function implimentation:
Code
void DebuggerGDB::StripQuotes(wxString& str)
{
if (str.GetChar(0) == '\"') str = str.Mid(1, str.Length() - 2);
}



I am fairly sure that the "directory" command is not working properly, but it is not giving output that can easily be checked. Through command line testing, it looks like paths will need to be converted to dos style (Docume~1 stuff), and then quotes removed. I can write this up, but would like some confirmation it is necessary, and to know how it acts on linux.

Hope this helps,
--Eric Burnett

Offline rickg22

  • Lives here!
  • ****
  • Posts: 2283
DebuggerGDB bugfix
« Reply #1 on: April 20, 2005, 01:47:23 am »
Please submit this as a bug report on sourceforge.
Thank you.

Offline EricBurnett

  • Multiple posting newcomer
  • *
  • Posts: 20
    • http://
DebuggerGDB bugfix
« Reply #2 on: April 20, 2005, 01:51:23 am »
Oops, didn't realize this would be better there. I'm just going to see if I can verify some of the info, then post a patch.

Offline rickg22

  • Lives here!
  • ****
  • Posts: 2283
DebuggerGDB bugfix
« Reply #3 on: April 20, 2005, 09:10:34 pm »
Thanks. Oh btw your implementation is flawed. What if the quotes appear only at the beginning? ;-)

Offline EricBurnett

  • Multiple posting newcomer
  • *
  • Posts: 20
    • http://
DebuggerGDB bugfix
« Reply #4 on: April 21, 2005, 06:55:00 am »
Good point. I need to learn to cover everything. Getting patches to pass your scrutiny will be good practise, I guess  :roll:.

Oh, and I tested on linux, and it looks like the path and directory issues are the same. As far as I know, 'directory' is doing nothing right now (on any OS), and so needs work. Still need to figure out how to get past the issues of spaces in the path (for instance '\ ' is still parsed as a space. Need to test '\032' and such later).

But rest assured, the patch is coming!

Offline rickg22

  • Lives here!
  • ****
  • Posts: 2283
DebuggerGDB bugfix
« Reply #5 on: April 21, 2005, 07:16:07 am »
Yeah, you should ask Yiannis how much I bothered him to fix the crashes on exit :roll: I tested every conceivable option and menu to make it crash ^^;;