ide/debugger: Fixed GDB communication losing breakpoint line numbers
authorJerome St-Louis <jerome@ecere.com>
Sat, 24 Nov 2012 09:36:33 +0000 (04:36 -0500)
committerJerome St-Louis <jerome@ecere.com>
Sat, 24 Nov 2012 09:36:33 +0000 (04:36 -0500)
- Added proper escaping to both StripQuotes2 and TokenizeList

ide/locale/ide.pot
ide/src/debugger/Debugger.ec

index 77677b1..9040f32 100644 (file)
@@ -58,7 +58,7 @@ msgstr " file is not part of any project.\n"
 msgid " was "
 msgstr " was "
 
-#: ./src/debugger/Debugger.ec:793
+#: ./src/debugger/Debugger.ec:797
 msgid " with exit code %s"
 msgstr " with exit code %s"
 
@@ -74,19 +74,19 @@ msgstr "%s - %s%smakefile for %s config...\n"
 msgid "%s Compiler\n"
 msgstr "%s Compiler\n"
 
-#: ./src/debugger/Debugger.ec:2854
+#: ./src/debugger/Debugger.ec:2858
 msgid "%s Constructor, %s:%d\n"
 msgstr "%s Constructor, %s:%d\n"
 
-#: ./src/debugger/Debugger.ec:2856
+#: ./src/debugger/Debugger.ec:2860
 msgid "%s Destructor, %s:%d\n"
 msgstr "%s Destructor, %s:%d\n"
 
-#: ./src/debugger/Debugger.ec:2858
+#: ./src/debugger/Debugger.ec:2862
 msgid "%s Function, %s:%d\n"
 msgstr "%s Function, %s:%d\n"
 
-#: ./src/debugger/Debugger.ec:2850
+#: ./src/debugger/Debugger.ec:2854
 msgid "%s Method, %s:%d\n"
 msgstr "%s Method, %s:%d\n"
 
@@ -94,7 +94,7 @@ msgstr "%s Method, %s:%d\n"
 msgid "%s Project"
 msgstr "%s Project"
 
-#: ./src/debugger/Debugger.ec:2852
+#: ./src/debugger/Debugger.ec:2856
 msgid "%s Property, %s:%d\n"
 msgstr "%s Property, %s:%d\n"
 
@@ -526,7 +526,7 @@ msgstr "Copy"
 msgid "Couldn't create file."
 msgstr "Couldn't create file."
 
-#: ./src/debugger/Debugger.ec:2359
+#: ./src/debugger/Debugger.ec:2363
 msgid "Couldn't read memory"
 msgstr "Couldn't read memory"
 
@@ -573,23 +573,23 @@ msgstr "Debug compiling"
 msgid "Debuggable"
 msgstr "Debuggable"
 
-#: ./src/debugger/Debugger.ec:3305
+#: ./src/debugger/Debugger.ec:3309
 msgid "Debugger Error: No target process ID\n"
 msgstr "Debugger Error: No target process ID\n"
 
-#: ./src/debugger/Debugger.ec:1870
+#: ./src/debugger/Debugger.ec:1874
 msgid "Debugger Fatal Error: Couldn't get GDB process ID\n"
 msgstr "Debugger Fatal Error: Couldn't get GDB process ID\n"
 
-#: ./src/debugger/Debugger.ec:1859
+#: ./src/debugger/Debugger.ec:1863
 msgid "Debugger Fatal Error: Couldn't start GDB\n"
 msgstr "Debugger Fatal Error: Couldn't start GDB\n"
 
-#: ./src/debugger/Debugger.ec:2655
+#: ./src/debugger/Debugger.ec:2659
 msgid "Debugger Fatal Error: GDB lost\n"
 msgstr "Debugger Fatal Error: GDB lost\n"
 
-#: ./src/debugger/Debugger.ec:2282
+#: ./src/debugger/Debugger.ec:2286
 msgid "Debugger required for symbol evaluation in \"%s\""
 msgstr "Debugger required for symbol evaluation in \"%s\""
 
