<html>
<head>
<meta content="text/html; charset=windows-1252"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<div class="moz-cite-prefix">This is the GDBMIServerDebugger?<br>
<br>
On 10/05/2015 14:08, Michael Ring wrote:<br>
</div>
<blockquote cite="mid:554F5853.3050907@michael-ring.org" type="cite">
<meta http-equiv="content-type" content="text/html;
charset=windows-1252">
<pre style="background-color:#ffffff;color:#000000;font-family:'Menlo';font-size:12,0pt;">After the breakpoint for main is set and -exec-continue is called (I tried both the async and not async version):
@@ -5007,15 +5030,20 @@
// RUN
DefaultTimeOut := 0;
- if not ExecuteCommand(Cmd, R, [cfTryAsync])
+// if not ExecuteCommand(Cmd, R, [cfTryAsync])
+ if not ExecuteCommand(Cmd, R)</pre>
</blockquote>
There is' a flag, in the debugger-properties, to allow/disallow
async. <br>
I have to chack, but IIRC:<br>
- in GDBMIDebugger it is not set, so the flag is always ignored.
(and it may not be published, so not editable)<br>
- In GDBMIServerDebugger it is set (and published)<br>
<br>
Try to unset async in config.<br>
<br>
<blockquote cite="mid:554F5853.3050907@michael-ring.org" type="cite">
<pre style="background-color:#ffffff;color:#000000;font-family:'Menlo';font-size:12,0pt;">the debugger comes back with the (gdb) prompt before the stop at the breakpoint.</pre>
</blockquote>
That should be normal. "run" or "continue" (any run command) has 2
prompts in return.<br>
<br>
1st prompt => acknowledges the command (the state changes to run)<br>
2nd prompt => should be after state changed to stopped, ready for
next command.<br>
<br>
In async mode it is more tricky, because one prompt (IIRC the 2nd)
may (sometimes) be missing.<br>
It makes sense, as in async mode, gdb takes input while running.<br>
<br>
<br>
<blockquote cite="mid:554F5853.3050907@michael-ring.org" type="cite">
<pre style="background-color:#ffffff;color:#000000;font-family:'Menlo';font-size:12,0pt;">This confuses StartDebugging, the next thing is tries is to remove the breakpint, this fails because the debugger thinks the process is still running.
I checked with gdb directly connected, there the output in non-async mode looks good:
(gdb) break main</pre>
</blockquote>
those are none MI commands. They may behave different.<br>
<br>
use "gdb -i mi" and then the gdbmi commands<br>
<br>
<blockquote cite="mid:554F5853.3050907@michael-ring.org" type="cite">Here's
the output of lazarus with debugging turned on:<br>
<br>
>> TCmdLineDebugger.SendCmdLn "-exec-continue"<br>
<< TCmdLineDebugger.ReadLn "~"Note: automatically using
hardware breakpoints for read-only addresses.\n""<br>
<< TCmdLineDebugger.ReadLn "^running"<br>
<< TCmdLineDebugger.ReadLn "*running,thread-id="all""<br>
<< TCmdLineDebugger.ReadLn "(gdb) "<br>
<br>
<br>
>> TCmdLineDebugger.SendCmdLn "-break-delete 2"<br>
<< TCmdLineDebugger.ReadLn "@"WARNING! The target is
already running. All changes GDB did to registers will be
discarded! Waiting for target to halt.\n""<br>
</blockquote>
odd...<br>
Please add <br>
<br>
// RUN<br>
DefaultTimeOut := 0;<br>
if not ExecuteCommand(Cmd, R, [cfTryAsync])<br>
then begin<br>
SetDebuggerErrorState(Format(gdbmiCommandStartMainRunError,
[LineEnding]),<br>
ErrorStateInfo);<br>
exit;<br>
end;<br>
////ADD
////////////////////////<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<br>
debugln(['After RUN ',dbgs(r.State)]);<br>
<br>
----------------------------------------------------------<br>
<br>
and log with<br>
<br>
--debug-log=LOG_FILE
--debug-enable=DBG_CMD_ECHO,DBG_STATE,DBG_DATA_MONITORS,DBGMI_QUEUE_DEBUG,DBGMI_TYPE_INFO,DBG_VERBOSE,DBG_EVENTS,DBG_STATE_EVENT<br>
<br>
</body>
</html>