Cross-debug for ARM: GDB Don't run. lazarus / 12-Debugger ---------------------------------------------------------------------- JFT · 2017-08-01 12:42 Hello, For several years I developed a linux embedded software, with Lazarus windows for an x86 target. For the debug, I use GDB/gdbserver and everything works perfectly. Today, I need to migrate my embedded linux software to an ARM target. This is an ARMv7. The cross-compilation part happens smoothly, but impossible to run GDB. For cross-compilation and GDB, I use the tools LINARO: https://releases.linaro.org/componen...nux-gnueabihf/ I put the gdbserver into my target, and correctly position the path to the debugger in Lazarus windows to "arm-linux-gnueabihf-gdb.exe" I starts the debug, the network connection is correct, the application starts on the target and at the IDE Lazarus the info (debugging ...) appears as well as the red rectangle ... But no action is possible. Even a breakpoint set before starting the debug is not taken into account. The same GDB/gdbserver work fine, when I use the GDB command line. - Development OS Windows 8.1 - Lazarus windows 1.6.2 - FPC 3.0.0 - Target OS Linux 4.9.30 - Target CPU ARMv7 - GDB 7.12.1 Thank you for your help ---------------------------------------------------------------------- Martin_fr · 2017-08-01 13:16 1) You did change the debugger settings in the IDE to "GNU remote debugger (gdbserver)" ? I assume you did, because if not it would be hard to supply the settings. http://wiki.lazarus.freepascal.org/Remote_Debugging#Using_gdbserver 2) Logfile ? http://wiki.lazarus.freepascal.org/GDB_Debugger_Tips#Log_info_for_debu g_session ---------------------------------------------------------------------- JFT · 2017-08-01 15:07 Thank you for your reply 1) Yes, the debugger setting is "GNU remote debugger (gdbserver)". 2) I create the Logfile, but I don't understand the error.    Can you help me in understanding: Quote  << TCmdLineDebugger.ReadLn "^running"   << TCmdLineDebugger.ReadLn "*running,thread-id="all""   << TCmdLineDebugger.ReadLn "(gdb) "   << TCmdLineDebugger.ReadLn "~"Reading /lib/libpthread.so.0 from remote target...\n""   << TCmdLineDebugger.ReadLn "=library- loaded,id="/lib/libpthread.so.0",target- name="/lib/libpthread.so.0",host- name="target:/lib/libpthread.so.0",symbols-loaded="0",thread- group="i1""   << TCmdLineDebugger.ReadLn "~"Reading /lib/libdl.so.2 from remote target...\n""   << TCmdLineDebugger.ReadLn "=library- loaded,id="/lib/libdl.so.2",target-name="/lib/libdl.so.2",host- name="target:/lib/libdl.so.2",symbols-loaded="0",thread-group="i1""   << TCmdLineDebugger.ReadLn "~"Reading /lib/libc.so.6 from remote target...\n""   << TCmdLineDebugger.ReadLn "=library- loaded,id="/lib/libc.so.6",target-name="/lib/libc.so.6",host- name="target:/lib/libc.so.6",symbols-loaded="0",thread-group="i1""   << TCmdLineDebugger.ReadLn "=breakpoint-modified,bkpt={number="4",ty pe="breakpoint",disp="keep",enabled="y",addr="0x00010624",func="main", file="K4ARMTst.lpr",fullname="C:\\K2...   << TCmdLineDebugger.ReadLn "=breakpoint-modified,bkpt={number="2",ty pe="breakpoint",disp="keep",enabled="y",addr="0x00010624",func="main", file="K4ARMTst.lpr",fullname="C:\\K2...   << TCmdLineDebugger.ReadLn "=breakpoint-modified,bkpt={number="4",ty pe="breakpoint",disp="keep",enabled="y",addr="0x00010624",func="main", file="K4ARMTst.lpr",fullname="C:\\K2...   << TCmdLineDebugger.ReadLn "~"\n""   << TCmdLineDebugger.ReadLn "~"Breakpoint 2, main () at K4ARMTst.lpr:5\n""   << TCmdLineDebugger.ReadLn "~"5\tbegin\n""   << TCmdLineDebugger.ReadLn "*stopped,reason="breakpoint-hit",disp="k eep",bkptno="2",frame={addr="0x00010624",func="main",args=[],file="K4A RMTst.lpr",fullname="C:\\K2...   >> TCmdLineDebugger.SendCmdLn "-break-delete 2"   << TCmdLineDebugger.ReadLn "^done"   << TCmdLineDebugger.ReadLn "(gdb) "   >> TCmdLineDebugger.SendCmdLn "-break-delete 3"   << TCmdLineDebugger.ReadLn "^done"   << TCmdLineDebugger.ReadLn "(gdb) "   >> TCmdLineDebugger.SendCmdLn "-break-delete 4"   << TCmdLineDebugger.ReadLn "^done"   << TCmdLineDebugger.ReadLn "(gdb) "   DebuggerState: Setting to dsRun, from dsStop     TGDBMIThreads: >>ENTER: TGDBMIThreads.DoStateChange  New- State=dsRun     TGDBMIThreads: <>ENTER: TSnapshotManager.DoStateChange  New- State=Run     DebugDataMonitor: <> TCmdLineDebugger.SendCmdLn "info program"   << TCmdLineDebugger.ReadLn "&"info program\n""   << TCmdLineDebugger.ReadLn "~"Debugging a target over a serial line.\n""   << TCmdLineDebugger.ReadLn "~"Program stopped at 0x10624.\n""   << TCmdLineDebugger.ReadLn "~"It stopped at a breakpoint that has since been deleted.\n""   << TCmdLineDebugger.ReadLn "~"It stopped at a breakpoint that has since been deleted.\n""   << TCmdLineDebugger.ReadLn "~"Type \"info stack\" or \"info registers\" for more information.\n""   << TCmdLineDebugger.ReadLn "^done"   << TCmdLineDebugger.ReadLn "(gdb) "   >> TCmdLineDebugger.SendCmdLn "info pid"   << TCmdLineDebugger.ReadLn "&"info pid\n""   << TCmdLineDebugger.ReadLn "&"Undefined info command: \"pid\".  Try \"help info\".\n""   << TCmdLineDebugger.ReadLn "^error,msg="Undefined info command: \"pid\".  Try \"help info\".""   << TCmdLineDebugger.ReadLn "(gdb) "   >> TCmdLineDebugger.SendCmdLn "info threads"   << TCmdLineDebugger.ReadLn "&"info threads\n""   << TCmdLineDebugger.ReadLn "~"  Id   Target Id         Frame \n""   << TCmdLineDebugger.ReadLn "~"* 1    Thread 218.218 \"REDYtst.K4ELF\" main () at K4ARMTst.lpr:5\n""   << TCmdLineDebugger.ReadLn "^done"   << TCmdLineDebugger.ReadLn "(gdb) "   DebuggerState: Setting to dsError, from dsRun     TGDBMIThreads: >>ENTER: TGDBMIThreads.DoStateChange  New- State=dsError     TGDBMIThreads: <>ENTER: TGDBMIWatches.DoStateChange  New- State=dsError     TGDBMIWatches: <>ENTER: TIdeWatchesMonitor.DoStateChange  New-State=dsError     TIdeWatchesMonitor: <> TCmdLineDebugger.SendCmdLn "kill"     DebugDataMonitor: >>ENTER: TSnapshotManager.DoStateChange  New- State=Error     DebugDataMonitor: <" DebuggerState: Setting to dsNone, from dsError   TGDBMIThreads: >>ENTER: TGDBMIThreads.DoStateChange  New- State=dsNone   TGDBMIThreads: <>ENTER: TIdeThreadsMonitor.DoStateChange  New- State=dsNone ---------------------------------------------------------------------- Martin_fr · 2017-08-01 18:04 Looks like https://bugs.freepascal.org/view.php?id=0031386 This is fixed in Lazarus 1.8 RC3. So you need to update. Alternatively an older gdb version may work (or not). ---------------------------------------------------------------------- Martin_fr · 2017-08-01 18:06 Actually it may even be in 1.6.4 ---------------------------------------------------------------------- JFT · 2017-08-03 08:39 Hello Martin_Fr, Lazarus v1.6.4 solves the problem. Thank you very much for your quick help.  JFT