@@ -597,9 +597,9 @@ msgstr "Debugger required for symbol evaluation in \"%s\""
 msgid "Debugging compressed applications is not supported\n"
 msgstr "Debugging compressed applications is not supported\n"
 
-#: ./src/debugger/Debugger.ec:1975
-#: ./src/debugger/Debugger.ec:2656
-#: ./src/debugger/Debugger.ec:3322
+#: ./src/debugger/Debugger.ec:1979
+#: ./src/debugger/Debugger.ec:2660
+#: ./src/debugger/Debugger.ec:3326
 msgid "Debugging stopped\n"
 msgstr "Debugging stopped\n"
 
@@ -649,7 +649,7 @@ msgstr "Deleteing intermediate objects for %s %s in project %s...\n"
 msgid "Deleting target and object files..."
 msgstr "Deleting target and object files..."
 
-#: ./src/debugger/Debugger.ec:2276
+#: ./src/debugger/Debugger.ec:2280
 msgid "Dereference failure for \"%s\""
 msgstr "Dereference failure for \"%s\""
 
@@ -719,7 +719,7 @@ msgstr "Edit"
 msgid "Editor"
 msgstr "Editor"
 
-#: ./src/debugger/Debugger.ec:2355
+#: ./src/debugger/Debugger.ec:2359
 msgid "Empty string"
 msgstr "Empty string"
 
@@ -765,11 +765,11 @@ msgstr "Error opening project file"
 msgid "Error writing project file"
 msgstr "Error writing project file"
 
-#: ./src/debugger/Debugger.ec:2243
+#: ./src/debugger/Debugger.ec:2247
 msgid "Error: Struct member not found for \"%s\""
 msgstr "Error: Struct member not found for \"%s\""
 
-#: ./src/debugger/Debugger.ec:2467
+#: ./src/debugger/Debugger.ec:2471
 msgid "Evaluation failed for \"%s\" of type \"%s\""
 msgstr "Evaluation failed for \"%s\" of type \"%s\""
 
@@ -1032,7 +1032,7 @@ msgstr "Include Files"
 msgid "Include Subdirectories"
 msgstr "Include Subdirectories"
 
-#: ./src/debugger/Debugger.ec:2285
+#: ./src/debugger/Debugger.ec:2289
 msgid "Incorrect debugger state for symbol evaluation in \"%s\""
 msgstr "Incorrect debugger state for symbol evaluation in \"%s\""
 
@@ -1048,22 +1048,22 @@ msgstr "Initializing Debugger"
 msgid "Intermediate Objects Directory"
 msgstr "Intermediate Objects Directory"
 
-#: ./src/debugger/Debugger.ec:2377
+#: ./src/debugger/Debugger.ec:2381
 msgid "Invalid Enum Value"
 msgstr "Invalid Enum Value"
 
-#: ./src/debugger/Debugger.ec:1094
-#: ./src/debugger/Debugger.ec:1110
-#: ./src/debugger/Debugger.ec:1123
-#: ./src/debugger/Debugger.ec:1228
+#: ./src/debugger/Debugger.ec:1098
+#: ./src/debugger/Debugger.ec:1114
+#: ./src/debugger/Debugger.ec:1127
+#: ./src/debugger/Debugger.ec:1232
 msgid "Invalid Source Directory"
 msgstr "Invalid Source Directory"
 
-#: ./src/debugger/Debugger.ec:2439
+#: ./src/debugger/Debugger.ec:2443
 msgid "Invalid Unicode Keypoint (0x%08X)"
 msgstr "Invalid Unicode Keypoint (0x%08X)"
 
-#: ./src/debugger/Debugger.ec:2474
+#: ./src/debugger/Debugger.ec:2478
 msgid "Invalid expression: \"%s\""
 msgstr "Invalid expression: \"%s\""
 
@@ -1134,11 +1134,11 @@ msgstr "Makefile doesn't exist. "
 msgid "Match case"
 msgstr "Match case"
 
