nemiver r796 - in trunk: . src/dbgengine tests
- From: dodji svn gnome org
- To: svn-commits-list gnome org
- Subject: nemiver r796 - in trunk: . src/dbgengine tests
- Date: Fri, 11 Apr 2008 18:56:51 +0100 (BST)
Author: dodji
Date: Fri Apr 11 18:56:51 2008
New Revision: 796
URL: http://svn.gnome.org/viewvc/nemiver?rev=796&view=rev
Log:
[gdbmi parser] fix #526866 â breakpoint parsing failures
* src/dbgengine/nmv-gdbmi-parser.cc: fix a parsing bug that happens
when setting a pending breakpoint on a fully qualified function.
* tests/test-gdbmi.cc: add a regression test for this bugfix.
This entry should fix bug #526866
Modified:
trunk/ChangeLog
trunk/src/dbgengine/nmv-gdbmi-parser.cc
trunk/tests/test-gdbmi.cc
Modified: trunk/src/dbgengine/nmv-gdbmi-parser.cc
==============================================================================
--- trunk/src/dbgengine/nmv-gdbmi-parser.cc (original)
+++ trunk/src/dbgengine/nmv-gdbmi-parser.cc Fri Apr 11 18:56:51 2008
@@ -210,7 +210,26 @@
}
LOG_D ("got pending breakpoint: '" << pending << "'",
GDBMI_OUTPUT_DOMAIN);
- vector<UString> str_tab = pending.split (":");
+ vector<UString> str_tab;
+ //pending contains either the name of the function the breakpoint
+ //has been set on, or the filename:linenumber location of the
+ //breakpoint.
+ //So either pending has the form:
+ //"ns::functionname" or it has the form "filename:linenumber"
+ bool breakpoint_on_function_name = false;
+ if (pending.raw ().find ("::") != std::string::npos) {
+ breakpoint_on_function_name = true;
+ }
+ if (!breakpoint_on_function_name) {
+ str_tab = pending.split (":");
+ } else {
+ str_tab.push_back (pending);
+ }
+ //from now on, if str_tab.size () == 2 then it contains
+ //the filename and line number of the breakpoint.
+ //if it str_tab.size () == 1 then it contains the function name
+ //the breakpoint was set on.
+ //Otherwise an error occured
if (str_tab.size () > 1) {
LOG_D ("filepath: '" << str_tab[0] << "'", GDBMI_OUTPUT_DOMAIN);
LOG_D ("linenum: '" << str_tab[1] << "'", GDBMI_OUTPUT_DOMAIN);
Modified: trunk/tests/test-gdbmi.cc
==============================================================================
--- trunk/tests/test-gdbmi.cc (original)
+++ trunk/tests/test-gdbmi.cc Fri Apr 11 18:56:51 2008
@@ -96,6 +96,10 @@
static const char* gv_breakpoint_table1 =
"BreakpointTable={nr_rows=\"2\",nr_cols=\"6\",hdr=[{width=\"7\",alignment=\"-1\",col_name=\"number\",colhdr=\"Num\"},{width=\"14\",alignment=\"-1\",col_name=\"type\",colhdr=\"Type\"},{width=\"4\",alignment=\"-1\",col_name=\"disp\",colhdr=\"Disp\"},{width=\"3\",alignment=\"-1\",col_name=\"enabled\",colhdr=\"Enb\"},{width=\"10\",alignment=\"-1\",col_name=\"addr\",colhdr=\"Address\"},{width=\"40\",alignment=\"2\",col_name=\"what\",colhdr=\"What\"}],body=[bkpt={number=\"1\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"0x0805e404\",func=\"main\",file=\"/usr/include/boost/test/minimal.hpp\",fullname=\"/usr/include/boost/test/minimal.hpp\",line=\"113\",times=\"1\"},bkpt={number=\"2\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"<PENDING>\",pending=\"nemiver_common_create_dynamic_module_instance\",times=\"0\"}]}";
+static const char* gv_breakpoint_table2 =
+"BreakpointTable={nr_rows=\"5\",nr_cols=\"6\",hdr=[{width=\"3\",alignment=\"-1\",col_name=\"number\",colhdr=\"Num\"},{width=\"14\",alignment=\"-1\",col_name=\"type\",colhdr=\"Type\"},{width=\"4\",alignment=\"-1\",col_name=\"disp\",colhdr=\"Disp\"},{width=\"3\",alignment=\"-1\",col_name=\"enabled\",colhdr=\"Enb\"},{width=\"10\",alignment=\"-1\",col_name=\"addr\",colhdr=\"Address\"},{width=\"40\",alignment=\"2\",col_name=\"what\",colhdr=\"What\"}],body=[bkpt={number=\"1\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"0x0806f8f8\",func=\"main\",file=\"main.cc\",fullname=\"/home/jonathon/Projects/agave.git/src/main.cc\",line=\"73\",times=\"1\"},bkpt={number=\"2\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"<PENDING>\",pending=\"gcs::MainWindow::MainWindow()\",times=\"0\"},bkpt={number=\"3\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"0x0805f91e\",func=\"gcs::MainWindow::Instance()\",file=\"gcs-mainwindow.cc\",fullname=\"/home/jonathon/Projects/agav
e.git/src/gcs-mainwindow.cc\",line=\"70\",times=\"1\"},bkpt={number=\"4\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"0x0805f91e\",func=\"gcs::MainWindow::Instance()\",file=\"gcs-mainwindow.cc\",fullname=\"/home/jonathon/Projects/agave.git/src/gcs-mainwindow.cc\",line=\"70\",times=\"1\"},bkpt={number=\"5\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"0x0805db44\",func=\"MainWindow\",file=\"gcs-mainwindow.cc\",fullname=\"/home/jonathon/Projects/agave.git/src/gcs-mainwindow.cc\",line=\"95\",times=\"0\"}]}";
+
+
void
test_str0 ()
{
@@ -506,6 +510,10 @@
cur = 0, cur = 0, breakpoints.clear();
BOOST_REQUIRE (parse_breakpoint_table (gv_breakpoint_table1,
cur, cur, breakpoints)) ;
+
+ cur = 0, cur = 0, breakpoints.clear();
+ BOOST_REQUIRE (parse_breakpoint_table (gv_breakpoint_table2,
+ cur, cur, breakpoints)) ;
}
using boost::unit_test::test_suite ;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]