<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<div class="moz-cite-prefix">Am 07.02.13 16:04, schrieb Martin:<br>
</div>
<blockquote cite="mid:5113C296.4000503@mfriebe.de" type="cite">
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
<div class="moz-cite-prefix">On 07/02/2013 07:14, Michael Ring
wrote:<br>
</div>
<blockquote cite="mid:5113544C.1060707@michael-ring.org"
type="cite">
<meta http-equiv="content-type" content="text/html;
charset=ISO-8859-1">
<br>
One more thing, do you know why ExecuteCommand is defined as
protected and not public in GDBMIDebugger? I need to send some
extra commands to GDB to make the remote connection, using
ExecuteCommand is an elegant way to do this. But the method is
invisible in my class because it is protected. Can the
ExecuteCommand methods be made public or is this a no-go?<br>
</blockquote>
They (the ones in GDBMIDebugger, not the ones in
TGDBMIDebuggerCommand) should be deprecated and removed.<br>
<br>
All commands must go via TGDBMIDebuggerCommand. This is because
GDB may need to be set into the correct state (select
thread/stack). <br>
The ones in TGDBMIDebugger are left overs from long ago. They do
work, because they do actually encapsulate the command in a
TGDBMIDebuggerCommand<br>
<br>
I have plans to change this and introduce a new "inner" queue,
that will automatically da the necessary thread/stack selection.<br>
<br>
Then also the TGDBMIDebuggerCommand should be changed, so they do
not expect a result from a gdb command, but assign an event, and
get called back. So ProcessMessages will no longer be needed.<br>
But that is still some time to go.<br>
<br>
---<br>
As for you, You should be able to inherit from
TGDBMIDebuggerCommand?<br>
</blockquote>
<blockquote cite="mid:5113C296.4000503@mfriebe.de" type="cite"> <br>
Also I do not understand why you do not see a protected class. You
do inherit from TGDBMIDebugger? And if you have helper objects,
then you can create a public wrapper in your main class.<br>
<br>
</blockquote>
<br>
The problem was sitting in front of the screen.... During some tests
I did not subclass TGDBMIDebugger but created a new instance. That's
I guess why I could not see ExecuteCommand. <br>
But now I have cleaned up my code-mess, there are currently only two
small code changes left in GDBMIDebugger and Debugger, one more will
come for the breakpoint handling.<br>
Without you great comments I would have never made it that far,
thank you again!<br>
<br>
<br>
Index: debugger/debugger.pp<br>
===================================================================<br>
--- debugger/debugger.pp (revision 40204)<br>
+++ debugger/debugger.pp (working copy)<br>
@@ -3304,6 +3304,7 @@<br>
const<br>
OLD_GDB_DBG_NAME = 'GNU debugger (gdb)';<br>
OLD_SSH_DBG_NAME = 'GNU debugger through SSH (gdb)';<br>
+ OLD_REMOTE_DBG_NAME = 'GNU debugger through OpenOCD (gdb)';<br>
var<br>
s: String;<br>
begin<br>
@@ -3314,6 +3315,7 @@<br>
s := ConfigStore.GetValue('Type', '');<br>
if s = OLD_GDB_DBG_NAME then FDebuggerClass:='TGDBMIDEBUGGER';<br>
if s = OLD_SSH_DBG_NAME then
FDebuggerClass:='TSSHGDBMIDEBUGGER';<br>
+ if s = OLD_REMOTE_DBG_NAME then
FDebuggerClass:='TOPENOCDGDBMIDEBUGGER';<br>
end;<br>
ConfigStore.AppendBasePath('WatchesDlg/');<br>
try<br>
Index: debugger/gdbmidebugger.pp<br>
===================================================================<br>
--- debugger/gdbmidebugger.pp (revision 40204)<br>
+++ debugger/gdbmidebugger.pp (working copy)<br>
@@ -4502,8 +4502,12 @@<br>
s := GetPart(['Thread '], [' '], R.Values, True);<br>
Result := StrToIntDef(s, 0);<br>
if Result <> 0 then exit;<br>
+<br>
+ // returned by openocd server<br>
+ s := GetPart(['* '], ['Remote target'], R.Values, True);<br>
+ Result := StrToIntDef(trim(s), 0);<br>
+ if Result <> 0 then exit;<br>
end;<br>
-<br>
// no PID found<br>
SetDebuggerErrorState(Format(gdbmiCommandStartMainRunNoPIDError,
[LineEnding]));<br>
end;<br>
<br>
<blockquote cite="mid:5113C296.4000503@mfriebe.de" type="cite"> <br>
<blockquote cite="mid:5113544C.1060707@michael-ring.org"
type="cite"> <br>
Which GDB version is your prefered version for debugging
FreePascal? <br>
</blockquote>
I run the testcase for gdb 6.3 to 7.5. So the IDE can communicate
with all of those. <br>
<br>
On Mac, apple provides a modified 6.3.5<br>
<br>
On Windows (at least 32 bit) I recommend 7.2. 7.3 up has some
regressions <a moz-do-not-send="true"
class="moz-txt-link-freetext"
href="http://wiki.lazarus.freepascal.org/GDB_Debugger_Tips#Bugs_in_GDB">http://wiki.lazarus.freepascal.org/GDB_Debugger_Tips#Bugs_in_GDB</a><br>
Win64 I am not sure<br>
<br>
On Linux any 7.x should be fine <br>
<br>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">_______________________________________________
fpc-devel maillist - <a class="moz-txt-link-abbreviated" href="mailto:fpc-devel@lists.freepascal.org">fpc-devel@lists.freepascal.org</a>
<a class="moz-txt-link-freetext" href="http://lists.freepascal.org/mailman/listinfo/fpc-devel">http://lists.freepascal.org/mailman/listinfo/fpc-devel</a>
</pre>
</blockquote>
<br>
</body>
</html>