microsoft / microsoft/vscode-cpptools

DAP doesn't appear to be sending a request to GDB for modifying a register value.

Open
#9,278 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

debugger Feature Request
Dominant language
TypeScript
Stars
6.2k
Forks
1.7k
Avg merge
14h 46m
Merged PRs (30d)
61

Description

Environment
  • OS and version: Ubuntu 16.04
  • VS Code: 1.60.0
  • C/C++ extension: 1.7.1
  • OS and version of remote machine (if applicable): Android 11
  • GDB / LLDB version: GDB 7.11
Bug Summary and Steps to Reproduce

Bug Summary:
When debugging an Android target with GDB, the CPU registers aren't able to be modified through the registers view, but can be modified by running the set command in the debug terminal window.

In the GUI when I attempt to change the register value I see the error below.

image

From the engine logs I see that the message to modify the register is never sent to GDB. The DAP responds with the message in the image.

(requires an android target. Likely this is N/A)
Steps to reproduce:

  1. In this environment...
  2. With this config...
  3. Do '...'
  4. See error...
Debugger Configurations
{
            "name": "Target_CPU",
            "type": "cppdbg",
            "request": "launch",
            "program": "/path/foo",
            "args": [],
            "stopAtEntry": false,
            "cwd": "${workspaceFolder}",
            "MIMode": "gdb",
            "preLaunchTask": "cpuDebugPrelaunchTask",
            "miDebuggerPath": "/path/bin/gdb",            
            "miDebuggerServerAddress": ":5039",
            "logging": {
                "engineLogging" : true,
                "trace": true,
                "traceResponse": true
            }
        }
Debugger Logs
// Attempting to set a CPU register from the register view
<--   C (setVariable-18): {"command":"setVariable","arguments":{"variablesReference":1003,"name":"x4","value":"0xd"},"type":"request","seq":18}
--> R (setVariable-18): {"type":"response","request_seq":18,"success":false,"command":"setVariable","message":"'x4' cannot be assigned to","body":{"error":{"id":1107,"format":"'x4' cannot be assigned to"}},"seq":862}

// Attempting to set a register value via console
`set $x4=0xd
<--   C (evaluate-62): {"command":"evaluate","arguments":{"expression":"`set $x4=0xd","frameId":1000,"context":"repl"},"type":"request","seq":62}
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (427384) <-1106-interpreter-exec console \"set $x4=0xd\"\n"},"seq":1536}
1: (427384) <-1106-interpreter-exec console "set $x4=0xd"
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (427392) ->1106^done\n"},"seq":1538}
1: (427392) ->1106^done
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (427392) ->(gdb)\n"},"seq":1540}
1: (427392) ->(gdb)
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (427392) 1106: elapsed time 7\n"},"seq":1542}
1: (427392) 1106: elapsed time 7
--> E (output): {"type":"event","event":"output","body":{"category":"telemetry","output":"VS/Diagnostics/Debugger/Evaluate","data":{"VS.Diagnostics.Debugger.ImplementationName":"Microsoft.MIDebugEngine","VS.Diagnostics.Debugger.EngineVersion":"17.0.10910.1","VS.Diagnostics.Debugger.HostVersion":"17.0.10910.1","VS.Diagnostics.Debugger.AdapterId":"cppdbg","VS.Diagnostics.Debugger.Evaluate.Duration":8.0,"VS.Diagnostics.Debugger.Evaluate.IsError":false,"VS.Diagnostics.Debugger.Evaluate.ExecuteInConsole":true}},"seq":1544}
--> R (evaluate-62): {"type":"response","request_seq":62,"success":true,"command":"evaluate","body":{"result":"","variablesReference":0},"seq":1546}

// Attempting to set a local variable from the variable view (succeeds)
<--   C (setVariable-20): {"command":"setVariable","arguments":{"variablesReference":1000,"name":"nErr","value":"1"},"type":"request","seq":20}
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (138064) <-1045-var-assign var7 \"1\"\n"},"seq":868}
1: (138064) <-1045-var-assign var7 "1"
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (138073) ->1045^done,value=\"1\"\n"},"seq":870}
1: (138073) ->1045^done,value="1"
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (138073) ->(gdb)\n"},"seq":872}
1: (138073) ->(gdb)
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (138073) 1045: elapsed time 8\n"},"seq":874}
1: (138073) 1045: elapsed time 8
--> R (setVariable-20): {"type":"response","request_seq":20,"success":true,"command":"setVariable","body":{"value":"1"},"seq":876}
Other Extensions

No response

Additional Information

No response

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing the DAP setVariable request for the register view and compare it with the working local-variable path and console evaluate request in the supplied logs. Reproduce with the Android target and debugger configuration shown; done means editing a CPU register sends the corresponding request to GDB and returns a successful response.

Written by the indexing model from the issue text.

Assessment

Tech stack
android, typescript
Domain
devtools
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.