Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remote debug issues, cannot launch debugger, parameter 'arch' #11051

Closed
duaneellissd opened this issue Jun 6, 2023 · 3 comments
Closed

remote debug issues, cannot launch debugger, parameter 'arch' #11051

duaneellissd opened this issue Jun 6, 2023 · 3 comments
Labels
debugger investigate: repro This issue's repro steps needs to be investigated/confirmed

Comments

@duaneellissd
Copy link

Environment

Compile host and VSCODE host is a Linux server in another room.
Remote JTAG server is my laptop running OpenOCD.
Target is: Microsemi Polarfire RISCV soft cpu core.

All of this works standalone out side of VS CODE.
I know that process well - I use Emacs GUD Mode like this all the time.

Goal here is to use VSCODE instead.

Bug Summary and Steps to Reproduce

Just select RUN from the menu - does not connect and does not seem to pass target to GDB.

ISSUE #1 - why do I need to specify the REMOTE machine in the launch.json file? Normally i do this in the local .gdbinit file - and it works just fine. This is not a good idea.

ISSUE #2 - Why can I not get to the GDB command line prompt? This is a very important feature.

Steps: Choose RUN, and I get an error message (Popup) Unable to start debugging. The specified argument was out of range of valid values. ('arch')

Debugger Configurations

LAUNCH.JSON:
===========
{
    "version": "0.2.0",
    "configurations": [
        {
            "cwd": "${workspaceRoot}",
            "program": "Build/debug.d/ls_supervisor.debug.elf",
                        "request" : "launch",
            "type": "cppdbg",

            "name": "debug-gdb-remote",

            "linux" : {

                "MIMode" : "gdb",
                "miDebuggerPath" : "/tools/Microchip/SoftConsole-v2022.2-RISC-V-747/riscv-unknown-elf-gcc/bin/riscv64-unknown-elf-gdb",
                "miDebuggerServerAddress" : "dellis2.company.local:3333",
                "stopAtConnect": true,
                "customLaunchSetupCommands": [
                        { "text" : "load", "description" : "Load image", "ignoreFailures": false }
                ]
             }
    ]
}

TASKS.JSON
==========
Please be more specific about this I have nothing in there other then simple items like:

{
    "version" : "2.0.0",
    "tasks" : [
        {
            "label": "make all",
            "command": "make",
            "args": [
                "all"
            ],
            "options": {
                "cwd": "${workspaceFolder}"
            },
            "problemMatcher": "$gcc",
            "group": {
                "kind": "build",
                "isDefault": false
            }
        },
        {
            "label": "REBUILD",
            "command": "bash",
            "args": [
                "./rebuild.sh"
            ],
            "options": {
                "cwd": "${workspaceFolder}"
            },
            "problemMatcher": "$gcc",
            "group": {
                "kind": "build",
                "isDefault": false
            },
        {
            "label": "make TARGET",
            "command": "make",
            "args": [
                "${input:TARGET}"
            ],
            "options": {
                "cwd": "${workspaceFolder}"
            },
            "problemMatcher": "$gcc",
            "group": {
                "kind": "build",
                "isDefault": false
            }
        }
    ],
    "inputs" : [
        {
            "id": "TARGET",
            "description" : "MAKE-TARGET:",
            "default" : "all",
            "type": "promptString"
        }
    ]
}

Debugger Logs

NOTE?HINT - the console window where this LOG appears should have a RIGHT_CLICK SAVE AS selection to save logs like this to a file. GRRR!!!!!
Log output is:

--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (71) LaunchOptions{\"logging\":{\"engineLogging\":true,\"trace\":true,\"traceResponse\":true},\"cwd\":\"/BULK/home/dellis/linux_libcore3\",\"program\":\"Build/debug.d/ls_supervisor.debug.elf\",\"request\":\"launch\",\"type\":\"cppdbg\",\"name\":\"debug-gdb-remote\",\"__configurationTarget\":6,\"MIMode\":\"gdb\",\"miDebuggerPath\":\"/tools/Microchip/SoftConsole-v2022.2-RISC-V-747/riscv-unknown-elf-gcc/bin/riscv64-unknown-elf-gdb\",\"miDebuggerServerAddress\":\"dellis2.company.local:3333\",\"stopAtConnect\":true,\"customLaunchSetupCommands\":[{\"text\":\"load\",\"description\":\"Load image\",\"ignoreFailures\":false}],\"__sessionId\":\"ed70c17d-8912-4800-9517-340ca8091f59\"}\n"},"seq":2}
1: (71) LaunchOptions{"logging":{"engineLogging":true,"trace":true,"traceResponse":true},"cwd":"/BULK/home/dellis/linux_libcore3","program":"Build/debug.d/ls_supervisor.debug.elf","request":"launch","type":"cppdbg","name":"debug-gdb-remote","__configurationTarget":6,"MIMode":"gdb","miDebuggerPath":"/tools/Microchip/SoftConsole-v2022.2-RISC-V-747/riscv-unknown-elf-gcc/bin/riscv64-unknown-elf-gdb","miDebuggerServerAddress":"dellis2.company.local:3333","stopAtConnect":true,"customLaunchSetupCommands":[{"text":"load","description":"Load image","ignoreFailures":false}],"__sessionId":"ed70c17d-8912-4800-9517-340ca8091f59"}
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (115) Starting: \"/tools/Microchip/SoftConsole-v2022.2-RISC-V-747/riscv-unknown-elf-gcc/bin/riscv64-unknown-elf-gdb\" --interpreter=mi\n"},"seq":4}
1: (115) Starting: "/tools/Microchip/SoftConsole-v2022.2-RISC-V-747/riscv-unknown-elf-gcc/bin/riscv64-unknown-elf-gdb" --interpreter=mi
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (133) ->=thread-group-added,id=\"i1\"\n"},"seq":6}
1: (133) ->=thread-group-added,id="i1"
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (134) ->~\"GNU gdb (xPack GNU RISC-V Embedded GCC (Microsemi SoftConsole build), 64-bit) 9.1\\n\"\n"},"seq":8}
1: (134) ->~"GNU gdb (xPack GNU RISC-V Embedded GCC (Microsemi SoftConsole build), 64-bit) 9.1\n"
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (134) ->~\"Copyright (C) 2020 Free Software Foundation, Inc.\\n\"\n"},"seq":10}
1: (134) ->~"Copyright (C) 2020 Free Software Foundation, Inc.\n"
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (135) ->~\"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.\"\n"},"seq":12}
1: (135) ->~"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."
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (135) ->~\"\\nType \\\"show copying\\\" and \\\"show warranty\\\" for details.\\n\"\n"},"seq":14}
1: (135) ->~"\nType \"show copying\" and \"show warranty\" for details.\n"
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (135) ->~\"This GDB was configured as \\\"--host=x86_64-unknown-linux-gnu --target=riscv64-unknown-elf\\\".\\n\"\n"},"seq":16}
1: (135) ->~"This GDB was configured as \"--host=x86_64-unknown-linux-gnu --target=riscv64-unknown-elf\".\n"
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (135) ->~\"Type \\\"show configuration\\\" for configuration details.\\n\"\n"},"seq":18}
1: (135) ->~"Type \"show configuration\" for configuration details.\n"
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (135) ->~\"For bug reporting instructions, please see:\\n\"\n"},"seq":20}
1: (135) ->~"For bug reporting instructions, please see:\n"
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (135) ->~\"<https://github.com/sifive/freedom-tools/issues>.\\n\"\n"},"seq":22}
1: (135) ->~"<https://github.com/sifive/freedom-tools/issues>.\n"
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (135) ->~\"Find the GDB manual and other documentation resources online at:\\n    <http://www.gnu.org/software/gdb/documentation/>.\"\n"},"seq":24}
1: (135) ->~"Find the GDB manual and other documentation resources online at:\n    <http://www.gnu.org/software/gdb/documentation/>."
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (135) ->~\"\\n\\n\"\n"},"seq":26}
1: (135) ->~"\n\n"
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (135) ->~\"For help, type \\\"help\\\".\\n\"\n"},"seq":28}
1: (135) ->~"For help, type \"help\".\n"
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (135) ->~\"Type \\\"apropos word\\\" to search for commands related to \\\"word\\\".\\n\"\n"},"seq":30}
1: (135) ->~"Type \"apropos word\" to search for commands related to \"word\".\n"
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (135) ->=cmd-param-changed,param=\"auto-load safe-path\",value=\"/\"\n"},"seq":32}
1: (135) ->=cmd-param-changed,param="auto-load safe-path",value="/"
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (135) ->=cmd-param-changed,param=\"print pretty\",value=\"on\"\n"},"seq":34}
1: (135) ->=cmd-param-changed,param="print pretty",value="on"
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (135) ->(gdb)\n"},"seq":36}
1: (135) ->(gdb)
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (135) DebuggerPid=1669\n"},"seq":38}
1: (135) DebuggerPid=1669
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (150) <-1001-gdb-set mi-async on\n"},"seq":40}
1: (150) <-1001-gdb-set mi-async on
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (153) ->1001^done\n"},"seq":42}
1: (153) ->1001^done
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (153) ->(gdb)\n"},"seq":44}
1: (153) ->(gdb)
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (154) 1001: elapsed time 5\n"},"seq":46}
1: (154) 1001: elapsed time 5
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (165) Send Event AD7MessageEvent\n"},"seq":48}
1: (165) Send Event AD7MessageEvent
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (168) <--gdb-exit\n"},"seq":50}
1: (168) <--gdb-exit
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (169) <-logout\n"},"seq":52}
1: (169) <-logout
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (169) ->^exit\n"},"seq":54}
1: (169) ->^exit
--> E (output): {"type":"event","event":"output","body":{"category":"telemetry","output":"VS/Diagnostics/Debugger/Launch","data":{"VS.Diagnostics.Debugger.ImplementationName":"Microsoft.MIDebugEngine","VS.Diagnostics.Debugger.EngineVersion":"17.4.30208.2","VS.Diagnostics.Debugger.HostVersion":"17.4.30208.2","VS.Diagnostics.Debugger.AdapterId":"cppdbg","VS.Diagnostics.Debugger.Launch.ErrorCode":1005,"VS.Diagnostics.Debugger.Launch.IsError":true}},"seq":56}
--> R (launch-2): {"type":"response","request_seq":2,"success":false,"command":"launch","message":"Unable to start debugging. Specified argument was out of the range of valid values. (Parameter 'arch')","body":{"error":{"id":1005,"format":"Unable to start debugging. Specified argument was out of the range of valid values. (Parameter 'arch')"}},"seq":58}

