[Lazarus] Remote debugger looses connection to target on Windows 7

Martin Frb lazarus at mfriebe.de
Wed Apr 9 18:54:20 CEST 2014


On 09/04/2014 17:27, Bernd Mueller wrote:
> Martin Frb wrote:
>> Please run with a logfile: 
>> http://wiki.lazarus.freepascal.org/GDB_Debugger_Tips#Log_info_for_debug_session 
>
>
> I have the log file attached.



What code is on this line?

Stepping will only work, if that code actually reaches the next line.
E.g.:
    while (always_true) do inc(a);

Same
   Call_Foo_that_will_go_into_an_endless_loop();

would never reach the next line. Stepping over it, is like Run. It will 
keep running.

Normally you can hit pause. But In remote-debugging pause only works if 
gdb is in "async" mode.

Your gdb did accept async for run(f9). Note the "&"
   >> TCmdLineDebugger.SendCmdLn "-exec-continue &"
   << TCmdLineDebugger.ReadLn "^running"
   << TCmdLineDebugger.ReadLn "*running,thread-id="1""
   << TCmdLineDebugger.ReadLn "(gdb) "

But it did not for stepping
   >> TCmdLineDebugger.SendCmdLn "-exec-next &"
   << TCmdLineDebugger.ReadLn "^error,msg="A syntax error in expression, 
near `&&'.""

Somehow strange, but that is what it did.

So the IDE used none async to do the step. But that means it can not 
interrupt (pause/stop) the remote, until the remote stops on its own 
(breakpoint/end of step)

The error might be bound to the "mi" made of gdb. That is "n &" might 
work. But it will take some work to make the IDE deal with none "mi" 
stepping

mi is a interface designed to control gdb from another app / gdb uses 
structured answers, instead of human readable. Human readable answers 
can differ in different gdb, and a harder to deal with by the IDE.

--------------------------
You could try, if you are on that line, instead of stepping (F8), set a 
breakpoint the next line (lines, if there is a conditional), and use F9.

Then, with F9 you should be able to use the pause button


>
>> And then try, what happens if you hit the pause button in the IDE?
>
> I stepped through the program until the problem occurred and hit then 
> pause. As far as I could see, nothing happened. Then I hit stop. This 
> was recognized by the target with the message, that the remote side 
> had terminated the connection.

So the remote printed connection lost, when you pressed stop in the IDE. 
Then it was still connected?





More information about the Lazarus mailing list