Comments (1)
If you take a peek at the current x86 arch defn, you'll find that it reports the following target.xml
<target version="1.0">
<architecture>i386:x86-64</architecture>
<feature name="org.gnu.gdb.i386.sse"></feature>
</target>
You can use the in-tree Arch
implementation as a starting off point for a custom out-of-tree implementation that reports this additional feature:
<target version="1.0">
<architecture>i386:x86-64</architecture>
<feature name="org.gnu.gdb.i386.sse"></feature>
<feature name="org.gnu.gdb.i386.segments"></feature>
</target>
You'll need to define a custom Registers
implementation that includes these additional registers as well:
struct X86_64_SegmentsRegs {
fs_base: u64,
gs_base: u64,
}
// and then package it up alongside the existing register defn
struct X86_64_SSE_SegmentsRegs {
core: gdbstub_arch::x86::reg::X86_64CoreRegs,
segments: X86_64_SegmentsRegs
}
These are all public traits, and can be implemented by types outside of the main gdbstub
repo. This makes it easy to get an implementation up-and-running without having to use a custom local version of gdbstub
. Once you get something working that you're happy with, feel free to open a PR to upstream it.
Now, while the above solution is all well and good, it does touch upon a larger and long-standing issue in gdbstub
that I never found a good time to sort out: what's a good way to support fine-grained control over available target features / registers without requiring a combinatorial explosion of Arch
implementations? More details of what I mean in #12.
I bring this up not as a call-to-action, but moreso as a reminder to my future self that I really need to stop kicking this issue down the road, and actually fixing this. After all, at the time of writing, there are 8 different x86 feature sets that can all be (theoretically) mixed and matched: https://sourceware.org/gdb/onlinedocs/gdb/i386-Features.html#i386-Features. Handling all combinations of features would require 8! == 40320 impls, which isn't at all sustainable!
from gdbstub.
Related Issues (20)
- Allow `read_addrs()` to send fewer bytes than requested HOT 2
- 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
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.