Other Extensions

make, C++ just Microsoft Extensions.

Additional Information

I'm very familiar with the remote debug features - been using this for years.
I'd like to set this up for my team to use but - this is utterly fustrating and hard to find things.

I'll admit - I am a NOOB for VSCODE, but I have been writing embedded code for +30 years
everything from IDEs to Makefiles, everything I do is cross compiled code.

There are a number of other issues that make this hard to use.
For example being able to launch other commands to do things like Power cycle our target board.
Or launch a SERIAL TERMINAL program in the background.

I filed other tickets... for those already.

While I might sound noisy and complainy - I will say I like what I see and beg you to continue.
You will end up with a fantastic solution which is greatly needed in this area. you are almost there now.

@WardenGnaw
Copy link
Member

Thank you for reporting this issue. We’ll let you know if we need more information to investigate it.

@duaneellissd
Copy link
Author

FYI - here is more information:

image

Sorry for the screen shot - but - I am using Remote Desktop to connect to my Linux Server where VSCODE runs
and it does not allow me to copy/paste text but I can copy/paste IMAGES.

Important points here:
a) The correct version of GDB is being launched for my RISCV target. (see the 1st line: xPack GNU RISCV...)

b) It does connect with the target, and stops and finds the source code, etc:
Evidenced by the line: 0x80000ef8 in dispatch_this_cmd(pCmd=0xd) ...

Copy link

This issue has been closed as lower priority. We're sorry if this issue still impacts you but unfortunately we're not able to address this. We will accept a pull request from the community if it's applicable for this issue.

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Apr 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
debugger investigate: repro This issue's repro steps needs to be investigated/confirmed
Projects
None yet
Development

No branches or pull requests

2 participants