nemiver r808 - in branches/0.5: . src/dbgengine tests



Author: dodji
Date: Tue May  6 21:10:04 2008
New Revision: 808
URL: http://svn.gnome.org/viewvc/nemiver?rev=808&view=rev

Log:
fix #526866 â breakpoint parsing failures

Command line was:
svn merge -r795:796 svn+ssh://svn.gnome.org/svn/nemiver/trunk



Modified:
   branches/0.5/ChangeLog
   branches/0.5/src/dbgengine/nmv-gdbmi-parser.cc
   branches/0.5/tests/test-gdbmi.cc

Modified: branches/0.5/src/dbgengine/nmv-gdbmi-parser.cc
==============================================================================
--- branches/0.5/src/dbgengine/nmv-gdbmi-parser.cc	(original)
+++ branches/0.5/src/dbgengine/nmv-gdbmi-parser.cc	Tue May  6 21:10:04 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: branches/0.5/tests/test-gdbmi.cc
==============================================================================
--- branches/0.5/tests/test-gdbmi.cc	(original)
+++ branches/0.5/tests/test-gdbmi.cc	Tue May  6 21:10:04 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]