-#: ./src/debugger/Debugger.ec:2263
+#: ./src/debugger/Debugger.ec:2267
 msgid "Member \"%s\" not found in class \"%s\""
 msgstr "Member \"%s\" not found in class \"%s\""
 
-#: ./src/debugger/Debugger.ec:2273
+#: ./src/debugger/Debugger.ec:2277
 msgid "Memory can't be read at %s"
 msgstr "Memory can't be read at %s"
 
@@ -1179,7 +1179,7 @@ msgstr "Microsoft Visual Studio 2010 (10.0) Compiler"
 msgid "Misc"
 msgstr "Misc"
 
-#: ./src/debugger/Debugger.ec:2465
+#: ./src/debugger/Debugger.ec:2469
 msgid "Missing property evaluation support for \"%s\""
 msgstr "Missing property evaluation support for \"%s\""
 
@@ -1252,11 +1252,11 @@ msgstr "Next"
 msgid "No Line Numbers"
 msgstr "No Line Numbers"
 
-#: ./src/debugger/Debugger.ec:1233
+#: ./src/debugger/Debugger.ec:1237
 msgid "No Source Directory Provided"
 msgstr "No Source Directory Provided"
 
-#: ./src/debugger/Debugger.ec:2068
+#: ./src/debugger/Debugger.ec:2072
 msgid "No source file found for selected frame"
 msgstr "No source file found for selected frame"
 
@@ -1273,11 +1273,11 @@ msgstr "Normal"
 msgid "Nothing to be found. Please specify at least one criteria."
 msgstr "Nothing to be found. Please specify at least one criteria."
 
-#: ./src/debugger/Debugger.ec:2320
+#: ./src/debugger/Debugger.ec:2324
 msgid "Null string"
 msgstr "Null string"
 
-#: ./src/debugger/Debugger.ec:2288
+#: ./src/debugger/Debugger.ec:2292
 msgid "Null type for \"%s\""
 msgstr "Null type for \"%s\""
 
@@ -1498,11 +1498,11 @@ msgstr "Properties.."
 msgid "Properties..."
 msgstr "Properties..."
 
-#: ./src/debugger/Debugger.ec:719
+#: ./src/debugger/Debugger.ec:723
 msgid "Provide source file location for %s"
 msgstr "Provide source file location for %s"
 
-#: ./src/debugger/Debugger.ec:1202
+#: ./src/debugger/Debugger.ec:1206
 msgid "Provide source files location directory for %s"
 msgstr "Provide source files location directory for %s"
 
@@ -1758,7 +1758,7 @@ msgstr "Sheet"
 msgid "Show line numbers in code editor"
 msgstr "Show line numbers in code editor"
 
-#: ./src/debugger/Debugger.ec:489
+#: ./src/debugger/Debugger.ec:493
 msgid "Signal received: %s - %s\n"
 msgstr "Signal received: %s - %s\n"
 
@@ -1782,10 +1782,10 @@ msgstr "Start"
 msgid "Starting Debug"
 msgstr "Starting Debug"
 
-#: ./src/debugger/Debugger.ec:866
-#: ./src/debugger/Debugger.ec:886
-#: ./src/debugger/Debugger.ec:930
-#: ./src/debugger/Debugger.ec:1815
+#: ./src/debugger/Debugger.ec:870
+#: ./src/debugger/Debugger.ec:890
+#: ./src/debugger/Debugger.ec:934
+#: ./src/debugger/Debugger.ec:1819
 msgid "Starting debug mode\n"
 msgstr "Starting debug mode\n"
 
@@ -1832,7 +1832,7 @@ msgstr "Strict Name Spaces"
 msgid "Supports forcing bit depth"
 msgstr "Supports forcing bit depth"
 
-#: ./src/debugger/Debugger.ec:2239
+#: ./src/debugger/Debugger.ec:2243
 msgid "Symbol \"%s\" not found"
 msgstr "Symbol \"%s\" not found"
 
