renode icon indicating copy to clipboard operation
renode copied to clipboard

GDB commands not working properly

Open Ahelion opened this issue 4 years ago • 6 comments

Using SystemWorkbench, configured for STM32 debug, Renode running with a stm32 elf. When debuging step over does not work, each function is entered, and chunks of code of 'skipped". Everything is sluggish. I debuged it a bit, on the gdb server socket aparenlty all data is send byte by byte, and i think that may be the root cause. Other Gdb servers( like the one in qemu), send packets consisting of several bytes. Did anybody else notice it? This is the only command i use: machine StartGdbServer 1234

Ahelion avatar Jul 13 '21 18:07 Ahelion

Hi @Ahelion, thanks for the report.

Can you please provide some GDB logs? You can enable them with (gdb) set debug remote 1, and then run a step that should go over a function but goes in instead.

It might be a specific SystemWorkbench behavior - stepping over functions is handled by GDB itself, not by the protocol we talk to it.

PiotrZierhoffer avatar Aug 03 '21 09:08 PiotrZierhoffer

@Ahelion we recently pushed some changes to GDB handling - can you please verify if they work for you?

PiotrZierhoffer avatar Aug 17 '21 09:08 PiotrZierhoffer

I am trying to debug a binary based on the STM32F4 discovery kit example. I can set breakpoints and those (usually) trigger, but if I attempt step or stepi the execution simply continues forever without stopping. I am using the latest daily build.

(gdb) set debug remote 1
(gdb) si
Sending packet: $m8003d74,2#65...Ack
Packet received: 72b6
Sending packet: $Z0,8003d74,2#ae...Ack
Packet received: OK
Sending packet: $p19#da...Ack
Packet received: d3010000
Sending packet: $m8001632,4#31...Ack
Packet received: 00bffee7
Sending packet: $m8001632,4#31...Ack
Packet received: 00bffee7
Sending packet: $m8001636,2#33...Ack
Packet received: 0848
Sending packet: $m8001636,2#33...Ack
Packet received: 0848
Sending packet: $m8001632,4#31...Ack
Packet received: 00bffee7
Sending packet: $m8001632,4#31...Ack
Packet received: 00bffee7
Sending packet: $m8001632,4#31...Ack
Packet received: 00bffee7
Sending packet: $Z0,8001636,4#7e...Ack
Packet received: OK
Sending packet: $Hc0#db...Ack
Packet received: 
Sending packet: $c#63...Ack

Ablu avatar Oct 21 '21 05:10 Ablu

@Ahelion we recently pushed some changes to GDB handling - can you please verify if they work for you?

Hello, I tried the latest renode today, but the debug experience is the same. Functions are entered each time, and everything is very slow.

Ahelion avatar Nov 11 '21 10:11 Ahelion

In our case we do not run into this issue if we test it on Windows with the arch-specific gdb. So maybe this either is a Linux or gdb-multiarch issue...

Ablu avatar Nov 11 '21 10:11 Ablu