coolchyni / beyond-debug

Other
20 stars 5 forks source link

remote debugger not step over #13

Open fjqingyou opened 1 year ago

fjqingyou commented 1 year ago

Hello! My English isn't good. I'm try win10 + wsl client remote debugger mips CPU openwrt, it's can run 'main' application and pause at breakpoints, but F10 step over never run to current function next code line. It seems to be hanging, I need to click on the triangle arrow button to continue working but, if set a breakpoints in the next code line, use F5, it's works, pause at there on the breakpoints I have tried before. If it is a 'Launch local' running locally, this phenomenon will not occur My launch.json file context

{
    "version": "0.2.0",
    "configurations": [
        {
            "name": "Launch-local",
            "type": "by-gdb",
            "request": "launch",
            "program": "main-ubuntu",
            "cwd": "${workspaceRoot}",
            "console": "integratedTerminal", //  this field has a warning: Property console is not allowed.
        },
        {
            "name": "Launch-remote",
            "type": "by-gdb",
            "request": "launch",
            "program": "main",
            "cwd": "${workspaceRoot}",
            //remote server need use: gdbserver --multi 192.168.1.1:1234  main
            "debuggerPath": "/usr/bin/gdb-multiarch",
            "remote": {
                "enabled": true,
                "address": "192.168.1.1:1234",
                "mode": "remote",
                "execfile": "/mnt/mstat/sources/test/c/main",
            }
        },
    ]
}

main.c context

#include <stdio.h>

int main(int argc, char** argv)

{

    printf("Hello, Auto Makefile!\n");

    getchar();

    return 0;

}

openwrt use this command

root@HL:c# gdbserver --multi 192.168.1.1:1234  main
Process /mnt/mstat/sources/test/c/main created; pid = 10603
Listening on port 1234

win10+wsl debugger output

GNU gdb (Ubuntu 10.2-0ubuntu1~20.04~1) 10.2
Copyright (C) 2021 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<https://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
    <http://www.gnu.org/software/gdb/documentation/>.

For help, type "help".
Type "apropos word" to search for commands related to "word".
Reading /lib/ld-musl-mipsel-sf.so.1 from remote target...
Reading /lib/ld-musl-mipsel-sf.so.1 from remote target...
0x77f62930 in ?? ()
Reading /lib/libgcc_s.so.1 from remote target...

    GDB is unable to find the start of the function at 0x77f71f3b
and thus can't determine the size of that function's stack frame.
This means that GDB may be unable to access that stack frame, or
the frames below it.
    This problem is most likely caused by an invalid program counter or
stack pointer.
    However, if you think GDB should simply search farther back
from 0x77f71f3b for code which looks like the beginning of a
function, you can increase the range of the search using the `set
heuristic-fence-post' command.

Breakpoint 1, main (argc=1, argv=0x7fffbd34) at main.c:7
7       printf("Hello, Auto Makefile!\n");

Breakpoint 2, main (argc=1, argv=0x7fffbd34) at main.c:9
9       getchar();
[Inferior 1 (process 11358) exited normally]
fjqingyou commented 1 year ago

I try "mode": "extended-remote", it's same