@@ -1873,7 +1873,7 @@ msgstr "Target Type"
 msgid "Target and object files deleted\n"
 msgstr "Target and object files deleted\n"
 
-#: ./src/debugger/Debugger.ec:2714
+#: ./src/debugger/Debugger.ec:2718
 msgid "Target doesn't contain debug information!\n"
 msgstr "Target doesn't contain debug information!\n"
 
@@ -1915,20 +1915,20 @@ msgstr "The following file"
 msgid "The following file%s could not be re-opened.%s"
 msgstr "The following file%s could not be re-opened.%s"
 
-#: ./src/debugger/Debugger.ec:836
+#: ./src/debugger/Debugger.ec:840
 msgid "The program %s has exited (gdb provided an unknown reason)%s.\n"
 msgstr "The program %s has exited (gdb provided an unknown reason)%s.\n"
 
-#: ./src/debugger/Debugger.ec:830
+#: ./src/debugger/Debugger.ec:834
 msgid "The program %s has exited normally%s.\n"
 msgstr "The program %s has exited normally%s.\n"
 
-#: ./src/debugger/Debugger.ec:834
+#: ./src/debugger/Debugger.ec:838
 msgid "The program %s has exited with a signal%s.\n"
 msgstr "The program %s has exited with a signal%s.\n"
 
-#: ./src/debugger/Debugger.ec:828
 #: ./src/debugger/Debugger.ec:832
+#: ./src/debugger/Debugger.ec:836
 msgid "The program %s has exited%s.\n"
 msgstr "The program %s has exited%s.\n"
 
@@ -1936,7 +1936,7 @@ msgstr "The program %s has exited%s.\n"
 msgid "The project %s was modified by another application.\nWould you like to reload it and lose your changes?"
 msgstr "The project %s was modified by another application.\nWould you like to reload it and lose your changes?"
 
-#: ./src/debugger/Debugger.ec:1093
+#: ./src/debugger/Debugger.ec:1097
 msgid "This is the project directory.\nWould you like to try again?"
 msgstr "This is the project directory.\nWould you like to try again?"
 
@@ -1944,7 +1944,7 @@ msgstr "This is the project directory.\nWould you like to try again?"
 msgid "This project is already present in workspace."
 msgstr "This project is already present in workspace."
 
-#: ./src/debugger/Debugger.ec:1109
+#: ./src/debugger/Debugger.ec:1113
 msgid "This source directory is already specified.\nWould you like to try again?"
 msgstr "This source directory is already specified.\nWould you like to try again?"
 
@@ -1988,7 +1988,7 @@ msgstr "Tree:"
 msgid "Type"
 msgstr "Type"
 
-#: ./src/debugger/Debugger.ec:1122
+#: ./src/debugger/Debugger.ec:1126
 msgid "Unable to locate source file.\nWould you like to try again?"
 msgstr "Unable to locate source file.\nWould you like to try again?"
 
@@ -2002,15 +2002,15 @@ msgstr "Unable to open file %s\n\n"
 msgid "Unable to save %s file.\n"
 msgstr "Unable to save %s file.\n"
 
-#: ./src/debugger/Debugger.ec:2279
+#: ./src/debugger/Debugger.ec:2283
 msgid "Unknown error for \"%s\""
 msgstr "Unknown error for \"%s\""
 
-#: ./src/debugger/Debugger.ec:3371
+#: ./src/debugger/Debugger.ec:3375
 msgid "Unknown output"
 msgstr "Unknown output"
 
-#: ./src/debugger/Debugger.ec:3349
+#: ./src/debugger/Debugger.ec:3353
 msgid "Unknown prompt"
 msgstr "Unknown prompt"
 
@@ -2133,11 +2133,11 @@ msgstr "Writing symbol loader...\n"
 msgid "You have modified projects.\nSave changes to "
 msgstr "You have modified projects.\nSave changes to "
 
