Comments (3)
I plan on working on this by implementing #109 (comment) i.e. making the Arch
provide a standard XML <xi:include>
-ing all its (Arch
-defined + GDB-standard) features and make the gdbstub
backend forward <xi:include>
callbacks from the GDB client to the Target
, giving it the opportunity, for each feature, to return the associated Arch
-defined XML, its own (don't really have a use-case for this... yet?), or None
.
This will help with unifying the MIPS architecture and trimming the ridiculously large list of AArch64 system registers that's reported to the GDB client (e.g. because the HW doesn't support an optional feature or because the GDB server can assume that the code won't ever run at certain ELs).
from gdbstub.
Hmm, I wonder if a quick-and-dirty solution might be to create some sort of "arch builder" macro?
Instead of exposing types that implement Arch
directly, each arch exposes a bunch of different "feature" structures, which encode a feature's associated registers + xml string. Consumers of the crate will then invoke the arch builder macro with the set of features they're interested in, creating a brand-new Arch
impl suited specifically for their project.
A rough sketch of what the end-user API might look like:
arch_builder! {
name: CustomX86,
arch: x86_64,
features: [
core, sse, segments, avx
]
}
Not sure what the implementation might look like, but this would fix the immediate problem of how to easily compose different Arch traits.
Of course, this approach isn't that great, since macro-based codegen is kinda hacky in my book. That said, I wanted to write this idea down before I forgot it, since it might be a good jumping off point in the future.
from gdbstub.
So here's something interesting: https://sourceware.org/gdb/onlinedocs/gdb/Target-Description-Format.html#Inclusion
Turns out target description XMLs support using <xi:include href="foo.xml"/>
to split the description into multiple files...
For example:
target.xml
<?xml version="1.0"?>
<!DOCTYPE target SYSTEM "gdb-target.dtd">
<target version="1.0">
<architecture>i386:x86-64</architecture>
<xi:include href="core64-regs.xml"/>
</target>
core64-regs.xml
<?xml version="1.0"?>
<!DOCTYPE target SYSTEM "gdb-target.dtd">
<feature name="org.gnu.gdb.i386.core">
...
</feature>
I'm definitely going to update the TargetDescriptionXmlOverride
extension to support custom annexes, but I think it might be very useful to somehow leverage this functionality to support fine grained target features...
from gdbstub.
Related Issues (20)
- Improved Error Type (more specificity, fewer semver hazards, etc...) HOT 1
- Clippy warnings in library code HOT 3
- Allow passing a custom initial stop reason
- [mips] "unexpected packet" packet on single step HOT 10
- Not getting any events when breakpoint is set HOT 1
- All registers are byteswapped when using lldb HOT 14
- Switch `enum Signal` to `struct Signal(pub u8)` with associated constants
- NoActiveThreads error when there are no active thread HOT 9
- Misleading comment in `state_machine`? HOT 2
- Multiprocess debugging HOT 8
- [riscv32] `PacketUnexpected` when issuing `stepi` HOT 3
- vAttach: invalid response causes command to not work HOT 6
- Remove `NoActiveThread` Error
- example_no_std doesn't build on Windows HOT 1
- Remove `SingleStepBehavior` guard rail HOT 1
- Make `QStartNoAckMode` optional HOT 1
- Options for flow control? HOT 3
- Support "ack/nack" packets for unreliable transports HOT 6
- Fails to compile for atmega328p (Arduino Uno) HOT 2
- Add APIs for generating XML on-the-fly
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 gdbstub.