Does "filename":line not make a lot more sense anyway, even now? That's assuming the current version supports that, of course.
If the present version supports this variant, I don't see why we should not use it. A line number should not contain anything that needs quoting, only a filename might. Insofar, only quoting the filename is a kind of sensible approach.
The gdb developer Keith strongly suggest that the line number should not be quoted.
This feature
"filename":line does not exist in the current gdb CVS or 7.4 branch, but I guess they still need some test. (Currently, the new line specification has already pass all the gdb build-in tests)
Change our debugger branch code is quite simple. For the
Here is the patch:
Index: E:/code/cb/cb_debugger_branch/src/plugins/debuggergdb/gdb_commands.h
===================================================================
--- E:/code/cb/cb_debugger_branch/src/plugins/debuggergdb/gdb_commands.h (revision 7909)
+++ E:/code/cb/cb_debugger_branch/src/plugins/debuggergdb/gdb_commands.h (working copy)
@@ -131,7 +131,7 @@
// Breakpoint 1 at 0x4013d6: file main.cpp, line 8.
static wxRegEx reBreakpoint(_T("Breakpoint ([0-9]+) at (0x[0-9A-Fa-f]+)"));
// Breakpoint 1 ("/home/jens/codeblocks-build/codeblocks-1.0svn/src/plugins/debuggergdb/gdb_commands.h:125) pending.
-static wxRegEx rePendingBreakpoint(_T("Breakpoint ([0-9]+)[ \t]\\(\\\"(.+):([0-9]+)\\)[ \t]pending\\."));
+static wxRegEx rePendingBreakpoint(_T("Breakpoint ([0-9]+)[ \t]\\((.+):([0-9]+)\\)[ \t]pending\\."));
// Hardware assisted breakpoint 1 at 0x4013d6: file main.cpp, line 8.
static wxRegEx reHWBreakpoint(_T("Hardware assisted breakpoint ([0-9]+) at (0x[0-9A-Fa-f]+)"));
// Hardware watchpoint 1: expr
@@ -448,7 +448,7 @@
m_Cmd << _T("break ");
else
m_Cmd << _T("tbreak ");
- m_Cmd << _T('"') << out << _T(":") << wxString::Format(_T("%d"), m_BP->line) << _T('"');
+ m_Cmd << out << _T(":") << wxString::Format(_T("%d"), m_BP->line);
}
else if (m_BP->type == DebuggerBreakpoint::bptData)
{
This patch works under both the official gdb or the gdb-line-spec-branch.
For
It should also be quite easy to implement.
To my point: I think mostly quote is not needed. (I exclude the case that file name does not contain spaces
, I'm not sure gdb support this)