coolchyni / beyond-debug

Other
20 stars 5 forks source link

risc-v embedded gdb fails #16

Open mrx23dot opened 1 year ago

mrx23dot commented 1 year ago

When I manually start it it works great riscv-none-elf-gdb.exe build\obj\proj.elf -ex "target extended-remote 127.0.0.1:3333"

but from VScode it prints this in Debug console, and exits, I can't even scroll in Debug console.

GNU gdb (xPack GNU RISC-V Embedded GCC x86_64) 12.1
Copyright (C) 2022 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 "--host=x86_64-w64-mingw32 --target=riscv-none-elf".
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".

so looks like it founds it, I think I got the same config, so no idea. I added a break point to main() too.

my config:

{
  "version": "0.2.0",
  "configurations": [
    {
      "type": "by-gdb",
      "request": "launch",
      "name": "Launch(remote)",
      "debuggerPath": "riscv-none-elf-gdb.exe",
      "program": "..\\build\\obj\\proj.elf",
      "cwd": "${workspaceRoot}",
      "remote": {
        "enabled": true,
        "address": "127.0.0.1:3333",
        "mode": "extended-remote",
      }
    },
  ]
}

No issue when using PC type of gdb.

xuming commented 1 year ago

Please provide details info under the output/BeyondDebug panel.

mrx23dot commented 1 year ago
-gdb-set new-console on

=thread-group-added,id="i1"

~"GNU gdb (xPack GNU RISC-V Embedded GCC x86_64) 12.1\n"

~"Copyright (C) 2022 Free Software Foundation, Inc.\n"

~"License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>\nThis is free software: you are free to change and redistribute it.\nThere is NO WARRANTY, to the extent permitted by law."

~"\nType \"show copying\" and \"show warranty\" for details.\n"

~"This GDB was configured as \"--host=x86_64-w64-mingw32 --target=riscv-none-elf\".\n"

~"Type \"show configuration\" for configuration details.\n"

~"For bug reporting instructions, please see:\n"

~"<https://www.gnu.org/software/gdb/bugs/>.\n"

~"Find the GDB manual and other documentation resources online at:\n    <http://www.gnu.org/software/gdb/documentation/>."

~"\n\n"

~"For help, type \"help\".\n"

~"Type \"apropos word\" to search for commands related to \"word\".\n"

^error,msg="No symbol table is loaded.  Use the \"file\" command."

-break-insert -f d:\DRIVE\Projects\xxx\src\main\main.c:148

&"No symbol table is loaded.  Use the \"file\" command.\n"

^done,bkpt={number="1",type="breakpoint",disp="keep",enabled="y",addr="<PENDING>",pending="d:\\DRIVE\\Projects\\xxx\\src\\main\\main.c:148",times="0",original-location="d:\\DRIVE\\Projects\\xxx\\src\\main\\main.c:148"}

-gdb-exit

^exit
mrx23dot commented 1 year ago

Could you print out the exact way gdb is called? (with absolute path to gdb, to know which one, and parameters)

that would be very useful, and give insight for future problems too.

xuming commented 10 months ago

It looks like the program is not correct . "program": "..\build\obj\proj.elf". sould be "build/obj/proj.elf" ?

mrx23dot commented 9 months ago

Same error with "program": "../build/obj/proj.elf",

also when I directly copy in proj.elf "program": "proj.elf",

for some reason it's not happy

~"For help, type \"help\".\n"
~"Type \"apropos word\" to search for commands related to \"word\".\n"
^error,msg="No symbol table is loaded.  Use the \"file\" command."
-gdb-exit
^exit

having the original gdb call printed would be helpful.

Also do you know why the output is not fully visible? 2024-01-07_184450_5a