<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
</head>
<body text="#000000" bgcolor="#FFFFFF">
Over the weekend I tried to see if it is possible to change from my
current approach of using cgdb for debugging embedded projects back
to lazarus.<br>
<br>
So I took my old patches and for lazarus and based on the patches I
wrote a new debugger unit for openocd. <br>
<br>
So far so good, but I am having an issue in the early startup phase
in
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<pre style="background-color:#ffffff;color:#000000;font-family:'Menlo';font-size:12,0pt;">TGDBMIDebuggerCommandStartDebugging.DoExecute
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)
the debugger comes back with the (gdb) prompt before the stop at the breakpoint.
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
Breakpoint 1 at 0x80001c4: main. (2 locations)
(gdb) continue
Continuing.
Note: automatically using hardware breakpoints for read-only addresses.
Breakpoint 1, main () at Nucleol053r8.pas:70
and in async mode also not bad:
(gdb) break main
Breakpoint 1 at 0x80001c4: main. (2 locations)
(gdb) cont &
Continuing.
Note: automatically using hardware breakpoints for read-only addresses.
(gdb)
Breakpoint 1, main () at Nucleol053r8.pas:70
</pre>
Here's the output of lazarus with debugging turned on:<br>
<br>
>> TCmdLineDebugger.SendCmdLn "-break-insert main"<br>
<< TCmdLineDebugger.ReadLn
"^done,bkpt={number="2",type="breakpoint",disp="keep",enabled="y",addr="<MULTIPLE>",times="0",original-location="main"},{number="2.1",enabled="y",addr="0x080001c4",file="Nucleol053r8.pas",fullname="/Users/ring/devel/nucleo-l053r8/Nucleol053r8.pas",line="70",thread-groups=["i1"]},{number="2.2",enabled="y",addr="0x080001c5",at="<main+4294967295>",thread-groups=["i1"]}"<br>
<< TCmdLineDebugger.ReadLn "(gdb) "<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>
<br>
</body>
</html>