-#: ./src/debugger/Debugger.ec:1232
+#: ./src/debugger/Debugger.ec:1236
 msgid "You must provide a source directory in order to place a breakpoint in this file.\nWould you like to try again?"
 msgstr "You must provide a source directory in order to place a breakpoint in this file.\nWould you like to try again?"
 
-#: ./src/debugger/Debugger.ec:1227
+#: ./src/debugger/Debugger.ec:1231
 msgid "You must provide a valid source directory in order to place a breakpoint in this file.\nWould you like to try again?"
 msgstr "You must provide a valid source directory in order to place a breakpoint in this file.\nWould you like to try again?"
 
@@ -2182,11 +2182,11 @@ msgstr "eC/C/C++ Files (*.ec, *.eh, *.c, *.cpp, *.cc, *.cxx, *.h, *.hpp, *.hh, *
 msgid "eC/C/C++ Source Files (*.ec, *.c, *.cpp, *.cc, *.cxx)"
 msgstr "eC/C/C++ Source Files (*.ec, *.c, *.cpp, *.cc, *.cxx)"
 
-#: ./src/debugger/Debugger.ec:3515
+#: ./src/debugger/Debugger.ec:3519
 msgid "err: Unable to create FIFO %s\n"
 msgstr "err: Unable to create FIFO %s\n"
 
-#: ./src/debugger/Debugger.ec:3516
+#: ./src/debugger/Debugger.ec:3520
 msgid "err: Unable to open FIFO %s for read\n"
 msgstr "err: Unable to open FIFO %s for read\n"
 
@@ -2213,7 +2213,7 @@ msgstr "folder"
 msgid "found"
 msgstr "found"
 
-#: ./src/debugger/Debugger.ec:2868
+#: ./src/debugger/Debugger.ec:2872
 msgid "inside %s, %s\n"
 msgstr "inside %s, %s\n"
 
@@ -2247,7 +2247,7 @@ msgstr "s were "
 msgid "single file"
 msgstr "single file"
 
-#: ./src/debugger/Debugger.ec:2874
+#: ./src/debugger/Debugger.ec:2878
 msgid "unknown source\n"
 msgstr "unknown source\n"
 
index 1955285..cf1463f 100644 (file)
@@ -3,7 +3,9 @@ import "process"
 import "debugFindCtx"
 import "debugTools"
 
-//#define GDB_DEBUG_CONSOLE
+#ifdef _DEBUG
+#define GDB_DEBUG_CONSOLE
+#endif
 
 extern char * strrchr(char * s, char c);
 
@@ -35,8 +37,7 @@ public char * StripQuotes2(char * string, char * output)
          if(escaped || ch != '\"')
          {
             output[d++] = ch;
-            if(ch == '\\')
-               escaped ^= true;
+            escaped = !escaped && ch == '\\';
          }
          else
             quoted = false;
@@ -233,25 +234,28 @@ static int TokenizeList(char * string, const char seperator, Array<char *> token
 {
    uint level = 0;
    
-   bool quoted = false; //bool escaped = false;
-   char * start = string;
+   bool quoted = false, escaped = false;
+   char * start = string, ch;
    
-   for(; *string; string++)
+   for(; (ch = *string); string++)
    {
       if(!start)
          start = string;
+
       if(quoted)
       {
-         if(*string == '\"')
+         if(escaped || ch != '\"')
+            escaped = !escaped && ch == '\\';
+         else
             quoted = false;
       }
-      else if(*string == '\"')
+      else if(ch == '\"')
          quoted = true;
-      else if(*string == '{' || *string == '[' || *string == '(' || *string == '<')
+      else if(ch == '{' || ch == '[' || ch == '(' || ch == '<')
          level++;
-      else if(*string == '}' || *string == ']' || *string == ')' || *string == '>')
+      else if(ch == '}' || ch == ']' || ch == ')' || ch == '>')
          level--;
-      else if(*string == seperator && !level)
+      else if(ch == seperator && !level)
       {
          tokens.Add(start);
          *string = '\0';