On 07/02/2013 23:51, Michael Ring wrote:

Index: debugger/debugger.pp
===================================================================
--- debugger/debugger.pp        (revision 40204)
+++ debugger/debugger.pp        (working copy)
@@ -3304,6 +3304,7 @@
 const
   OLD_GDB_DBG_NAME = 'GNU debugger (gdb)';
   OLD_SSH_DBG_NAME = 'GNU debugger through SSH (gdb)';
+  OLD_REMOTE_DBG_NAME = 'GNU debugger through OpenOCD (gdb)';

You should not need this.

Older versions of the IDE used those strings in the XML. But now the IDE uses the classname.

The 2 existing old names are kept so old config can be read.

There is no old config for your class.

 var
   s: String;
 begin
@@ -3314,6 +3315,7 @@
     s := ConfigStore.GetValue('Type', '');
     if s = OLD_GDB_DBG_NAME then FDebuggerClass:='TGDBMIDEBUGGER';
     if s = OLD_SSH_DBG_NAME then FDebuggerClass:='TSSHGDBMIDEBUGGER';
+ if s = OLD_REMOTE_DBG_NAME then FDebuggerClass:='TOPENOCDGDBMIDEBUGGER';
see above

Index: debugger/gdbmidebugger.pp
===================================================================
--- debugger/gdbmidebugger.pp   (revision 40204)
+++ debugger/gdbmidebugger.pp   (working copy)
@@ -4502,8 +4502,12 @@
       s := GetPart(['Thread '], [' '], R.Values, True);
       Result := StrToIntDef(s, 0);
       if Result <> 0 then exit;
+
+      // returned by openocd server
+      s := GetPart(['* '], ['Remote target'], R.Values, True);
+      Result := StrToIntDef(trim(s), 0);
+      if Result <> 0 then exit;
     end;

I'd rather factor all of the "get PID" code into a virtual method. (on the class TGDBMIDebuggerCommandStartDebugging)
Actually that might be the entire "RunToMain"

Then you can override it, and add there.

That means you have to subclass TGDBMIDebuggerCommandStartDebugging. See the GDBMIServerDebugger haw to do that


_______________________________________________
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel

Reply via email to