Comments (6)
Please double check for a recent GDB, if you have the error there as well report this to GDB buglist.
Upgraded GDB from v12.1 to the newest commit which is still v12.1 and the result is sadly the same. After some search I found that it’s actually QEMU’s fault, rather than GDB’s.
I’m using QEMU 7.0 and the changelog of QEMU 8.0 says they solved the problems related with CSRs including pmpcfg1
:
Fixes to gdbstub, CSR accesses, dependencies between the various floating-point exceptions, and XTheadMemPair
I will test that newer version but that requires some time because my QEMU 7.0 has custom patches that enables extra serial ports. In order to let my guest OS running on QEMU 8.0 I have to do the same patch again.
from code-debug.
Please recheck with plain GDB:
interpreter-exec mi2 "-data-list-register-values N"
results in an errorinterpreter-exec mi2 "-data-list-register-values --skip-unavailable N"
works.
They all result in the same error, how weird. Looks like GDB think that pmpcfg1
is avaliable, which is wrong because pmpcfg1 is specified as "RV32 only" in the RISC-V document (I am debugging an RV64 OS running in qemu-system-riscv64
).
Could not fetch register "pmpcfg1"; remote failure reply 'E14' (from data-list-register-values N)
Could not fetch register "pmpcfg1"; remote failure reply 'E14' (from data-list-register-values --skip-unavailable N)
However, this works:
-data-list-register-values N 0 1 2 3 4 5 6 7
GDB -> App: {
"token": 86,
"outOfBandRecord": "[]",
"resultRecords": {
"resultClass": "done",
"results": "[["register-values",[[["number","0"],["value","0"]],[["number","1"],["value","0x8026bdb0 <os::rust_main+528>"]],[["number","2"],["value","0x8035ce70"]],[["number","3"],["value","0x0"]],[["number","4"],["value","0x0"]],[["number","5"],["value","4"]],[["number","6"],["value","2150024030"]],[["number","7"],["value","48"]]]]]"
}
}
In short, --skip-unavailable
won't work due to GDB or QEMU bugs. I thought of some workarounds like adding a "register whitelist" configuration in launch.json but that'll require a lot of extra work. Haven't thought of any simple and elegant solutions yet.
Currently I just changed the line in getRegisterValues()
from
const result = await this.sendCommand("data-list-register-values N");
to:
const result = await this.sendCommand("data-list-register-values N 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32");
so at least I can see "regular" risc-v registers.
from code-debug.
I think in this case, that specific register, rather than the whole register list, should be ignored.
I agree - but we currently get the value of all registers (which also provide us with the names) using data-list-register-values
).
But looking at the docs there is an option --skip-unavailable
.
Please recheck with plain GDB:
interpreter-exec mi2 "-data-list-register-values N"
results in an error interpreter-exec mi2 "-data-list-register-values --skip-unavailable N"
works.
If this is the case I can create a PR to include that.
from code-debug.
In short, --skip-unavailable won't work due to GDB or QEMU bugs.
Please double check for a recent GDB, if you have the error there as well report this to GDB buglist.
from code-debug.
I thought of some workarounds like adding a "register whitelist" configuration in launch.json but that'll require a lot of extra work.
Hm, would this be more than a single configuration of type string registerLimit
or similar? If set then this goes onto the request as-is, otherwise we don't set the limit.
from code-debug.
Hm, would this be more than a single configuration of type string
registerLimit
or similar? If set then this goes onto the request as-is, otherwise we don't set the limit.
I think registerLimit
will suffice in most situations since those special registers that caused the trouble are usually placed after the common registers.
If the user wants to watch a fetchable register exceeding registerLimit
, he can use custom expressions.
from code-debug.
Related Issues (20)
- support input variables `gdbpath` setting HOT 3
- Debug this plugin HOT 3
- [enhancement] Support source file browsing HOT 5
- bad error message if `cwd` points to non-existing directory HOT 2
- UI out of sync with gdb status HOT 11
- Dynamically choose PID to attach HOT 2
- not finding the source files despite setting the sourceFileMap correctly HOT 5
- missing checks for debug attributes lead to TypeErrors on Execution
- how to do mix debug with python and c++ HOT 19
- F10(step over) end of main function, 'crtexe.c' The editor could not be opened because the file was not found. HOT 1
- Variables Evaluate is NOT Working for Struct Pointer of Function Variable HOT 2
- How pass multiple args to debug_args?
- My breakpoints are completely ignored HOT 4
- ssh2 dependency does not seem to support older KEX algorithms
- Hardware breakpoint support for embedded development HOT 1
- Popup error on hovering.
- (Microcontrollers) Is it possible to utilize .svd file to view target registers? HOT 2
- Failed to attach: Remote target doesn't support qGetTIBAddr packet
- Standard output parsing changes lines with `@` (at) symbol in them to "undefined"
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from code-debug.