Showing preview only (1,065K chars total). Download the full file or copy to clipboard to get everything.
Repository: daniel5151/gdbstub
Branch: master
Commit: 1bc505ff9ef7
Files: 266
Total size: 993.2 KB
Directory structure:
gitextract_vgu50cw1/
├── .cargo/
│ └── config.toml
├── .git-blame-ignore-revs
├── .github/
│ ├── FUNDING.yml
│ ├── pull_request_template.md
│ └── workflows/
│ └── ci.yml
├── .gitignore
├── CHANGELOG.md
├── Cargo.toml
├── LICENSE
├── README.md
├── docs/
│ ├── LICENSE-APACHE
│ ├── LICENSE-MIT
│ └── transition_guide.md
├── example_no_std/
│ ├── .gitignore
│ ├── Cargo.toml
│ ├── README.md
│ ├── check_size.sh
│ ├── dump_asm.sh
│ ├── rustfmt.toml
│ └── src/
│ ├── conn.rs
│ ├── gdb.rs
│ ├── main.rs
│ └── print_str.rs
├── examples/
│ ├── armv4t/
│ │ ├── README.md
│ │ ├── emu.rs
│ │ ├── gdb/
│ │ │ ├── auxv.rs
│ │ │ ├── breakpoints.rs
│ │ │ ├── catch_syscalls.rs
│ │ │ ├── exec_file.rs
│ │ │ ├── extended_mode.rs
│ │ │ ├── flash.rs
│ │ │ ├── host_io.rs
│ │ │ ├── libraries.rs
│ │ │ ├── lldb_register_info_override.rs
│ │ │ ├── memory_map.rs
│ │ │ ├── mod.rs
│ │ │ ├── monitor_cmd.rs
│ │ │ ├── section_offsets.rs
│ │ │ ├── target_description_xml_override.rs
│ │ │ └── tracepoints.rs
│ │ ├── main.rs
│ │ ├── mem_sniffer.rs
│ │ └── test_bin/
│ │ ├── .gdbinit
│ │ ├── .gitignore
│ │ ├── compile_test.sh
│ │ ├── test.c
│ │ ├── test.elf
│ │ └── test.ld
│ └── armv4t_multicore/
│ ├── README.md
│ ├── emu.rs
│ ├── gdb.rs
│ ├── main.rs
│ ├── mem_sniffer.rs
│ └── test_bin/
│ ├── .gdbinit
│ ├── .gitignore
│ ├── compile_test.sh
│ ├── test.c
│ ├── test.elf
│ └── test.ld
├── gdbstub_arch/
│ ├── CHANGELOG.md
│ ├── Cargo.toml
│ ├── LICENSE
│ ├── README.md
│ └── src/
│ ├── aarch64/
│ │ ├── core.xml
│ │ ├── fpu.xml
│ │ ├── mod.rs
│ │ ├── reg/
│ │ │ ├── aarch64_core.rs
│ │ │ ├── id.rs
│ │ │ └── mod.rs
│ │ └── sysregs.xml
│ ├── arm/
│ │ ├── mod.rs
│ │ └── reg/
│ │ ├── arm_core.rs
│ │ ├── id.rs
│ │ └── mod.rs
│ ├── lib.rs
│ ├── mips/
│ │ ├── mod.rs
│ │ └── reg/
│ │ ├── id.rs
│ │ ├── mips.rs
│ │ └── mod.rs
│ ├── msp430/
│ │ ├── mod.rs
│ │ └── reg/
│ │ ├── id.rs
│ │ ├── mod.rs
│ │ └── msp430.rs
│ ├── ppc/
│ │ ├── mod.rs
│ │ └── reg/
│ │ ├── common.rs
│ │ ├── id.rs
│ │ └── mod.rs
│ ├── riscv/
│ │ ├── mod.rs
│ │ ├── reg/
│ │ │ ├── id.rs
│ │ │ ├── mod.rs
│ │ │ └── riscv.rs
│ │ ├── rv32i.xml
│ │ └── rv64i.xml
│ ├── wasm/
│ │ ├── addr.rs
│ │ ├── mod.rs
│ │ └── reg/
│ │ ├── id.rs
│ │ ├── mod.rs
│ │ └── wasm_regs.rs
│ └── x86/
│ ├── mod.rs
│ └── reg/
│ ├── core32.rs
│ ├── core64.rs
│ ├── id.rs
│ └── mod.rs
├── rustfmt.toml
├── scripts/
│ ├── check_target_delegation.sh
│ └── test_dead_code_elim.sh
└── src/
├── arch.rs
├── common/
│ ├── mod.rs
│ └── signal.rs
├── conn/
│ ├── impls/
│ │ ├── boxed.rs
│ │ ├── mod.rs
│ │ ├── tcpstream.rs
│ │ └── unixstream.rs
│ └── mod.rs
├── internal/
│ ├── be_bytes.rs
│ ├── le_bytes.rs
│ └── mod.rs
├── lib.rs
├── protocol/
│ ├── commands/
│ │ ├── _QAgent.rs
│ │ ├── _QCatchSyscalls.rs
│ │ ├── _QDisableRandomization.rs
│ │ ├── _QEnvironmentHexEncoded.rs
│ │ ├── _QEnvironmentReset.rs
│ │ ├── _QEnvironmentUnset.rs
│ │ ├── _QSetWorkingDir.rs
│ │ ├── _QStartNoAckMode.rs
│ │ ├── _QStartupWithShell.rs
│ │ ├── _QTBuffer_upcase.rs
│ │ ├── _QTDP.rs
│ │ ├── _QTDPsrc.rs
│ │ ├── _QTFrame.rs
│ │ ├── _QTStart.rs
│ │ ├── _QTStop.rs
│ │ ├── _QTinit.rs
│ │ ├── _bc.rs
│ │ ├── _bs.rs
│ │ ├── _c.rs
│ │ ├── _d_upcase.rs
│ │ ├── _g.rs
│ │ ├── _g_upcase.rs
│ │ ├── _h_upcase.rs
│ │ ├── _k.rs
│ │ ├── _m.rs
│ │ ├── _m_upcase.rs
│ │ ├── _p.rs
│ │ ├── _p_upcase.rs
│ │ ├── _qAttached.rs
│ │ ├── _qC.rs
│ │ ├── _qHostInfo.rs
│ │ ├── _qOffsets.rs
│ │ ├── _qProcessInfo.rs
│ │ ├── _qRcmd.rs
│ │ ├── _qRegisterInfo.rs
│ │ ├── _qSupported.rs
│ │ ├── _qTBuffer.rs
│ │ ├── _qTP.rs
│ │ ├── _qTStatus.rs
│ │ ├── _qTfP.rs
│ │ ├── _qTfV.rs
│ │ ├── _qThreadExtraInfo.rs
│ │ ├── _qTsP.rs
│ │ ├── _qTsV.rs
│ │ ├── _qWasmCallStack.rs
│ │ ├── _qWasmGlobal.rs
│ │ ├── _qWasmLocal.rs
│ │ ├── _qWasmStackValue.rs
│ │ ├── _qXfer_auxv_read.rs
│ │ ├── _qXfer_exec_file.rs
│ │ ├── _qXfer_features_read.rs
│ │ ├── _qXfer_libraries_read.rs
│ │ ├── _qXfer_libraries_svr4_read.rs
│ │ ├── _qXfer_memory_map.rs
│ │ ├── _qfThreadInfo.rs
│ │ ├── _qsThreadInfo.rs
│ │ ├── _r_upcase.rs
│ │ ├── _s.rs
│ │ ├── _t_upcase.rs
│ │ ├── _vAttach.rs
│ │ ├── _vCont.rs
│ │ ├── _vFile_close.rs
│ │ ├── _vFile_fstat.rs
│ │ ├── _vFile_open.rs
│ │ ├── _vFile_pread.rs
│ │ ├── _vFile_pwrite.rs
│ │ ├── _vFile_readlink.rs
│ │ ├── _vFile_setfs.rs
│ │ ├── _vFile_unlink.rs
│ │ ├── _vFlashDone.rs
│ │ ├── _vFlashErase.rs
│ │ ├── _vFlashWrite.rs
│ │ ├── _vKill.rs
│ │ ├── _vRun.rs
│ │ ├── _x_lowcase.rs
│ │ ├── _x_upcase.rs
│ │ ├── breakpoint.rs
│ │ ├── exclamation_mark.rs
│ │ └── question_mark.rs
│ ├── commands.rs
│ ├── common/
│ │ ├── hex.rs
│ │ ├── lists.rs
│ │ ├── mod.rs
│ │ ├── qxfer.rs
│ │ └── thread_id.rs
│ ├── console_output.rs
│ ├── mod.rs
│ ├── packet.rs
│ ├── recv_packet.rs
│ └── response_writer.rs
├── stub/
│ ├── builder.rs
│ ├── core_impl/
│ │ ├── auxv.rs
│ │ ├── base.rs
│ │ ├── breakpoints.rs
│ │ ├── catch_syscalls.rs
│ │ ├── exec_file.rs
│ │ ├── extended_mode.rs
│ │ ├── flash.rs
│ │ ├── host_io.rs
│ │ ├── host_process_info.rs
│ │ ├── libraries.rs
│ │ ├── lldb_register_info.rs
│ │ ├── memory_map.rs
│ │ ├── monitor_cmd.rs
│ │ ├── no_ack_mode.rs
│ │ ├── resume.rs
│ │ ├── reverse_exec.rs
│ │ ├── section_offsets.rs
│ │ ├── single_register_access.rs
│ │ ├── target_xml.rs
│ │ ├── thread_extra_info.rs
│ │ ├── tracepoints.rs
│ │ ├── wasm.rs
│ │ ├── x_lowcase_packet.rs
│ │ └── x_upcase_packet.rs
│ ├── core_impl.rs
│ ├── error.rs
│ ├── mod.rs
│ ├── state_machine.rs
│ └── stop_reason.rs
├── target/
│ ├── ext/
│ │ ├── auxv.rs
│ │ ├── base/
│ │ │ ├── mod.rs
│ │ │ ├── multithread.rs
│ │ │ ├── reverse_exec.rs
│ │ │ ├── single_register_access.rs
│ │ │ └── singlethread.rs
│ │ ├── breakpoints.rs
│ │ ├── catch_syscalls.rs
│ │ ├── exec_file.rs
│ │ ├── extended_mode.rs
│ │ ├── flash.rs
│ │ ├── host_info.rs
│ │ ├── host_io.rs
│ │ ├── libraries.rs
│ │ ├── lldb_register_info_override.rs
│ │ ├── memory_map.rs
│ │ ├── mod.rs
│ │ ├── monitor_cmd.rs
│ │ ├── process_info.rs
│ │ ├── section_offsets.rs
│ │ ├── target_description_xml_override.rs
│ │ ├── thread_extra_info.rs
│ │ ├── tracepoints.rs
│ │ └── wasm.rs
│ └── mod.rs
└── util/
├── dead_code_marker.rs
├── managed_vec.rs
└── mod.rs
================================================
FILE CONTENTS
================================================
================================================
FILE: .cargo/config.toml
================================================
[target.'cfg(all())']
rustflags = [
"-Dfuture_incompatible",
"-Dnonstandard_style",
"-Drust_2018_idioms",
"-Wmissing_docs",
"-Wunexpected_cfgs",
"-Wunsafe_op_in_unsafe_fn",
"-Wclippy::dbg_macro",
"-Wclippy::debug_assert_with_mut_call",
"-Wclippy::disallowed_types",
"-Wclippy::filter_map_next",
"-Wclippy::fn_params_excessive_bools",
"-Wclippy::imprecise_flops",
"-Wclippy::inefficient_to_string",
"-Wclippy::let_unit_value",
"-Wclippy::linkedlist",
"-Wclippy::lossy_float_literal",
"-Wclippy::macro_use_imports",
"-Wclippy::map_flatten",
"-Wclippy::needless_borrow",
"-Wclippy::needless_continue",
"-Wclippy::option_option",
"-Wclippy::ref_option_ref",
"-Wclippy::rest_pat_in_fully_bound_structs",
"-Wclippy::string_to_string",
"-Wclippy::suboptimal_flops",
"-Wclippy::verbose_file_reads",
# "-Wclippy::unused_self", # might be interesting to explore this...
# deny explicit panic paths
"-Wclippy::panic",
"-Wclippy::todo",
"-Wclippy::unimplemented",
"-Wclippy::unreachable",
"-Aclippy::collapsible_else_if",
"-Aclippy::collapsible_if",
"-Aclippy::too_many_arguments",
"-Aclippy::type_complexity",
"-Aclippy::bool_assert_comparison",
# Primarily due to rust-lang/rust#8995
#
# If this ever gets fixed, it's be possible to rewrite complex types using
# inherent associated type aliases.
#
# For example, instead of writing this monstrosity:
#
# Result<Option<MultiThreadStopReason<<Self::Arch as Arch>::Usize>>, Self::Error>
#
# ...it could be rewritten as:
#
# type StopReason = MultiThreadStopReason<<Self::Arch as Arch>::Usize>>;
# Result<Option<StopReason>, Self::Error>
"-Aclippy::type_complexity",
"-Aclippy::manual_range_patterns",
]
================================================
FILE: .git-blame-ignore-revs
================================================
# fmt everything using imports_granularity = "Item"
e2329b80c2d51ee0ab4678365a35b27b51f32235
================================================
FILE: .github/FUNDING.yml
================================================
# These are supported funding model platforms
ko_fi: prilik
================================================
FILE: .github/pull_request_template.md
================================================
### Description
<!-- Please include a brief description of what is being added/changed -->
e.g: This PR implements the `foobar` extension, based off the GDB documentation [here](https://sourceware.org/gdb/onlinedocs/gdb/Remote-Protocol.html).
Closes #(issue number) <!-- if appropriate -->
### API Stability
- [ ] This PR does not require a breaking API change
<!-- If it does require making a breaking API change, please elaborate why -->
### Checklist
<!-- CI takes care of a lot of things, but there are some things that have yet to be automated -->
- Documentation
- [ ] Ensured any public-facing `rustdoc` formatting looks good (via `cargo doc`)
- [ ] (if appropriate) Added feature to "Debugging Features" in README.md
- Validation
- [ ] Included output of running `examples/armv4t` with `RUST_LOG=trace` + any relevant GDB output under the "Validation" section below
- [ ] Included output of running `./example_no_std/check_size.sh` before/after changes under the "Validation" section below
- _If implementing a new protocol extension IDET_
- [ ] Included a basic sample implementation in `examples/armv4t`
- [ ] IDET can be optimized out (confirmed via `./example_no_std/check_size.sh`)
- [ ] **OR** implementation requires introducing non-optional binary bloat (please elaborate under "Description")
- _If upstreaming an `Arch` implementation_
- [ ] I have tested this code in my project, and to the best of my knowledge, it is working as intended.
<!-- Oh, and if you're integrating `gdbstub` in an open-source project, do consider updating the README.md's "Real World Examples" section to link back to your project! -->
### Validation
<!-- example output, from https://github.com/daniel5151/gdbstub/pull/54 -->
<details>
<summary>GDB output</summary>
```
!!!!! EXAMPLE OUTPUT !!!!!
(gdb) info mem
Using memory regions provided by the target.
Num Enb Low Addr High Addr Attrs
0 y 0x00000000 0x100000000 rw nocache
```
</details>
<details>
<summary>armv4t output</summary>
```
!!!!! EXAMPLE OUTPUT !!!!!
Finished dev [unoptimized + debuginfo] target(s) in 0.01s
Running `target/debug/examples/armv4t`
loading section ".text" into memory from [0x55550000..0x55550078]
Setting PC to 0x55550000
Waiting for a GDB connection on "127.0.0.1:9001"...
Debugger connected from 127.0.0.1:37142
TRACE gdbstub::gdbstub_impl > <-- +
TRACE gdbstub::gdbstub_impl > <-- $qSupported:multiprocess+;swbreak+;hwbreak+;qRelocInsn+;fork-events+;vfork-events+;exec-events+;vContSupported+;QThreadEvents+;no-resumed+;xmlRegisters=i386#6a
TRACE gdbstub::protocol::response_writer > --> $PacketSize=1000;vContSupported+;multiprocess+;QStartNoAckMode+;ReverseContinue+;ReverseStep+;QDisableRandomization+;QEnvironmentHexEncoded+;QEnvironmentUnset+;QEnvironmentReset+;QStartupWithShell+;QSetWorkingDir+;swbreak+;hwbreak+;qXfer:features:read+;qXfer:memory-map:read+#e4
TRACE gdbstub::gdbstub_impl > <-- +
TRACE gdbstub::gdbstub_impl > <-- $vMustReplyEmpty#3a
INFO gdbstub::gdbstub_impl > Unknown command: vMustReplyEmpty
TRACE gdbstub::protocol::response_writer > --> $#00
TRACE gdbstub::gdbstub_impl > <-- +
TRACE gdbstub::gdbstub_impl > <-- $QStartNoAckMode#b0
TRACE gdbstub::protocol::response_writer > --> $OK#9a
TRACE gdbstub::gdbstub_impl > <-- +
TRACE gdbstub::gdbstub_impl > <-- $Hgp0.0#ad
TRACE gdbstub::protocol::response_writer > --> $OK#9a
TRACE gdbstub::gdbstub_impl > <-- $qXfer:features:read:target.xml:0,ffb#79
TRACE gdbstub::protocol::response_writer > --> $l<target version="1.0"><!-- custom override string --><architecture>armv4t</architecture></target>#bb
TRACE gdbstub::gdbstub_impl > <-- $qTStatus#49
INFO gdbstub::gdbstub_impl > Unknown command: qTStatus
TRACE gdbstub::protocol::response_writer > --> $#00
TRACE gdbstub::gdbstub_impl > <-- $?#3f
TRACE gdbstub::protocol::response_writer > --> $S05#b8
TRACE gdbstub::gdbstub_impl > <-- $qfThreadInfo#bb
TRACE gdbstub::protocol::response_writer > --> $mp01.01#cd
TRACE gdbstub::gdbstub_impl > <-- $qsThreadInfo#c8
TRACE gdbstub::protocol::response_writer > --> $l#6c
TRACE gdbstub::gdbstub_impl > <-- $qAttached:1#fa
GDB queried if it was attached to a process with PID 1
TRACE gdbstub::protocol::response_writer > --> $1#31
TRACE gdbstub::gdbstub_impl > <-- $Hc-1#09
TRACE gdbstub::protocol::response_writer > --> $OK#9a
TRACE gdbstub::gdbstub_impl > <-- $qC#b4
INFO gdbstub::gdbstub_impl > Unknown command: qC
TRACE gdbstub::protocol::response_writer > --> $#00
TRACE gdbstub::gdbstub_impl > <-- $g#67
TRACE gdbstub::protocol::response_writer > --> $00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000107856341200005555xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx10000000#66
TRACE gdbstub::gdbstub_impl > <-- $qfThreadInfo#bb
TRACE gdbstub::protocol::response_writer > --> $mp01.01#cd
TRACE gdbstub::gdbstub_impl > <-- $qsThreadInfo#c8
TRACE gdbstub::protocol::response_writer > --> $l#6c
TRACE gdbstub::gdbstub_impl > <-- $qXfer:memory-map:read::0,ffb#18
TRACE gdbstub::protocol::response_writer > --> $l<?xml version="1.0"?>
<!DOCTYPE memory-map
PUBLIC "+//IDN gnu.org//DTD GDB Memory Map V1.0//EN"
"http://sourceware.org/gdb/gdb-memory-map.dtd">
<memory-map>
<memory type="ram" start="0x0" length="0x100000000"/>
</memory-map>#75
TRACE gdbstub::gdbstub_impl > <-- $m55550000,4#61
TRACE gdbstub::protocol::response_writer > --> $04b02de5#26
TRACE gdbstub::gdbstub_impl > <-- $m5554fffc,4#35
TRACE gdbstub::protocol::response_writer > --> $00000000#7e
TRACE gdbstub::gdbstub_impl > <-- $m55550000,4#61
TRACE gdbstub::protocol::response_writer > --> $04b02de5#26
TRACE gdbstub::gdbstub_impl > <-- $m5554fffc,4#35
TRACE gdbstub::protocol::response_writer > --> $00000000#7e
TRACE gdbstub::gdbstub_impl > <-- $m55550000,2#5f
TRACE gdbstub::protocol::response_writer > --> $04b0#f6
TRACE gdbstub::gdbstub_impl > <-- $m5554fffe,2#35
TRACE gdbstub::protocol::response_writer > --> $0000#7a
TRACE gdbstub::gdbstub_impl > <-- $m5554fffc,2#33
TRACE gdbstub::protocol::response_writer > --> $0000#7a
TRACE gdbstub::gdbstub_impl > <-- $m55550000,2#5f
TRACE gdbstub::protocol::response_writer > --> $04b0#f6
TRACE gdbstub::gdbstub_impl > <-- $m5554fffe,2#35
TRACE gdbstub::protocol::response_writer > --> $0000#7a
TRACE gdbstub::gdbstub_impl > <-- $m5554fffc,2#33
TRACE gdbstub::protocol::response_writer > --> $0000#7a
TRACE gdbstub::gdbstub_impl > <-- $m55550000,4#61
TRACE gdbstub::protocol::response_writer > --> $04b02de5#26
TRACE gdbstub::gdbstub_impl > <-- $m5554fffc,4#35
TRACE gdbstub::protocol::response_writer > --> $00000000#7e
TRACE gdbstub::gdbstub_impl > <-- $m55550000,4#61
TRACE gdbstub::protocol::response_writer > --> $04b02de5#26
TRACE gdbstub::gdbstub_impl > <-- $m5554fffc,4#35
TRACE gdbstub::protocol::response_writer > --> $00000000#7e
TRACE gdbstub::gdbstub_impl > <-- $m55550000,4#61
TRACE gdbstub::protocol::response_writer > --> $04b02de5#26
TRACE gdbstub::gdbstub_impl > <-- $m55550000,4#61
TRACE gdbstub::protocol::response_writer > --> $04b02de5#26
TRACE gdbstub::gdbstub_impl > <-- $m55550000,4#61
TRACE gdbstub::protocol::response_writer > --> $04b02de5#26
TRACE gdbstub::gdbstub_impl > <-- $m0,4#fd
TRACE gdbstub::protocol::response_writer > --> $00000000#7e
```
</details>
<details>
<summary>Before/After `./example_no_std/check_size.sh` output</summary>
### Before
```
!!!!! EXAMPLE OUTPUT !!!!!
target/release/gdbstub-nostd :
section size addr
.interp 28 680
.note.gnu.build-id 36 708
.note.ABI-tag 32 744
.gnu.hash 36 776
.dynsym 360 816
.dynstr 193 1176
.gnu.version 30 1370
.gnu.version_r 48 1400
.rela.dyn 408 1448
.init 27 4096
.plt 16 4128
.plt.got 8 4144
.text 15253 4160
.fini 13 19416
.rodata 906 20480
.eh_frame_hdr 284 21388
.eh_frame 1432 21672
.init_array 8 28072
.fini_array 8 28080
.dynamic 448 28088
.got 136 28536
.data 8 28672
.bss 8 28680
.comment 43 0
Total 19769
```
### After
```
!!!!! EXAMPLE OUTPUT !!!!!
target/release/gdbstub-nostd :
section size addr
.interp 28 680
.note.gnu.build-id 36 708
.note.ABI-tag 32 744
.gnu.hash 36 776
.dynsym 360 816
.dynstr 193 1176
.gnu.version 30 1370
.gnu.version_r 48 1400
.rela.dyn 408 1448
.init 27 4096
.plt 16 4128
.plt.got 8 4144
.text 15253 4160
.fini 13 19416
.rodata 906 20480
.eh_frame_hdr 284 21388
.eh_frame 1432 21672
.init_array 8 28072
.fini_array 8 28080
.dynamic 448 28088
.got 136 28536
.data 8 28672
.bss 8 28680
.comment 43 0
Total 19769
```
</details>
================================================
FILE: .github/workflows/ci.yml
================================================
on: [push, pull_request]
name: ci
jobs:
test:
name: clippy + tests + docs
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
- name: cargo clippy
uses: actions-rs/cargo@v1
with:
command: clippy
args: --workspace --tests --examples --features=std -- -D warnings
# don't forget the no_std example!
- name: cargo clippy (example_no_std)
uses: actions-rs/cargo@v1
with:
command: clippy
args: --manifest-path example_no_std/Cargo.toml
- name: check dyn Target delegations
run: ./scripts/check_target_delegation.sh
shell: bash
- name: cargo test
uses: actions-rs/cargo@v1
with:
command: test
args: --workspace --features=std
- name: no panics in example_no_std
run: ./example_no_std/dump_asm.sh
shell: bash
- name: cargo doc
run: cargo doc --workspace --features=std
env:
RUSTDOCFLAGS: "-Dwarnings"
rustfmt:
name: rustfmt (nightly)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: nightly
override: true
components: rustfmt
- name: cargo +nightly fmt
uses: actions-rs/cargo@v1
with:
command: fmt
args: --all -- --check
# don't forget the no_std example!
- name: cargo +nightly fmt (example_no_std)
uses: actions-rs/cargo@v1
with:
command: fmt
args: --manifest-path example_no_std/Cargo.toml
================================================
FILE: .gitignore
================================================
/target
**/*.rs.bk
Cargo.lock
**/.gdb_history
# The GDB client may core dump if the target is implemented incorrectly
**/core
.vscode
================================================
FILE: CHANGELOG.md
================================================
All notable changes to this project will be documented in this file.
This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
# 0.7.10
#### New Features
- `GdbStubStateMachineInner::report_stop_with_regs` - new API to pass expedited register values in the stop reply T-packet. [\#189](https://github.com/daniel5151/gdbstub/pull/189) ([cfallin](https://github.com/cfallin))
#### New Protocol Extensions
- `Wasm` - (LLDB extension) Wasm-specific actions (i.e: reading Wasm call stack, and global/local/stack vars). [\#188](https://github.com/daniel5151/gdbstub/pull/188) ([cfallin](https://github.com/cfallin))
- `ProcessInfo` + `HostInfo` - (LLDB extension) Report key/value metadata about the host / process being debugged. [\#190](https://github.com/daniel5151/gdbstub/pull/190) ([cfallin](https://github.com/cfallin))
#### Internal Improvements
- Dependencies: Switch from `paste` to `pastey`. [\#187](https://github.com/daniel5151/gdbstub/pull/187) ([Maiux92](https://github.com/Maiux92))
# 0.7.9
#### New Protocol Extensions
- `MultiThreadSchedulerLocking` - Support running in [Scheduler Locking](https://sourceware.org/gdb/current/onlinedocs/gdb#index-scheduler-locking-mode) mode. [\#179](https://github.com/daniel5151/gdbstub/pull/179) ([Satar07](https://github.com/Satar07))
- `Libraries` - List a target's loaded libraries. [\#183](https://github.com/daniel5151/gdbstub/pull/183) ([mrexodia](https://github.com/mrexodia))
- _Note:_ This is a platform-agnostic version of the existing System-V/Unix-specific `LibrariesSvr4` feature, which landed in `0.7.1`
#### Bugfixes
- Fixed a bug in the RLE encoding where a `$` would be inserted in the packet when encoding runs of 8 chars (e.g: `00000000`). [\#182](https://github.com/daniel5151/gdbstub/pull/182) ([mrexodia](https://github.com/mrexodia))
# 0.7.8
#### New Features
- `HostIo` - Add HostIoErrno::{EIO,ENOSYS} variants. [\#175](https://github.com/daniel5151/gdbstub/pull/175) ([yodel](https://github.com/yodel))
# 0.7.7
#### Bugfixes
- Add missing `alloc::borrow::ToOwned` import when building `no_std` with `alloc`. [\#174](https://github.com/daniel5151/gdbstub/pull/174) ([AdamKMeller](https://github.com/AdamKMeller))
# 0.7.6
#### New Protocol Extensions
- `Flash` - Support for GDB [flash commands](https://sourceware.org/gdb/current/onlinedocs/gdb.html/Packets.html#Packets) (e.g: `load`). [\#172](https://github.com/daniel5151/gdbstub/pull/172) ([eulerdisk](https://github.com/eulerdisk))
# 0.7.5
#### New Protocol Extensions
- `Tracepoints` - Basic [tracepoint extension](https://sourceware.org/gdb/current/onlinedocs/gdb.html/Tracepoints.html) support. [\#160](https://github.com/daniel5151/gdbstub/pull/160) ([cczetier](https://github.com/cczetier))
- _Note:_ Most fundamental tracepoint operations are supported, but there quite a few packets / APIs that are not yet implemented. Please see the module documentation for additional details.
#### Bugfixes
- Fixed case-insensitive filename collision issue [\#166](https://github.com/daniel5151/gdbstub/issues/166) introduced in `0.7.4`
# 0.7.4 (Yanked)
_This version was yanked, as it introduced two files - `qTBuffer.rs` and `QTBuffer.rs` - that resulted in filename collisions when cloning `gdbstub` on case-insensitive filesystems._
# 0.7.3
#### New Features
- Add new `core_error` feature, to have `GdbStubError` impl `core::error::Error`. [\#154](https://github.com/daniel5151/gdbstub/pull/154) ([ultimaweapon](https://github.com/ultimaweapon))
- _Note:_ Out of an abundance of caution, this has been put behind a
feature-flag, as while `gdbstub` doesn't claim a strict MSRV at this time,
it seemed unwise to have a PATCH release break folks stuck on a pre-1.81
Rust toolchain.
# 0.7.2
#### Bugfixes
- Add workaround for vCont packets that specify a '0' (Any) thread-id
- For more context, see [`e9a5296c`](https://github.com/daniel5151/gdbstub/commit/e9a5296c4d02f4b5b73d5738654a33d01afa8711)
#### Internal Improvements
- Various README tweaks
- Various clippy lint fixes
- Fix incorrect valid-addr check in armv4t example
# 0.7.1
#### New Protocol Extensions
- `LibrariesSvr4` - List an SVR4 (System-V/Unix) target's libraries. [\#142](https://github.com/daniel5151/gdbstub/pull/142) ([alexcrichton](https://github.com/alexcrichton))
# 0.7.0
#### Breaking API Changes
- `stub::GdbStubError` is now an opaque `struct` with a handful of methods to extract user-defined context (as opposed to being an `enum` that directly exposed all error internals to the user).
- _This change will enable future versions of `gdbstub` to fearlessly improve error messages and infrastructure without making semver breaking changes. See [\#112](https://github.com/daniel5151/gdbstub/pull/132) for more._
- `common::Signal` is not longer an `enum`, and is instead a `struct` with a single `pub u8` field + a collection of associated constants.
- _As a result, yet another instance of `unsafe` could be removed from the codebase!_
- `Arch` API:
- Entirely removed `single_step_behavior`. See [\#132](https://github.com/daniel5151/gdbstub/pull/132) for details and rationale
- `Target` APIs:
- `SingleThreadBase`/`MultiThreadBase`
- `read_addrs` now returns a `usize` instead of a `()`, allowing implementations to report cases where only a subset of memory could be read. [\#115](https://github.com/daniel5151/gdbstub/pull/115) ([geigerzaehler](https://github.com/geigerzaehler))
- `HostIo`
- `bitflags` has been updated from `1.x` to `2.x`, affecting the type of `HostIoOpenFlags` and `HostIoOpenMode` [\#138](https://github.com/daniel5151/gdbstub/pull/138) ([qwandor](https://github.com/qwandor))
#### Internal Improvements
- Reformatted codebase with nightly rustfmt using `imports_granularity = "Item"`
# 0.6.6
#### New Features
- `Target::use_no_ack_mode` - toggle support for for activating "no ack mode" [\#135](https://github.com/daniel5151/gdbstub/pull/135) ([bet4it](https://github.com/bet4it))
# 0.6.5
#### New Protocol Extensions
- `ExtendedMode > CurrentActivePid` - Support reporting a non-default active PID [\#133](https://github.com/daniel5151/gdbstub/pull/129)
- Required to fix `vAttach` behavior (see Bugfixes section below)
#### Bugfixes
- Fix for targets with no active threads [\#127](https://github.com/daniel5151/gdbstub/pull/127) ([xobs](https://github.com/xobs))
- Fix `vAttach` behavior when switching between multiple processes [\#129](https://github.com/daniel5151/gdbstub/pull/129) ([xobs](https://github.com/xobs)), and [\#133](https://github.com/daniel5151/gdbstub/pull/129)
- Minor doc fixes
# 0.6.4
#### Bugfixes
- Avoid truncating `X` packets that contain `:` and `,` as part of the payload. [\#121](https://github.com/daniel5151/gdbstub/pull/121) ([709924470](https://github.com/709924470))
#### Internal Improvements
- Various README tweaks
- Remove some `unsafe` code
- CI improvements
- Run no-panic checks on `example_no_std`
- Run CI on docs
# 0.6.3
#### New Features
- `SingleRegisterAccess`: Support reporting unavailable regs [\#107](https://github.com/daniel5151/gdbstub/pull/107) ([ptosi](https://github.com/ptosi))
# 0.6.2
#### New Protocol Extensions
- `MultiThreadBase > ThreadExtraInfo` - Provide extra information per-thread. [\#106](https://github.com/daniel5151/gdbstub/pull/106) ([thefaxman](https://github.com/thefaxman))
- `LldbRegisterInfo` - (LLDB specific) Report register information in the LLDB format. [\#103](https://github.com/daniel5151/gdbstub/pull/103) ([jawilk](https://github.com/jawilk))
- This information can be statically included as part of the `Arch` implemention, or dynamically reported via the `LldbRegisterInfoOverride` IDET.
#### Bugfixes
- Report thread ID in response to `?` packet. [\#105](https://github.com/daniel5151/gdbstub/pull/105) ([thefaxman](https://github.com/thefaxman))
#### Internal Improvements
- Tweak enabled clippy lints
- Added a light dusting of `#[inline]` across the packet parsing code, crunching the code down even further
- Expanded on "no-panic guarantee" docs
# 0.6.1
#### New Features
- add LLDB-specific HostIoOpenFlags [\#100](https://github.com/daniel5151/gdbstub/pull/100) ([mrk](https://github.com/mrk-its))
# 0.6.0
After over a half-year of development, `gdbstub` 0.6 has finally been released!
This massive release delivers a slew of new protocol extensions, internal improvements, and key API improvements. Some highlights include:
- A new _non-blocking_ `GdbStubStateMachine` API, enabling `gdbstub` to integrate nicely with async event loops!
- Moreover, on `no_std` platforms, this new API enables `gdbstub` to be driven directly via breakpoint/serial interrupt handlers!
- This API is already being used in several Rust kernel projects, such as [`vmware-labs/node-replicated-kernel`](https://github.com/vmware-labs/node-replicated-kernel/tree/4326704/kernel/src/arch/x86_64/gdb) and [`betrusted-io/xous-core`](https://github.com/betrusted-io/xous-core/blob/7d3d710/kernel/src/debug/gdb_server.rs) to enable bare-metal, in-kernel debugging.
- `gdbstub` is now entirely **panic free** in release builds!
- \* subject to `rustc`'s compiler optimizations
- This was a pretty painstaking effort, but the end result is a substantial reduction in binary size on `no_std` platforms.
- Tons of new and exciting protocol extensions, including but not limited to:
- Support for remote file I/O (reading/writing files to the debug target)
- Fetching remote memory maps
- Catching + reporting syscall entry/exit conditions
- ...and many more!
- A new license: `gdbstub` is licensed under MIT OR Apache-2.0
See the [changelog](https://github.com/daniel5151/gdbstub/blob/dev/0.6/CHANGELOG.md) for a comprehensive rundown of all the new features.
While this release does come with quite a few breaking changes, the core IDET-based `Target` API has remained much the same, which should make porting code over from 0.5.x to 0.6 pretty mechanical. See the [`transition_guide.md`](./docs/transition_guide.md) for guidance on upgrading from `0.5.x` to `0.6`.
And as always, a huge shoutout to the folks who contributed PRs, Issues, and ideas to `gdbstub` - this release wouldn't have been possible without you! Special shoutouts to [gz](https://github.com/gz) and [xobs](https://github.com/xobs) for helping me test and iterate on the new bare-metal state machine API, and [bet4it](https://github.com/bet4it) for pointing out and implementing many useful API improvements and internal refactors.
Cheers!
#### New Features
- The new `GdbStubStateMachine` API gives users the power and flexibility to integrate `gdbstub` into their project-specific event loop infrastructure.
- e.g: A global instance of `GdbStubStateMachine` can be driven directly from bare-metal interrupt handlers in `no_std` environments
- e.g: A project using `async`/`await` can wrap `GdbStubStateMachine` in a task, yielding execution while waiting for the target to resume / new data to arrive down the `Connection`
- Removed all panicking code from `gdbstub`
- See the [commit message](https://github.com/daniel5151/gdbstub/commit/ecbbaf72e01293b410ef3bc5970d18aa81e45599) for more details on how this was achieved.
- Introduced strongly-typed enum for protocol defined signal numbers (instead of using bare `u8`s)
- Added basic feature negotiation to support clients that don't support `multiprocess+` extensions.
- Relicensed `gdbstub` under MIT OR Apache-2.0 [\#68](https://github.com/daniel5151/gdbstub/pull/68)
- Added several new "guard rails" to avoid common integration footguns:
- `Target::guard_rail_implicit_sw_breakpoints` - guards against the GDB client silently overriding target instructions with breakpoints if `SwBreakpoints` hasn't been implemented.
- `Target::guard_rail_single_step_gdb_behavior` - guards against a GDB client bug where support for single step may be required / ignored on certain platforms (e.g: required on x86, ignored on MIPS)
- Added several new "toggle switches" to enable/disable parts of the protocol (all default to `true`)
- `Target::use_x_upcase_packet` - toggle support for the more efficient `X` memory write packet
- `Target::use_resume_stub` - toggle `gdbstub`'s built-in "stub" resume handler that returns `SIGRAP` if a target doesn't implement support for resumption
- `Target::use_rle` - toggle whether outgoing packets are Run Length Encoded (RLE)
#### New Protocol Extensions
- `MemoryMap` - Get memory map XML file from the target. [\#54](https://github.com/daniel5151/gdbstub/pull/54) ([Tiwalun](https://github.com/Tiwalun))
- `CatchSyscalls` - Enable and disable catching syscalls from the inferior process. [\#57](https://github.com/daniel5151/gdbstub/pull/57) ([mchesser](https://github.com/mchesser))
- `HostIo` - Perform I/O operations on host. [\#66](https://github.com/daniel5151/gdbstub/pull/66) ([bet4it](https://github.com/bet4it))
- Support for all Host I/O operations: `open`, `close`, `pread`, `pwrite`, `fstat`, `unlink`, `readlink`, `setfs`
- `ExecFile` - Get full absolute path of the file that was executed to create a process running on the remote system. [\#69](https://github.com/daniel5151/gdbstub/pull/69) ([bet4it](https://github.com/bet4it))
- `Auxv` - Access the target’s auxiliary vector. [\#86](https://github.com/daniel5151/gdbstub/pull/86) ([bet4it](https://github.com/bet4it))
- Implement `X` packet - More efficient bulk-write to memory (superceding the `M` packet). [\#82](https://github.com/daniel5151/gdbstub/pull/82) ([gz](https://github.com/gz))
#### Breaking API Changes
- `Connection` API:
- Removed the `read` and `peek` methods from `Connection`
- These have been moved to the new `ConnectionExt` trait, which is used in the new `GdbStub::run_blocking` API
- `Arch` API:
- Dynamic read_register + RegId support. [\#85](https://github.com/daniel5151/gdbstub/pull/85) ([bet4it](https://github.com/bet4it))
- `Target` APIs:
- prefix all IDET methods with `support_`
- _makes it far easier to tell at-a-glance whether a method is an IDET, or an actual handler method.
- Introduce strongly-typed enum for protocol defined signal numbers (instead of using bare `u8`s)
- `Base` API:
- Make single-stepping optional [\#92](https://github.com/daniel5151/gdbstub/pull/92)
- Remove `GdbInterrupt` type (interrupt handling lifted to higher-level APIs)
- Remove `ResumeAction` type (in favor of separate methods for various resume types)
- `Breakpoints` API:
- `HwWatchpoint`: Plumb watchpoint `length` parameter to public API
- `TargetXml` API:
- Support for `<xi:include>` in target.xml, which required including the `annex` parameter in the handler method.
- `annex` is set to `b"target.xml"` on the fist call, though it may be set to other values in subsequent calls if `<xi:include>` is being used.
- Pass `PacketBuf`-backed `&mut [u8]` as a response buffer to various APIs [\#72](https://github.com/daniel5151/gdbstub/pull/72) ([bet4it](https://github.com/bet4it))
- Improvement over the callback-based approach.
- This change is possible thanks to a clause in the GDB spec that specifies that responses will never exceed the size of the `PacketBuf`.
- Also see [\#70](https://github.com/daniel5151/gdbstub/pull/70), which tracks some other methods that might be refactored to use this approach in the future.
#### Internal Improvements
- Documentation
- Fix crates.io badges [\#71](https://github.com/daniel5151/gdbstub/pull/71) ([atouchet](https://github.com/atouchet))
- Add `uhyve` to real-world examples [\#73](https://github.com/daniel5151/gdbstub/pull/73) ([mkroening](https://github.com/mkroening))
- Use stable `clippy` in CI
- Enable logging for responses with only alloc [\#78](https://github.com/daniel5151/gdbstub/pull/78) ([gz](https://github.com/gz))
- Lots of internal refactoring and cleanup
# 0.5.0
While the overall structure of the API has remained the same, `0.5.0` does introduce a few breaking API changes that require some attention. That being said, it should not be a difficult migration, and updating to `0.5.0` from `0.4` shouldn't take more than 10 mins of refactoring.
Check out [`transition_guide.md`](./docs/transition_guide.md) for guidance on upgrading from `0.4.x` to `0.5`.
#### New Features
- Implement Run-Length-Encoding (RLE) on outgoing packets
- _This significantly cuts down on the data being transferred over the wire when reading from registers/memory_
- Add target-specific `kind: Arch::BreakpointKind` parameters to the Breakpoint API
- _While emulated systems typically implement breakpoints by pausing execution once the PC hits a certain value, "real" systems typically need to patch the instruction stream with a breakpoint instruction. On systems with variable-sized instructions, this `kind` parameter specifies the size of the instruction that should be injected._
- Implement `ResumeAction::{Step,Continue}WithSignal`
- Added the `Exited(u8)`, `Terminated(u8)`, and `ReplayLog("begin"|"end")` stop reasons.
- Added `DisconnectReason::Exited(u8)` and `DisconnectReason::Terminated(u8)`.
- Reworked the `MultiThreadOps::resume` API to be significantly more ergonomic and efficient
- See the [transition guide](https://github.com/daniel5151/gdbstub/blob/master/docs/transition_guide.md#new-multithreadopsresume-api) for more details.
#### New Protocol Extensions
- `{Single,Multi}ThreadReverse{Step,Continue}` - Support for reverse-step and reverse-continue. [\#48](https://github.com/daniel5151/gdbstub/pull/48 ) ([DrChat](https://github.com/DrChat))
- `{Single,Multi}ThreadRangeStepping` - Optional optimized [range stepping](https://sourceware.org/gdb/current/onlinedocs/gdb/Continuing-and-Stepping.html#range-stepping) support.
#### Breaking Arch Changes
- **`gdbstub::arch` has been moved into a separate `gdbstub_arch` crate**
- _See [\#45](https://github.com/daniel5151/gdbstub/issues/45) for details on why this was done._
- (x86) Break GPRs & SRs into individual fields/variants [\#34](https://github.com/daniel5151/gdbstub/issues/34)
#### Breaking API Changes
- Base Protocol Refactors
- Reworked the `MultiThreadOps::resume` API
- Added a wrapper around the raw `check_gdb_interrupt` callback, hiding the underlying implementation details
- Extracted base protocol single-register access methods (`{read,write}_register`) into separate `SingleRegisterAccess` trait
- _These are optional GDB protocol methods, and as such, should be modeled as IDETs_
- Protocol Extension Refactors
- Consolidated the `{Hw,Sw}Breakpoints/Watchpoints` IDETs under a single `Breakpoints` IDET + sub-IDETs
- Added new arch-specific `kind: Arch::BreakpointKind` parameter to `add_{hw,sw}_breakpoint` methods
- Renamed `target::ext::extended_mod::ConfigureASLR{Ops}` to `ConfigureAslr{Ops}` (clippy::upper_case_acronyms)
- Added `{Step,Continue}WithSignal` variants to `target::ext::base::ResumeAction`
- Trait Changes
- `arch::Arch`: Added `type BreakpointKind`. Required to support arch-specific breakpoint kinds
- `arch::Arch`: (very minor) Added [`num_traits::FromPrimitive`](https://docs.rs/num/0.4.0/num/traits/trait.FromPrimitive.html) bound to `Arch::Usize`
- `arch::Registers`: Added `type ProgramCounter` and associated `fn pc(&self) -> Self::ProgramCounter` method. Added preemptively in anticipation of future GDB Agent support
- Removed the `Halted` stop reason (more accurate to simply return `{Exited|Terminated}(SIGSTOP)` instead).
- Removed the `Halted` disconnect reason (replaced with the `Exited` and `Terminated` stop reasons instead).
- Removed the implicit `ExtendedMode` attached PID tracking when `alloc` was available. See [`23b56038`](https://github.com/daniel5151/gdbstub/commit/23b56038) rationale behind this change.
#### Internal Improvements
- Split monolithic `GdbStubImpl` implementation into separate files (by protocol extension)
- Finally rewrite + optimize `GdbStubImpl::do_vcont`, along with streamlining its interactions with the legacy `s` and `c` packets
- Sprinkle more IDET-based dead code elimination hints (notably wrt. stop reasons)
- Remove the default `self.current_mem_tid` hack, replacing it with a much more elegant solution
- Packet Parser improvements
- Remove last remaining bit of UTF-8 related code
- Eliminate as much panicking bounds-checking code as possible
- support efficient parsing of packets that are parsed differently depending on active protocol extension (namely, the breakpoint packets)
- (currently unused) Zero-cost support for parsing `Z` and `z` packets with embedded agent bytecode expressions
- Use intra-doc links whenever possible
#### Bugfixes
- Fix `RiscvRegId` for `arch::riscv::Riscv64` [\#46](https://github.com/daniel5151/gdbstub/issues/46) ([fzyz999](https://github.com/fzyz999))
# 0.4.5
#### New Protocol Extensions
- `TargetDescriptionXmlOverride` - Allow targets to override the target description XML file (`target.xml`) specified by `Target::Arch::target_description_xml`. This is useful in cases where a `Target` is expected to be generic over multiple architectures. [\#43](https://github.com/daniel5151/gdbstub/pull/43) (with help from [DrChat](https://github.com/DrChat))
# 0.4.4
#### Bugfixes
- use `write!` instead of `writeln!` in `output!` macro [\#41](https://github.com/daniel5151/gdbstub/issues/41)
# 0.4.3
#### New Arch Implementations
- Implement `RegId` for Mips/Mips64 [\#38](https://github.com/daniel5151/gdbstub/pull/38) ([starfleetcadet75](https://github.com/starfleetcadet75))
- Implement `RegId` for MSP430 [\#38](https://github.com/daniel5151/gdbstub/pull/38) ([starfleetcadet75](https://github.com/starfleetcadet75))
# 0.4.2
#### Packaging
- Exclude test object files from package [\#37](https://github.com/daniel5151/gdbstub/pull/37) ([keiichiw](https://github.com/keiichiw))
# 0.4.1
#### New Arch Implementations
- Implement `RegId` for x86/x86_64 [\#34](https://github.com/daniel5151/gdbstub/pull/34) ([keiichiw](https://github.com/keiichiw))
#### Bugfixes
- Switch fatal error signal from `T06` to `S05`,
- specify cfg-if 0.1.10 or later [\#33](https://github.com/daniel5151/gdbstub/pull/33) ([keiichiw](https://github.com/keiichiw))
- `cargo build` fails if cfg-if is 0.1.9 or older
#### Internal Improvements
- Don't hard-code u64 when parsing packets (use big-endian byte arrays + late conversion to `Target::Arch::Usize`).
# 0.4.0
This version includes a _major_ API overhaul, alongside a slew of new features and general improvements. While updating to `0.4.0` will require some substantial code modifications, it's well worth the effort, as `0.4.0` is the safest, leanest, and most featureful release of `gdbstub` yet!
Fun fact: Even after adding a _bunch_ of new features and bug-fixes, the in-tree `example_no_std` has remained just as small! The example on the `semver-fix-0.2.2` branch is `20251` bytes, while the example on `0.4.0` is `20246` bytes.
#### Breaking API Changes
- Rewrite the `Target` API in terms of "Inlineable Dyn Extension Traits" (IDETs)
- _By breaking up `Target` into smaller pieces which can be mixed-and-matched, it not only makes it easier to get up-and-running with `gdbstub`, but it also unlocks a lot of awesome internal optimizations:_
- Substantially reduces binary-size footprint by guaranteeing dead-code-elimination of parsing/handling unimplemented GDB protocol features.
- Compile-time enforcement that certain groups of methods are implemented in-tandem (e.g: `add_sw_breakpoint` and `remove_sw_breakpoint`).
- Update the `Target` API with support for non-fatal error handling.
- _The old approach of only allowing \*fatal\* errors was woefully inadequate when dealing with potentially fallible operations such as reading from unauthorized memory (which GDB likes to do a bunch), or handling non-fatal `std::io::Error` that occur as a result of `ExtendedMode` operations. The new `TargetResult`/`TargetError` result is much more robust, and opens to door to supporting additional error handling extensions (such as LLDB's ASCII Errors)._
- Update the `Connection` trait with new methods (`flush` - required, `write_all`, `on_session_start`)
- Lift `Registers::RegId` to `Arch::RegId`, and introduce new temporary `RegIdImpl` solution for avoiding breaking API changes due to new `RegId` implementations (see [\#29](https://github.com/daniel5151/gdbstub/pull/29))
- Mark various `RegId` enums as `#[non_exhaustive]`, allowing more registers to be added if need be.
- Error types are now marked as `#[non_exhaustive]`.
#### New Protocol Extensions
- `ExtendedMode` - Allow targets to run new processes / attach to existing processes / restart execution.
- Includes support for `set disable-randomization`, `set environment`, `set startup-with-shell`, and `set cwd` and `cd`.
- `SectionOffsets` - Get section/segment relocation offsets from the target. [\#30](https://github.com/daniel5151/gdbstub/pull/30) ([mchesser](https://github.com/mchesser))
- Uses the `qOffsets` packet under-the-hood.
#### Bugfixes
- Fix issues related to selecting the incorrect thread after hitting a breakpoint in multi-threaded targets.
- Ensure that `set_nodelay` is set when using a `TcpStream` as a `Connection` (via the new `Connection::on_session_start` API)
- _This should result in a noticeable performance improvement when debugging over TCP._
#### Internal Improvements
- Removed `btou` dependency.
- Removed all `UTF-8` aware `str` handling code.
- _GDB uses a pure ASCII protocol, so including code to deal with UTF-8 resulted in unnecessary binary bloat._
# 0.3.0 (formerly 0.2.2)
This version contains a few minor breaking changes from `0.2.1`. These are only surface-level changes, and can be fixed with minimal effort.
Version `0.3.0` is identical to the yanked version `0.2.2`, except that it adheres to `cargo`'s [modified SemVer rule](https://doc.rust-lang.org/cargo/reference/manifest.html#the-version-field) which states that the pre-`0.x.y` breaking changes should still bump the minor version.
Thanks to [h33p](https://github.com/h33p) for reporting this issue ([\#27](https://github.com/daniel5151/gdbstub/issues/27))
#### Breaking API Changes
- Update `Target::resume` API to replace raw `&mut dyn Iterator` with a functionally identical concrete `Actions` iterator.
- Mark the `StopReason` enum as `#[non_exhaustive]`, allowing further types to be added without being considered as an API breaking change.
#### New Protocol Extensions
- Add `Target::read/write_register` support (to support single register accesses) [\#22](https://github.com/daniel5151/gdbstub/pull/22) ([thomashk0](https://github.com/thomashk0))
- Add `StopReason::Signal(u8)` variant, to send arbitrary signal codes [\#19](https://github.com/daniel5151/gdbstub/pull/19) ([mchesser](https://github.com/mchesser))
#### New Arch Implementations
- Add partial RISC-V support (only integer ISA at the moment) [\#21](https://github.com/daniel5151/gdbstub/pull/21) ([thomashk0](https://github.com/thomashk0))
- Add i386 (x86) support [\#23](https://github.com/daniel5151/gdbstub/pull/23) ([jamcleod](https://github.com/jamcleod))
- Add 32-bit PowerPC support [\#25](https://github.com/daniel5151/gdbstub/pull/25) ([jamcleod](https://github.com/jamcleod))
# 0.2.1
#### New Arch Implementations
- Add x86_64 support [\#11](https://github.com/daniel5151/gdbstub/pull/11) ([jamcleod](https://github.com/jamcleod))
- Add Mips and Mips64 support [\#13](https://github.com/daniel5151/gdbstub/pull/13) ([starfleetcadet75](https://github.com/starfleetcadet75))
#### Internal Improvements
- Documentation improvements
- Document PC adjustment requirements in `Target::resume`
- Add docs on handling non-fatal invalid memory reads/writes in `Target::read/write_addrs`.
# 0.2.0
_start of changelog_
================================================
FILE: Cargo.toml
================================================
[package]
name = "gdbstub"
description = "An implementation of the GDB Remote Serial Protocol in Rust"
authors = ["Daniel Prilik <danielprilik@gmail.com>"]
version = "0.7.10"
license = "MIT OR Apache-2.0"
edition = "2018"
readme = "README.md"
documentation = "https://docs.rs/gdbstub"
homepage = "https://github.com/daniel5151/gdbstub"
repository = "https://github.com/daniel5151/gdbstub"
keywords = ["gdb", "emulation", "no_std", "debugging"]
categories = ["development-tools::debugging", "embedded", "emulators", "network-programming", "no-std"]
exclude = ["examples/**/*.elf", "examples/**/*.o"]
[dependencies]
bitflags = "2.3.1"
cfg-if = "1.0"
log = "0.4"
managed = { version = "0.8", default-features = false }
num-traits = { version = "0.2", default-features = false }
pastey = "0.2.1"
[dev-dependencies]
gdbstub_arch = { path = "./gdbstub_arch/" }
armv4t_emu = "0.1"
pretty_env_logger = "0.4"
goblin = "0.4"
[features]
default = ["std", "trace-pkt"]
alloc = ["managed/alloc"]
std = ["alloc"]
trace-pkt = ["alloc"]
paranoid_unsafe = []
core_error = []
# INTERNAL: enables the `__dead_code_marker!` macro.
# used as part of the `scripts/test_dead_code_elim.sh`
__dead_code_marker = []
[[example]]
name = "armv4t"
required-features = ["std"]
[[example]]
name = "armv4t_multicore"
required-features = ["std"]
[workspace]
members = ["gdbstub_arch"]
exclude = ["example_no_std"]
================================================
FILE: LICENSE
================================================
gdbstub is dual-licensed under either
* MIT License (docs/LICENSE-MIT or http://opensource.org/licenses/MIT)
* Apache License, Version 2.0 (docs/LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0)
at your option.
================================================
FILE: README.md
================================================
# gdbstub
[](https://crates.io/crates/gdbstub)
[](https://docs.rs/gdbstub)
[](./LICENSE)
An ergonomic, featureful, and easy-to-integrate implementation of the [GDB Remote Serial Protocol](https://sourceware.org/gdb/onlinedocs/gdb/Remote-Protocol.html#Remote-Protocol) in Rust, with _no-compromises_ `#![no_std]` support.
`gdbstub` makes it easy to integrate powerful guest debugging support to your emulator / hypervisor / debugger / embedded project. By implementing just a few basic methods of the [`gdbstub::Target`](https://docs.rs/gdbstub/latest/gdbstub/target/ext/base/singlethread/trait.SingleThreadBase.html) trait, you can have a rich GDB debugging session up and running in no time!
`gdbstub`'s API makes extensive use of a technique called [**Inlineable Dyn Extension Traits**](#zero-overhead-protocol-extensions) (IDETs) to expose fine-grained, zero-cost control over enabled GDB protocol features _without_ relying on compile-time features flags. Aside from making it effortless to toggle enabled protocol features, IDETs also ensure that any unimplemented features are guaranteed to be dead-code-eliminated in release builds!
**If you're looking for a quick snippet of example code to see what a featureful `gdbstub` integration might look like, check out [examples/armv4t/gdb/mod.rs](https://github.com/daniel5151/gdbstub/blob/master/examples/armv4t/gdb/mod.rs)**
- [Documentation (gdbstub)](https://docs.rs/gdbstub)
- [Documentation (gdbstub_arch)](https://docs.rs/gdbstub_arch)
- [Changelog](CHANGELOG.md)
- [0.5 to 0.6 Transition Guide](docs/transition_guide.md)
Why use `gdbstub`?
- **Excellent Ergonomics**
- Instead of simply exposing the underlying GDB protocol "warts and all", `gdbstub` tries to abstract as much of the raw GDB protocol details from the user.
- Instead of having to dig through [obscure XML files deep the GDB codebase](https://github.com/bminor/binutils-gdb/tree/master/gdb/features) just to read/write from CPU/architecture registers, `gdbstub` comes with a community-curated collection of [built-in architecture definitions](https://docs.rs/gdbstub_arch) for most popular platforms!
- Organizes GDB's countless optional protocol extensions into a coherent, understandable, and type-safe hierarchy of traits.
- Automatically handles client/server protocol feature negotiation, without needing to micro-manage the specific [`qSupported` packet](https://sourceware.org/gdb/onlinedocs/gdb/General-Query-Packets.html#qSupported) response.
- `gdbstub` makes _extensive_ use of Rust's powerful type system + generics to enforce protocol invariants at compile time, minimizing the number of tricky protocol details end users have to worry about.
- Using a novel technique called [**Inlineable Dyn Extension Traits**](#zero-overhead-protocol-extensions) (IDETs), `gdbstub` enables fine-grained control over active protocol extensions _without_ relying on clunky `cargo` features or the use of `unsafe` code!
- **Easy to Integrate**
- `gdbstub`'s API is designed to be a "drop in" solution when you want to add debugging support into a project, and shouldn't require any large refactoring effort to integrate into an existing project.
- **`#![no_std]` Ready & Size Optimized**
- `gdbstub` is a **`no_std` first** library, whereby all protocol features are required to be `no_std` compatible.
- `gdbstub` does not require _any_ dynamic memory allocation, and can be configured to use fixed-size, pre-allocated buffers. This enables `gdbstub` to be used on even the most resource constrained, no-[`alloc`](https://doc.rust-lang.org/alloc/) platforms.
- `gdbstub` is entirely **panic free** in most minimal configurations\*, resulting in substantially smaller and more robust code.
- \*See the [Writing panic-free code](#writing-panic-free-code) section below for more details.
- `gdbstub` is transport-layer agnostic, and uses a basic [`Connection`](https://docs.rs/gdbstub/latest/gdbstub/conn/trait.Connection.html) interface to communicate with the GDB server. As long as target has some method of performing in-order, serial, byte-wise I/O (e.g: putchar/getchar over UART), it's possible to run `gdbstub` on it!
- "You don't pay for what you don't use": All code related to parsing/handling protocol extensions is guaranteed to be dead-code-eliminated from an optimized binary if left unimplemented. See the [Zero-overhead Protocol Extensions](#zero-overhead-protocol-extensions) section below for more details.
- `gdbstub`'s minimal configuration has an incredibly low binary size + RAM overhead, enabling it to be used on even the most resource-constrained microcontrollers.
- When compiled in release mode, using all the tricks outlined in [`min-sized-rust`](https://github.com/johnthagen/min-sized-rust), a baseline `gdbstub` implementation can weigh in at **_less than 10kb of `.text` + `.rodata`!_** \*
- \*Exact numbers vary by target platform, compiler version, and `gdbstub` revision. In mixed-language projects, cross-language LTO may be required ([\#101](https://github.com/daniel5151/gdbstub/issues/101#issuecomment-1264444815)). Data was collected using the included `example_no_std` project compiled on x86_64.
### Can I Use `gdbstub` in Production?
**Yes, as long as you don't mind some API churn until `1.0.0` is released.**
Due to `gdbstub`'s heavy use of Rust's type system in enforcing GDB protocol invariants at compile time, it's often been the case that implementing new GDB protocol features has required making some breaking API changes. While these changes are typically quite minor, they are nonetheless semver-breaking, and may require a code-change when moving between versions. Any particularly involved changes will typically be documented in a dedicated [transition guide](docs/transition_guide.md) document.
That being said, `gdbstub` has already been integrated into [many real-world projects](#real-world-examples) since its initial `0.1` release, and empirical evidence suggests that it seems to be doing its job quite well! Thusfar, most reported issues have been caused by improperly implemented `Target` and/or `Arch` implementations, while the core `gdbstub` library itself has proven to be reasonably bug-free.
See the [Future Plans + Roadmap to `1.0.0`](#future-plans--roadmap-to-100) for more information on what features `gdbstub` still needs to implement before committing to API stability with version `1.0.0`.
## Debugging Features
The GDB Remote Serial Protocol is surprisingly complex, supporting advanced features such as remote file I/O, spawning new processes, "rewinding" program execution, and much, _much_ more. Thankfully, most of these features are completely optional, and getting a basic debugging session up-and-running only requires implementing a few basic methods:
- Base GDB Protocol
- Read/Write memory
- Read/Write registers
- Enumerating threads
Yep, that's right! That's all it takes to get `gdb` connected!
Of course, most use-cases will want to support additional debugging features as well. At the moment, `gdbstub` implements the following GDB protocol extensions:
- Automatic target architecture + feature configuration
- Resume
- Continue
- Single Step
- Range Step
- _Reverse_ Step/Continue
- Breakpoints
- Software Breakpoints
- Hardware Breakpoints
- Read/Write/Access Watchpoints (i.e: value breakpoints)
- Extended Mode
- Launch new processes
- Attach to an existing process
- Kill an existing process
- Pass env vars + args to spawned processes
- Change working directory
- Enable/disable ASLR
- Read Memory Map (`info mem`)
- Read Section/Segment relocation offsets
- Handle custom `monitor` Commands
- Extend the GDB protocol with custom debug commands using GDB's `monitor` command!
- Host I/O
- Access the remote target's filesystem to read/write file
- Can be used to automatically read the remote executable on attach (using `ExecFile`)
- Read auxiliary vector (`info auxv`)
- Extra thread info (`info threads`)
- Extra library information (`info sharedlibraries` or `info shared`)
- Tracepoints
- Configure tracepoints and actions to perform when hit
- Select and interrogate collected trace frames
- _Note:_ Feature support is not exhaustive, and many feature haven't been implemented yet.
- Flash operations (`load`)
_Note:_ GDB features are implemented on an as-needed basis by `gdbstub`'s contributors. If there's a missing GDB feature that you'd like `gdbstub` to implement, please file an issue and/or open a PR!
For a full list of GDB remote features, check out the [GDB Remote Configuration Docs](https://sourceware.org/gdb/onlinedocs/gdb/Remote-Configuration.html) for a table of GDB commands + their corresponding Remote Serial Protocol packets.
### Zero-overhead Protocol Extensions
Using a technique called **Inlineable Dyn Extension Traits** (IDETs), `gdbstub` is able to leverage the Rust compiler's powerful optimization passes to ensure any unused features are dead-code-eliminated in release builds _without_ having to rely on compile-time features flags!
For example, if your target doesn't implement a custom GDB `monitor` command handler, the resulting binary won't include any code related to parsing / handling the underlying `qRcmd` packet!
If you're interested in the low-level technical details of how IDETs work, I've included a brief writeup in the documentation [here](https://docs.rs/gdbstub/latest/gdbstub/target/ext/index.html#how-protocol-extensions-work---inlineable-dyn-extension-traits-idets).
## Feature flags
By default, the `std` and `alloc` features are enabled.
When using `gdbstub` in `#![no_std]` contexts, make sure to set `default-features = false`.
- `alloc`
- Implement `Connection` for `Box<dyn Connection>`.
- Log outgoing packets via `log::trace!` (uses a heap-allocated output buffer).
- Provide built-in implementations for certain protocol features:
- Use a heap-allocated packet buffer in `GdbStub` (if none is provided via `GdbStubBuilder::with_packet_buffer`).
- (Monitor Command) Use a heap-allocated output buffer in `ConsoleOutput`.
- `std` (implies `alloc`)
- Implement `Connection` for [`TcpStream`](https://doc.rust-lang.org/std/net/struct.TcpStream.html) and [`UnixStream`](https://doc.rust-lang.org/std/os/unix/net/struct.UnixStream.html).
- Implement [`std::error::Error`](https://doc.rust-lang.org/std/error/trait.Error.html) for `gdbstub::Error`.
- Add a `TargetError::Io` variant to simplify `std::io::Error` handling from Target methods.
- `paranoid_unsafe`
- Please refer to the [`unsafe` in `gdbstub`](#unsafe-in-gdbstub) section below for more details.
- `core_error`
- Make `GdbStubError` implement [`core::error::Error`](https://doc.rust-lang.org/core/error/trait.Error.html) instead of `std::error::Error`.
## Examples
### Real-World Examples
While some of these projects may use older versions of `gdbstub`, they can nonetheless serve as useful examples of what a typical `gdbstub` integration might look like.
If you end up using `gdbstub` in your project, consider opening a PR and adding it to this list!
- Virtual Machine Monitors (VMMs)
- [OpenVMM/OpenHCL](https://openvmm.dev/reference/dev_feats/gdbstub.html) - (Microsoft) Modular, cross-platform, async-first VMM, with paravisor support
- [firecracker](https://github.com/firecracker-microvm/firecracker/blob/main/docs/gdb-debugging.md) - (Amazon) Secure and fast microVMs for serverless computing
- [crosvm](https://google.github.io/crosvm/running_crosvm/advanced_usage.html#gdb-support) - (Google) The Chrome OS VMM
- [cloud-hypervisor](https://github.com/cloud-hypervisor/cloud-hypervisor) - A VMM for modern cloud workloads
- [uhyve](https://github.com/hermitcore/uhyve) - A minimal hypervisor for [RustyHermit](https://github.com/hermitcore/rusty-hermit)
- OS Kernels (using `gdbstub` on `no_std`)
- [COCONUT-SVSM](https://github.com/coconut-svsm/svsm) - VM Service Module (SVSM), supporting Confidential VMs (CVMs)
- [`betrusted-io/xous-core`](https://github.com/betrusted-io/xous-core/blob/b471b604/kernel/src/debug/gdb.rs) - The Xous microkernel operating system
- [`vmware-labs/node-replicated-kernel`](https://github.com/vmware-labs/node-replicated-kernel/tree/57f953c2/kernel/src/arch/x86_64/gdb) - An (experimental) research OS kernel for x86-64 (amd64) machines
- [`patina`](https://github.com/OpenDevicePartnership/patina/blob/main/core/patina_debugger/README.md) - A UEFI compliant pure rust DXE core
- Emulators
- [obliteration](https://github.com/obhq/obliteration) - Kernel + VMM for running PS4 software on PCs
- [solana_rbpf](https://github.com/solana-labs/rbpf) - VM and JIT compiler for eBPF programs
- [rustyboyadvance-ng](https://github.com/michelhe/rustboyadvance-ng/) - Nintendo Gameboy Advance emulator and debugger (ARMv4T)
- [gamegirl](https://github.com/anellie/gamegirl) - A Gameboy (Color/Advance) emulator
- [bevy-atari](https://github.com/mrk-its/bevy-atari) - An Atari XL/XE Emulator (MOS 6502)
- [rmips](https://github.com/starfleetcadet75/rmips) - MIPS R3000 virtual machine simulator
- [clicky](https://github.com/daniel5151/clicky/) - Emulator for classic clickwheel iPods (dual-core ARMv4T)
- [ts7200](https://github.com/daniel5151/ts7200/) - Emulator for the TS-7200 SoC (ARMv4T)
- [vaporstation](https://github.com/Colin-Suckow/vaporstation) - A Playstation One emulator (MIPS)
- [microcorruption-emu](https://github.com/sapir/microcorruption-emu) - Emulator for the microcorruption.com ctf (MSP430)
- Other
- [probe-rs](https://probe.rs/) - A modern, embedded debugging toolkit
- [udbserver](https://github.com/bet4it/udbserver) - Plug-in GDB debugging for the [Unicorn Engine](https://www.unicorn-engine.org/) (Multi Architecture)
- [enarx](https://github.com/enarx/enarx) - An open source framework for running applications in Trusted Execution Environments
- [icicle-emu](https://github.com/icicle-emu/icicle-emu) - An experimental fuzzing-specific, multi-architecture emulation framework
### In-tree "Toy" Examples
These examples are built as part of the CI, and are guaranteed to be kept up to date with the latest version of `gdbstub`'s API.
- `armv4t` - `./examples/armv4t/`
- An incredibly simple ARMv4T-based system emulator with `gdbstub` support.
- **Implements (almost) all available `target::ext` features.** This makes it a great resource when first implementing a new protocol extension!
- `armv4t_multicore` - `./examples/armv4t_multicore/`
- A dual-core variation of the `armv4t` example.
- Implements the core of `gdbstub`'s multithread extensions API, but not much else.
- `example_no_std` - `./example_no_std`
- An _extremely_ minimal example which shows off how `gdbstub` can be used in a `#![no_std]` project.
- Unlike the `armv4t/armv4t_multicore` examples, this project does _not_ include a working emulator, and simply stubs all `gdbstub` functions.
- Doubles as a test-bed for tracking `gdbstub`'s approximate binary footprint (via the `check_size.sh` script), as well as validating certain dead-code-elimination optimizations.
## `unsafe` in `gdbstub`
`gdbstub` limits its use of `unsafe` to a bare minimum, with all uses of `unsafe` required to have a corresponding `// SAFETY` comment as justification.
For those paranoid about trusting third-party unsafe code, `gdbstub` comes with an opt-in `paranoid_unsafe` feature, which enables `#![forbid(unsafe_code)]` on the entire `gdbstub` crate, swapping out all instances of `unsafe` code with equivalent (albeit less-performant) alternatives.
The following list exhaustively documents all uses of `unsafe` in `gdbstub`:
- With `default` features
- Don't emit provably unreachable panics
- `src/protocol/packet.rs`: Method in `PacketBuf` that use index using stored sub-`Range<usize>` into the buffer
- `src/protocol/common/hex.rs`: `decode_hex_buf`
- When the `std` feature is enabled:
- `src/connection/impls/unixstream.rs`: An implementation of `UnixStream::peek` which uses `libc::recv`. Will be removed once [rust-lang/rust#76923](https://github.com/rust-lang/rust/issues/76923) stabilizes this feature in the stdlib.
## Writing panic-free code
Ideally, the Rust compiler would have some way to opt-in to a strict "no-panic" mode. Unfortunately, at the time of writing (2022/04/24), no such mode exists. As such, the only way to avoid the Rust compiler + stdlib's implicit panics is by being _very careful_ when writing code, and _manually checking_ that those panicking paths get optimized out!
And when I say "manually checking", I mean [checking generated asm output](example_no_std/dump_asm.sh).
Why even go through this effort?
- Panic infrastructure can be _expensive_, and when you're optimizing for embedded, `no_std` use-cases, panic infrastructure brings in hundreds of additional bytes into the final binary.
- `gdbstub` can be used to implement low-level debuggers, and if the debugger itself panics, well... it's not like you can debug it all that easily!
As such, **`gdbstub` promises to introduce zero additional panics** into an existing project, subject to the following conditions:
1. The binary is compiled in release mode
- \*subject to the specific `rustc` version being used (codegen and optimization vary between versions)
- \*different hardware architectures may be subject to different compiler optimizations
- i.e: at this time, only `x86` is actively tested to be panic-free
2. `gdbstub`'s `paranoid_unsafe` cargo feature is _disabled_
- LLVM is unable to omit certain `panic` checks without requiring a bit of `unsafe` code
- See the [`unsafe` in `gdbstub`](#unsafe-in-gdbstub) section for more details
3. The `Arch` implementation being used doesn't include panicking code
- _Note:_ The arch implementations under `gdbstub_arch` are _not_ guaranteed to be panic free!
- If you do spot a panicking arch in `gdbstub_arch`, consider opening a PR to fix it
If you're using `gdbstub` in a no-panic project and have determined that `gdbstub` is at fault for introducing a panicking code path, please file an issue!
## Future Plans + Roadmap to `1.0.0`
While the vast majority of GDB protocol features (e.g: remote filesystem support, tracepoint packets, most query packets, etc...) should _not_ require breaking API changes, the following features will most likely require at least some breaking API changes, and should therefore be implemented prior to `1.0.0`.
Not that this is _not_ an exhaustive list, and is subject to change.
- [ ] Allow fine-grained control over target features via the `Arch` trait ([\#12](https://github.com/daniel5151/gdbstub/issues/12))
- [ ] Implement GDB's various high-level operating modes:
- [x] Single/Multi Thread debugging
- [ ] Multiprocess Debugging ([\#124](https://github.com/daniel5151/gdbstub/issues/124)
- [ ] Requires adding a new `target::ext::base::multiprocess` API.
- _Note:_ `gdbstub` already implements multiprocess extensions "under-the-hood", and just hard-codes a fake PID, so this is mostly a matter of "putting in the work".
- [x] [Extended Mode](https://sourceware.org/gdb/current/onlinedocs/gdb/Connecting.html) (`target extended-remote`)
- [ ] [Non-Stop Mode](https://sourceware.org/gdb/onlinedocs/gdb/Remote-Non_002dStop.html#Remote-Non_002dStop)
- [x] Have a working example of `gdbstub` running in a "bare-metal" `#![no_std]` environment.
Additionally, while not _strict_ blockers to `1.0.0`, it would be good to explore these features as well:
- [ ] Should `gdbstub` commit to a MSRV?
- [ ] Remove lingering instances of `RawRegId` from `gdbstub_arch` ([\#29](https://github.com/daniel5151/gdbstub/issues/29))
- [x] Exposing `async/await` interfaces (particularly wrt. handling GDB client interrupts) ([\#36](https://github.com/daniel5151/gdbstub/issues/36))
- [ ] How/if to support [LLDB extensions](https://raw.githubusercontent.com/llvm-mirror/lldb/master/docs/lldb-gdb-remote.txt) ([\#99](https://github.com/daniel5151/gdbstub/issues/99))
- [ ] Supporting multi-arch debugging via a single target
- e.g: debugging x86 and ARM processes on macOS
- [ ] Proper handling of "nack" packets (for spotty connections) ([\#137](https://github.com/daniel5151/gdbstub/issues/137))
## License
gdbstub is free and open source! All code in this repository is dual-licensed under either:
* MIT License ([LICENSE-MIT](docs/LICENSE-MIT) or [http://opensource.org/licenses/MIT](http://opensource.org/licenses/MIT))
* Apache License, Version 2.0 ([LICENSE-APACHE](docs/LICENSE-APACHE) or [http://www.apache.org/licenses/LICENSE-2.0](http://www.apache.org/licenses/LICENSE-2.0))
at your option. This means you can select the license you prefer! This dual-licensing approach is the de-facto standard in the Rust ecosystem and there are [very good reasons](https://github.com/daniel5151/gdbstub/issues/68) to include both.
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.
================================================
FILE: docs/LICENSE-APACHE
================================================
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS
================================================
FILE: docs/LICENSE-MIT
================================================
MIT License
Copyright (c) 2021 Daniel Prilik
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
================================================
FILE: docs/transition_guide.md
================================================
# Transition Guide
This document provides a brief overview of breaking changes between major `gdbstub` releases, along with tips/tricks/suggestions on how to migrate between `gdbstub` releases.
This document does _not_ discuss any new features that might have been added between releases. For a comprehensive overview of what's been _added_ to `gdbstub` (as opposed to what's _changed_), check out the [`CHANGELOG.md`](../CHANGELOG.md).
> _Note:_ after reading through this doc, you may also find it helpful to refer to the in-tree `armv4t` and `armv4t_multicore` examples when transitioning between versions.
## `0.6` -> `0.7`
`0.7` is a fairly minimal "cleanup" release, landing a collection of small breaking changes that collectively improve various ergonomic issues in `gdbstub`'s API.
The breaking changes introduced in `0.7` are generally trivial to fix, and porting from `0.6` to `0.7` shouldn't take more than ~10 minutes, at most.
##### `stub::GdbStubError` Changes
`stub::GdbStubError` is now an opaque `struct` with a handful of methods to extract user-defined context.
**Please file an issue if your code required matching on concrete error variants aside from `TargetError` and `ConnectionError`!**.
In contrast with the old version - which was an `enum` that directly exposed all error internals to the user - this new type will enable future versions of `gdbstub` to fearlessly improve error infrastructure without requiring semver breaking changes. See [\#112](https://github.com/daniel5151/gdbstub/pull/132) for more.
Assuming you stuck to the example error handling described in the `gdbstub` getting started guide, adapting to the new type should be quite straightforward.
```rust
// ==== 0.6.x ==== //
match gdb.run_blocking::<EmuGdbEventLoop>(&mut emu) {
Ok(disconnect_reason) => { ... },
Err(GdbStubError::TargetError(e)) => {
println!("target encountered a fatal error: {}", e)
}
Err(e) => {
println!("gdbstub encountered a fatal error: {}", e)
}
}
// ==== 0.7.0 ==== //
match gdb.run_blocking::<EmuGdbEventLoop>(&mut emu) {
Ok(disconnect_reason) => { ... },
Err(e) => {
if e.is_target_error() {
println!(
"target encountered a fatal error: {}",
e.into_target_error().unwrap()
)
} else if e.is_connection_error() {
let (e, kind) = e.into_connection_error().unwrap();
println!("connection error: {:?} - {}", kind, e,)
} else {
println!("gdbstub encountered a fatal error: {}", e)
}
}
}
```
##### `{Single, Multi}ThreadBase::read_addrs` return value
`read_addrs` now returns a `usize` instead of a `()`, allowing implementations to report cases where only a subset of memory could be read.
In the past, the only way to handle these cases was by returning a `TargetError`. This provides an alternative mechanism, which may or may not be more appropriate for your particular use-case.
When upgrading, the Rust compiler will emit a clear error message pointing out the updated function signature. The fix should be trivial.
##### Removal of `Arch::single_step_behavior`
See [\#132](https://github.com/daniel5151/gdbstub/pull/132) for more discussion on why this API was removed.
This change only affects you if you're maintaining a custom `Arch` implementation (vs. using a community-maintained one via `gdbstub_arch`).
The fix here is to simply remove the `Arch::single_step_behavior` impl.
That's it! It's that easy.
## `0.5` -> `0.6`
`0.6` introduces a large number of breaking changes to the public APIs, and will require quite a bit more more "hands on" porting than previous `gdbstub` upgrades.
The following guide is a **best-effort** attempt to document all the changes, but there are some parts that may be missing / incomplete.
##### General API change - _lots_ of renaming + exported type reorganization
Many types have been renamed, and many import paths have changed in `0.6`.
Exhaustively listing them would be nearly impossible, but suffice it to say, you will need to tweak your imports.
##### `Connection` API changes
> _Note:_ If you haven't implemented `Connection` yourself (i.e: you are using one of the built-in `Connection` impls on `TcpStream`/`UnixStream`), you can skip this section.
The blocking `read` method and non-blocking `peek` methods have been removed from the base `Connection` API, and have been moved to a new `ConnectionExt` type.
For more context around this change, please refer to [Moving from `GdbStub::run` to `GdbStub::run_blocking`](#moving-from-gdbstubrun-to-gdbstubrun_blocking).
Porting a `0.5` `Connection` to `0.6` is incredibly straightforward - you simply split your existing implementation in two:
```rust
// ==== 0.5.x ==== //
impl Connection for MyConnection {
type Error = MyError;
fn write(&mut self, byte: u8) -> Result<(), Self::Error> { .. }
fn write_all(&mut self, buf: &[u8]) -> Result<(), Self::Error> { .. }
fn read(&mut self) -> Result<u8, Self::Error> { .. }
fn peek(&mut self) -> Result<Option<u8>, Self::Error> { .. }
fn flush(&mut self) -> Result<(), Self::Error> { .. }
fn on_session_start(&mut self) -> Result<(), Self::Error> { .. }
}
// ==== 0.6.0 ==== //
impl Connection for MyConnection {
type Error = MyError;
fn write(&mut self, byte: u8) -> Result<(), Self::Error> { .. }
fn write_all(&mut self, buf: &[u8]) -> Result<(), Self::Error> { .. }
fn flush(&mut self) -> Result<(), Self::Error> { .. }
fn on_session_start(&mut self) -> Result<(), Self::Error> { .. }
}
impl ConnectionExt for MyConnection {
type Error = MyError;
fn read(&mut self) -> Result<u8, Self::Error> { .. }
fn peek(&mut self) -> Result<Option<u8>, Self::Error> { .. }
}
```
##### `Arch` API - `RegId::from_raw_id`
> _Note:_ If you haven't implemented `Arch` yourself (i.e: you are any of the `Arch` impls from `gdbstub_arch`), you can skip this section.
The `Arch` API has had one breaking changes: The `RegId::from_raw_id` method's "register size" return value has been changed from `usize` to `Option<NonZeroUsize>`.
If the register size is `Some`, `gdbstub` will include a runtime check to ensures that the target implementation does not send back more bytes than the register allows when responding to single-register read requests.
If the register size is `None`, `gdbstub` will _omit_ this runtime check, and trust that the target's implementation of `read_register` is correct.
_Porting advice:_ If your `Arch` implementation targets a specific architecture, it is _highly recommended_ that you simply wrap your existing size value with `Some`. This API change was made to support dynamic `Arch` implementations, whereby the behavior of the `Arch` varies on the runtime state of the program (e.g: in multi-system emulators), and there is not "fixed" register size per id.
##### `Target` API - IDET methods are now prefixed with `supports_`
All IDET methods have been prefixed with `supports_`, to make it easier to tell at-a-glance which methods are actual handler methods, and which are simply IDET plumbing.
As such, when porting target code from `0.5` to `0.6`, before you dive into any functional changes, you should take a moment to find and rename any methods that have had their name changed.
##### `Target` API - Introducing `enum Signal`
In prior versions of `gdbstub`, signals were encoded as raw `u8` values. This wasn't very user-friendly, as it meant users had to manually locate the signal-to-integer mapping table themselves when working with signals in code.
`0.6` introduces a new `enum Signal` which encodes this information within `gdbstub` itself.
This new `Signal` type has replaced `u8` in any places that a `u8` was used to represent a signal, such as in `StopReason::Signal`, or as part of the various `resume` APIs.
_Porting advice:_ The Rust compiler should catch any type errors due to this change, making it easy to swap out any instances of `u8` with the new `Signal` type.
##### `HwWatchpoint` API - Plumb watchpoint `length` parameter to public API
The watchpoint API has been updated to include a new `length` parameter, specifying what range of memory addresses the watchpoint should encompass.
##### `TargetXmlOverride` API - Return data via `&mut [u8]` buffer
In an effort to unify the implementations of various new `qXfer`-backed protocol extensions, the existing `TargetXmlOverride` has been changed from returning a `&str` value to using a `std::io::Read`-style "write the data into a `&mut [u8]` buffer" API.
Porting a `0.5` `TargetDescriptionXmlOverride` to `0.6` is straightforward, though a bit boilerplate-y.
```rust
// ==== 0.5.x ==== //
impl target::ext::target_description_xml_override::TargetDescriptionXmlOverride for Emu {
fn target_description_xml(&self) -> &str {
r#"<target version="1.0"><!-- custom override string --><architecture>armv4t</architecture></target>"#
}
}
// ==== 0.6.0 ==== //
pub fn copy_to_buf(data: &[u8], buf: &mut [u8]) -> usize {
let len = data.len();
let buf = &mut buf[..len];
buf.copy_from_slice(data);
len
}
pub fn copy_range_to_buf(data: &[u8], offset: u64, length: usize, buf: &mut [u8]) -> usize {
let offset = match usize::try_from(offset) {
Ok(v) => v,
Err(_) => return 0,
};
let len = data.len();
let data = &data[len.min(offset)..len.min(offset + length)];
copy_to_buf(data, buf)
}
impl target::ext::target_description_xml_override::TargetDescriptionXmlOverride for Emu {
fn target_description_xml(
&self,
offset: u64,
length: usize,
buf: &mut [u8],
) -> TargetResult<usize, Self> {
let xml = r#"<target version="1.0"><!-- custom override string --><architecture>armv4t</architecture></target>"#
.trim()
.as_bytes();
Ok(copy_range_to_buf(xml, offset, length, buf))
}
}
```
##### Updates to `{Single,Multi}ThreadOps::resume` API
`0.6` includes three fairly major behavioral changes to the `resume` method:
###### Support for `resume` is now entirely optional
There are quite a few use cases where it might make sense to debug a target that does _not_ support resumption, e.g: a post-mortem debugging session, or when debugging crash dumps. In these cases, past version of `gdbstub` would force the user to nonetheless implement "stub" methods for resuming these targets, along with forcing users to pay the "cost" of including all the handler code related to resumption (of which there is quite a bit.)
In `0.6`, all resume-related functionality has been extracted out of `{Single,Multi}ThreadBase`, and split into new `{Singe,Multi}ThreadResume` IDETs.
###### Removing `ResumeAction`, and making single-step support optional
The GDB protocol only requires that targets implement support for _continuing_ execution - support for instruction-level single-step execution is totally optional.
> Note: this isn't actually true in practice, thanks to a bug in the mainline GDB client... See the docs for `Target::use_optional_single_step` for details...
To model this behavior, `0.6` has split single-step support into its own IDET, in a manner similar to how optimized range step support was handled in `0.5`.
In doing so, the `enum ResumeAction` type could be removed entirely, as single-step resume was to be handled in its own method.
###### Removing `gdb_interrupt: GdbInterrupt`, and making `resume` non-blocking
In past versions of `gdbstub`, the `resume` API would _block_ the thread waiting for the target to hit some kind of stop condition. In this model, checking for pending GDB interrupts was quite unergonomic, requiring that the thread periodically wake up and check whether an interrupt has arrived via the `GdbInterrupt` type.
`gdbstub` `0.6` introduces a new paradigm of driving target execution, predicated on the idea that the target's `resume` method _does not block_, instead yielding execution immediately, and deferring the responsibility of "selecting" between incoming stop events and GDB interrupts to higher levels of the `gdbstub` "stack".
In practice, this means that much of the logic that used to live in the `resume` implementation will now move into upper-levels of the `gdbstub` API, with the `resume` API serving more of a "bookkeeping" purpose, recording what kind of resumption mode the GDB client has requested from the target, while not actually resuming the target itself.
For more context around this change, please refer to [Moving from `GdbStub::run` to `GdbStub::run_blocking`](#moving-from-gdbstubrun-to-gdbstubrun_blocking).
###### Example: migrating `resume` from `0.5` to `0.6`
Much of the code contained within methods such as `block_until_stop_reason_or_interrupt` will be lifted into upper layers of the `gdbstub` API, leaving behind just a small bit of code in the target's `resume` method to perform "bookkeeping" regarding how the GDB client requested the target to be resumed.
```rust
// ==== 0.5.x ==== //
impl SingleThreadOps for Emu {
fn resume(
&mut self,
action: ResumeAction,
gdb_interrupt: GdbInterrupt<'_>,
) -> Result<StopReason<u32>, Self::Error> {
match action {
ResumeAction::Step => self.do_single_step(),
ResumeAction::Continue => self.block_until_stop_reason_or_interrupt(action, || gdb_interrupt.pending()),
_ => self.handle_resume_with_signal(action),
}
}
}
// ==== 0.6.0 ==== //
impl SingleThreadBase for Emu {
// resume has been split into a separate IDET
#[inline(always)]
fn support_resume(
&mut self
) -> Option<SingleThreadResumeOps<Self>> {
Some(self)
}
}
impl SingleThreadResume for Emu {
fn resume(
&mut self,
signal: Option<Signal>,
) -> Result<(), Self::Error> { // <-- no longer returns a stop reason!
if let Some(signal) = signal {
self.handle_signal(signal)?;
}
// upper layers of the `gdbstub` API will be responsible for "driving"
// target execution - `resume` simply performs book keeping on _how_ the
// target should be resumed.
self.set_execution_mode(ExecMode::Continue)?;
Ok(())
}
// single-step support has been split into a separate IDET
#[inline(always)]
fn support_single_step(
&mut self
) -> Option<SingleThreadSingleStepOps<'_, Self>> {
Some(self)
}
}
impl SingleThreadSingleStep for Emu {
fn step(&mut self, signal: Option<Signal>) -> Result<(), Self::Error> {
if let Some(signal) = signal {
self.handle_signal(signal)?;
}
self.set_execution_mode(ExecMode::Step)?;
Ok(())
}
}
```
##### Moving from `GdbStub::run` to `GdbStub::run_blocking`
With the introduction of the new state-machine API, the responsibility of reading incoming has been lifted out of `gdbstub` itself, and is now something implementations are responsible for . The alternative approach would've been to have `Connection` include multiple different `read`-like methods for various kinds of paradigms - such as `async`/`await`, `epoll`, etc...
> TODO. In the meantime, I would suggest looking at rustdoc for details on how to use `GdbStub::run_blocking`...
## `0.4` -> `0.5`
While the overall structure of the API has remained the same, `0.5.0` does introduce a few breaking API changes that require some attention. That being said, it should not be a difficult migration, and updating to `0.5.0` from `0.4` shouldn't take more than 10 mins of refactoring.
##### Consolidating the `{Hw,Sw}Breakpoint/Watchpoint` IDETs under the newly added `Breakpoints` IDETs.
The various breakpoint IDETs that were previously directly implemented on the top-level `Target` trait have now been consolidated under a single `Breakpoints` IDET. This is purely an organizational change, and will not require rewriting any existing `{add, remove}_{sw_break,hw_break,watch}point` implementations.
Porting from `0.4` to `0.5` should be as simple as:
```rust
// ==== 0.4.x ==== //
impl Target for Emu {
fn sw_breakpoint(&mut self) -> Option<target::ext::breakpoints::SwBreakpointOps<Self>> {
Some(self)
}
fn hw_watchpoint(&mut self) -> Option<target::ext::breakpoints::HwWatchpointOps<Self>> {
Some(self)
}
}
impl target::ext::breakpoints::SwBreakpoint for Emu {
fn add_sw_breakpoint(&mut self, addr: u32) -> TargetResult<bool, Self> { ... }
fn remove_sw_breakpoint(&mut self, addr: u32) -> TargetResult<bool, Self> { ... }
}
impl target::ext::breakpoints::HwWatchpoint for Emu {
fn add_hw_watchpoint(&mut self, addr: u32, kind: WatchKind) -> TargetResult<bool, Self> { ... }
fn remove_hw_watchpoint(&mut self, addr: u32, kind: WatchKind) -> TargetResult<bool, Self> { ... }
}
// ==== 0.5.0 ==== //
impl Target for Emu {
// (New Method) //
fn breakpoints(&mut self) -> Option<target::ext::breakpoints::BreakpointsOps<Self>> {
Some(self)
}
}
impl target::ext::breakpoints::Breakpoints for Emu {
fn sw_breakpoint(&mut self) -> Option<target::ext::breakpoints::SwBreakpointOps<Self>> {
Some(self)
}
fn hw_watchpoint(&mut self) -> Option<target::ext::breakpoints::HwWatchpointOps<Self>> {
Some(self)
}
}
// (Almost Unchanged) //
impl target::ext::breakpoints::SwBreakpoint for Emu {
// /-- New `kind` parameter
// \/
fn add_sw_breakpoint(&mut self, addr: u32, _kind: arch::arm::ArmBreakpointKind) -> TargetResult<bool, Self> { ... }
fn remove_sw_breakpoint(&mut self, addr: u32, _kind: arch::arm::ArmBreakpointKind) -> TargetResult<bool, Self> { ... }
}
// (Unchanged) //
impl target::ext::breakpoints::HwWatchpoint for Emu {
fn add_hw_watchpoint(&mut self, addr: u32, kind: WatchKind) -> TargetResult<bool, Self> { ... }
fn remove_hw_watchpoint(&mut self, addr: u32, kind: WatchKind) -> TargetResult<bool, Self> { ... }
}
```
##### Single-register access methods (`{read,write}_register`) are now a separate `SingleRegisterAccess` trait
Single register access is not a required part of the GDB protocol, and as such, has been moved out into its own IDET. This is a purely organizational change, and will not require rewriting any existing `{read,write}_register` implementations.
Porting from `0.4` to `0.5` should be as simple as:
```rust
// ==== 0.4.x ==== //
impl SingleThreadOps for Emu {
fn read_register(&mut self, reg_id: arch::arm::reg::id::ArmCoreRegId, dst: &mut [u8]) -> TargetResult<(), Self> { ... }
fn write_register(&mut self, reg_id: arch::arm::reg::id::ArmCoreRegId, val: &[u8]) -> TargetResult<(), Self> { ... }
}
// ==== 0.5.0 ==== //
impl SingleThreadOps for Emu {
// (New Method) //
fn single_register_access(&mut self) -> Option<target::ext::base::SingleRegisterAccessOps<(), Self>> {
Some(self)
}
}
impl target::ext::base::SingleRegisterAccess<()> for Emu {
// /-- New `tid` parameter (ignored on single-threaded systems)
// \/
fn read_register(&mut self, _tid: (), reg_id: arch::arm::reg::id::ArmCoreRegId, dst: &mut [u8]) -> TargetResult<(), Self> { ... }
fn write_register(&mut self, _tid: (), reg_id: arch::arm::reg::id::ArmCoreRegId, val: &[u8]) -> TargetResult<(), Self> { ... }
}
```
##### New `MultiThreadOps::resume` API
In `0.4`, resuming a multithreaded target was done using an `Actions` iterator passed to a single `resume` method. In hindsight, this approach had a couple issues:
- It was impossible to statically enforce the property that the `Actions` iterator was guaranteed to return at least one element, often forcing users to manually `unwrap`
- The iterator machinery was quite heavy, and did not optimize very effectively
- Handling malformed packets encountered during iteration was tricky, as the user-facing API exposed an infallible iterator, thereby complicating the internal error handling
- Adding new kinds of `ResumeAction` (e.g: range stepping) required a breaking change, and forced users to change their `resume` method implementation regardless whether or not their target ended up using said action.
In `0.5`, the API has been refactored to address some of these issues, and the single `resume` method has now been split into multiple "lifecycle" methods:
1. `resume`
- As before, when `resume` is called the target should resume execution.
- But how does the target know how each thread should be resumed? That's where the next method comes in...
1. `set_resume_action`
- This method is called prior to `resume`, and notifies the target how a particular `Tid` should be resumed.
1. (optionally) `set_resume_action_range_step`
- If the target supports optimized range-stepping, it can opt to implement the newly added `MultiThreadRangeStepping` IDET which includes this method.
- Targets that aren't interested in optimized range-stepping can skip this method!
1. `clear_resume_actions`
- After the target returns a `ThreadStopReason` from `resume`, this method will be called to reset the previously set per-`tid` resume actions.
NOTE: This change does mean that targets are now responsible for maintaining some internal state that maps `Tid`s to `ResumeAction`s. Thankfully, this isn't difficult at all, and can as simple as maintaining a `HashMap<Tid, ResumeAction>`.
Please refer to the in-tree `armv4t_multicore` example for an example of how this new `resume` flow works.
================================================
FILE: example_no_std/.gitignore
================================================
/target
.gdb_history
*.s
================================================
FILE: example_no_std/Cargo.toml
================================================
[package]
name = "gdbstub-nostd"
version = "0.1.0"
authors = ["Daniel Prilik <danielprilik@gmail.com>"]
edition = "2018"
[features]
__dead_code_marker = ["gdbstub/__dead_code_marker"]
[dependencies]
gdbstub = { path = "../", default-features = false }
gdbstub_arch = { path = "../gdbstub_arch", default-features = false }
libc = { version = "0.2", default-features = false }
log = { version = "0.4", features = ["release_max_level_off"] }
[profile.dev]
panic = "abort"
[profile.release]
panic = "abort"
opt-level = 's' # Optimize for size.
lto = true
codegen-units = 1
debug = true
================================================
FILE: example_no_std/README.md
================================================
# example_no_std
This basic example is used to benchmark how large `gdbstub`'s binary footprint is in `#![no_std]` contexts.
It uses many of the [`min-sized-rust`](https://github.com/johnthagen/min-sized-rust) guidelines to crunch down the binary size. This includes directly linking against `libc` to perform I/O, and avoiding and and all uses of Rust's [heavy formatting machinery](https://jamesmunns.com/blog/fmt-unreasonably-expensive/). While not perfect, this example should give a rough estimate of what a typical embedded system `gdbstub` integration might look like.
Oh, and please excuse the _terrible_ sockets code in `conn.rs`. I've never worked with raw C sockets, and that code was very haphazardly thrown together. If you're so inclined, I'd more than happily merge the PR that improves it's implementation!
================================================
FILE: example_no_std/check_size.sh
================================================
#!/bin/bash
set -e
cd "$(dirname "$(realpath $0)")"
# checks the size of the resulting --release level binary (that's been stripped)
cargo build --release
cargo bloat --release --split-std -n 100
strip target/release/gdbstub-nostd
size -A -t target/release/gdbstub-nostd
================================================
FILE: example_no_std/dump_asm.sh
================================================
#!/bin/bash
set -e
cd "$(dirname "$(realpath "$0")")"
if ! command -v rustfilt &> /dev/null
then
cargo install rustfilt
fi
rm -rf ./target
cargo rustc --release -- --emit asm -C "llvm-args=-x86-asm-syntax=intel"
cat ./target/release/deps/gdbstub_nostd-*.s | rustfilt > asm.s
sed -i -E '/\.(cfi_def_cfa_offset|cfi_offset|cfi_startproc|cfi_endproc|size)/d' asm.s
if [ -n "$EXTRA_TRIM" ]; then
sed -i -E '/\.(Ltmp|file|loc)/d' asm.s
sed -i -E '/.section\t.debug_loc/,$d' asm.s
fi
echo "asm emitted to asm.s"
if grep "core::panicking::panic_fmt" asm.s
then
echo "found panic in example_no_std!"
exit 1
else
echo "no panics in example_no_std"
fi
================================================
FILE: example_no_std/rustfmt.toml
================================================
wrap_comments = true
================================================
FILE: example_no_std/src/conn.rs
================================================
use gdbstub::conn::Connection;
pub struct TcpConnection {
sock: i32,
fd: i32,
}
impl TcpConnection {
pub fn new_localhost(port: u16) -> Result<TcpConnection, &'static str> {
unsafe {
let sockaddr = libc::sockaddr_in {
#[cfg(any(
target_os = "macos",
target_os = "ios",
target_os = "freebsd",
target_os = "netbsd",
target_os = "openbsd",
target_os = "dragonfly"
))]
sin_len: core::mem::size_of::<libc::sockaddr_in>() as _,
sin_family: libc::AF_INET as _,
sin_port: port.to_be(),
// 127.0.0.1
sin_addr: libc::in_addr {
s_addr: 0x7f000001u32.to_be(),
},
sin_zero: [0; 8],
};
let socklen = core::mem::size_of::<libc::sockaddr_in>();
let sock = libc::socket(libc::AF_INET, libc::SOCK_STREAM, 0);
if sock == -1 {
return Err("could not create listen socket");
}
let reuseaddr: i32 = 1;
if libc::setsockopt(
sock,
libc::SOL_SOCKET,
libc::SO_REUSEADDR,
&reuseaddr as *const _ as *const libc::c_void,
core::mem::size_of::<i32>() as u32,
) < 0
{
return Err("could not set SO_REUSEADDR");
}
if libc::bind(sock, &sockaddr as *const _ as _, socklen as u32) < 0 {
return Err("could not bind socket");
}
if libc::listen(sock, 1) < 0 {
return Err("could not open socket for listening");
}
let fd = libc::accept(sock, core::ptr::null_mut(), &mut 0);
if fd < 0 {
return Err("could not accept socket connection");
}
Ok(TcpConnection { sock, fd })
}
}
pub fn read(&mut self) -> Result<u8, &'static str> {
let mut buf = [0];
let ret = unsafe { libc::read(self.fd, buf.as_mut_ptr() as _, 1) };
if ret == -1 || ret != 1 {
Err("socket read failed")
} else {
Ok(buf[0])
}
}
#[allow(dead_code)]
pub fn peek(&mut self) -> Result<Option<u8>, &'static str> {
let mut buf = [0];
let ret = unsafe {
libc::recv(
self.fd,
buf.as_mut_ptr() as *mut _,
buf.len(),
libc::MSG_PEEK,
)
};
if ret == -1 || ret != 1 {
Err("socket peek failed")
} else {
Ok(Some(buf[0]))
}
}
}
impl Drop for TcpConnection {
fn drop(&mut self) {
unsafe {
libc::close(self.fd);
libc::close(self.sock);
}
}
}
impl Connection for TcpConnection {
type Error = &'static str;
fn write(&mut self, b: u8) -> Result<(), &'static str> {
let buf = [b];
let ret = unsafe { libc::write(self.fd, buf.as_ptr() as _, 1) };
if ret == -1 || ret != 1 {
Err("socket write failed")
} else {
Ok(())
}
}
fn flush(&mut self) -> Result<(), &'static str> {
// huh, apparently flushing isn't a "thing" for Tcp streams.
// see https://doc.rust-lang.org/src/std/net/tcp.rs.html#592-609
Ok(())
}
}
================================================
FILE: example_no_std/src/gdb.rs
================================================
use crate::print_str::print_str;
use gdbstub::common::Signal;
use gdbstub::common::Tid;
use gdbstub::target;
use gdbstub::target::ext::base::multithread::MultiThreadBase;
use gdbstub::target::ext::base::multithread::MultiThreadResume;
use gdbstub::target::Target;
use gdbstub::target::TargetResult;
pub struct DummyTarget {}
impl DummyTarget {
pub fn new() -> DummyTarget {
DummyTarget {}
}
}
impl Target for DummyTarget {
type Arch = gdbstub_arch::arm::Armv4t;
type Error = &'static str;
#[inline(always)]
fn base_ops(&mut self) -> target::ext::base::BaseOps<'_, Self::Arch, Self::Error> {
target::ext::base::BaseOps::MultiThread(self)
}
// disable `QStartNoAckMode` in order to save space
#[inline(always)]
fn use_no_ack_mode(&self) -> bool {
false
}
// disable X packet optimization in order to save space
#[inline(always)]
fn use_x_upcase_packet(&self) -> bool {
false
}
// disable fork events to save space
#[inline(always)]
fn use_fork_stop_reason(&self) -> bool {
false
}
// disable vfork events to save space
#[inline(always)]
fn use_vfork_stop_reason(&self) -> bool {
false
}
// disable vforkdone events to save space
#[inline(always)]
fn use_vforkdone_stop_reason(&self) -> bool {
false
}
#[inline(always)]
fn support_breakpoints(
&mut self,
) -> Option<target::ext::breakpoints::BreakpointsOps<'_, Self>> {
Some(self)
}
}
// NOTE: to try and make this a marginally more realistic estimate of
// `gdbstub`'s library overhead, non-IDET methods are marked as
// `#[inline(never)]` to prevent the optimizer from too aggressively coalescing
// the stubbed implementations.
//
// EXCEPTION: `list_active_threads` accepts a closure arg, and should be
// be inlined for smaller codegen
impl MultiThreadBase for DummyTarget {
#[inline(never)]
fn read_registers(
&mut self,
_regs: &mut gdbstub_arch::arm::reg::ArmCoreRegs,
_tid: Tid,
) -> TargetResult<(), Self> {
print_str("> read_registers");
Ok(())
}
#[inline(never)]
fn write_registers(
&mut self,
_regs: &gdbstub_arch::arm::reg::ArmCoreRegs,
_tid: Tid,
) -> TargetResult<(), Self> {
print_str("> write_registers");
Ok(())
}
#[inline(never)]
fn read_addrs(
&mut self,
_start_addr: u32,
data: &mut [u8],
_tid: Tid, // same address space for each core
) -> TargetResult<usize, Self> {
print_str("> read_addrs");
data.iter_mut().for_each(|b| *b = 0x55);
Ok(data.len())
}
#[inline(never)]
fn write_addrs(
&mut self,
_start_addr: u32,
_data: &[u8],
_tid: Tid, // same address space for each core
) -> TargetResult<(), Self> {
print_str("> write_addrs");
Ok(())
}
#[inline(always)] // !! EXCEPTION !!
fn list_active_threads(
&mut self,
register_thread: &mut dyn FnMut(Tid),
) -> Result<(), Self::Error> {
print_str("> list_active_threads");
register_thread(Tid::new(1).unwrap());
register_thread(Tid::new(2).unwrap());
Ok(())
}
#[inline(always)]
fn support_resume(
&mut self,
) -> Option<target::ext::base::multithread::MultiThreadResumeOps<'_, Self>> {
Some(self)
}
}
impl MultiThreadResume for DummyTarget {
#[inline(never)]
fn resume(&mut self) -> Result<(), Self::Error> {
print_str("> resume");
Ok(())
}
#[inline(never)]
fn clear_resume_actions(&mut self) -> Result<(), Self::Error> {
print_str("> clear_resume_actions");
Ok(())
}
#[inline(never)]
fn set_resume_action_continue(
&mut self,
_tid: Tid,
_signal: Option<Signal>,
) -> Result<(), Self::Error> {
print_str("> set_resume_action_continue");
Ok(())
}
}
impl target::ext::breakpoints::Breakpoints for DummyTarget {
#[inline(always)]
fn support_sw_breakpoint(
&mut self,
) -> Option<target::ext::breakpoints::SwBreakpointOps<'_, Self>> {
Some(self)
}
}
impl target::ext::breakpoints::SwBreakpoint for DummyTarget {
#[inline(never)]
fn add_sw_breakpoint(
&mut self,
_addr: u32,
_kind: gdbstub_arch::arm::ArmBreakpointKind,
) -> TargetResult<bool, Self> {
Ok(true)
}
#[inline(never)]
fn remove_sw_breakpoint(
&mut self,
_addr: u32,
_kind: gdbstub_arch::arm::ArmBreakpointKind,
) -> TargetResult<bool, Self> {
Ok(true)
}
}
================================================
FILE: example_no_std/src/main.rs
================================================
//! A basic `no_std` example that's used to ballpark estimate how large
//! `gdbstub`'s binary footprint is resource-restricted environments.
#![no_std]
#![no_main]
use crate::print_str::print_str;
use gdbstub::stub::state_machine::GdbStubStateMachine;
use gdbstub::stub::DisconnectReason;
use gdbstub::stub::GdbStubBuilder;
use gdbstub::stub::MultiThreadStopReason;
mod conn;
mod gdb;
mod print_str;
#[panic_handler]
fn panic(_info: &core::panic::PanicInfo<'_>) -> ! {
loop {}
}
fn rust_main() -> Result<(), i32> {
print_str("Running example_no_std...");
let mut target = gdb::DummyTarget::new();
let conn = match conn::TcpConnection::new_localhost(9001) {
Ok(c) => c,
Err(e) => {
print_str("could not start TCP server:");
print_str(e);
return Err(-1);
}
};
let mut buf = [0; 4096];
let gdb = GdbStubBuilder::new(conn)
.with_packet_buffer(&mut buf)
.build()
.map_err(|_| 1)?;
print_str("Starting GDB session...");
let mut gdb = gdb.run_state_machine(&mut target).map_err(|_| 1)?;
let res = loop {
gdb = match gdb {
GdbStubStateMachine::Idle(mut gdb) => {
let byte = gdb.borrow_conn().read().map_err(|_| 1)?;
match gdb.incoming_data(&mut target, byte) {
Ok(gdb) => gdb,
Err(e) => break Err(e),
}
}
GdbStubStateMachine::Running(gdb) => {
match gdb.report_stop(&mut target, MultiThreadStopReason::DoneStep) {
Ok(gdb) => gdb,
Err(e) => break Err(e),
}
}
GdbStubStateMachine::CtrlCInterrupt(gdb) => {
match gdb.interrupt_handled(&mut target, None::<MultiThreadStopReason<u32>>) {
Ok(gdb) => gdb,
Err(e) => break Err(e),
}
}
GdbStubStateMachine::Disconnected(gdb) => break Ok(gdb.get_reason()),
}
};
match res {
Ok(disconnect_reason) => match disconnect_reason {
DisconnectReason::Disconnect => print_str("GDB Disconnected"),
DisconnectReason::TargetExited(_) => print_str("Target exited"),
DisconnectReason::TargetTerminated(_) => print_str("Target halted"),
DisconnectReason::Kill => print_str("GDB sent a kill command"),
},
Err(e) => {
if e.is_target_error() {
print_str("Target raised a fatal error");
} else {
print_str("gdbstub internal error");
}
}
}
Ok(())
}
#[no_mangle]
extern "C" fn main(_argc: isize, _argv: *const *const u8) -> isize {
if let Err(e) = rust_main() {
return e as isize;
}
0
}
================================================
FILE: example_no_std/src/print_str.rs
================================================
pub fn print_str(s: &str) {
unsafe {
libc::write(1, s.as_ptr() as _, s.len());
libc::write(1, "\n".as_ptr() as _, 1);
}
}
================================================
FILE: examples/armv4t/README.md
================================================
# armv4t
An incredibly simple emulator to run elf binaries compiled with `arm-none-eabi-cc -march=armv4t`.
This emulator isn't based off any particular system -- it's moreso just a test-bed for showing off various bits of `gdbstub` functionality.
## Usage
Run `gdb-arm-none-eabi` (or alternatively, `gdb-multiarch`) from the `test_bin` directory to automatically connect to the emulator + load debug symbols for the emulated binary.
This example can be run using:
```bash
cargo run --example armv4t --features=std
```
**NOTE:** If debug symbols couldn't be loaded, try rebuilding `test.elf` locally (requires the `arm-none-eabi` toolchain to be installed), and recompiling the example.
### Unix Domain Sockets
GDB versions since \~2018 support running a debugging session over Unix Domain Sockets (UDS). Debugging over UDS can feel much snappier than debugging over loopback TCP.
Running the example with the `--uds` flag will bind the GdbStub to a socket at `/tmp/armv4t_gdb`.
This feature is only supported on Unix-like systems.
================================================
FILE: examples/armv4t/emu.rs
================================================
use crate::mem_sniffer::AccessKind;
use crate::mem_sniffer::MemSniffer;
use crate::DynResult;
use armv4t_emu::reg;
use armv4t_emu::Cpu;
use armv4t_emu::ExampleMem;
use armv4t_emu::Memory;
use armv4t_emu::Mode;
use gdbstub::common::Pid;
use gdbstub::target::ext::tracepoints::NewTracepoint;
use gdbstub::target::ext::tracepoints::SourceTracepoint;
use gdbstub::target::ext::tracepoints::Tracepoint;
use gdbstub::target::ext::tracepoints::TracepointAction;
use gdbstub::target::ext::tracepoints::TracepointEnumerateState;
use std::collections::BTreeMap;
const HLE_RETURN_ADDR: u32 = 0x12345678;
#[derive(Debug, Copy, Clone, PartialEq, Eq)]
pub enum Event {
DoneStep,
Halted,
Break,
WatchWrite(u32),
WatchRead(u32),
}
pub enum ExecMode {
Step,
Continue,
RangeStep(u32, u32),
}
#[derive(Debug)]
pub struct TraceFrame {
pub number: Tracepoint,
pub snapshot: Cpu,
}
/// incredibly barebones armv4t-based emulator
pub struct Emu {
start_addr: u32,
// example custom register. only read/written to from the GDB client
pub(crate) custom_reg: u32,
pub(crate) exec_mode: ExecMode,
pub(crate) cpu: Cpu,
pub(crate) mem: ExampleMem,
pub(crate) watchpoints: Vec<u32>,
pub(crate) breakpoints: Vec<u32>,
pub(crate) files: Vec<Option<std::fs::File>>,
pub(crate) tracepoints: BTreeMap<
Tracepoint,
(
NewTracepoint<u32>,
Vec<SourceTracepoint<'static, u32>>,
Vec<TracepointAction<'static, u32>>,
),
>,
pub(crate) traceframes: Vec<TraceFrame>,
pub(crate) tracepoint_enumerate_state: TracepointEnumerateState<u32>,
pub(crate) tracing: bool,
pub(crate) selected_frame: Option<usize>,
pub(crate) reported_pid: Pid,
}
impl Emu {
pub fn new(program_elf: &[u8]) -> DynResult<Emu> {
// set up emulated system
let mut cpu = Cpu::new();
let mut mem = ExampleMem::new();
// load ELF
let elf_header = goblin::elf::Elf::parse(program_elf)?;
// copy all in-memory sections from the ELF file into system RAM
let sections = elf_header
.section_headers
.iter()
.filter(|h| h.is_alloc() && h.sh_type != goblin::elf::section_header::SHT_NOBITS);
for h in sections {
eprintln!(
"loading section {:?} into memory from [{:#010x?}..{:#010x?}]",
elf_header.shdr_strtab.get_at(h.sh_name).unwrap(),
h.sh_addr,
h.sh_addr + h.sh_size,
);
for (i, b) in program_elf[h.file_range().unwrap()].iter().enumerate() {
mem.w8(h.sh_addr as u32 + i as u32, *b);
}
}
// setup execution state
eprintln!("Setting PC to {:#010x?}", elf_header.entry);
cpu.reg_set(Mode::User, reg::SP, 0x10000000);
cpu.reg_set(Mode::User, reg::LR, HLE_RETURN_ADDR);
cpu.reg_set(Mode::User, reg::PC, elf_header.entry as u32);
cpu.reg_set(Mode::User, reg::CPSR, 0x10); // user mode
Ok(Emu {
start_addr: elf_header.entry as u32,
custom_reg: 0x12345678,
exec_mode: ExecMode::Continue,
cpu,
mem,
watchpoints: Vec::new(),
breakpoints: Vec::new(),
files: Vec::new(),
tracepoints: BTreeMap::new(),
traceframes: Vec::new(),
tracepoint_enumerate_state: Default::default(),
tracing: false,
selected_frame: None,
reported_pid: Pid::new(1).unwrap(),
})
}
pub(crate) fn reset(&mut self) {
self.cpu.reg_set(Mode::User, reg::SP, 0x10000000);
self.cpu.reg_set(Mode::User, reg::LR, HLE_RETURN_ADDR);
self.cpu.reg_set(Mode::User, reg::PC, self.start_addr);
self.cpu.reg_set(Mode::User, reg::CPSR, 0x10);
}
/// single-step the interpreter
pub fn step(&mut self) -> Option<Event> {
if self.tracing {
let pc = self.cpu.reg_get(self.cpu.mode(), reg::PC);
let frames: Vec<_> = self
.tracepoints
.iter()
.filter(|(_tracepoint, (ctp, _source, _actions))| ctp.enabled && ctp.addr == pc)
.map(|(tracepoint, _definition)| {
// our `tracepoint_define` restricts our loaded tracepoints to only contain
// register collect actions. instead of only collecting the registers requested
// in the register mask and recording a minimal trace frame, we just collect
// all of them by cloning the cpu itself.
TraceFrame {
number: *tracepoint,
snapshot: self.cpu,
}
})
.collect();
self.traceframes.extend(frames);
}
let mut hit_watchpoint = None;
let mut sniffer = MemSniffer::new(&mut self.mem, &self.watchpoints, |access| {
hit_watchpoint = Some(access)
});
self.cpu.step(&mut sniffer);
let pc = self.cpu.reg_get(Mode::User, reg::PC);
if let Some(access) = hit_watchpoint {
let fixup = if self.cpu.thumb_mode() { 2 } else { 4 };
self.cpu.reg_set(Mode::User, reg::PC, pc - fixup);
return Some(match access.kind {
AccessKind::Read => Event::WatchRead(access.addr),
AccessKind::Write => Event::WatchWrite(access.addr),
});
}
if self.breakpoints.contains(&pc) {
return Some(Event::Break);
}
if pc == HLE_RETURN_ADDR {
return Some(Event::Halted);
}
None
}
/// run the emulator in accordance with the currently set `ExecutionMode`.
///
/// since the emulator runs in the same thread as the GDB loop, the emulator
/// will use the provided callback to poll the connection for incoming data
/// every 1024 steps.
pub fn run(&mut self, mut poll_incoming_data: impl FnMut() -> bool) -> RunEvent {
match self.exec_mode {
ExecMode::Step => RunEvent::Event(self.step().unwrap_or(Event::DoneStep)),
ExecMode::Continue => {
let mut cycles = 0;
loop {
if cycles % 1024 == 0 {
// poll for incoming data
if poll_incoming_data() {
break RunEvent::IncomingData;
}
}
cycles += 1;
if let Some(event) = self.step() {
break RunEvent::Event(event);
};
}
}
// just continue, but with an extra PC check
ExecMode::RangeStep(start, end) => {
let mut cycles = 0;
loop {
if cycles % 1024 == 0 {
// poll for incoming data
if poll_incoming_data() {
break RunEvent::IncomingData;
}
}
cycles += 1;
if let Some(event) = self.step() {
break RunEvent::Event(event);
};
if !(start..end).contains(&self.cpu.reg_get(self.cpu.mode(), reg::PC)) {
break RunEvent::Event(Event::DoneStep);
}
}
}
}
}
}
pub enum RunEvent {
IncomingData,
Event(Event),
}
================================================
FILE: examples/armv4t/gdb/auxv.rs
================================================
use super::copy_range_to_buf;
use crate::emu::Emu;
use gdbstub::target;
use gdbstub::target::TargetResult;
impl target::ext::auxv::Auxv for Emu {
fn get_auxv(&self, offset: u64, length: usize, buf: &mut [u8]) -> TargetResult<usize, Self> {
let auxv = b"\x00\x00\x00\x00\x00\x00\x00\x00";
Ok(copy_range_to_buf(auxv, offset, length, buf))
}
}
================================================
FILE: examples/armv4t/gdb/breakpoints.rs
================================================
use crate::emu::Emu;
use gdbstub::target;
use gdbstub::target::ext::breakpoints::WatchKind;
use gdbstub::target::TargetResult;
impl target::ext::breakpoints::Breakpoints for Emu {
#[inline(always)]
fn support_sw_breakpoint(
&mut self,
) -> Option<target::ext::breakpoints::SwBreakpointOps<'_, Self>> {
Some(self)
}
#[inline(always)]
fn support_hw_watchpoint(
&mut self,
) -> Option<target::ext::breakpoints::HwWatchpointOps<'_, Self>> {
Some(self)
}
}
impl target::ext::breakpoints::SwBreakpoint for Emu {
fn add_sw_breakpoint(
&mut self,
addr: u32,
_kind: gdbstub_arch::arm::ArmBreakpointKind,
) -> TargetResult<bool, Self> {
self.breakpoints.push(addr);
Ok(true)
}
fn remove_sw_breakpoint(
&mut self,
addr: u32,
_kind: gdbstub_arch::arm::ArmBreakpointKind,
) -> TargetResult<bool, Self> {
match self.breakpoints.iter().position(|x| *x == addr) {
None => return Ok(false),
Some(pos) => self.breakpoints.remove(pos),
};
Ok(true)
}
}
impl target::ext::breakpoints::HwWatchpoint for Emu {
fn add_hw_watchpoint(
&mut self,
addr: u32,
len: u32,
kind: WatchKind,
) -> TargetResult<bool, Self> {
for addr in addr..(addr + len) {
match kind {
WatchKind::Write => self.watchpoints.push(addr),
WatchKind::Read => self.watchpoints.push(addr),
WatchKind::ReadWrite => self.watchpoints.push(addr),
};
}
Ok(true)
}
fn remove_hw_watchpoint(
&mut self,
addr: u32,
len: u32,
kind: WatchKind,
) -> TargetResult<bool, Self> {
for addr in addr..(addr + len) {
let pos = match self.watchpoints.iter().position(|x| *x == addr) {
None => return Ok(false),
Some(pos) => pos,
};
match kind {
WatchKind::Write => self.watchpoints.remove(pos),
WatchKind::Read => self.watchpoints.remove(pos),
WatchKind::ReadWrite => self.watchpoints.remove(pos),
};
}
Ok(true)
}
}
================================================
FILE: examples/armv4t/gdb/catch_syscalls.rs
================================================
use crate::gdb::Emu;
use gdbstub::target;
use gdbstub::target::ext::catch_syscalls::SyscallNumbers;
// This implementation is for illustrative purposes only. If the target doesn't
// support syscalls then there is no need to implement this extension
impl target::ext::catch_syscalls::CatchSyscalls for Emu {
fn enable_catch_syscalls(
&mut self,
filter: Option<SyscallNumbers<'_, u32>>,
) -> target::TargetResult<(), Self> {
match filter {
Some(numbers) => eprintln!(
"Enabled catching syscalls: {:?}",
numbers.collect::<Vec<u32>>()
),
None => eprintln!("Enabled catching all syscalls"),
}
Ok(())
}
fn disable_catch_syscalls(&mut self) -> target::TargetResult<(), Self> {
eprintln!("Disabled catching syscalls");
Ok(())
}
}
================================================
FILE: examples/armv4t/gdb/exec_file.rs
================================================
use super::copy_range_to_buf;
use crate::emu::Emu;
use gdbstub::common::Pid;
use gdbstub::target;
use gdbstub::target::TargetResult;
impl target::ext::exec_file::ExecFile for Emu {
fn get_exec_file(
&self,
_pid: Option<Pid>,
offset: u64,
length: usize,
buf: &mut [u8],
) -> TargetResult<usize, Self> {
let filename = b"/test.elf";
Ok(copy_range_to_buf(filename, offset, length, buf))
}
}
================================================
FILE: examples/armv4t/gdb/extended_mode.rs
================================================
use crate::emu::Emu;
use gdbstub::common::Pid;
use gdbstub::target;
use gdbstub::target::ext::extended_mode::Args;
use gdbstub::target::ext::extended_mode::AttachKind;
use gdbstub::target::ext::extended_mode::ShouldTerminate;
use gdbstub::target::TargetResult;
/*=====================================
= Extended Mode =
=====================================*/
// This is a stub implementation of GDB's Extended Mode extensions.
//
// Truth be told, this particular emulator is _not_ very well suited to running
// in extended mode, as it doesn't technically spawn/attach to any process.
// Nonetheless, it's useful to have a stubbed implementation in-tree which can
// be used for basic usability / regression testing.
//
// If you happen to implement a "proper" extended mode gdbstub, feel free to
// file an issue / open a PR that links to your project!
impl target::ext::extended_mode::ExtendedMode for Emu {
fn kill(&mut self, pid: Option<Pid>) -> TargetResult<ShouldTerminate, Self> {
eprintln!("GDB sent a kill request for pid {:?}", pid);
Ok(ShouldTerminate::No)
}
fn restart(&mut self) -> Result<(), Self::Error> {
eprintln!("GDB sent a restart request");
Ok(())
}
fn attach(&mut self, pid: Pid) -> TargetResult<(), Self> {
eprintln!("GDB attached to a process with PID {}", pid);
// stub implementation: just report the same code, but running under a
// different pid.
self.reported_pid = pid;
Ok(())
}
fn run(&mut self, filename: Option<&[u8]>, args: Args<'_, '_>) -> TargetResult<Pid, Self> {
// simplified example: assume UTF-8 filenames / args
//
// To be 100% pedantically correct, consider converting to an `OsStr` in the
// least lossy way possible (e.g: using the `from_bytes` extension from
// `std::os::unix::ffi::OsStrExt`).
let filename = match filename {
None => None,
Some(raw) => Some(core::str::from_utf8(raw).map_err(drop)?),
};
let args = args
.map(|raw| core::str::from_utf8(raw).map_err(drop))
.collect::<Result<Vec<_>, _>>()?;
eprintln!(
"GDB tried to run a new process with filename {:?}, and args {:?}",
filename, args
);
self.reset();
// when running in single-threaded mode, this PID can be anything
Ok(Pid::new(1337).unwrap())
}
fn query_if_attached(&mut self, pid: Pid) -> TargetResult<AttachKind, Self> {
eprintln!(
"GDB queried if it was attached to a process with PID {}",
pid
);
Ok(AttachKind::Attach)
}
#[inline(always)]
fn support_configure_aslr(
&mut self,
) -> Option<target::ext::extended_mode::ConfigureAslrOps<'_, Self>> {
Some(self)
}
#[inline(always)]
fn support_configure_env(
&mut self,
) -> Option<target::ext::extended_mode::ConfigureEnvOps<'_, Self>> {
Some(self)
}
#[inline(always)]
fn support_configure_startup_shell(
&mut self,
) -> Option<target::ext::extended_mode::ConfigureStartupShellOps<'_, Self>> {
Some(self)
}
#[inline(always)]
fn support_configure_working_dir(
&mut self,
) -> Option<target::ext::extended_mode::ConfigureWorkingDirOps<'_, Self>> {
Some(self)
}
#[inline(always)]
fn support_current_active_pid(
&mut self,
) -> Option<target::ext::extended_mode::CurrentActivePidOps<'_, Self>> {
Some(self)
}
}
impl target::ext::extended_mode::ConfigureAslr for Emu {
fn cfg_aslr(&mut self, enabled: bool) -> TargetResult<(), Self> {
eprintln!("GDB {} ASLR", if enabled { "enabled" } else { "disabled" });
Ok(())
}
}
impl target::ext::extended_mode::ConfigureEnv for Emu {
fn set_env(&mut self, key: &[u8], val: Option<&[u8]>) -> TargetResult<(), Self> {
// simplified example: assume UTF-8 key/val env vars
let key = core::str::from_utf8(key).map_err(drop)?;
let val = match val {
None => None,
Some(raw) => Some(core::str::from_utf8(raw).map_err(drop)?),
};
eprintln!("GDB tried to set a new env var: {:?}={:?}", key, val);
Ok(())
}
fn remove_env(&mut self, key: &[u8]) -> TargetResult<(), Self> {
let key = core::str::from_utf8(key).map_err(drop)?;
eprintln!("GDB tried to set remove a env var: {:?}", key);
Ok(())
}
fn reset_env(&mut self) -> TargetResult<(), Self> {
eprintln!("GDB tried to reset env vars");
Ok(())
}
}
impl target::ext::extended_mode::ConfigureStartupShell for Emu {
fn cfg_startup_with_shell(&mut self, enabled: bool) -> TargetResult<(), Self> {
eprintln!(
"GDB {} startup with shell",
if enabled { "enabled" } else { "disabled" }
);
Ok(())
}
}
impl target::ext::extended_mode::ConfigureWorkingDir for Emu {
fn cfg_working_dir(&mut self, dir: Option<&[u8]>) -> TargetResult<(), Self> {
let dir = match dir {
None => None,
Some(raw) => Some(core::str::from_utf8(raw).map_err(drop)?),
};
match dir {
None => eprintln!("GDB reset the working directory"),
Some(dir) => eprintln!("GDB set the working directory to {:?}", dir),
}
Ok(())
}
}
impl target::ext::extended_mode::CurrentActivePid for Emu {
fn current_active_pid(&mut self) -> Result<Pid, Self::Error> {
Ok(self.reported_pid)
}
}
================================================
FILE: examples/armv4t/gdb/flash.rs
================================================
use crate::emu::Emu;
use gdbstub::target;
use gdbstub::target::TargetResult;
impl target::ext::flash::Flash for Emu {
fn flash_erase(&mut self, start_addr: u32, length: u32) -> TargetResult<(), Self> {
log::info!("flash_erase start_addr: {start_addr:08x}, length: {length:08x}");
Ok(())
}
fn flash_write(&mut self, start_addr: u32, _data: &[u8]) -> TargetResult<(), Self> {
log::info!("flash_write start_addr: {start_addr:08x}");
Ok(())
}
fn flash_done(&mut self) -> TargetResult<(), Self> {
log::info!("flash_done");
Ok(())
}
}
================================================
FILE: examples/armv4t/gdb/host_io.rs
================================================
use super::copy_range_to_buf;
use super::copy_to_buf;
use crate::emu::Emu;
use crate::TEST_PROGRAM_ELF;
use gdbstub::target;
use gdbstub::target::ext::host_io::FsKind;
use gdbstub::target::ext::host_io::HostIoErrno;
use gdbstub::target::ext::host_io::HostIoError;
use gdbstub::target::ext::host_io::HostIoOpenFlags;
use gdbstub::target::ext::host_io::HostIoOpenMode;
use gdbstub::target::ext::host_io::HostIoResult;
use gdbstub::target::ext::host_io::HostIoStat;
use std::io::Read;
use std::io::Seek;
use std::io::Write;
const FD_RESERVED: u32 = 1;
impl target::ext::host_io::HostIo for Emu {
#[inline(always)]
fn support_open(&mut self) -> Option<target::ext::host_io::HostIoOpenOps<'_, Self>> {
Some(self)
}
#[inline(always)]
fn support_close(&mut self) -> Option<target::ext::host_io::HostIoCloseOps<'_, Self>> {
Some(self)
}
#[inline(always)]
fn support_pread(&mut self) -> Option<target::ext::host_io::HostIoPreadOps<'_, Self>> {
Some(self)
}
#[inline(always)]
fn support_pwrite(&mut self) -> Option<target::ext::host_io::HostIoPwriteOps<'_, Self>> {
Some(self)
}
#[inline(always)]
fn support_fstat(&mut self) -> Option<target::ext::host_io::HostIoFstatOps<'_, Self>> {
Some(self)
}
#[inline(always)]
fn support_unlink(&mut self) -> Option<target::ext::host_io::HostIoUnlinkOps<'_, Self>> {
Some(self)
}
#[inline(always)]
fn support_readlink(&mut self) -> Option<target::ext::host_io::HostIoReadlinkOps<'_, Self>> {
Some(self)
}
#[inline(always)]
fn support_setfs(&mut self) -> Option<target::ext::host_io::HostIoSetfsOps<'_, Self>> {
Some(self)
}
}
impl target::ext::host_io::HostIoOpen for Emu {
fn open(
&mut self,
filename: &[u8],
flags: HostIoOpenFlags,
_mode: HostIoOpenMode,
) -> HostIoResult<u32, Self> {
if filename.starts_with(b"/proc") {
return Err(HostIoError::Errno(HostIoErrno::ENOENT));
}
// In this example, the test binary is compiled into the binary itself as the
// `TEST_PROGRAM_ELF` array using `include_bytes!`. As such, we must "spoof" the
// existence of a real file, which will actually be backed by the in-binary
// `TEST_PROGRAM_ELF` array.
if filename == b"/test.elf" {
return Ok(0);
}
let path =
std::str::from_utf8(filename).map_err(|_| HostIoError::Errno(HostIoErrno::ENOENT))?;
let mut read = false;
let mut write = false;
if flags.contains(HostIoOpenFlags::O_RDWR) {
read = true;
write = true;
} else if flags.contains(HostIoOpenFlags::O_WRONLY) {
write = true;
} else {
read = true;
}
let file = std::fs::OpenOptions::new()
.read(read)
.write(write)
.append(flags.contains(HostIoOpenFlags::O_APPEND))
.create(flags.contains(HostIoOpenFlags::O_CREAT))
.truncate(flags.contains(HostIoOpenFlags::O_TRUNC))
.create_new(flags.contains(HostIoOpenFlags::O_EXCL))
.open(path)?;
let n = match self.files.iter_mut().enumerate().find(|(_, f)| f.is_none()) {
Some((n, free_file)) => {
*free_file = Some(file);
n
}
None => {
self.files.push(Some(file));
self.files.len() - 1
}
};
Ok(n as u32 + FD_RESERVED)
}
}
impl target::ext::host_io::HostIoClose for Emu {
fn close(&mut self, fd: u32) -> HostIoResult<(), Self> {
if fd < FD_RESERVED {
return Ok(());
}
let file = match self.files.get_mut((fd - FD_RESERVED) as usize) {
Some(file) => file,
_ => return Err(HostIoError::Errno(HostIoErrno::EBADF)),
};
file.take().ok_or(HostIoError::Errno(HostIoErrno::EBADF))?;
while let Some(None) = self.files.last() {
self.files.pop();
}
Ok(())
}
}
impl target::ext::host_io::HostIoPread for Emu {
fn pread<'a>(
&mut self,
fd: u32,
count: usize,
offset: u64,
buf: &mut [u8],
) -> HostIoResult<usize, Self> {
if fd < FD_RESERVED {
if fd == 0 {
return Ok(copy_range_to_buf(TEST_PROGRAM_ELF, offset, count, buf));
} else {
return Err(HostIoError::Errno(HostIoErrno::EBADF));
}
}
let file = match self.files.get_mut((fd - FD_RESERVED) as usize) {
Some(Some(file)) => file,
_ => return Err(HostIoError::Errno(HostIoErrno::EBADF)),
};
file.seek(std::io::SeekFrom::Start(offset))?;
let n = file.read(buf)?;
Ok(n)
}
}
impl target::ext::host_io::HostIoPwrite for Emu {
fn pwrite(&mut self, fd: u32, offset: u32, data: &[u8]) -> HostIoResult<u32, Self> {
if fd < FD_RESERVED {
return Err(HostIoError::Errno(HostIoErrno::EACCES));
}
let file = match self.files.get_mut((fd - FD_RESERVED) as usize) {
Some(Some(file)) => file,
_ => return Err(HostIoError::Errno(HostIoErrno::EBADF)),
};
file.seek(std::io::SeekFrom::Start(offset as u64))?;
let n = file.write(data)?;
Ok(n as u32)
}
}
impl target::ext::host_io::HostIoFstat for Emu {
fn fstat(&mut self, fd: u32) -> HostIoResult<HostIoStat, Self> {
if fd < FD_RESERVED {
if fd == 0 {
return Ok(HostIoStat {
st_dev: 0,
st_ino: 0,
st_mode: HostIoOpenMode::empty(),
st_nlink: 0,
st_uid: 0,
st_gid: 0,
st_rdev: 0,
st_size: TEST_PROGRAM_ELF.len() as u64,
st_blksize: 0,
st_blocks: 0,
st_atime: 0,
st_mtime: 0,
st_ctime: 0,
});
} else {
return Err(HostIoError::Errno(HostIoErrno::EBADF));
}
}
let metadata = match self.files.get((fd - FD_RESERVED) as usize) {
Some(Some(file)) => file.metadata()?,
_ => return Err(HostIoError::Errno(HostIoErrno::EBADF)),
};
macro_rules! time_to_secs {
($time:expr) => {
$time
.map_err(|_| HostIoError::Errno(HostIoErrno::EACCES))?
.duration_since(std::time::SystemTime::UNIX_EPOCH)
.map_err(|_| HostIoError::Errno(HostIoErrno::EACCES))?
.as_secs() as u32
};
}
let atime = time_to_secs!(metadata.accessed());
let mtime = time_to_secs!(metadata.modified());
let ctime = time_to_secs!(metadata.created());
Ok(HostIoStat {
st_dev: 0,
st_ino: 0,
st_mode: HostIoOpenMode::empty(),
st_nlink: 0,
st_uid: 0,
st_gid: 0,
st_rdev: 0,
st_size: metadata.len(),
st_blksize: 0,
st_blocks: 0,
st_atime: atime,
st_mtime: mtime,
st_ctime: ctime,
})
}
}
impl target::ext::host_io::HostIoUnlink for Emu {
fn unlink(&mut self, filename: &[u8]) -> HostIoResult<(), Self> {
let path =
std::str::from_utf8(filename).map_err(|_| HostIoError::Errno(HostIoErrno::ENOENT))?;
std::fs::remove_file(path)?;
Ok(())
}
}
impl target::ext::host_io::HostIoReadlink for Emu {
fn readlink<'a>(&mut self, filename: &[u8], buf: &mut [u8]) -> HostIoResult<usize, Self> {
if filename == b"/proc/1/exe" {
// Support `info proc exe` command
let exe = b"/test.elf";
return Ok(copy_to_buf(exe, buf));
} else if filename == b"/proc/1/cwd" {
// Support `info proc cwd` command
let cwd = b"/";
return Ok(copy_to_buf(cwd, buf));
} else if filename.starts_with(b"/proc") {
return Err(HostIoError::Errno(HostIoErrno::ENOENT));
}
let path =
std::str::from_utf8(filename).map_err(|_| HostIoError::Errno(HostIoErrno::ENOENT))?;
let link = std::fs::read_link(path)?;
let data = link
.to_str()
.ok_or(HostIoError::Errno(HostIoErrno::ENOENT))?
.as_bytes();
if data.len() <= buf.len() {
Ok(copy_to_buf(data, buf))
} else {
Err(HostIoError::Errno(HostIoErrno::ENAMETOOLONG))
}
}
}
impl target::ext::host_io::HostIoSetfs for Emu {
fn setfs(&mut self, _fs: FsKind) -> HostIoResult<(), Self> {
Ok(())
}
}
================================================
FILE: examples/armv4t/gdb/libraries.rs
================================================
use super::copy_range_to_buf;
use crate::emu::Emu;
use gdbstub::target;
use gdbstub::target::TargetResult;
impl target::ext::libraries::LibrariesSvr4 for Emu {
fn get_libraries_svr4(
&self,
offset: u64,
length: usize,
buf: &mut [u8],
) -> TargetResult<usize, Self> {
// `l_ld` is the address of the `PT_DYNAMIC` ELF segment, so fake an
// address here.
//
// The `main-lm`, `lm`, and `lmid` seem to refer to in-memory structures
// which gdb may read, but gdb also seems to work well enough if they're
// null-ish or otherwise pointing to non-present things.
let xml = r#"
<library-list-svr4 version="1.0" main-lm="0x4">
<library name="/test.elf" lm="0x8" l_addr="0" l_ld="0" lmid="0x14"/>
</library-list-svr4>
"#
.trim()
.as_bytes();
Ok(copy_range_to_buf(xml, offset, length, buf))
}
}
impl target::ext::libraries::Libraries for Emu {
fn get_libraries(
&self,
offset: u64,
length: usize,
buf: &mut [u8],
) -> TargetResult<usize, Self> {
// This is the Windows/generic library list format, which uses segment
// addresses instead of the SVR4 link_map structure.
//
// Note: on Windows, the `address` is not the image base, but the
// address of the first section (typically .text).
let xml = r#"
<library-list>
<library name="/test.elf"><segment address="0x55550000"/></library>
</library-list>
"#
.trim()
.as_bytes();
Ok(copy_range_to_buf(xml, offset, length, buf))
}
}
================================================
FILE: examples/armv4t/gdb/lldb_register_info_override.rs
================================================
use crate::gdb::custom_arch::ArmCoreRegIdCustom;
use crate::gdb::Emu;
use gdbstub::arch::lldb::Encoding;
use gdbstub::arch::lldb::Format;
use gdbstub::arch::lldb::Generic;
use gdbstub::arch::lldb::Register;
use gdbstub::arch::RegId;
use gdbstub::target;
use gdbstub::target::ext::lldb_register_info_override::Callback;
use gdbstub::target::ext::lldb_register_info_override::CallbackToken;
use gdbstub_arch::arm::reg::id::ArmCoreRegId;
// (LLDB extension) This implementation is for illustrative purposes only.
//
// Note: In this implementation, we have r0-pc from 0-16 but cpsr is at offset
// 25*4 in the 'g'/'G' packets, so we add 8 padding registers here. Please see
// gdbstub/examples/armv4t/gdb/target_description_xml_override.rs for more info.
impl target::ext::lldb_register_info_override::LldbRegisterInfoOverride for Emu {
fn lldb_register_info<'a>(
&mut self,
reg_id: usize,
reg_info: Callback<'a>,
) -> Result<CallbackToken<'a>, Self::Error> {
match ArmCoreRegIdCustom::from_raw_id(reg_id) {
Some((_, None)) | None => Ok(reg_info.done()),
Some((r, Some(size))) => {
let name: String = match r {
// For the purpose of demonstration, we end the qRegisterInfo packet exchange
// when reaching the Time register id, so that this register can only be
// explicitly queried via the single-register read packet.
ArmCoreRegIdCustom::Time => return Ok(reg_info.done()),
ArmCoreRegIdCustom::Core(ArmCoreRegId::Gpr(i)) => match i {
0 => "r0",
1 => "r1",
2 => "r2",
3 => "r3",
4 => "r4",
5 => "r5",
6 => "r6",
7 => "r7",
8 => "r8",
9 => "r9",
10 => "r10",
11 => "r11",
12 => "r12",
_ => "unknown",
},
ArmCoreRegIdCustom::Core(ArmCoreRegId::Sp) => "sp",
ArmCoreRegIdCustom::Core(ArmCoreRegId::Lr) => "lr",
ArmCoreRegIdCustom::Core(ArmCoreRegId::Pc) => "pc",
ArmCoreRegIdCustom::Core(ArmCoreRegId::Fpr(_i)) => "padding",
ArmCoreRegIdCustom::Core(ArmCoreRegId::Fps) => "padding",
ArmCoreRegIdCustom::Core(ArmCoreRegId::Cpsr) => "cpsr",
ArmCoreRegIdCustom::Custom => "custom",
_ => "unknown",
}
.into();
let encoding = match r {
ArmCoreRegIdCustom::Core(ArmCoreRegId::Gpr(_i)) => Encoding::Uint,
ArmCoreRegIdCustom::Core(ArmCoreRegId::Sp)
| ArmCoreRegIdCustom::Core(ArmCoreRegId::Pc)
| ArmCoreRegIdCustom::Core(ArmCoreRegId::Cpsr)
| ArmCoreRegIdCustom::Custom => Encoding::Uint,
_ => Encoding::Vector,
};
let format = match r {
ArmCoreRegIdCustom::Core(ArmCoreRegId::Gpr(_i)) => Format::Hex,
ArmCoreRegIdCustom::Core(ArmCoreRegId::Sp)
| ArmCoreRegIdCustom::Core(ArmCoreRegId::Pc)
| ArmCoreRegIdCustom::Core(ArmCoreRegId::Cpsr)
| ArmCoreRegIdCustom::Custom => Format::Hex,
_ => Format::VectorUInt8,
};
let set: String = match r {
ArmCoreRegIdCustom::Core(ArmCoreRegId::Gpr(_i)) => "General Purpose Registers",
ArmCoreRegIdCustom::Core(ArmCoreRegId::Sp)
| ArmCoreRegIdCustom::Core(ArmCoreRegId::Pc)
| ArmCoreRegIdCustom::Core(ArmCoreRegId::Cpsr)
| ArmCoreRegIdCustom::Custom => "General Purpose Registers",
_ => "Floating Point Registers",
}
.into();
let generic = match r {
ArmCoreRegIdCustom::Core(ArmCoreRegId::Sp) => Some(Generic::Sp),
ArmCoreRegIdCustom::Core(ArmCoreRegId::Pc) => Some(Generic::Pc),
_ => None,
};
let reg = Register {
name: &name,
alt_name: None,
bitsize: (usize::from(size)) * 8,
offset: reg_id * (usize::from(size)),
encoding,
format,
set: &set,
gcc: None,
dwarf: Some(reg_id),
generic,
container_regs: None,
invalidate_regs: None,
};
Ok(reg_info.write(reg))
}
}
}
}
================================================
FILE: examples/armv4t/gdb/memory_map.rs
================================================
use super::copy_range_to_buf;
use crate::emu::Emu;
use gdbstub::target;
use gdbstub::target::TargetResult;
impl target::ext::memory_map::MemoryMap for Emu {
fn memory_map_xml(
&self,
offset: u64,
length: usize,
buf: &mut [u8],
) -> TargetResult<usize, Self> {
let memory_map = r#"<?xml version="1.0"?>
<!DOCTYPE memory-map
PUBLIC "+//IDN gnu.org//DTD GDB Memory Map V1.0//EN"
"http://sourceware.org/gdb/gdb-memory-map.dtd">
<memory-map>
<memory type="ram" start="0x00000000" length="0x10000000"/>
<memory type="ram" start="0x12340000" length="0x10000"/>
<memory type="flash" start="0x55550000" length="0x10000000">
<property name="blocksize">0x1000</property>
</memory>
</memory-map>"#
.trim()
.as_bytes();
Ok(copy_range_to_buf(memory_map, offset, length, buf))
}
}
================================================
FILE: examples/armv4t/gdb/mod.rs
================================================
use crate::emu::Emu;
use crate::emu::ExecMode;
use armv4t_emu::reg;
use armv4t_emu::Memory;
use core::convert::TryInto;
use gdbstub::common::Signal;
use gdbstub::target;
use gdbstub::target::ext::base::singlethread::SingleThreadBase;
use gdbstub::target::ext::base::singlethread::SingleThreadResume;
use gdbstub::target::Target;
use gdbstub::target::TargetError;
use gdbstub::target::TargetResult;
use gdbstub_arch::arm::reg::id::ArmCoreRegId;
// Additional GDB extensions
mod auxv;
mod breakpoints;
mod catch_syscalls;
mod exec_file;
mod extended_mode;
mod flash;
mod host_io;
mod libraries;
mod lldb_register_info_override;
mod memory_map;
mod monitor_cmd;
mod section_offsets;
mod target_description_xml_override;
pub(crate) mod tracepoints;
/// Turn a `ArmCoreRegId` into an internal register number of `armv4t_emu`.
fn cpu_reg_id(id: ArmCoreRegId) -> Option<u8> {
match id {
ArmCoreRegId::Gpr(i) => Some(i),
ArmCoreRegId::Sp => Some(reg::SP),
ArmCoreRegId::Lr => Some(reg::LR),
ArmCoreRegId::Pc => Some(reg::PC),
ArmCoreRegId::Cpsr => Some(reg::CPSR),
_ => None,
}
}
/// Copy all bytes of `data` to `buf`.
/// Return the size of data copied.
pub fn copy_to_buf(data: &[u8], buf: &mut [u8]) -> usize {
let len = buf.len().min(data.len());
buf[..len].copy_from_slice(&data[..len]);
len
}
/// Copy a range of `data` (start at `offset` with a size of `length`) to `buf`.
/// Return the size of data copied. Returns 0 if `offset >= buf.len()`.
///
/// Mainly used by qXfer:_object_:read commands.
pub fn copy_range_to_buf(data: &[u8], offset: u64, length: usize, buf: &mut [u8]) -> usize {
let offset = offset as usize;
if offset > data.len() {
return 0;
}
let start = offset;
let end = (offset + length).min(data.len());
copy_to_buf(&data[start..end], buf)
}
impl Target for Emu {
// As an example, I've defined a custom architecture based off
// `gdbstub_arch::arm::Armv4t`. The implementation is in the `custom_arch`
// module at the bottom of this file.
//
// unless you're working with a particularly funky architecture that uses custom
// registers, you should probably stick to using the simple `target.xml`
// implementations from the `gdbstub_arch` repo (i.e: `target.xml` files that
// only specify the <architecture> and <feature>s of the arch, instead of
// listing out all the registers out manually).
type Arch = custom_arch::Armv4tCustom;
type Error = &'static str;
// --------------- IMPORTANT NOTE ---------------
// Always remember to annotate IDET enable methods with `inline(always)`!
// Without this annotation, LLVM might fail to dead-code-eliminate nested IDET
// implementations, resulting in unnecessary binary bloat.
#[inline(always)]
fn base_ops(&mut self) -> target::ext::base::BaseOps<'_, Self::Arch, Self::Error> {
target::ext::base::BaseOps::SingleThread(self)
}
#[inline(always)]
fn support_breakpoints(
&mut self,
) -> Option<target::ext::breakpoints::BreakpointsOps<'_, Self>> {
Some(self)
}
#[inline(always)]
fn support_extended_mode(
&mut self,
) -> Option<target::ext::extended_mode::ExtendedModeOps<'_, Self>> {
Some(self)
}
#[inline(always)]
fn support_monitor_cmd(&mut self) -> Option<target::ext::monitor_cmd::MonitorCmdOps<'_, Self>> {
Some(self)
}
#[inline(always)]
fn support_section_offsets(
&mut self,
) -> Option<target::ext::section_offsets::SectionOffsetsOps<'_, Self>> {
Some(self)
}
#[inline(always)]
fn support_target_description_xml_override(
&mut self,
) -> Option<
target::ext::target_description_xml_override::TargetDescriptionXmlOverrideOps<'_, Self>,
> {
Some(self)
}
#[inline(always)]
fn support_lldb_register_info_override(
&mut self,
) -> Option<target::ext::lldb_register_info_override::LldbRegisterInfoOverrideOps<'_, Self>>
{
Some(self)
}
#[inline(always)]
fn support_memory_map(&mut self) -> Option<target::ext::memory_map::MemoryMapOps<'_, Self>> {
Some(self)
}
#[inline(always)]
fn support_catch_syscalls(
&mut self,
) -> Option<target::ext::catch_syscalls::CatchSyscallsOps<'_, Self>> {
Some(self)
}
#[inline(always)]
fn support_host_io(&mut self) -> Option<target::ext::host_io::HostIoOps<'_, Self>> {
Some(self)
}
#[inline(always)]
fn support_exec_file(&mut self) -> Option<target::ext::exec_file::ExecFileOps<'_, Self>> {
Some(self)
}
#[inline(always)]
fn support_auxv(&mut self) -> Option<target::ext::auxv::AuxvOps<'_, Self>> {
Some(self)
}
#[inline(always)]
fn support_libraries_svr4(
&mut self,
) -> Option<target::ext::libraries::LibrariesSvr4Ops<'_, Self>> {
Some(self)
}
#[inline(always)]
fn support_libraries(&mut self) -> Option<target::ext::libraries::LibrariesOps<'_, Self>> {
Some(self)
}
#[inline(always)]
fn support_tracepoints(
&mut self,
) -> Option<target::ext::tracepoints::TracepointsOps<'_, Self>> {
Some(self)
}
#[inline(always)]
fn support_flash_operations(&mut self) -> Option<target::ext::flash::FlashOps<'_, Self>> {
Some(self)
}
}
impl SingleThreadBase for Emu {
fn read_registers(
&mut self,
regs: &mut custom_arch::ArmCoreRegsCustom,
) -> TargetResult<(), Self> {
// if we selected a frame from a tracepoint, return registers from that snapshot
let cpu = self
.selected_frame
.and_then(|selected| self.traceframes.get(selected))
.map(|frame| frame.snapshot)
.unwrap_or_else(|| self.cpu);
let mode = cpu.mode();
for i in 0..13 {
regs.core.r[i] = cpu.reg_get(mode, i as u8);
}
regs.core.sp = cpu.reg_get(mode, reg::SP);
regs.core.lr = cpu.reg_get(mode, reg::LR);
regs.core.pc = cpu.reg_get(mode, reg::PC);
regs.core.cpsr = cpu.reg_get(mode, reg::CPSR);
regs.custom = self.custom_reg;
Ok(())
}
fn write_registers(&mut self, regs: &custom_arch::ArmCoreRegsCustom) -> TargetResult<(), Self> {
if self.selected_frame.is_some() {
// we can't modify registers in a tracepoint frame
return Err(TargetError::NonFatal);
}
let mode = self.cpu.mode();
for i in 0..13 {
self.cpu.reg_set(mode, i, regs.core.r[i as usize]);
}
self.cpu.reg_set(mode, reg::SP, regs.core.sp);
self.cpu.reg_set(mode, reg::LR, regs.core.lr);
self.cpu.reg_set(mode, reg::PC, regs.core.pc);
self.cpu.reg_set(mode, reg::CPSR, regs.core.cpsr);
self.custom_reg = regs.custom;
Ok(())
}
#[inline(always)]
fn support_single_register_access(
&mut self,
) -> Option<target::ext::base::single_register_access::SingleRegisterAccessOps<'_, (), Self>>
{
Some(self)
}
fn read_addrs(&mut self, start_addr: u32, data: &mut [u8]) -> TargetResult<usize, Self> {
if self.selected_frame.is_some() {
// we only support register collection actions for our tracepoint frames.
// if we have a selected frame, then we don't have any memory we can
// return from the frame snapshot.
return Ok(0);
}
// this is a simple emulator, with RAM covering the entire 32 bit address space
for (addr, val) in (start_addr..).zip(data.iter_mut()) {
*val = self.mem.r8(addr)
}
Ok(data.len())
}
fn write_addrs(&mut self, start_addr: u32, data: &[u8]) -> TargetResult<(), Self> {
if self.selected_frame.is_some() {
// we can't modify memory in a tracepoint frame
return Err(TargetError::NonFatal);
}
// this is a simple emulator, with RAM covering the entire 32 bit address space
for (addr, val) in (start_addr..).zip(data.iter().copied()) {
self.mem.w8(addr, val)
}
Ok(())
}
#[inline(always)]
fn support_resume(
&mut self,
) -> Option<target::ext::base::singlethread::SingleThreadResumeOps<'_, Self>> {
Some(self)
}
}
impl SingleThreadResume for Emu {
fn resume(&mut self, signal: Option<Signal>) -> Result<(), Self::Error> {
// Upon returning from the `resume` method, the target being debugged should be
// configured to run according to whatever resume actions the GDB client has
// specified (as specified by `set_resume_action`, `resume_range_step`,
// `reverse_{step, continue}`, etc...)
//
// In this basic `armv4t` example, the `resume` method simply sets the exec mode
// of the emulator's interpreter loop and returns.
//
// In more complex implementations, it's likely that the target being debugged
// will be running in another thread / process, and will require some kind of
// external "orchestration" to set it's execution mode (e.g: modifying the
// target's process state via platform specific debugging syscalls).
if signal.is_some() {
return Err("no support for continuing with signal");
}
self.exec_mode = ExecMode::Continue;
Ok(())
}
#[inline(always)]
fn support_reverse_cont(
&mut self,
) -> Option<target::ext::base::reverse_exec::ReverseContOps<'_, (), Self>> {
Some(self)
}
#[inline(always)]
fn support_reverse_step(
&mut self,
) -> Option<target::ext::base::reverse_exec::ReverseStepOps<'_, (), Self>> {
Some(self)
}
#[inline(always)]
fn support_single_step(
&mut self,
) -> Option<target::ext::base::singlethread::SingleThreadSingleStepOps<'_, Self>> {
Some(self)
}
#[inline(always)]
fn support_range_step(
&mut self,
) -> Option<target::ext::base::singlethread::SingleThreadRangeSteppingOps<'_, Self>> {
Some(self)
}
}
impl target::ext::base::singlethread::SingleThreadSingleStep for Emu {
fn step(&mut self, signal: Option<Signal>) -> Result<(), Self::Error> {
if signal.is_some() {
return Err("no support for stepping with signal");
}
self.exec_mode = ExecMode::Step;
Ok(())
}
}
impl target::ext::base::single_register_access::SingleRegisterAccess<()> for Emu {
fn read_register(
&mut self,
_tid: (),
reg_id: custom_arch::ArmCoreRegIdCustom,
buf: &mut [u8],
) -> TargetResult<usize, Self> {
match reg_id {
custom_arch::ArmCoreRegIdCustom::Core(reg_id) => {
if let Some(i) = cpu_reg_id(reg_id) {
let w = self.cpu.reg_get(self.cpu.mode(), i);
buf.copy_from_slice(&w.to_le_bytes());
Ok(buf.len())
} else {
Err(().into())
}
}
custom_arch::ArmCoreRegIdCustom::Custom => {
buf.copy_from_slice(&self.custom_reg.to_le_bytes());
Ok(buf.len())
}
custom_arch::ArmCoreRegIdCustom::Time => {
buf.copy_from_slice(
&(std::time::SystemTime::now()
.duration_since(std::time::UNIX_EPOCH)
.unwrap()
.as_millis() as u32)
.to_le_bytes(),
);
Ok(buf.len())
}
custom_arch::ArmCoreRegIdCustom::Unavailable => Ok(0),
}
}
fn write_register(
&mut self,
_tid: (),
reg_id: custom_arch::ArmCoreRegIdCustom,
val: &[u8],
) -> TargetResult<(), Self> {
let w = u32::from_le_bytes(
val.try_into()
.map_err(|_| TargetError::Fatal("invalid data"))?,
);
match reg_id {
custom_arch::ArmCoreRegIdCustom::Core(reg_id) => {
if let Some(i) = cpu_reg_id(reg_id) {
self.cpu.reg_set(self.cpu.mode(), i, w);
Ok(())
} else {
Err(().into())
}
}
custom_arch::ArmCoreRegIdCustom::Custom => {
self.custom_reg = w;
Ok(())
}
// ignore writes
custom_arch::ArmCoreRegIdCustom::Unavailable
| custom_arch::ArmCoreRegIdCustom::Time => Ok(()),
}
}
}
impl target::ext::base::reverse_exec::ReverseCont<()> for Emu {
fn reverse_cont(&mut self) -> Result<(), Self::Error> {
// FIXME: actually implement reverse step
eprintln!(
"FIXME: Not actually reverse-continuing. Performing forwards continue instead..."
);
self.exec_mode = ExecMode::Continue;
Ok(())
}
}
impl target::ext::base::reverse_exec::ReverseStep<()> for Emu {
fn reverse_step(&mut self, _tid: ()) -> Result<(), Self::Error> {
// FIXME: actually implement reverse step
eprintln!(
"FIXME: Not actually reverse-stepping. Performing single forwards step instead..."
);
self.exec_mode = ExecMode::Step;
Ok(())
}
}
impl target::ext::base::singlethread::SingleThreadRangeStepping for Emu {
fn resume_range_step(&mut self, start: u32, end: u32) -> Result<(), Self::Error> {
self.exec_mode = ExecMode::RangeStep(start, end);
Ok(())
}
}
mod custom_arch {
use core::num::NonZeroUsize;
use gdbstub::arch::lldb::Encoding;
use gdbstub::arch::lldb::Format;
use gdbstub::arch::lldb::Generic;
use gdbstub::arch::lldb::Register;
use gdbstub::arch::lldb::RegisterInfo;
use gdbstub::arch::Arch;
use gdbstub::arch::RegId;
use gdbstub::arch::Registers;
use gdbstub_arch::arm::reg::id::ArmCoreRegId;
use gdbstub_arch::arm::reg::ArmCoreRegs;
use gdbstub_arch::arm::ArmBreakpointKind;
/// Implements `Arch` for ARMv4T
pub enum Armv4tCustom {}
#[derive(Debug, Default, Clone, Eq, PartialEq)]
pub struct ArmCoreRegsCustom {
pub core: ArmCoreRegs,
pub custom: u32,
}
impl Registers for ArmCoreRegsCustom {
type ProgramCounter = u32;
fn pc(&self) -> Self::ProgramCounter {
self.core.pc
}
fn gdb_serialize(&self, mut write_byte: impl FnMut(Option<u8>)) {
self.core.gdb_serialize(&mut write_byte);
macro_rules! write_bytes {
($bytes:expr) => {
for b in $bytes {
write_byte(Some(*b))
}
};
}
write_bytes!(&self.custom.to_le_bytes());
}
fn gdb_deserialize(&mut self, bytes: &[u8]) -> Result<(), ()> {
// ensure bytes.chunks_exact(4) won't panic
if !bytes.len().is_multiple_of(4) {
return Err(());
}
use core::convert::TryInto;
let mut regs = bytes
.chunks_exact(4)
.map(|c| u32::from_le_bytes(c.try_into().unwrap()));
// copied from ArmCoreRegs
{
for reg in self.core.r.iter_mut() {
*reg = regs.next().ok_or(())?
}
self.core.sp = regs.next().ok_or(())?;
self.core.lr = regs.next().ok_or(())?;
self.core.pc = regs.next().ok_or(())?;
// Floating point registers (unused)
for _ in 0..25 {
regs.next().ok_or(())?;
}
self.core.cpsr = regs.next().ok_or(())?;
}
self.custom = regs.next().ok_or(())?;
if regs.next().is_some() {
return Err(());
}
Ok(())
}
}
#[derive(Debug)]
pub enum ArmCoreRegIdCustom {
Core(ArmCoreRegId),
Custom,
// not sent as part of `struct ArmCoreRegsCustom`, and only accessible via the single
// register read/write functions
Time,
/// This pseudo-register is valid but never available
Unavailable,
}
impl RegId for ArmCoreRegIdCustom {
fn from_raw_id(id: usize) -> Option<(Self, Option<NonZeroUsize>)> {
let reg = match id {
26 => Self::Custom,
27 => Self::Time,
28 => Self::Unavailable,
_ => {
let (reg, size) = ArmCoreRegId::from_raw_id(id)?;
return Some((Self::Core(reg), size));
}
};
Some((reg, Some(NonZeroUsize::new(4)?)))
}
}
impl Arch for Armv4tCustom {
type Usize = u32;
type Registers = ArmCoreRegsCustom;
type RegId = ArmCoreRegIdCustom;
type BreakpointKind = ArmBreakpointKind;
// for _purely demonstrative purposes_, i'll return dummy data from this
// function, as it will be overwritten by TargetDescriptionXmlOverride.
//
// See `examples/armv4t/gdb/target_description_xml_override.rs`
//
// in an actual implementation, you'll want to return an actual string here!
fn target_description_xml() -> Option<&'static str> {
Some("never gets returned")
}
// (LLDB extension)
//
// for _purely demonstrative purposes_, even though this provides a working
// example, it will get overwritten by RegisterInfoOverride.
//
// See `examples/armv4t/gdb/register_info_override.rs`
fn lldb_register_info(reg_id: usize) -> Option<RegisterInfo<'static>> {
match ArmCoreRegIdCustom::from_raw_id(reg_id) {
Some((_, None)) | None => Some(RegisterInfo::Done),
Some((r, Some(size))) => {
let name = match r {
// For the purpose of demonstration, we end the qRegisterInfo packet
// exchange when reaching the Time register id, so that this register can
// only be explicitly queried via the single-register read packet.
ArmCoreRegIdCustom::Time => return Some(RegisterInfo::Done),
ArmCoreRegIdCustom::Core(ArmCoreRegId::Gpr(i)) => match i {
0 => "r0",
1 => "r1",
2 => "r2",
3 => "r3",
4 => "r4",
5 => "r5",
6 => "r6",
7 => "r7",
8 => "r8",
9 => "r9",
10 => "r10",
11 => "r11",
12 => "r12",
_ => "unknown",
},
ArmCoreRegIdCustom::Core(ArmCoreRegId::Sp) => "sp",
ArmCoreRegIdCustom::Core(ArmCoreRegId::Lr) => "lr",
ArmCoreRegIdCustom::Core(ArmCoreRegId::Pc) => "pc",
ArmCoreRegIdCustom::Core(ArmCoreRegId::Fpr(_i)) => "padding",
ArmCoreRegIdCustom::Core(ArmCoreRegId::Fps) => "padding",
ArmCoreRegIdCustom::Core(ArmCoreRegId::Cpsr) => "cpsr",
ArmCoreRegIdCustom::Custom => "custom",
ArmCoreRegIdCustom::Unavailable => "Unavailable",
_ => "unknown",
};
let encoding = match r {
ArmCoreRegIdCustom::Core(ArmCoreRegId::Gpr(_i)) => Encoding::Uint,
ArmCoreRegIdCustom::Core(ArmCoreRegId::Sp)
| ArmCoreRegIdCustom::Core(ArmCoreRegId::Pc)
| ArmCoreRegIdCustom::Core(ArmCoreRegId::Cpsr)
| ArmCoreRegIdCustom::Unavailable
| ArmCoreRegIdCustom::Custom => Encoding::Uint,
_ => Encoding::Vector,
};
let format = match r {
ArmCoreRegIdCustom::Core(ArmCoreRegId::Gpr(_i)) => Format::Hex,
ArmCoreRegIdCustom::Core(ArmCoreRegId::Sp)
| ArmCoreRegIdCustom::Core(ArmCoreRegId::Pc)
| ArmCoreRegIdCustom::Core(ArmCoreRegId::Cpsr)
| ArmCoreRegIdCustom::Unavailable
| ArmCoreRegIdCustom::Custom => Format::Hex,
_ => Format::VectorUInt8,
};
let set = match r {
ArmCoreRegIdCustom::Core(ArmCoreRegId::Gpr(_i)) => {
"General Purpose Registers"
}
ArmCoreRegIdCustom::Core(ArmCoreRegId::Sp)
| ArmCoreRegIdCustom::Core(ArmCoreRegId::Pc)
| ArmCoreRegIdCustom::Core(ArmCoreRegId::Cpsr)
| ArmCoreRegIdCustom::Unavailable
| ArmCoreRegIdCustom::Custom => "General Purpose Registers",
_ => "Floating Point Registers",
};
let generic = match r {
ArmCoreRegIdCustom::Core(ArmCoreRegId::Sp) => Some(Generic::Sp),
ArmCoreRegIdCustom::Core(ArmCoreRegId::Pc) => Some(Generic::Pc),
_ => None,
};
let reg = Register {
name,
alt_name: None,
bitsize: (usize::from(size)) * 8,
offset: reg_id * (usize::from(size)),
encoding,
format,
set,
gcc: None,
dwarf: Some(reg_id),
generic,
container_regs: None,
invalidate_regs: None,
};
Some(RegisterInfo::Register(reg))
}
}
}
}
}
================================================
FILE: examples/armv4t/gdb/monitor_cmd.rs
================================================
use crate::gdb::Emu;
use gdbstub::target;
use gdbstub::target::ext::monitor_cmd::outputln;
use gdbstub::target::ext::monitor_cmd::ConsoleOutput;
impl target::ext::monitor_cmd::MonitorCmd for Emu {
fn handle_monitor_cmd(
&mut self,
cmd: &[u8],
mut out: ConsoleOutput<'_>,
) -> Result<(), Self::Error> {
let cmd = match core::str::from_utf8(cmd) {
Ok(cmd) => cmd,
Err(_) => {
outputln!(out, "command must be valid UTF-8");
return Ok(());
}
};
match cmd {
"" => outputln!(out, "Sorry, didn't catch that. Try `monitor ping`!"),
"ping" => outputln!(out, "pong!"),
_ => outputln!(out, "I don't know how to handle '{}'", cmd),
};
Ok(())
}
}
================================================
FILE: examples/armv4t/gdb/section_offsets.rs
================================================
use crate::gdb::Emu;
use gdbstub::target;
use gdbstub::target::ext::section_offsets::Offsets;
// This implementation is for illustrative purposes only. If the offsets are
// guaranteed to be zero, this extension does not need to be implemented.
impl target::ext::section_offsets::SectionOffsets for Emu {
fn get_section_offsets(&mut self) -> Result<Offsets<u32>, Self::Error> {
Ok(Offsets::Sections {
text: 0,
data: 0,
bss: None,
})
}
}
================================================
FILE: examples/armv4t/gdb/target_description_xml_override.rs
================================================
use super::copy_range_to_buf;
use crate::emu::Emu;
use gdbstub::target;
use gdbstub::target::TargetError;
use gdbstub::target::TargetResult;
impl target::ext::target_description_xml_override::TargetDescriptionXmlOverride for Emu {
fn target_description_xml(
&self,
annex: &[u8],
offset: u64,
length: usize,
buf: &mut [u8],
) -> TargetResult<usize, Self> {
let xml = match annex {
b"target.xml" => TARGET_XML.trim(),
b"extra.xml" => EXTRA_XML.trim(),
_ => return Err(TargetError::NonFatal),
};
Ok(copy_range_to_buf(
xml.trim().as_bytes(),
offset,
length,
buf,
))
}
}
const TARGET_XML: &str = r#"
<?xml version="1.0"?>
<!DOCTYPE target SYSTEM "gdb-target.dtd">
<target version="1.0">
<architecture>armv4t</architecture>
<feature name="org.gnu.gdb.arm.core">
<vector id="padding" type="uint32" count="25"/>
<reg name="r0" bitsize="32" type="uint32"/>
<reg name="r1" bitsize="32" type="uint32"/>
<reg name="r2" bitsize="32" type="uint32"/>
<reg name="r3" bitsize="32" type="uint32"/>
<reg name="r4" bitsize="32" type="uint32"/>
<reg name="r5" bitsize="32" type="uint32"/>
<reg name="r6" bitsize="32" type="uint32"/>
<reg name="r7" bitsize="32" type="uint32"/>
<reg name="r8" bitsize="32" type="uint32"/>
<reg name="r9" bitsize="32" type="uint32"/>
<reg name="r10" bitsize="32" type="uint32"/>
<reg name="r11" bitsize="32" type="uint32"/>
<reg name="r12" bitsize="32" type="uint32"/>
<reg name="sp" bitsize="32" type="data_ptr"/>
<reg name="lr" bitsize="32"/>
<reg name="pc" bitsize="32" type="code_ptr"/>
<!--
For some reason, my version of `gdb-multiarch` doesn't seem to
respect "regnum", and will not parse this custom target.xml unless I
manually include the padding bytes in the target description.
On the bright side, AFAIK, there aren't all that many architectures
that use padding bytes. Heck, the only reason armv4t uses padding is
for historical reasons (see comment below).
Odds are if you're defining your own custom arch, you won't run into
this issue, since you can just lay out all the registers in the
correct order.
-->
<reg name="padding" type="padding" bitsize="32"/>
<!-- The CPSR is register 25, rather than register 16, because
the FPA registers historically were placed between the PC
and the CPSR in the "g" packet. -->
<reg name="cpsr" bitsize="32" regnum="25"/>
</feature>
<xi:include href="extra.xml"/>
</target>
"#;
const EXTRA_XML: &str = r#"
<?xml version="1.0"?>
<!DOCTYPE target SYSTEM "gdb-target.dtd">
<feature name="custom-armv4t-extension">
<!--
maps to a simple scratch register within the emulator. the GDB
client can read the register using `p $custom` and set it using
`set $custom=1337`
-->
<reg name="custom" bitsize="32" type="uint32"/>
<!--
pseudo-register that return the current time when read.
notably, i've set up the target to NOT send this register as part of
the regular register list, which means that GDB will fetch/update
this register via the 'p' and 'P' packets respectively
-->
<reg name="time" bitsize="32" type="uint32"/>
<!--
pseudo-register that is always unavailable.
it is supposed to be reported as 'x'-ed bytes in replies to 'p' packets
and shown by the GDB client as "<unavailable>".
-->
<reg name="unavailable" bitsize="32" type="uint32"/>
</feature>
"#;
================================================
FILE: examples/armv4t/gdb/tracepoints.rs
================================================
use crate::emu::Emu;
use gdbstub::target;
use gdbstub::target::ext::tracepoints::ExperimentExplanation;
use gdbstub::target::ext::tracepoints::ExperimentStatus;
use gdbstub::target::ext::tracepoints::FrameDescription;
use gdbstub::target::ext::tracepoints::FrameRequest;
use gdbstub::target::ext::tracepoints::NewTracepoint;
use gdbstub::target::ext::tracepoints::SourceTracepoint;
use gdbstub::target::ext::tracepoints::TraceBufferConfig;
use gdbstub::target::ext::tracepoints::Tracepoint;
use gdbstub::target::ext::tracepoints::TracepointAction;
use gdbstub::target::ext::tracepoints::TracepointEnumerateState;
use gdbstub::target::ext::tracepoints::TracepointEnumerateStep;
use gdbstub::target::ext::tracepoints::TracepointStatus;
use gdbstub::target::TargetError;
use gdbstub::target::TargetResult;
impl Emu {
fn step_to_next_tracepoint(&self, tp: Tracepoint) -> TracepointEnumerateStep<u32> {
let next_tp = self.tracepoints.range(tp..).nth(1);
if let Some((tp, (new_tp, _, _))) = next_tp {
TracepointEnumerateStep::Next {
tp: *tp,
addr: new_tp.addr,
}
} else {
// No more tracepoints
TracepointEnumerateStep::Done
}
}
}
impl target::ext::tracepoints::Tracepoints for Emu {
fn tracepoints_init(&mut self) -> TargetResult<(), Self> {
self.tracepoints.clear();
self.traceframes.clear();
Ok(())
}
fn tracepoint_create_begin(&mut self, tp: NewTracepoint<u32>) -> TargetResult<(), Self> {
self.tracepoints.insert(tp.number, (tp, vec![], vec![]));
Ok(())
}
fn tracepoint_create_continue(
&mut self,
tp: Tracepoint,
action: &TracepointAction<'_, u32>,
) -> TargetResult<(), Self> {
if let &TracepointAction::Registers { mask: _ } = &action {
// we only handle register collection actions for the simple
// case
} else {
return Err(TargetError::NonFatal);
}
self.tracepoints
.get_mut(&tp)
.map(move |(_ctp, _source, actions)| actions.push(action.get_owned()))
.ok_or(TargetError::Fatal("extend on non-existing tracepoint"))
}
fn tracepoint_create_complete(&mut self, _tp: Tracepoint) -> TargetResult<(), Self> {
/* nothing to do */
Ok(())
}
fn tracepoint_status(
&self,
tp: Tracepoint,
_addr: u32,
) -> TargetResult<TracepointStatus, Self> {
// We don't collect "real" trace buffer frames, so just report hit count
// and say the number of bytes is always 0.
// Because we don't implement "while-stepping" actions, we don't need to
// also check that `addr` matches.
Ok(TracepointStatus {
hit_count: self
.traceframes
.iter()
.filter(|frame| frame.number.0 == tp.0)
.count() as u64,
bytes_used: 0,
})
}
fn tracepoint_enumerate_state(&mut self) -> &mut TracepointEnumerateState<u32> {
&mut self.tracepoint_enumerate_state
}
fn tracepoint_enumerate_start(
&mut self,
tp: Option<Tracepoint>,
f: &mut dyn FnMut(&NewTracepoint<u32>),
) -> TargetResult<TracepointEnumerateStep<u32>, Self> {
let tp = match tp {
Some(tp) => tp,
None => {
// We have no tracepoints to report
if self.tracepoints.is_empty() {
return Ok(TracepointEnumerateStep::Done);
} else {
// Start enumerating at the first one
*self.tracepoints.keys().next().unwrap()
}
}
};
// Report our tracepoint
(f)(&self.tracepoints[&tp].0);
let ret = if !self.tracepoints[&tp].1.is_empty() {
TracepointEnumerateStep::Source
} else if !self.tracepoints[&tp].2.is_empty() {
TracepointEnumerateStep::Action
} else {
TracepointEnumerateStep::Done
};
Ok(ret)
}
fn tracepoint_enumerate_action(
&mut self,
tp: Tracepoint,
step: u64,
f: &mut dyn FnMut(&TracepointAction<'_, u32>),
) -> TargetResult<TracepointEnumerateStep<u32>, Self> {
// Report our next action
(f)(&self.tracepoints[&tp].2[step as usize]);
let ret = if self.tracepoints[&tp].2.get((step as usize) + 1).is_some() {
// Continue stepping
TracepointEnumerateStep::Action
} else if !self.tracepoints[&tp].1.is_empty() {
// We're done with this tracepoint, report source
TracepointEnumerateStep::Source
} else {
// No sources, move to the next tracepoint
self.step_to_next_tracepoint(tp)
};
Ok(ret)
}
#[inline(always)]
fn support_tracepoint_source(
&mut self,
) -> Option<target::ext::tracepoints::TracepointSourceOps<'_, Self>> {
Some(self)
}
fn trace_buffer_configure(&mut self, _config: TraceBufferConfig) -> TargetResult<(), Self> {
// we don't collect a "real" trace buffer, so just ignore configuration
// attempts.
Ok(())
}
fn trace_buffer_request(
&mut self,
_offset: u64,
_len: usize,
_f: &mut dyn FnMut(&mut [u8]),
) -> TargetResult<(), Self> {
// We don't have a "real" trace buffer, so just don't report any data
Ok(())
}
fn trace_experiment_status(
&self,
report: &mut dyn FnMut(ExperimentStatus<'_>),
) -> TargetResult<(), Self> {
// For a bare-bones example, we don't provide in-depth status explanations.
(report)(if self.tracing {
ExperimentStatus::Running
} else {
ExperimentStatus::NotRunning
});
Ok(())
}
fn trace_experiment_info(
&self,
report: &mut dyn FnMut(ExperimentExplanation<'_>),
) -> TargetResult<(), Self> {
(report)(ExperimentExplanation::Frames(self.traceframes.len()));
Ok(())
}
fn select_frame(
&mut self,
frame: FrameRequest<u32>,
report: &mut dyn FnMut(FrameDescription),
) -> TargetResult<(), Self> {
// For a bare-bones example, we only support `tfind <number>` and `tfind
// tracepoint <tpnum>` style frame selection and not the more
// complicated ones.
let found = match frame {
FrameRequest::Select(n) => self.traceframes.get(n as usize).map(|frame| (n, frame)),
FrameRequest::Hit(tp) => {
let start = self
.selected_frame
.map(|selected| selected + 1)
.unwrap_or(0);
self.traceframes.get(start..).and_then(|frames| {
frames
.iter()
.enumerate()
.filter(|(_n, frame)| frame.number == tp)
.map(|(n, frame)| ((start + n) as u64, frame))
.next()
})
}
_ => return Err(TargetError::NonFatal),
};
if let Some((n, frame)) = found {
(report)(FrameDescription::FrameNumber(n));
(report)(FrameDescription::Hit(frame.number));
self.selected_frame = Some(n as usize);
} else {
self.selected_frame = None;
}
Ok(())
}
fn trace_experiment_start(&mut self) -> TargetResult<(), Self> {
self.tracing = true;
Ok(())
}
fn trace_experiment_stop(&mut self) -> TargetResult<(), Self> {
self.tracing = false;
Ok(())
}
}
impl target::ext::tracepoints::TracepointSource for Emu {
fn tracepoint_enumerate_source(
&mut self,
tp: Tracepoint,
step: u64,
f: &mut dyn FnMut(&SourceTracepoint<'_, u32>),
) -> TargetResult<TracepointEnumerateStep<u32>, Self> {
// Report our next source item
(f)(&self.tracepoints[&tp].1[step as usize]);
let ret = if self.tracepoints[&tp].1.get((step as usize) + 1).is_some() {
// Continue stepping
TracepointEnumerateStep::Source
} else {
// Move to next tracepoint
self.step_to_next_tracepoint(tp)
};
Ok(ret)
}
fn tracepoint_attach_source(
&mut self,
src: SourceTracepoint<'_, u32>,
) -> TargetResult<(), Self> {
self.tracepoints
.get_mut(&src.number)
.unwrap()
.1
.push(src.get_owned());
Ok(())
}
}
================================================
FILE: examples/armv4t/main.rs
================================================
//! An incredibly simple emulator to run elf binaries compiled with
//! `arm-none-eabi-cc -march=armv4t`. It's not modeled after any real-world
//! system.
use gdbstub::common::Signal;
use gdbstub::conn::Connection;
use gdbstub::conn::ConnectionExt;
use gdbstub::stub::run_blocking;
use gdbstub::stub::DisconnectReason;
use gdbstub::stub::GdbStub;
use gdbstub::stub::SingleThreadStopReason;
use gdbstub::target::Target;
use std::net::TcpListener;
use std::net::TcpStream;
#[cfg(unix)]
use std::os::unix::net::UnixListener;
#[cfg(unix)]
use std::os::unix::net::UnixStream;
type DynResult<T> = Result<T, Box<dyn std::error::Error>>;
const TEST_PROGRAM_ELF: &[u8] = include_bytes!("test_bin/test.elf");
mod emu;
mod gdb;
mod mem_sniffer;
fn wait_for_tcp(port: u16) -> DynResult<TcpStream> {
let sockaddr = format!("127.0.0.1:{}", port);
eprintln!("Waiting for a GDB connection on {:?}...", sockaddr);
let sock = TcpListener::bind(sockaddr)?;
let (stream, addr) = sock.accept()?;
eprintln!("Debugger connected from {}", addr);
Ok(stream)
}
#[cfg(unix)]
fn wait_for_uds(path: &str) -> DynResult<UnixStream> {
match std::fs::remove_file(path) {
Ok(_) => {}
Err(e) => match e.kind() {
std::io::ErrorKind::NotFound => {}
_ => return Err(e.into()),
},
}
eprintln!("Waiting for a GDB connection on {}...", path);
let sock = UnixListener::bind(path)?;
let (stream, addr) = sock.accept()?;
eprintln!("Debugger connected from {:?}", addr);
Ok(stream)
}
enum EmuGdbEventLoop {}
impl run_blocking::BlockingEventLoop for EmuGdbEventLoop {
type Target = emu::Emu;
type Connection = Box<dyn ConnectionExt<Error = std::io::Error>>;
type StopReason = SingleThreadStopReason<u32>;
#[allow(clippy::type_complexity)]
fn wait_for_stop_reason(
target: &mut emu::Emu,
conn: &mut Self::Connection,
) -> Result<
run_blocking::Event<SingleThreadStopReason<u32>>,
run_blocking::WaitForStopReasonError<
<Self::Target as Target>::Error,
<Self::Connection as Connection>::Error,
>,
> {
// The `armv4t` example runs the emulator in the same thread as the GDB state
// machine loop. As such, it uses a simple poll-based model to check for
// interrupt events, whereby the emulator will check if there is any incoming
// data over the connection, and pause execution with a synthetic
// `RunEvent::IncomingData` event.
//
// In more complex integrations, the target will probably be running in a
// separate thread, and instead of using a poll-based model to check for
// incoming data, you'll want to use some kind of "select" based model to
// simultaneously wait for incoming GDB data coming over the connection, along
// with any target-reported stop events.
//
// The specifics of how this "select" mechanism work + how the target reports
// stop events will entirely depend on your project's architecture.
//
// Some ideas on how to implement this `select` mechanism:
//
// - A mpsc channel
// - epoll/kqueue
// - Running the target + stopping every so often to peek the connection
// - Driving `GdbStub` from various interrupt handlers
let poll_incoming_data = || {
// gdbstub takes ownership of the underlying connection, so the `borrow_conn`
// method is used to borrow the underlying connection back from the stub to
// check for incoming data.
conn.peek().map(|b| b.is_some()).unwrap_or(true)
};
match target.run(poll_incoming_data) {
emu::RunEvent::IncomingData => {
let byte = conn
.read()
.map_err(run_blocking::WaitForStopReasonError::Connection)?;
Ok(run_blocking::Event::IncomingData(byte))
}
emu::RunEvent::Event(event) => {
use gdbstub::target::ext::breakpoints::WatchKind;
// translate emulator stop reason into GDB stop reason
let stop_reason = match event {
emu::Event::DoneStep => SingleThreadStopReason::DoneStep,
emu::Event::Halted => SingleThreadStopReason::Terminated(Signal::SIGSTOP),
emu::Event::Break => SingleThreadStopReason::SwBreak(()),
emu::Event::WatchWrite(addr) => SingleThreadStopReason::Watch {
tid: (),
kind: WatchKind::Write,
addr,
},
emu::Event::WatchRead(addr) => SingleThreadStopReason::Watch {
tid: (),
kind: WatchKind::Read,
addr,
},
};
Ok(run_blocking::Event::TargetStopped(stop_reason))
}
}
}
fn on_interrupt(
_target: &mut emu::Emu,
) -> Result<Option<SingleThreadStopReason<u32>>, <emu::Emu as Target>::Error> {
// Because this emulator runs as part of the GDB stub loop, there isn't any
// special action that needs to be taken to interrupt the underlying target. It
// is implicitly paused whenever the stub isn't within the
// `wait_for_stop_reason` callback.
Ok(Some(SingleThreadStopReason::Signal(Signal::SIGINT)))
}
}
fn main() -> DynResult<()> {
pretty_env_logger::init();
let mut emu = emu::Emu::new(TEST_PROGRAM_ELF)?;
let connection: Box<dyn ConnectionExt<Error = std::io::Error>> = {
if std::env::args().nth(1) == Some("--uds".to_string()) {
#[cfg(not(unix))]
{
return Err("Unix Domain Sockets can only be used on Unix".into());
}
#[cfg(unix)]
{
Box::new(wait_for_uds("/tmp/armv4t_gdb")?)
}
} else {
Box::new(wait_for_tcp(9001)?)
}
};
let gdb = GdbStub::new(connection);
match gdb.run_blocking::<EmuGdbEventLoop>(&mut emu) {
Ok(disconnect_reason) => match disconnect_reason {
DisconnectReason::Disconnect => {
println!("GDB client has disconnected. Running to completion...");
while emu.step() != Some(emu::Event::Halted) {}
}
DisconnectReason::TargetExited(code) => {
println!("Target exited with code {}!", code)
}
DisconnectReason::TargetTerminated(sig) => {
println!("Target terminated with signal {}!", sig)
}
DisconnectReason::Kill => println!("GDB sent a kill command!"),
},
Err(e) => {
if e.is_target_error() {
println!(
"target encountered a fatal error: {}",
e.into_target_error().unwrap()
)
} else if e.is_connection_error() {
let (e, kind) = e.into_connection_error().unwrap();
println!("connection error: {:?} - {}", kind, e,)
} else {
println!("gdbstub encountered a fatal error: {}", e)
}
}
}
let ret = emu.cpu.reg_get(armv4t_emu::Mode::User, 0);
println!("Program completed. Return value: {}", ret);
Ok(())
}
================================================
FILE: examples/armv4t/mem_sniffer.rs
================================================
use armv4t_emu::Memory;
pub enum AccessKind {
Read,
Write,
}
pub struct Access {
pub kind: AccessKind,
pub addr: u32,
// allow(dead_code) because the emulator is so simple that it doesn't matter
#[allow(dead_code)]
pub val: u32,
#[allow(dead_code)]
pub len: usize,
}
/// Wraps a `Memory` object, logging any accesses with the provided callback.
#[derive(Debug)]
pub struct MemSniffer<'a, M, F: FnMut(Access)> {
mem: &'a mut M,
addrs: &'a [u32],
on_access: F,
}
impl<'a, M: Memory, F: FnMut(Access)> MemSniffer<'a, M, F> {
pub fn new(mem: &'a mut M, addrs: &'a [u32], on_access: F) -> MemSniffer<'a, M, F> {
MemSniffer {
mem,
addrs,
on_access,
}
}
}
macro_rules! impl_memsniff_r {
($fn:ident, $ret:ty) => {
fn $fn(&mut self, addr: u32) -> $ret {
let ret = self.mem.$fn(addr);
if self.addrs.contains(&addr) {
(self.on_access)(Access {
kind: AccessKind::Read,
addr,
val: ret as u32,
len: ret.to_le_bytes().len(),
});
}
ret
}
};
}
macro_rules! impl_memsniff_w {
($fn:ident, $val:ty) => {
fn $fn(&mut self, addr: u32, val: $val) {
self.mem.$fn(addr, val);
if self.addrs.contains(&addr) {
(self.on_access)(Access {
kind: AccessKind::Write,
addr,
val: val as u32,
len: val.to_le_bytes().len(),
});
}
}
};
}
impl<M: Memory, F: FnMut(Access)> Memory for MemSniffer<'_, M, F> {
impl_memsniff_r!(r8, u8);
impl_memsniff_r!(r16, u16);
impl_memsniff_r!(r32, u32);
impl_memsniff_w!(w8, u8);
impl_memsniff_w!(w16, u16);
impl_memsniff_w!(w32, u32);
}
================================================
FILE: examples/armv4t/test_bin/.gdbinit
================================================
# set remote multiprocess-feature-packet off
target extended-remote :9001
================================================
FILE: examples/armv4t/test_bin/.gitignore
================================================
*.o
.gdb_history
================================================
FILE: examples/armv4t/test_bin/compile_test.sh
================================================
arm-none-eabi-gcc -c test.c -march=armv4t -O0 -g -std=c11 -fdebug-prefix-map=$(pwd)=.
arm-none-eabi-ld -static -Ttest.ld test.o -o test.elf
================================================
FILE: examples/armv4t/test_bin/test.c
================================================
int main() {
int x = 4;
int y = 3;
x += 1;
y += 3;
// big, useless loop to test ctrl-c functionality
for (int i = 0; i < 1024 * 32; i++) {
x += 1;
}
return x;
}
================================================
FILE: examples/armv4t/test_bin/test.ld
================================================
ENTRY
gitextract_vgu50cw1/
├── .cargo/
│ └── config.toml
├── .git-blame-ignore-revs
├── .github/
│ ├── FUNDING.yml
│ ├── pull_request_template.md
│ └── workflows/
│ └── ci.yml
├── .gitignore
├── CHANGELOG.md
├── Cargo.toml
├── LICENSE
├── README.md
├── docs/
│ ├── LICENSE-APACHE
│ ├── LICENSE-MIT
│ └── transition_guide.md
├── example_no_std/
│ ├── .gitignore
│ ├── Cargo.toml
│ ├── README.md
│ ├── check_size.sh
│ ├── dump_asm.sh
│ ├── rustfmt.toml
│ └── src/
│ ├── conn.rs
│ ├── gdb.rs
│ ├── main.rs
│ └── print_str.rs
├── examples/
│ ├── armv4t/
│ │ ├── README.md
│ │ ├── emu.rs
│ │ ├── gdb/
│ │ │ ├── auxv.rs
│ │ │ ├── breakpoints.rs
│ │ │ ├── catch_syscalls.rs
│ │ │ ├── exec_file.rs
│ │ │ ├── extended_mode.rs
│ │ │ ├── flash.rs
│ │ │ ├── host_io.rs
│ │ │ ├── libraries.rs
│ │ │ ├── lldb_register_info_override.rs
│ │ │ ├── memory_map.rs
│ │ │ ├── mod.rs
│ │ │ ├── monitor_cmd.rs
│ │ │ ├── section_offsets.rs
│ │ │ ├── target_description_xml_override.rs
│ │ │ └── tracepoints.rs
│ │ ├── main.rs
│ │ ├── mem_sniffer.rs
│ │ └── test_bin/
│ │ ├── .gdbinit
│ │ ├── .gitignore
│ │ ├── compile_test.sh
│ │ ├── test.c
│ │ ├── test.elf
│ │ └── test.ld
│ └── armv4t_multicore/
│ ├── README.md
│ ├── emu.rs
│ ├── gdb.rs
│ ├── main.rs
│ ├── mem_sniffer.rs
│ └── test_bin/
│ ├── .gdbinit
│ ├── .gitignore
│ ├── compile_test.sh
│ ├── test.c
│ ├── test.elf
│ └── test.ld
├── gdbstub_arch/
│ ├── CHANGELOG.md
│ ├── Cargo.toml
│ ├── LICENSE
│ ├── README.md
│ └── src/
│ ├── aarch64/
│ │ ├── core.xml
│ │ ├── fpu.xml
│ │ ├── mod.rs
│ │ ├── reg/
│ │ │ ├── aarch64_core.rs
│ │ │ ├── id.rs
│ │ │ └── mod.rs
│ │ └── sysregs.xml
│ ├── arm/
│ │ ├── mod.rs
│ │ └── reg/
│ │ ├── arm_core.rs
│ │ ├── id.rs
│ │ └── mod.rs
│ ├── lib.rs
│ ├── mips/
│ │ ├── mod.rs
│ │ └── reg/
│ │ ├── id.rs
│ │ ├── mips.rs
│ │ └── mod.rs
│ ├── msp430/
│ │ ├── mod.rs
│ │ └── reg/
│ │ ├── id.rs
│ │ ├── mod.rs
│ │ └── msp430.rs
│ ├── ppc/
│ │ ├── mod.rs
│ │ └── reg/
│ │ ├── common.rs
│ │ ├── id.rs
│ │ └── mod.rs
│ ├── riscv/
│ │ ├── mod.rs
│ │ ├── reg/
│ │ │ ├── id.rs
│ │ │ ├── mod.rs
│ │ │ └── riscv.rs
│ │ ├── rv32i.xml
│ │ └── rv64i.xml
│ ├── wasm/
│ │ ├── addr.rs
│ │ ├── mod.rs
│ │ └── reg/
│ │ ├── id.rs
│ │ ├── mod.rs
│ │ └── wasm_regs.rs
│ └── x86/
│ ├── mod.rs
│ └── reg/
│ ├── core32.rs
│ ├── core64.rs
│ ├── id.rs
│ └── mod.rs
├── rustfmt.toml
├── scripts/
│ ├── check_target_delegation.sh
│ └── test_dead_code_elim.sh
└── src/
├── arch.rs
├── common/
│ ├── mod.rs
│ └── signal.rs
├── conn/
│ ├── impls/
│ │ ├── boxed.rs
│ │ ├── mod.rs
│ │ ├── tcpstream.rs
│ │ └── unixstream.rs
│ └── mod.rs
├── internal/
│ ├── be_bytes.rs
│ ├── le_bytes.rs
│ └── mod.rs
├── lib.rs
├── protocol/
│ ├── commands/
│ │ ├── _QAgent.rs
│ │ ├── _QCatchSyscalls.rs
│ │ ├── _QDisableRandomization.rs
│ │ ├── _QEnvironmentHexEncoded.rs
│ │ ├── _QEnvironmentReset.rs
│ │ ├── _QEnvironmentUnset.rs
│ │ ├── _QSetWorkingDir.rs
│ │ ├── _QStartNoAckMode.rs
│ │ ├── _QStartupWithShell.rs
│ │ ├── _QTBuffer_upcase.rs
│ │ ├── _QTDP.rs
│ │ ├── _QTDPsrc.rs
│ │ ├── _QTFrame.rs
│ │ ├── _QTStart.rs
│ │ ├── _QTStop.rs
│ │ ├── _QTinit.rs
│ │ ├── _bc.rs
│ │ ├── _bs.rs
│ │ ├── _c.rs
│ │ ├── _d_upcase.rs
│ │ ├── _g.rs
│ │ ├── _g_upcase.rs
│ │ ├── _h_upcase.rs
│ │ ├── _k.rs
│ │ ├── _m.rs
│ │ ├── _m_upcase.rs
│ │ ├── _p.rs
│ │ ├── _p_upcase.rs
│ │ ├── _qAttached.rs
│ │ ├── _qC.rs
│ │ ├── _qHostInfo.rs
│ │ ├── _qOffsets.rs
│ │ ├── _qProcessInfo.rs
│ │ ├── _qRcmd.rs
│ │ ├── _qRegisterInfo.rs
│ │ ├── _qSupported.rs
│ │ ├── _qTBuffer.rs
│ │ ├── _qTP.rs
│ │ ├── _qTStatus.rs
│ │ ├── _qTfP.rs
│ │ ├── _qTfV.rs
│ │ ├── _qThreadExtraInfo.rs
│ │ ├── _qTsP.rs
│ │ ├── _qTsV.rs
│ │ ├── _qWasmCallStack.rs
│ │ ├── _qWasmGlobal.rs
│ │ ├── _qWasmLocal.rs
│ │ ├── _qWasmStackValue.rs
│ │ ├── _qXfer_auxv_read.rs
│ │ ├── _qXfer_exec_file.rs
│ │ ├── _qXfer_features_read.rs
│ │ ├── _qXfer_libraries_read.rs
│ │ ├── _qXfer_libraries_svr4_read.rs
│ │ ├── _qXfer_memory_map.rs
│ │ ├── _qfThreadInfo.rs
│ │ ├── _qsThreadInfo.rs
│ │ ├── _r_upcase.rs
│ │ ├── _s.rs
│ │ ├── _t_upcase.rs
│ │ ├── _vAttach.rs
│ │ ├── _vCont.rs
│ │ ├── _vFile_close.rs
│ │ ├── _vFile_fstat.rs
│ │ ├── _vFile_open.rs
│ │ ├── _vFile_pread.rs
│ │ ├── _vFile_pwrite.rs
│ │ ├── _vFile_readlink.rs
│ │ ├── _vFile_setfs.rs
│ │ ├── _vFile_unlink.rs
│ │ ├── _vFlashDone.rs
│ │ ├── _vFlashErase.rs
│ │ ├── _vFlashWrite.rs
│ │ ├── _vKill.rs
│ │ ├── _vRun.rs
│ │ ├── _x_lowcase.rs
│ │ ├── _x_upcase.rs
│ │ ├── breakpoint.rs
│ │ ├── exclamation_mark.rs
│ │ └── question_mark.rs
│ ├── commands.rs
│ ├── common/
│ │ ├── hex.rs
│ │ ├── lists.rs
│ │ ├── mod.rs
│ │ ├── qxfer.rs
│ │ └── thread_id.rs
│ ├── console_output.rs
│ ├── mod.rs
│ ├── packet.rs
│ ├── recv_packet.rs
│ └── response_writer.rs
├── stub/
│ ├── builder.rs
│ ├── core_impl/
│ │ ├── auxv.rs
│ │ ├── base.rs
│ │ ├── breakpoints.rs
│ │ ├── catch_syscalls.rs
│ │ ├── exec_file.rs
│ │ ├── extended_mode.rs
│ │ ├── flash.rs
│ │ ├── host_io.rs
│ │ ├── host_process_info.rs
│ │ ├── libraries.rs
│ │ ├── lldb_register_info.rs
│ │ ├── memory_map.rs
│ │ ├── monitor_cmd.rs
│ │ ├── no_ack_mode.rs
│ │ ├── resume.rs
│ │ ├── reverse_exec.rs
│ │ ├── section_offsets.rs
│ │ ├── single_register_access.rs
│ │ ├── target_xml.rs
│ │ ├── thread_extra_info.rs
│ │ ├── tracepoints.rs
│ │ ├── wasm.rs
│ │ ├── x_lowcase_packet.rs
│ │ └── x_upcase_packet.rs
│ ├── core_impl.rs
│ ├── error.rs
│ ├── mod.rs
│ ├── state_machine.rs
│ └── stop_reason.rs
├── target/
│ ├── ext/
│ │ ├── auxv.rs
│ │ ├── base/
│ │ │ ├── mod.rs
│ │ │ ├── multithread.rs
│ │ │ ├── reverse_exec.rs
│ │ │ ├── single_register_access.rs
│ │ │ └── singlethread.rs
│ │ ├── breakpoints.rs
│ │ ├── catch_syscalls.rs
│ │ ├── exec_file.rs
│ │ ├── extended_mode.rs
│ │ ├── flash.rs
│ │ ├── host_info.rs
│ │ ├── host_io.rs
│ │ ├── libraries.rs
│ │ ├── lldb_register_info_override.rs
│ │ ├── memory_map.rs
│ │ ├── mod.rs
│ │ ├── monitor_cmd.rs
│ │ ├── process_info.rs
│ │ ├── section_offsets.rs
│ │ ├── target_description_xml_override.rs
│ │ ├── thread_extra_info.rs
│ │ ├── tracepoints.rs
│ │ └── wasm.rs
│ └── mod.rs
└── util/
├── dead_code_marker.rs
├── managed_vec.rs
└── mod.rs
Showing preview only (207K chars total). Download the full file or copy to clipboard to get everything.
SYMBOL INDEX (2247 symbols across 210 files)
FILE: example_no_std/src/conn.rs
type TcpConnection (line 3) | pub struct TcpConnection {
method new_localhost (line 9) | pub fn new_localhost(port: u16) -> Result<TcpConnection, &'static str> {
method read (line 65) | pub fn read(&mut self) -> Result<u8, &'static str> {
method peek (line 76) | pub fn peek(&mut self) -> Result<Option<u8>, &'static str> {
method drop (line 95) | fn drop(&mut self) {
type Error (line 104) | type Error = &'static str;
method write (line 106) | fn write(&mut self, b: u8) -> Result<(), &'static str> {
method flush (line 116) | fn flush(&mut self) -> Result<(), &'static str> {
FILE: example_no_std/src/gdb.rs
type DummyTarget (line 10) | pub struct DummyTarget {}
method new (line 13) | pub fn new() -> DummyTarget {
method support_sw_breakpoint (line 162) | fn support_sw_breakpoint(
method add_sw_breakpoint (line 171) | fn add_sw_breakpoint(
method remove_sw_breakpoint (line 180) | fn remove_sw_breakpoint(
type Arch (line 19) | type Arch = gdbstub_arch::arm::Armv4t;
type Error (line 20) | type Error = &'static str;
method base_ops (line 23) | fn base_ops(&mut self) -> target::ext::base::BaseOps<'_, Self::Arch, Sel...
method use_no_ack_mode (line 29) | fn use_no_ack_mode(&self) -> bool {
method use_x_upcase_packet (line 35) | fn use_x_upcase_packet(&self) -> bool {
method use_fork_stop_reason (line 41) | fn use_fork_stop_reason(&self) -> bool {
method use_vfork_stop_reason (line 47) | fn use_vfork_stop_reason(&self) -> bool {
method use_vforkdone_stop_reason (line 53) | fn use_vforkdone_stop_reason(&self) -> bool {
method support_breakpoints (line 58) | fn support_breakpoints(
method read_registers (line 75) | fn read_registers(
method write_registers (line 85) | fn write_registers(
method read_addrs (line 95) | fn read_addrs(
method write_addrs (line 107) | fn write_addrs(
method list_active_threads (line 118) | fn list_active_threads(
method support_resume (line 129) | fn support_resume(
method resume (line 138) | fn resume(&mut self) -> Result<(), Self::Error> {
method clear_resume_actions (line 144) | fn clear_resume_actions(&mut self) -> Result<(), Self::Error> {
method set_resume_action_continue (line 150) | fn set_resume_action_continue(
FILE: example_no_std/src/main.rs
function panic (line 18) | fn panic(_info: &core::panic::PanicInfo<'_>) -> ! {
function rust_main (line 22) | fn rust_main() -> Result<(), i32> {
function main (line 91) | extern "C" fn main(_argc: isize, _argv: *const *const u8) -> isize {
FILE: example_no_std/src/print_str.rs
function print_str (line 1) | pub fn print_str(s: &str) {
FILE: examples/armv4t/emu.rs
constant HLE_RETURN_ADDR (line 17) | const HLE_RETURN_ADDR: u32 = 0x12345678;
type Event (line 20) | pub enum Event {
type ExecMode (line 28) | pub enum ExecMode {
type TraceFrame (line 35) | pub struct TraceFrame {
type Emu (line 41) | pub struct Emu {
method new (line 73) | pub fn new(program_elf: &[u8]) -> DynResult<Emu> {
method reset (line 131) | pub(crate) fn reset(&mut self) {
method step (line 139) | pub fn step(&mut self) -> Option<Event> {
method run (line 195) | pub fn run(&mut self, mut poll_incoming_data: impl FnMut() -> bool) ->...
type RunEvent (line 239) | pub enum RunEvent {
FILE: examples/armv4t/gdb/auxv.rs
method get_auxv (line 7) | fn get_auxv(&self, offset: u64, length: usize, buf: &mut [u8]) -> Target...
FILE: examples/armv4t/gdb/breakpoints.rs
method support_sw_breakpoint (line 8) | fn support_sw_breakpoint(
method support_hw_watchpoint (line 15) | fn support_hw_watchpoint(
method add_sw_breakpoint (line 23) | fn add_sw_breakpoint(
method remove_sw_breakpoint (line 32) | fn remove_sw_breakpoint(
method add_hw_watchpoint (line 47) | fn add_hw_watchpoint(
method remove_hw_watchpoint (line 64) | fn remove_hw_watchpoint(
FILE: examples/armv4t/gdb/catch_syscalls.rs
method enable_catch_syscalls (line 9) | fn enable_catch_syscalls(
method disable_catch_syscalls (line 23) | fn disable_catch_syscalls(&mut self) -> target::TargetResult<(), Self> {
FILE: examples/armv4t/gdb/exec_file.rs
method get_exec_file (line 8) | fn get_exec_file(
FILE: examples/armv4t/gdb/extended_mode.rs
method kill (line 24) | fn kill(&mut self, pid: Option<Pid>) -> TargetResult<ShouldTerminate, Se...
method restart (line 29) | fn restart(&mut self) -> Result<(), Self::Error> {
method attach (line 34) | fn attach(&mut self, pid: Pid) -> TargetResult<(), Self> {
method run (line 42) | fn run(&mut self, filename: Option<&[u8]>, args: Args<'_, '_>) -> Target...
method query_if_attached (line 68) | fn query_if_attached(&mut self, pid: Pid) -> TargetResult<AttachKind, Se...
method support_configure_aslr (line 77) | fn support_configure_aslr(
method support_configure_env (line 84) | fn support_configure_env(
method support_configure_startup_shell (line 91) | fn support_configure_startup_shell(
method support_configure_working_dir (line 98) | fn support_configure_working_dir(
method support_current_active_pid (line 105) | fn support_current_active_pid(
method cfg_aslr (line 113) | fn cfg_aslr(&mut self, enabled: bool) -> TargetResult<(), Self> {
method set_env (line 120) | fn set_env(&mut self, key: &[u8], val: Option<&[u8]>) -> TargetResult<()...
method remove_env (line 133) | fn remove_env(&mut self, key: &[u8]) -> TargetResult<(), Self> {
method reset_env (line 140) | fn reset_env(&mut self) -> TargetResult<(), Self> {
method cfg_startup_with_shell (line 148) | fn cfg_startup_with_shell(&mut self, enabled: bool) -> TargetResult<(), ...
method cfg_working_dir (line 158) | fn cfg_working_dir(&mut self, dir: Option<&[u8]>) -> TargetResult<(), Se...
method current_active_pid (line 174) | fn current_active_pid(&mut self) -> Result<Pid, Self::Error> {
FILE: examples/armv4t/gdb/flash.rs
method flash_erase (line 6) | fn flash_erase(&mut self, start_addr: u32, length: u32) -> TargetResult<...
method flash_write (line 11) | fn flash_write(&mut self, start_addr: u32, _data: &[u8]) -> TargetResult...
method flash_done (line 16) | fn flash_done(&mut self) -> TargetResult<(), Self> {
FILE: examples/armv4t/gdb/host_io.rs
constant FD_RESERVED (line 17) | const FD_RESERVED: u32 = 1;
method support_open (line 21) | fn support_open(&mut self) -> Option<target::ext::host_io::HostIoOpenOps...
method support_close (line 26) | fn support_close(&mut self) -> Option<target::ext::host_io::HostIoCloseO...
method support_pread (line 31) | fn support_pread(&mut self) -> Option<target::ext::host_io::HostIoPreadO...
method support_pwrite (line 36) | fn support_pwrite(&mut self) -> Option<target::ext::host_io::HostIoPwrit...
method support_fstat (line 41) | fn support_fstat(&mut self) -> Option<target::ext::host_io::HostIoFstatO...
method support_unlink (line 46) | fn support_unlink(&mut self) -> Option<target::ext::host_io::HostIoUnlin...
method support_readlink (line 51) | fn support_readlink(&mut self) -> Option<target::ext::host_io::HostIoRea...
method support_setfs (line 56) | fn support_setfs(&mut self) -> Option<target::ext::host_io::HostIoSetfsO...
method open (line 62) | fn open(
method close (line 119) | fn close(&mut self, fd: u32) -> HostIoResult<(), Self> {
method pread (line 138) | fn pread<'a>(
method pwrite (line 165) | fn pwrite(&mut self, fd: u32, offset: u32, data: &[u8]) -> HostIoResult<...
method fstat (line 182) | fn fstat(&mut self, fd: u32) -> HostIoResult<HostIoStat, Self> {
method unlink (line 241) | fn unlink(&mut self, filename: &[u8]) -> HostIoResult<(), Self> {
method readlink (line 250) | fn readlink<'a>(&mut self, filename: &[u8], buf: &mut [u8]) -> HostIoRes...
method setfs (line 279) | fn setfs(&mut self, _fs: FsKind) -> HostIoResult<(), Self> {
FILE: examples/armv4t/gdb/libraries.rs
method get_libraries_svr4 (line 7) | fn get_libraries_svr4(
method get_libraries (line 31) | fn get_libraries(
FILE: examples/armv4t/gdb/lldb_register_info_override.rs
method lldb_register_info (line 19) | fn lldb_register_info<'a>(
FILE: examples/armv4t/gdb/memory_map.rs
method memory_map_xml (line 7) | fn memory_map_xml(
FILE: examples/armv4t/gdb/mod.rs
function cpu_reg_id (line 33) | fn cpu_reg_id(id: ArmCoreRegId) -> Option<u8> {
function copy_to_buf (line 46) | pub fn copy_to_buf(data: &[u8], buf: &mut [u8]) -> usize {
function copy_range_to_buf (line 56) | pub fn copy_range_to_buf(data: &[u8], offset: u64, length: usize, buf: &...
type Arch (line 77) | type Arch = custom_arch::Armv4tCustom;
type Error (line 78) | type Error = &'static str;
method base_ops (line 86) | fn base_ops(&mut self) -> target::ext::base::BaseOps<'_, Self::Arch, Sel...
method support_breakpoints (line 91) | fn support_breakpoints(
method support_extended_mode (line 98) | fn support_extended_mode(
method support_monitor_cmd (line 105) | fn support_monitor_cmd(&mut self) -> Option<target::ext::monitor_cmd::Mo...
method support_section_offsets (line 110) | fn support_section_offsets(
method support_target_description_xml_override (line 117) | fn support_target_description_xml_override(
method support_lldb_register_info_override (line 126) | fn support_lldb_register_info_override(
method support_memory_map (line 134) | fn support_memory_map(&mut self) -> Option<target::ext::memory_map::Memo...
method support_catch_syscalls (line 139) | fn support_catch_syscalls(
method support_host_io (line 146) | fn support_host_io(&mut self) -> Option<target::ext::host_io::HostIoOps<...
method support_exec_file (line 151) | fn support_exec_file(&mut self) -> Option<target::ext::exec_file::ExecFi...
method support_auxv (line 156) | fn support_auxv(&mut self) -> Option<target::ext::auxv::AuxvOps<'_, Self...
method support_libraries_svr4 (line 161) | fn support_libraries_svr4(
method support_libraries (line 168) | fn support_libraries(&mut self) -> Option<target::ext::libraries::Librar...
method support_tracepoints (line 173) | fn support_tracepoints(
method support_flash_operations (line 180) | fn support_flash_operations(&mut self) -> Option<target::ext::flash::Fla...
method read_registers (line 186) | fn read_registers(
method write_registers (line 211) | fn write_registers(&mut self, regs: &custom_arch::ArmCoreRegsCustom) -> ...
method support_single_register_access (line 232) | fn support_single_register_access(
method read_addrs (line 239) | fn read_addrs(&mut self, start_addr: u32, data: &mut [u8]) -> TargetResu...
method write_addrs (line 253) | fn write_addrs(&mut self, start_addr: u32, data: &[u8]) -> TargetResult<...
method support_resume (line 267) | fn support_resume(
method resume (line 275) | fn resume(&mut self, signal: Option<Signal>) -> Result<(), Self::Error> {
method support_reverse_cont (line 299) | fn support_reverse_cont(
method support_reverse_step (line 306) | fn support_reverse_step(
method support_single_step (line 313) | fn support_single_step(
method support_range_step (line 320) | fn support_range_step(
method step (line 328) | fn step(&mut self, signal: Option<Signal>) -> Result<(), Self::Error> {
method read_register (line 340) | fn read_register(
method write_register (line 374) | fn write_register(
method reverse_cont (line 405) | fn reverse_cont(&mut self) -> Result<(), Self::Error> {
method reverse_step (line 416) | fn reverse_step(&mut self, _tid: ()) -> Result<(), Self::Error> {
method resume_range_step (line 427) | fn resume_range_step(&mut self, start: u32, end: u32) -> Result<(), Self...
type Armv4tCustom (line 448) | pub enum Armv4tCustom {}
type ArmCoreRegsCustom (line 451) | pub struct ArmCoreRegsCustom {
type ProgramCounter (line 457) | type ProgramCounter = u32;
method pc (line 459) | fn pc(&self) -> Self::ProgramCounter {
method gdb_serialize (line 463) | fn gdb_serialize(&self, mut write_byte: impl FnMut(Option<u8>)) {
method gdb_deserialize (line 477) | fn gdb_deserialize(&mut self, bytes: &[u8]) -> Result<(), ()> {
type ArmCoreRegIdCustom (line 516) | pub enum ArmCoreRegIdCustom {
method from_raw_id (line 527) | fn from_raw_id(id: usize) -> Option<(Self, Option<NonZeroUsize>)> {
type Usize (line 542) | type Usize = u32;
type Registers (line 543) | type Registers = ArmCoreRegsCustom;
type RegId (line 544) | type RegId = ArmCoreRegIdCustom;
type BreakpointKind (line 545) | type BreakpointKind = ArmBreakpointKind;
method target_description_xml (line 553) | fn target_description_xml() -> Option<&'static str> {
method lldb_register_info (line 563) | fn lldb_register_info(reg_id: usize) -> Option<RegisterInfo<'static>> {
FILE: examples/armv4t/gdb/monitor_cmd.rs
method handle_monitor_cmd (line 7) | fn handle_monitor_cmd(
FILE: examples/armv4t/gdb/section_offsets.rs
method get_section_offsets (line 9) | fn get_section_offsets(&mut self) -> Result<Offsets<u32>, Self::Error> {
FILE: examples/armv4t/gdb/target_description_xml_override.rs
method target_description_xml (line 8) | fn target_description_xml(
constant TARGET_XML (line 30) | const TARGET_XML: &str = r#"
constant EXTRA_XML (line 79) | const EXTRA_XML: &str = r#"
FILE: examples/armv4t/gdb/tracepoints.rs
method step_to_next_tracepoint (line 19) | fn step_to_next_tracepoint(&self, tp: Tracepoint) -> TracepointEnumerate...
method tracepoints_init (line 34) | fn tracepoints_init(&mut self) -> TargetResult<(), Self> {
method tracepoint_create_begin (line 40) | fn tracepoint_create_begin(&mut self, tp: NewTracepoint<u32>) -> TargetR...
method tracepoint_create_continue (line 45) | fn tracepoint_create_continue(
method tracepoint_create_complete (line 62) | fn tracepoint_create_complete(&mut self, _tp: Tracepoint) -> TargetResul...
method tracepoint_status (line 67) | fn tracepoint_status(
method tracepoint_enumerate_state (line 86) | fn tracepoint_enumerate_state(&mut self) -> &mut TracepointEnumerateStat...
method tracepoint_enumerate_start (line 90) | fn tracepoint_enumerate_start(
method tracepoint_enumerate_action (line 122) | fn tracepoint_enumerate_action(
method support_tracepoint_source (line 146) | fn support_tracepoint_source(
method trace_buffer_configure (line 152) | fn trace_buffer_configure(&mut self, _config: TraceBufferConfig) -> Targ...
method trace_buffer_request (line 158) | fn trace_buffer_request(
method trace_experiment_status (line 168) | fn trace_experiment_status(
method trace_experiment_info (line 181) | fn trace_experiment_info(
method select_frame (line 190) | fn select_frame(
method trace_experiment_start (line 226) | fn trace_experiment_start(&mut self) -> TargetResult<(), Self> {
method trace_experiment_stop (line 231) | fn trace_experiment_stop(&mut self) -> TargetResult<(), Self> {
method tracepoint_enumerate_source (line 238) | fn tracepoint_enumerate_source(
method tracepoint_attach_source (line 258) | fn tracepoint_attach_source(
FILE: examples/armv4t/main.rs
type DynResult (line 20) | type DynResult<T> = Result<T, Box<dyn std::error::Error>>;
constant TEST_PROGRAM_ELF (line 22) | const TEST_PROGRAM_ELF: &[u8] = include_bytes!("test_bin/test.elf");
function wait_for_tcp (line 28) | fn wait_for_tcp(port: u16) -> DynResult<TcpStream> {
function wait_for_uds (line 40) | fn wait_for_uds(path: &str) -> DynResult<UnixStream> {
type EmuGdbEventLoop (line 58) | enum EmuGdbEventLoop {}
type Target (line 61) | type Target = emu::Emu;
type Connection (line 62) | type Connection = Box<dyn ConnectionExt<Error = std::io::Error>>;
type StopReason (line 63) | type StopReason = SingleThreadStopReason<u32>;
method wait_for_stop_reason (line 66) | fn wait_for_stop_reason(
method on_interrupt (line 137) | fn on_interrupt(
function main (line 148) | fn main() -> DynResult<()> {
FILE: examples/armv4t/mem_sniffer.rs
type AccessKind (line 3) | pub enum AccessKind {
type Access (line 8) | pub struct Access {
type MemSniffer (line 20) | pub struct MemSniffer<'a, M, F: FnMut(Access)> {
function new (line 27) | pub fn new(mem: &'a mut M, addrs: &'a [u32], on_access: F) -> MemSniffer...
FILE: examples/armv4t/test_bin/test.c
function main (line 1) | int main() {
FILE: examples/armv4t_multicore/emu.rs
constant HLE_RETURN_ADDR (line 22) | const HLE_RETURN_ADDR: u32 = 0x12345678;
type CpuId (line 25) | pub enum CpuId {
type Event (line 31) | pub enum Event {
type ExecMode (line 40) | pub enum ExecMode {
type Emu (line 47) | pub struct Emu {
method new (line 65) | pub fn new(program_elf: &[u8]) -> DynResult<Emu> {
method step_core (line 115) | pub fn step_core(&mut self, id: CpuId) -> Option<Event> {
method step (line 188) | pub fn step(&mut self) -> Option<(Event, CpuId)> {
method run (line 206) | pub fn run(&mut self, mut poll_incoming_data: impl FnMut() -> bool) ->...
type RunEvent (line 247) | pub enum RunEvent {
FILE: examples/armv4t_multicore/gdb.rs
function cpuid_to_tid (line 16) | pub fn cpuid_to_tid(id: CpuId) -> Tid {
function tid_to_cpuid (line 23) | fn tid_to_cpuid(tid: Tid) -> Result<CpuId, &'static str> {
type Arch (line 32) | type Arch = gdbstub_arch::arm::Armv4t;
type Error (line 33) | type Error = &'static str;
method base_ops (line 36) | fn base_ops(&mut self) -> target::ext::base::BaseOps<'_, Self::Arch, Sel...
method support_breakpoints (line 41) | fn support_breakpoints(
method read_registers (line 49) | fn read_registers(
method write_registers (line 72) | fn write_registers(
method read_addrs (line 95) | fn read_addrs(
method write_addrs (line 107) | fn write_addrs(
method list_active_threads (line 119) | fn list_active_threads(
method support_resume (line 129) | fn support_resume(
method support_thread_extra_info (line 136) | fn support_thread_extra_info(
method resume (line 144) | fn resume(&mut self) -> Result<(), Self::Error> {
method clear_resume_actions (line 162) | fn clear_resume_actions(&mut self) -> Result<(), Self::Error> {
method support_single_step (line 168) | fn support_single_step(
method set_resume_action_continue (line 174) | fn set_resume_action_continue(
method support_scheduler_locking (line 190) | fn support_scheduler_locking(
method set_resume_action_step (line 198) | fn set_resume_action_step(
method support_sw_breakpoint (line 214) | fn support_sw_breakpoint(
method support_hw_watchpoint (line 220) | fn support_hw_watchpoint(
method add_sw_breakpoint (line 228) | fn add_sw_breakpoint(
method remove_sw_breakpoint (line 237) | fn remove_sw_breakpoint(
method add_hw_watchpoint (line 252) | fn add_hw_watchpoint(
method remove_hw_watchpoint (line 270) | fn remove_hw_watchpoint(
method thread_extra_info (line 296) | fn thread_extra_info(&self, tid: Tid, buf: &mut [u8]) -> Result<usize, S...
method set_resume_action_scheduler_lock (line 305) | fn set_resume_action_scheduler_lock(&mut self) -> Result<(), Self::Error> {
function copy_to_buf (line 315) | pub fn copy_to_buf(data: &[u8], buf: &mut [u8]) -> usize {
FILE: examples/armv4t_multicore/main.rs
type DynResult (line 21) | type DynResult<T> = Result<T, Box<dyn std::error::Error>>;
function wait_for_tcp (line 29) | fn wait_for_tcp(port: u16) -> DynResult<TcpStream> {
function wait_for_uds (line 41) | fn wait_for_uds(path: &str) -> DynResult<UnixStream> {
type EmuGdbEventLoop (line 59) | enum EmuGdbEventLoop {}
type Target (line 62) | type Target = emu::Emu;
type Connection (line 63) | type Connection = Box<dyn ConnectionExt<Error = std::io::Error>>;
type StopReason (line 64) | type StopReason = MultiThreadStopReason<u32>;
method wait_for_stop_reason (line 67) | fn wait_for_stop_reason(
method on_interrupt (line 139) | fn on_interrupt(
function main (line 150) | fn main() -> DynResult<()> {
FILE: examples/armv4t_multicore/mem_sniffer.rs
type AccessKind (line 4) | pub enum AccessKind {
type Access (line 10) | pub struct Access {
type MemSniffer (line 22) | pub struct MemSniffer<'a, M, F: FnMut(Access)> {
function new (line 29) | pub fn new(mem: &'a mut M, addrs: &'a [u32], on_access: F) -> MemSniffer...
FILE: examples/armv4t_multicore/test_bin/test.c
function main (line 3) | int main() {
FILE: gdbstub_arch/src/aarch64/mod.rs
type AArch64 (line 15) | pub struct AArch64 {}
type Usize (line 18) | type Usize = u64;
type Registers (line 19) | type Registers = reg::AArch64CoreRegs;
type RegId (line 20) | type RegId = reg::id::AArch64RegId;
type BreakpointKind (line 21) | type BreakpointKind = usize;
method target_description_xml (line 23) | fn target_description_xml() -> Option<&'static str> {
FILE: gdbstub_arch/src/aarch64/reg/aarch64_core.rs
type AArch64CoreRegs (line 9) | pub struct AArch64CoreRegs {
type ProgramCounter (line 27) | type ProgramCounter = u64;
method pc (line 29) | fn pc(&self) -> Self::ProgramCounter {
method gdb_serialize (line 33) | fn gdb_serialize(&self, mut write_byte: impl FnMut(Option<u8>)) {
method gdb_deserialize (line 55) | fn gdb_deserialize(&mut self, bytes: &[u8]) -> Result<(), ()> {
FILE: gdbstub_arch/src/aarch64/reg/id.rs
type AArch64RegId (line 33) | pub enum AArch64RegId {
method len (line 74) | pub fn len(&self) -> Option<usize> {
constant MIDR_EL1 (line 85) | pub const MIDR_EL1: Self = Self::System(0b11_000_0000_0000_000);
constant MPIDR_EL1 (line 87) | pub const MPIDR_EL1: Self = Self::System(0b11_000_0000_0000_101);
constant REVIDR_EL1 (line 89) | pub const REVIDR_EL1: Self = Self::System(0b11_000_0000_0000_110);
constant ID_PFR0_EL1 (line 91) | pub const ID_PFR0_EL1: Self = Self::System(0b11_000_0000_0001_000);
constant ID_PFR1_EL1 (line 93) | pub const ID_PFR1_EL1: Self = Self::System(0b11_000_0000_0001_001);
constant ID_DFR0_EL1 (line 95) | pub const ID_DFR0_EL1: Self = Self::System(0b11_000_0000_0001_010);
constant ID_AFR0_EL1 (line 97) | pub const ID_AFR0_EL1: Self = Self::System(0b11_000_0000_0001_011);
constant ID_MMFR0_EL1 (line 99) | pub const ID_MMFR0_EL1: Self = Self::System(0b11_000_0000_0001_100);
constant ID_MMFR1_EL1 (line 101) | pub const ID_MMFR1_EL1: Self = Self::System(0b11_000_0000_0001_101);
constant ID_MMFR2_EL1 (line 103) | pub const ID_MMFR2_EL1: Self = Self::System(0b11_000_0000_0001_110);
constant ID_MMFR3_EL1 (line 105) | pub const ID_MMFR3_EL1: Self = Self::System(0b11_000_0000_0001_111);
constant ID_ISAR0_EL1 (line 107) | pub const ID_ISAR0_EL1: Self = Self::System(0b11_000_0000_0010_000);
constant ID_ISAR1_EL1 (line 109) | pub const ID_ISAR1_EL1: Self = Self::System(0b11_000_0000_0010_001);
constant ID_ISAR2_EL1 (line 111) | pub const ID_ISAR2_EL1: Self = Self::System(0b11_000_0000_0010_010);
constant ID_ISAR3_EL1 (line 113) | pub const ID_ISAR3_EL1: Self = Self::System(0b11_000_0000_0010_011);
constant ID_ISAR4_EL1 (line 115) | pub const ID_ISAR4_EL1: Self = Self::System(0b11_000_0000_0010_100);
constant ID_ISAR5_EL1 (line 117) | pub const ID_ISAR5_EL1: Self = Self::System(0b11_000_0000_0010_101);
constant ID_MMFR4_EL1 (line 119) | pub const ID_MMFR4_EL1: Self = Self::System(0b11_000_0000_0010_110);
constant ID_ISAR6_EL1 (line 121) | pub const ID_ISAR6_EL1: Self = Self::System(0b11_000_0000_0010_111);
constant MVFR0_EL1 (line 123) | pub const MVFR0_EL1: Self = Self::System(0b11_000_0000_0011_000);
constant MVFR1_EL1 (line 125) | pub const MVFR1_EL1: Self = Self::System(0b11_000_0000_0011_001);
constant MVFR2_EL1 (line 127) | pub const MVFR2_EL1: Self = Self::System(0b11_000_0000_0011_010);
constant ID_PFR2_EL1 (line 129) | pub const ID_PFR2_EL1: Self = Self::System(0b11_000_0000_0011_100);
constant ID_DFR1_EL1 (line 131) | pub const ID_DFR1_EL1: Self = Self::System(0b11_000_0000_0011_101);
constant ID_MMFR5_EL1 (line 133) | pub const ID_MMFR5_EL1: Self = Self::System(0b11_000_0000_0011_110);
constant ID_AA64PFR0_EL1 (line 135) | pub const ID_AA64PFR0_EL1: Self = Self::System(0b11_000_0000_0100_000);
constant ID_AA64PFR1_EL1 (line 137) | pub const ID_AA64PFR1_EL1: Self = Self::System(0b11_000_0000_0100_001);
constant ID_AA64ZFR0_EL1 (line 139) | pub const ID_AA64ZFR0_EL1: Self = Self::System(0b11_000_0000_0100_100);
constant ID_AA64SMFR0_EL1 (line 141) | pub const ID_AA64SMFR0_EL1: Self = Self::System(0b11_000_0000_0100_101);
constant ID_AA64DFR0_EL1 (line 143) | pub const ID_AA64DFR0_EL1: Self = Self::System(0b11_000_0000_0101_000);
constant ID_AA64DFR1_EL1 (line 145) | pub const ID_AA64DFR1_EL1: Self = Self::System(0b11_000_0000_0101_001);
constant ID_AA64AFR0_EL1 (line 147) | pub const ID_AA64AFR0_EL1: Self = Self::System(0b11_000_0000_0101_100);
constant ID_AA64AFR1_EL1 (line 149) | pub const ID_AA64AFR1_EL1: Self = Self::System(0b11_000_0000_0101_101);
constant ID_AA64ISAR0_EL1 (line 151) | pub const ID_AA64ISAR0_EL1: Self = Self::System(0b11_000_0000_0110_000);
constant ID_AA64ISAR1_EL1 (line 153) | pub const ID_AA64ISAR1_EL1: Self = Self::System(0b11_000_0000_0110_001);
constant ID_AA64ISAR2_EL1 (line 155) | pub const ID_AA64ISAR2_EL1: Self = Self::System(0b11_000_0000_0110_010);
constant ID_AA64MMFR0_EL1 (line 157) | pub const ID_AA64MMFR0_EL1: Self = Self::System(0b11_000_0000_0111_000);
constant ID_AA64MMFR1_EL1 (line 159) | pub const ID_AA64MMFR1_EL1: Self = Self::System(0b11_000_0000_0111_001);
constant ID_AA64MMFR2_EL1 (line 161) | pub const ID_AA64MMFR2_EL1: Self = Self::System(0b11_000_0000_0111_010);
constant SCTLR_EL1 (line 163) | pub const SCTLR_EL1: Self = Self::System(0b11_000_0001_0000_000);
constant ACTLR_EL1 (line 165) | pub const ACTLR_EL1: Self = Self::System(0b11_000_0001_0000_001);
constant CPACR_EL1 (line 167) | pub const CPACR_EL1: Self = Self::System(0b11_000_0001_0000_010);
constant RGSR_EL1 (line 169) | pub const RGSR_EL1: Self = Self::System(0b11_000_0001_0000_101);
constant GCR_EL1 (line 171) | pub const GCR_EL1: Self = Self::System(0b11_000_0001_0000_110);
constant ZCR_EL1 (line 173) | pub const ZCR_EL1: Self = Self::System(0b11_000_0001_0010_000);
constant TRFCR_EL1 (line 175) | pub const TRFCR_EL1: Self = Self::System(0b11_000_0001_0010_001);
constant SMPRI_EL1 (line 177) | pub const SMPRI_EL1: Self = Self::System(0b11_000_0001_0010_100);
constant SMCR_EL1 (line 179) | pub const SMCR_EL1: Self = Self::System(0b11_000_0001_0010_110);
constant TTBR0_EL1 (line 181) | pub const TTBR0_EL1: Self = Self::System(0b11_000_0010_0000_000);
constant TTBR1_EL1 (line 183) | pub const TTBR1_EL1: Self = Self::System(0b11_000_0010_0000_001);
constant TCR_EL1 (line 185) | pub const TCR_EL1: Self = Self::System(0b11_000_0010_0000_010);
constant APIAKEYLO_EL1 (line 187) | pub const APIAKEYLO_EL1: Self = Self::System(0b11_000_0010_0001_000);
constant APIAKEYHI_EL1 (line 189) | pub const APIAKEYHI_EL1: Self = Self::System(0b11_000_0010_0001_001);
constant APIBKEYLO_EL1 (line 191) | pub const APIBKEYLO_EL1: Self = Self::System(0b11_000_0010_0001_010);
constant APIBKEYHI_EL1 (line 193) | pub const APIBKEYHI_EL1: Self = Self::System(0b11_000_0010_0001_011);
constant APDAKEYLO_EL1 (line 195) | pub const APDAKEYLO_EL1: Self = Self::System(0b11_000_0010_0010_000);
constant APDAKEYHI_EL1 (line 197) | pub const APDAKEYHI_EL1: Self = Self::System(0b11_000_0010_0010_001);
constant APDBKEYLO_EL1 (line 199) | pub const APDBKEYLO_EL1: Self = Self::System(0b11_000_0010_0010_010);
constant APDBKEYHI_EL1 (line 201) | pub const APDBKEYHI_EL1: Self = Self::System(0b11_000_0010_0010_011);
constant APGAKEYLO_EL1 (line 203) | pub const APGAKEYLO_EL1: Self = Self::System(0b11_000_0010_0011_000);
constant APGAKEYHI_EL1 (line 205) | pub const APGAKEYHI_EL1: Self = Self::System(0b11_000_0010_0011_001);
constant SPSR_EL1 (line 207) | pub const SPSR_EL1: Self = Self::System(0b11_000_0100_0000_000);
constant ELR_EL1 (line 209) | pub const ELR_EL1: Self = Self::System(0b11_000_0100_0000_001);
constant SP_EL0 (line 211) | pub const SP_EL0: Self = Self::System(0b11_000_0100_0001_000);
constant ICC_PMR_EL1 (line 213) | pub const ICC_PMR_EL1: Self = Self::System(0b11_000_0100_0110_000);
constant ICV_PMR_EL1 (line 215) | pub const ICV_PMR_EL1: Self = Self::System(0b11_000_0100_0110_000);
constant AFSR0_EL1 (line 217) | pub const AFSR0_EL1: Self = Self::System(0b11_000_0101_0001_000);
constant AFSR1_EL1 (line 219) | pub const AFSR1_EL1: Self = Self::System(0b11_000_0101_0001_001);
constant ESR_EL1 (line 221) | pub const ESR_EL1: Self = Self::System(0b11_000_0101_0010_000);
constant ERRIDR_EL1 (line 223) | pub const ERRIDR_EL1: Self = Self::System(0b11_000_0101_0011_000);
constant ERRSELR_EL1 (line 225) | pub const ERRSELR_EL1: Self = Self::System(0b11_000_0101_0011_001);
constant ERXFR_EL1 (line 227) | pub const ERXFR_EL1: Self = Self::System(0b11_000_0101_0100_000);
constant ERXCTLR_EL1 (line 229) | pub const ERXCTLR_EL1: Self = Self::System(0b11_000_0101_0100_001);
constant ERXSTATUS_EL1 (line 231) | pub const ERXSTATUS_EL1: Self = Self::System(0b11_000_0101_0100_010);
constant ERXADDR_EL1 (line 233) | pub const ERXADDR_EL1: Self = Self::System(0b11_000_0101_0100_011);
constant ERXPFGF_EL1 (line 235) | pub const ERXPFGF_EL1: Self = Self::System(0b11_000_0101_0100_100);
constant ERXPFGCTL_EL1 (line 237) | pub const ERXPFGCTL_EL1: Self = Self::System(0b11_000_0101_0100_101);
constant ERXPFGCDN_EL1 (line 239) | pub const ERXPFGCDN_EL1: Self = Self::System(0b11_000_0101_0100_110);
constant ERXMISC0_EL1 (line 241) | pub const ERXMISC0_EL1: Self = Self::System(0b11_000_0101_0101_000);
constant ERXMISC1_EL1 (line 243) | pub const ERXMISC1_EL1: Self = Self::System(0b11_000_0101_0101_001);
constant ERXMISC2_EL1 (line 245) | pub const ERXMISC2_EL1: Self = Self::System(0b11_000_0101_0101_010);
constant ERXMISC3_EL1 (line 247) | pub const ERXMISC3_EL1: Self = Self::System(0b11_000_0101_0101_011);
constant TFSR_EL1 (line 249) | pub const TFSR_EL1: Self = Self::System(0b11_000_0101_0110_000);
constant TFSRE0_EL1 (line 251) | pub const TFSRE0_EL1: Self = Self::System(0b11_000_0101_0110_001);
constant FAR_EL1 (line 253) | pub const FAR_EL1: Self = Self::System(0b11_000_0110_0000_000);
constant PAR_EL1 (line 255) | pub const PAR_EL1: Self = Self::System(0b11_000_0111_0100_000);
constant PMSCR_EL1 (line 257) | pub const PMSCR_EL1: Self = Self::System(0b11_000_1001_1001_000);
constant PMSNEVFR_EL1 (line 259) | pub const PMSNEVFR_EL1: Self = Self::System(0b11_000_1001_1001_001);
constant PMSICR_EL1 (line 261) | pub const PMSICR_EL1: Self = Self::System(0b11_000_1001_1001_010);
constant PMSIRR_EL1 (line 263) | pub const PMSIRR_EL1: Self = Self::System(0b11_000_1001_1001_011);
constant PMSFCR_EL1 (line 265) | pub const PMSFCR_EL1: Self = Self::System(0b11_000_1001_1001_100);
constant PMSEVFR_EL1 (line 267) | pub const PMSEVFR_EL1: Self = Self::System(0b11_000_1001_1001_101);
constant PMSLATFR_EL1 (line 269) | pub const PMSLATFR_EL1: Self = Self::System(0b11_000_1001_1001_110);
constant PMSIDR_EL1 (line 271) | pub const PMSIDR_EL1: Self = Self::System(0b11_000_1001_1001_111);
constant PMBLIMITR_EL1 (line 273) | pub const PMBLIMITR_EL1: Self = Self::System(0b11_000_1001_1010_000);
constant PMBPTR_EL1 (line 275) | pub const PMBPTR_EL1: Self = Self::System(0b11_000_1001_1010_001);
constant PMBSR_EL1 (line 277) | pub const PMBSR_EL1: Self = Self::System(0b11_000_1001_1010_011);
constant PMBIDR_EL1 (line 279) | pub const PMBIDR_EL1: Self = Self::System(0b11_000_1001_1010_111);
constant TRBLIMITR_EL1 (line 281) | pub const TRBLIMITR_EL1: Self = Self::System(0b11_000_1001_1011_000);
constant TRBPTR_EL1 (line 283) | pub const TRBPTR_EL1: Self = Self::System(0b11_000_1001_1011_001);
constant TRBBASER_EL1 (line 285) | pub const TRBBASER_EL1: Self = Self::System(0b11_000_1001_1011_010);
constant TRBSR_EL1 (line 287) | pub const TRBSR_EL1: Self = Self::System(0b11_000_1001_1011_011);
constant TRBMAR_EL1 (line 289) | pub const TRBMAR_EL1: Self = Self::System(0b11_000_1001_1011_100);
constant TRBTRG_EL1 (line 291) | pub const TRBTRG_EL1: Self = Self::System(0b11_000_1001_1011_110);
constant TRBIDR_EL1 (line 293) | pub const TRBIDR_EL1: Self = Self::System(0b11_000_1001_1011_111);
constant PMINTENSET_EL1 (line 295) | pub const PMINTENSET_EL1: Self = Self::System(0b11_000_1001_1110_001);
constant PMINTENCLR_EL1 (line 297) | pub const PMINTENCLR_EL1: Self = Self::System(0b11_000_1001_1110_010);
constant PMMIR_EL1 (line 299) | pub const PMMIR_EL1: Self = Self::System(0b11_000_1001_1110_110);
constant MAIR_EL1 (line 301) | pub const MAIR_EL1: Self = Self::System(0b11_000_1010_0010_000);
constant AMAIR_EL1 (line 303) | pub const AMAIR_EL1: Self = Self::System(0b11_000_1010_0011_000);
constant LORSA_EL1 (line 305) | pub const LORSA_EL1: Self = Self::System(0b11_000_1010_0100_000);
constant LOREA_EL1 (line 307) | pub const LOREA_EL1: Self = Self::System(0b11_000_1010_0100_001);
constant LORN_EL1 (line 309) | pub const LORN_EL1: Self = Self::System(0b11_000_1010_0100_010);
constant LORC_EL1 (line 311) | pub const LORC_EL1: Self = Self::System(0b11_000_1010_0100_011);
constant MPAMIDR_EL1 (line 313) | pub const MPAMIDR_EL1: Self = Self::System(0b11_000_1010_0100_100);
constant LORID_EL1 (line 315) | pub const LORID_EL1: Self = Self::System(0b11_000_1010_0100_111);
constant MPAM1_EL1 (line 317) | pub const MPAM1_EL1: Self = Self::System(0b11_000_1010_0101_000);
constant MPAM0_EL1 (line 319) | pub const MPAM0_EL1: Self = Self::System(0b11_000_1010_0101_001);
constant MPAMSM_EL1 (line 321) | pub const MPAMSM_EL1: Self = Self::System(0b11_000_1010_0101_011);
constant VBAR_EL1 (line 323) | pub const VBAR_EL1: Self = Self::System(0b11_000_1100_0000_000);
constant RVBAR_EL1 (line 325) | pub const RVBAR_EL1: Self = Self::System(0b11_000_1100_0000_001);
constant RMR_EL1 (line 327) | pub const RMR_EL1: Self = Self::System(0b11_000_1100_0000_010);
constant ISR_EL1 (line 329) | pub const ISR_EL1: Self = Self::System(0b11_000_1100_0001_000);
constant DISR_EL1 (line 331) | pub const DISR_EL1: Self = Self::System(0b11_000_1100_0001_001);
constant ICC_IAR0_EL1 (line 333) | pub const ICC_IAR0_EL1: Self = Self::System(0b11_000_1100_1000_000);
constant ICV_IAR0_EL1 (line 335) | pub const ICV_IAR0_EL1: Self = Self::System(0b11_000_1100_1000_000);
constant ICC_EOIR0_EL1 (line 337) | pub const ICC_EOIR0_EL1: Self = Self::System(0b11_000_1100_1000_001);
constant ICV_EOIR0_EL1 (line 339) | pub const ICV_EOIR0_EL1: Self = Self::System(0b11_000_1100_1000_001);
constant ICC_HPPIR0_EL1 (line 341) | pub const ICC_HPPIR0_EL1: Self = Self::System(0b11_000_1100_1000_010);
constant ICV_HPPIR0_EL1 (line 344) | pub const ICV_HPPIR0_EL1: Self = Self::System(0b11_000_1100_1000_010);
constant ICC_BPR0_EL1 (line 346) | pub const ICC_BPR0_EL1: Self = Self::System(0b11_000_1100_1000_011);
constant ICV_BPR0_EL1 (line 348) | pub const ICV_BPR0_EL1: Self = Self::System(0b11_000_1100_1000_011);
constant ICC_AP0R0_EL1 (line 350) | pub const ICC_AP0R0_EL1: Self = Self::System(0b11_000_1100_1000_100);
constant ICV_AP0R0_EL1 (line 352) | pub const ICV_AP0R0_EL1: Self = Self::System(0b11_000_1100_1000_100);
constant ICC_AP0R1_EL1 (line 354) | pub const ICC_AP0R1_EL1: Self = Self::System(0b11_000_1100_1000_101);
constant ICV_AP0R1_EL1 (line 356) | pub const ICV_AP0R1_EL1: Self = Self::System(0b11_000_1100_1000_101);
constant ICC_AP0R2_EL1 (line 358) | pub const ICC_AP0R2_EL1: Self = Self::System(0b11_000_1100_1000_110);
constant ICV_AP0R2_EL1 (line 360) | pub const ICV_AP0R2_EL1: Self = Self::System(0b11_000_1100_1000_110);
constant ICC_AP0R3_EL1 (line 362) | pub const ICC_AP0R3_EL1: Self = Self::System(0b11_000_1100_1000_111);
constant ICV_AP0R3_EL1 (line 364) | pub const ICV_AP0R3_EL1: Self = Self::System(0b11_000_1100_1000_111);
constant ICC_AP1R0_EL1 (line 366) | pub const ICC_AP1R0_EL1: Self = Self::System(0b11_000_1100_1001_000);
constant ICV_AP1R0_EL1 (line 368) | pub const ICV_AP1R0_EL1: Self = Self::System(0b11_000_1100_1001_000);
constant ICC_AP1R1_EL1 (line 370) | pub const ICC_AP1R1_EL1: Self = Self::System(0b11_000_1100_1001_001);
constant ICV_AP1R1_EL1 (line 372) | pub const ICV_AP1R1_EL1: Self = Self::System(0b11_000_1100_1001_001);
constant ICC_AP1R2_EL1 (line 374) | pub const ICC_AP1R2_EL1: Self = Self::System(0b11_000_1100_1001_010);
constant ICV_AP1R2_EL1 (line 376) | pub const ICV_AP1R2_EL1: Self = Self::System(0b11_000_1100_1001_010);
constant ICC_AP1R3_EL1 (line 378) | pub const ICC_AP1R3_EL1: Self = Self::System(0b11_000_1100_1001_011);
constant ICV_AP1R3_EL1 (line 380) | pub const ICV_AP1R3_EL1: Self = Self::System(0b11_000_1100_1001_011);
constant ICC_NMIAR1_EL1 (line 382) | pub const ICC_NMIAR1_EL1: Self = Self::System(0b11_000_1100_1001_101);
constant ICV_NMIAR1_EL1 (line 385) | pub const ICV_NMIAR1_EL1: Self = Self::System(0b11_000_1100_1001_101);
constant ICC_DIR_EL1 (line 387) | pub const ICC_DIR_EL1: Self = Self::System(0b11_000_1100_1011_001);
constant ICV_DIR_EL1 (line 389) | pub const ICV_DIR_EL1: Self = Self::System(0b11_000_1100_1011_001);
constant ICC_RPR_EL1 (line 391) | pub const ICC_RPR_EL1: Self = Self::System(0b11_000_1100_1011_011);
constant ICV_RPR_EL1 (line 393) | pub const ICV_RPR_EL1: Self = Self::System(0b11_000_1100_1011_011);
constant ICC_SGI1R_EL1 (line 395) | pub const ICC_SGI1R_EL1: Self = Self::System(0b11_000_1100_1011_101);
constant ICC_ASGI1R_EL1 (line 397) | pub const ICC_ASGI1R_EL1: Self = Self::System(0b11_000_1100_1011_110);
constant ICC_SGI0R_EL1 (line 399) | pub const ICC_SGI0R_EL1: Self = Self::System(0b11_000_1100_1011_111);
constant ICC_IAR1_EL1 (line 401) | pub const ICC_IAR1_EL1: Self = Self::System(0b11_000_1100_1100_000);
constant ICV_IAR1_EL1 (line 403) | pub const ICV_IAR1_EL1: Self = Self::System(0b11_000_1100_1100_000);
constant ICC_EOIR1_EL1 (line 405) | pub const ICC_EOIR1_EL1: Self = Self::System(0b11_000_1100_1100_001);
constant ICV_EOIR1_EL1 (line 407) | pub const ICV_EOIR1_EL1: Self = Self::System(0b11_000_1100_1100_001);
constant ICC_HPPIR1_EL1 (line 409) | pub const ICC_HPPIR1_EL1: Self = Self::System(0b11_000_1100_1100_010);
constant ICV_HPPIR1_EL1 (line 412) | pub const ICV_HPPIR1_EL1: Self = Self::System(0b11_000_1100_1100_010);
constant ICC_BPR1_EL1 (line 414) | pub const ICC_BPR1_EL1: Self = Self::System(0b11_000_1100_1100_011);
constant ICV_BPR1_EL1 (line 416) | pub const ICV_BPR1_EL1: Self = Self::System(0b11_000_1100_1100_011);
constant ICC_CTLR_EL1 (line 418) | pub const ICC_CTLR_EL1: Self = Self::System(0b11_000_1100_1100_100);
constant ICV_CTLR_EL1 (line 420) | pub const ICV_CTLR_EL1: Self = Self::System(0b11_000_1100_1100_100);
constant ICC_SRE_EL1 (line 422) | pub const ICC_SRE_EL1: Self = Self::System(0b11_000_1100_1100_101);
constant ICC_IGRPEN0_EL1 (line 424) | pub const ICC_IGRPEN0_EL1: Self = Self::System(0b11_000_1100_1100_110);
constant ICV_IGRPEN0_EL1 (line 426) | pub const ICV_IGRPEN0_EL1: Self = Self::System(0b11_000_1100_1100_110);
constant ICC_IGRPEN1_EL1 (line 428) | pub const ICC_IGRPEN1_EL1: Self = Self::System(0b11_000_1100_1100_111);
constant ICV_IGRPEN1_EL1 (line 430) | pub const ICV_IGRPEN1_EL1: Self = Self::System(0b11_000_1100_1100_111);
constant CONTEXTIDR_EL1 (line 432) | pub const CONTEXTIDR_EL1: Self = Self::System(0b11_000_1101_0000_001);
constant TPIDR_EL1 (line 434) | pub const TPIDR_EL1: Self = Self::System(0b11_000_1101_0000_100);
constant ACCDATA_EL1 (line 436) | pub const ACCDATA_EL1: Self = Self::System(0b11_000_1101_0000_101);
constant SCXTNUM_EL1 (line 438) | pub const SCXTNUM_EL1: Self = Self::System(0b11_000_1101_0000_111);
constant CNTKCTL_EL1 (line 440) | pub const CNTKCTL_EL1: Self = Self::System(0b11_000_1110_0001_000);
constant CCSIDR_EL1 (line 442) | pub const CCSIDR_EL1: Self = Self::System(0b11_001_0000_0000_000);
constant CLIDR_EL1 (line 444) | pub const CLIDR_EL1: Self = Self::System(0b11_001_0000_0000_001);
constant CCSIDR2_EL1 (line 446) | pub const CCSIDR2_EL1: Self = Self::System(0b11_001_0000_0000_010);
constant GMID_EL1 (line 448) | pub const GMID_EL1: Self = Self::System(0b11_001_0000_0000_100);
constant SMIDR_EL1 (line 450) | pub const SMIDR_EL1: Self = Self::System(0b11_001_0000_0000_110);
constant AIDR_EL1 (line 452) | pub const AIDR_EL1: Self = Self::System(0b11_001_0000_0000_111);
constant CSSELR_EL1 (line 454) | pub const CSSELR_EL1: Self = Self::System(0b11_010_0000_0000_000);
constant CTR_EL0 (line 456) | pub const CTR_EL0: Self = Self::System(0b11_011_0000_0000_001);
constant DCZID_EL0 (line 458) | pub const DCZID_EL0: Self = Self::System(0b11_011_0000_0000_111);
constant RNDR (line 460) | pub const RNDR: Self = Self::System(0b11_011_0010_0100_000);
constant RNDRRS (line 462) | pub const RNDRRS: Self = Self::System(0b11_011_0010_0100_001);
constant SVCR (line 464) | pub const SVCR: Self = Self::System(0b11_011_0100_0010_010);
constant FPCR (line 466) | pub const FPCR: Self = Self::System(0b11_011_0100_0100_000);
constant FPSR (line 468) | pub const FPSR: Self = Self::System(0b11_011_0100_0100_001);
constant DSPSR_EL0 (line 470) | pub const DSPSR_EL0: Self = Self::System(0b11_011_0100_0101_000);
constant DLR_EL0 (line 472) | pub const DLR_EL0: Self = Self::System(0b11_011_0100_0101_001);
constant PMCR_EL0 (line 474) | pub const PMCR_EL0: Self = Self::System(0b11_011_1001_1100_000);
constant PMCNTENSET_EL0 (line 476) | pub const PMCNTENSET_EL0: Self = Self::System(0b11_011_1001_1100_001);
constant PMCNTENCLR_EL0 (line 478) | pub const PMCNTENCLR_EL0: Self = Self::System(0b11_011_1001_1100_010);
constant PMOVSCLR_EL0 (line 480) | pub const PMOVSCLR_EL0: Self = Self::System(0b11_011_1001_1100_011);
constant PMSWINC_EL0 (line 482) | pub const PMSWINC_EL0: Self = Self::System(0b11_011_1001_1100_100);
constant PMSELR_EL0 (line 484) | pub const PMSELR_EL0: Self = Self::System(0b11_011_1001_1100_101);
constant PMCEID0_EL0 (line 486) | pub const PMCEID0_EL0: Self = Self::System(0b11_011_1001_1100_110);
constant PMCEID1_EL0 (line 488) | pub const PMCEID1_EL0: Self = Self::System(0b11_011_1001_1100_111);
constant PMCCNTR_EL0 (line 490) | pub const PMCCNTR_EL0: Self = Self::System(0b11_011_1001_1101_000);
constant PMXEVTYPER_EL0 (line 492) | pub const PMXEVTYPER_EL0: Self = Self::System(0b11_011_1001_1101_001);
constant PMXEVCNTR_EL0 (line 494) | pub const PMXEVCNTR_EL0: Self = Self::System(0b11_011_1001_1101_010);
constant PMUSERENR_EL0 (line 496) | pub const PMUSERENR_EL0: Self = Self::System(0b11_011_1001_1110_000);
constant PMOVSSET_EL0 (line 498) | pub const PMOVSSET_EL0: Self = Self::System(0b11_011_1001_1110_011);
constant TPIDR_EL0 (line 500) | pub const TPIDR_EL0: Self = Self::System(0b11_011_1101_0000_010);
constant TPIDRRO_EL0 (line 502) | pub const TPIDRRO_EL0: Self = Self::System(0b11_011_1101_0000_011);
constant TPIDR2_EL0 (line 504) | pub const TPIDR2_EL0: Self = Self::System(0b11_011_1101_0000_101);
constant SCXTNUM_EL0 (line 506) | pub const SCXTNUM_EL0: Self = Self::System(0b11_011_1101_0000_111);
constant AMCR_EL0 (line 508) | pub const AMCR_EL0: Self = Self::System(0b11_011_1101_0010_000);
constant AMCFGR_EL0 (line 510) | pub const AMCFGR_EL0: Self = Self::System(0b11_011_1101_0010_001);
constant AMCGCR_EL0 (line 512) | pub const AMCGCR_EL0: Self = Self::System(0b11_011_1101_0010_010);
constant AMUSERENR_EL0 (line 514) | pub const AMUSERENR_EL0: Self = Self::System(0b11_011_1101_0010_011);
constant AMCNTENCLR0_EL0 (line 516) | pub const AMCNTENCLR0_EL0: Self = Self::System(0b11_011_1101_0010_100);
constant AMCNTENSET0_EL0 (line 518) | pub const AMCNTENSET0_EL0: Self = Self::System(0b11_011_1101_0010_101);
constant AMCG1IDR_EL0 (line 520) | pub const AMCG1IDR_EL0: Self = Self::System(0b11_011_1101_0010_110);
constant AMCNTENCLR1_EL0 (line 522) | pub const AMCNTENCLR1_EL0: Self = Self::System(0b11_011_1101_0011_000);
constant AMCNTENSET1_EL0 (line 524) | pub const AMCNTENSET1_EL0: Self = Self::System(0b11_011_1101_0011_001);
constant AMEVCNTR00_EL0 (line 526) | pub const AMEVCNTR00_EL0: Self = Self::System(0b11_011_1101_0100_000);
constant AMEVCNTR01_EL0 (line 528) | pub const AMEVCNTR01_EL0: Self = Self::System(0b11_011_1101_0100_001);
constant AMEVCNTR02_EL0 (line 530) | pub const AMEVCNTR02_EL0: Self = Self::System(0b11_011_1101_0100_010);
constant AMEVCNTR03_EL0 (line 532) | pub const AMEVCNTR03_EL0: Self = Self::System(0b11_011_1101_0100_011);
constant AMEVTYPER00_EL0 (line 534) | pub const AMEVTYPER00_EL0: Self = Self::System(0b11_011_1101_0110_000);
constant AMEVTYPER01_EL0 (line 536) | pub const AMEVTYPER01_EL0: Self = Self::System(0b11_011_1101_0110_001);
constant AMEVTYPER02_EL0 (line 538) | pub const AMEVTYPER02_EL0: Self = Self::System(0b11_011_1101_0110_010);
constant AMEVTYPER03_EL0 (line 540) | pub const AMEVTYPER03_EL0: Self = Self::System(0b11_011_1101_0110_011);
constant AMEVCNTR10_EL0 (line 542) | pub const AMEVCNTR10_EL0: Self = Self::System(0b11_011_1101_1100_000);
constant AMEVCNTR11_EL0 (line 544) | pub const AMEVCNTR11_EL0: Self = Self::System(0b11_011_1101_1100_001);
constant AMEVCNTR12_EL0 (line 546) | pub const AMEVCNTR12_EL0: Self = Self::System(0b11_011_1101_1100_010);
constant AMEVCNTR13_EL0 (line 548) | pub const AMEVCNTR13_EL0: Self = Self::System(0b11_011_1101_1100_011);
constant AMEVCNTR14_EL0 (line 550) | pub const AMEVCNTR14_EL0: Self = Self::System(0b11_011_1101_1100_100);
constant AMEVCNTR15_EL0 (line 552) | pub const AMEVCNTR15_EL0: Self = Self::System(0b11_011_1101_1100_101);
constant AMEVCNTR16_EL0 (line 554) | pub const AMEVCNTR16_EL0: Self = Self::System(0b11_011_1101_1100_110);
constant AMEVCNTR17_EL0 (line 556) | pub const AMEVCNTR17_EL0: Self = Self::System(0b11_011_1101_1100_111);
constant AMEVCNTR18_EL0 (line 558) | pub const AMEVCNTR18_EL0: Self = Self::System(0b11_011_1101_1101_000);
constant AMEVCNTR19_EL0 (line 560) | pub const AMEVCNTR19_EL0: Self = Self::System(0b11_011_1101_1101_001);
constant AMEVCNTR110_EL0 (line 562) | pub const AMEVCNTR110_EL0: Self = Self::System(0b11_011_1101_1101_010);
constant AMEVCNTR111_EL0 (line 564) | pub const AMEVCNTR111_EL0: Self = Self::System(0b11_011_1101_1101_011);
constant AMEVCNTR112_EL0 (line 566) | pub const AMEVCNTR112_EL0: Self = Self::System(0b11_011_1101_1101_100);
constant AMEVCNTR113_EL0 (line 568) | pub const AMEVCNTR113_EL0: Self = Self::System(0b11_011_1101_1101_101);
constant AMEVCNTR114_EL0 (line 570) | pub const AMEVCNTR114_EL0: Self = Self::System(0b11_011_1101_1101_110);
constant AMEVCNTR115_EL0 (line 572) | pub const AMEVCNTR115_EL0: Self = Self::System(0b11_011_1101_1101_111);
constant AMEVTYPER10_EL0 (line 574) | pub const AMEVTYPER10_EL0: Self = Self::System(0b11_011_1101_1110_000);
constant AMEVTYPER11_EL0 (line 576) | pub const AMEVTYPER11_EL0: Self = Self::System(0b11_011_1101_1110_001);
constant AMEVTYPER12_EL0 (line 578) | pub const AMEVTYPER12_EL0: Self = Self::System(0b11_011_1101_1110_010);
constant AMEVTYPER13_EL0 (line 580) | pub const AMEVTYPER13_EL0: Self = Self::System(0b11_011_1101_1110_011);
constant AMEVTYPER14_EL0 (line 582) | pub const AMEVTYPER14_EL0: Self = Self::System(0b11_011_1101_1110_100);
constant AMEVTYPER15_EL0 (line 584) | pub const AMEVTYPER15_EL0: Self = Self::System(0b11_011_1101_1110_101);
constant AMEVTYPER16_EL0 (line 586) | pub const AMEVTYPER16_EL0: Self = Self::System(0b11_011_1101_1110_110);
constant AMEVTYPER17_EL0 (line 588) | pub const AMEVTYPER17_EL0: Self = Self::System(0b11_011_1101_1110_111);
constant AMEVTYPER18_EL0 (line 590) | pub const AMEVTYPER18_EL0: Self = Self::System(0b11_011_1101_1111_000);
constant AMEVTYPER19_EL0 (line 592) | pub const AMEVTYPER19_EL0: Self = Self::System(0b11_011_1101_1111_001);
constant AMEVTYPER110_EL0 (line 594) | pub const AMEVTYPER110_EL0: Self = Self::System(0b11_011_1101_1111_010);
constant AMEVTYPER111_EL0 (line 596) | pub const AMEVTYPER111_EL0: Self = Self::System(0b11_011_1101_1111_011);
constant AMEVTYPER112_EL0 (line 598) | pub const AMEVTYPER112_EL0: Self = Self::System(0b11_011_1101_1111_100);
constant AMEVTYPER113_EL0 (line 600) | pub const AMEVTYPER113_EL0: Self = Self::System(0b11_011_1101_1111_101);
constant AMEVTYPER114_EL0 (line 602) | pub const AMEVTYPER114_EL0: Self = Self::System(0b11_011_1101_1111_110);
constant AMEVTYPER115_EL0 (line 604) | pub const AMEVTYPER115_EL0: Self = Self::System(0b11_011_1101_1111_111);
constant CNTFRQ_EL0 (line 606) | pub const CNTFRQ_EL0: Self = Self::System(0b11_011_1110_0000_000);
constant CNTPCT_EL0 (line 608) | pub const CNTPCT_EL0: Self = Self::System(0b11_011_1110_0000_001);
constant CNTVCT_EL0 (line 610) | pub const CNTVCT_EL0: Self = Self::System(0b11_011_1110_0000_010);
constant CNTPCTSS_EL0 (line 612) | pub const CNTPCTSS_EL0: Self = Self::System(0b11_011_1110_0000_101);
constant CNTVCTSS_EL0 (line 614) | pub const CNTVCTSS_EL0: Self = Self::System(0b11_011_1110_0000_110);
constant CNTP_TVAL_EL0 (line 616) | pub const CNTP_TVAL_EL0: Self = Self::System(0b11_011_1110_0010_000);
constant CNTP_CTL_EL0 (line 618) | pub const CNTP_CTL_EL0: Self = Self::System(0b11_011_1110_0010_001);
constant CNTP_CVAL_EL0 (line 620) | pub const CNTP_CVAL_EL0: Self = Self::System(0b11_011_1110_0010_010);
constant CNTV_TVAL_EL0 (line 622) | pub const CNTV_TVAL_EL0: Self = Self::System(0b11_011_1110_0011_000);
constant CNTV_CTL_EL0 (line 624) | pub const CNTV_CTL_EL0: Self = Self::System(0b11_011_1110_0011_001);
constant CNTV_CVAL_EL0 (line 626) | pub const CNTV_CVAL_EL0: Self = Self::System(0b11_011_1110_0011_010);
constant PMEVCNTR0_EL0 (line 628) | pub const PMEVCNTR0_EL0: Self = Self::System(0b11_011_1110_1000_000);
constant PMEVCNTR1_EL0 (line 630) | pub const PMEVCNTR1_EL0: Self = Self::System(0b11_011_1110_1000_001);
constant PMEVCNTR2_EL0 (line 632) | pub const PMEVCNTR2_EL0: Self = Self::System(0b11_011_1110_1000_010);
constant PMEVCNTR3_EL0 (line 634) | pub const PMEVCNTR3_EL0: Self = Self::System(0b11_011_1110_1000_011);
constant PMEVCNTR4_EL0 (line 636) | pub const PMEVCNTR4_EL0: Self = Self::System(0b11_011_1110_1000_100);
constant PMEVCNTR5_EL0 (line 638) | pub const PMEVCNTR5_EL0: Self = Self::System(0b11_011_1110_1000_101);
constant PMEVCNTR6_EL0 (line 640) | pub const PMEVCNTR6_EL0: Self = Self::System(0b11_011_1110_1000_110);
constant PMEVCNTR7_EL0 (line 642) | pub const PMEVCNTR7_EL0: Self = Self::System(0b11_011_1110_1000_111);
constant PMEVCNTR8_EL0 (line 644) | pub const PMEVCNTR8_EL0: Self = Self::System(0b11_011_1110_1001_000);
constant PMEVCNTR9_EL0 (line 646) | pub const PMEVCNTR9_EL0: Self = Self::System(0b11_011_1110_1001_001);
constant PMEVCNTR10_EL0 (line 648) | pub const PMEVCNTR10_EL0: Self = Self::System(0b11_011_1110_1001_010);
constant PMEVCNTR11_EL0 (line 650) | pub const PMEVCNTR11_EL0: Self = Self::System(0b11_011_1110_1001_011);
constant PMEVCNTR12_EL0 (line 652) | pub const PMEVCNTR12_EL0: Self = Self::System(0b11_011_1110_1001_100);
constant PMEVCNTR13_EL0 (line 654) | pub const PMEVCNTR13_EL0: Self = Self::System(0b11_011_1110_1001_101);
constant PMEVCNTR14_EL0 (line 656) | pub const PMEVCNTR14_EL0: Self = Self::System(0b11_011_1110_1001_110);
constant PMEVCNTR15_EL0 (line 658) | pub const PMEVCNTR15_EL0: Self = Self::System(0b11_011_1110_1001_111);
constant PMEVCNTR16_EL0 (line 660) | pub const PMEVCNTR16_EL0: Self = Self::System(0b11_011_1110_1010_000);
constant PMEVCNTR17_EL0 (line 662) | pub const PMEVCNTR17_EL0: Self = Self::System(0b11_011_1110_1010_001);
constant PMEVCNTR18_EL0 (line 664) | pub const PMEVCNTR18_EL0: Self = Self::System(0b11_011_1110_1010_010);
constant PMEVCNTR19_EL0 (line 666) | pub const PMEVCNTR19_EL0: Self = Self::System(0b11_011_1110_1010_011);
constant PMEVCNTR20_EL0 (line 668) | pub const PMEVCNTR20_EL0: Self = Self::System(0b11_011_1110_1010_100);
constant PMEVCNTR21_EL0 (line 670) | pub const PMEVCNTR21_EL0: Self = Self::System(0b11_011_1110_1010_101);
constant PMEVCNTR22_EL0 (line 672) | pub const PMEVCNTR22_EL0: Self = Self::System(0b11_011_1110_1010_110);
constant PMEVCNTR23_EL0 (line 674) | pub const PMEVCNTR23_EL0: Self = Self::System(0b11_011_1110_1010_111);
constant PMEVCNTR24_EL0 (line 676) | pub const PMEVCNTR24_EL0: Self = Self::System(0b11_011_1110_1011_000);
constant PMEVCNTR25_EL0 (line 678) | pub const PMEVCNTR25_EL0: Self = Self::System(0b11_011_1110_1011_001);
constant PMEVCNTR26_EL0 (line 680) | pub const PMEVCNTR26_EL0: Self = Self::System(0b11_011_1110_1011_010);
constant PMEVCNTR27_EL0 (line 682) | pub const PMEVCNTR27_EL0: Self = Self::System(0b11_011_1110_1011_011);
constant PMEVCNTR28_EL0 (line 684) | pub const PMEVCNTR28_EL0: Self = Self::System(0b11_011_1110_1011_100);
constant PMEVCNTR29_EL0 (line 686) | pub const PMEVCNTR29_EL0: Self = Self::System(0b11_011_1110_1011_101);
constant PMEVCNTR30_EL0 (line 688) | pub const PMEVCNTR30_EL0: Self = Self::System(0b11_011_1110_1011_110);
constant PMEVTYPER0_EL0 (line 690) | pub const PMEVTYPER0_EL0: Self = Self::System(0b11_011_1110_1100_000);
constant PMEVTYPER1_EL0 (line 692) | pub const PMEVTYPER1_EL0: Self = Self::System(0b11_011_1110_1100_001);
constant PMEVTYPER2_EL0 (line 694) | pub const PMEVTYPER2_EL0: Self = Self::System(0b11_011_1110_1100_010);
constant PMEVTYPER3_EL0 (line 696) | pub const PMEVTYPER3_EL0: Self = Self::System(0b11_011_1110_1100_011);
constant PMEVTYPER4_EL0 (line 698) | pub const PMEVTYPER4_EL0: Self = Self::System(0b11_011_1110_1100_100);
constant PMEVTYPER5_EL0 (line 700) | pub const PMEVTYPER5_EL0: Self = Self::System(0b11_011_1110_1100_101);
constant PMEVTYPER6_EL0 (line 702) | pub const PMEVTYPER6_EL0: Self = Self::System(0b11_011_1110_1100_110);
constant PMEVTYPER7_EL0 (line 704) | pub const PMEVTYPER7_EL0: Self = Self::System(0b11_011_1110_1100_111);
constant PMEVTYPER8_EL0 (line 706) | pub const PMEVTYPER8_EL0: Self = Self::System(0b11_011_1110_1101_000);
constant PMEVTYPER9_EL0 (line 708) | pub const PMEVTYPER9_EL0: Self = Self::System(0b11_011_1110_1101_001);
constant PMEVTYPER10_EL0 (line 710) | pub const PMEVTYPER10_EL0: Self = Self::System(0b11_011_1110_1101_010);
constant PMEVTYPER11_EL0 (line 712) | pub const PMEVTYPER11_EL0: Self = Self::System(0b11_011_1110_1101_011);
constant PMEVTYPER12_EL0 (line 714) | pub const PMEVTYPER12_EL0: Self = Self::System(0b11_011_1110_1101_100);
constant PMEVTYPER13_EL0 (line 716) | pub const PMEVTYPER13_EL0: Self = Self::System(0b11_011_1110_1101_101);
constant PMEVTYPER14_EL0 (line 718) | pub const PMEVTYPER14_EL0: Self = Self::System(0b11_011_1110_1101_110);
constant PMEVTYPER15_EL0 (line 720) | pub const PMEVTYPER15_EL0: Self = Self::System(0b11_011_1110_1101_111);
constant PMEVTYPER16_EL0 (line 722) | pub const PMEVTYPER16_EL0: Self = Self::System(0b11_011_1110_1110_000);
constant PMEVTYPER17_EL0 (line 724) | pub const PMEVTYPER17_EL0: Self = Self::System(0b11_011_1110_1110_001);
constant PMEVTYPER18_EL0 (line 726) | pub const PMEVTYPER18_EL0: Self = Self::System(0b11_011_1110_1110_010);
constant PMEVTYPER19_EL0 (line 728) | pub const PMEVTYPER19_EL0: Self = Self::System(0b11_011_1110_1110_011);
constant PMEVTYPER20_EL0 (line 730) | pub const PMEVTYPER20_EL0: Self = Self::System(0b11_011_1110_1110_100);
constant PMEVTYPER21_EL0 (line 732) | pub const PMEVTYPER21_EL0: Self = Self::System(0b11_011_1110_1110_101);
constant PMEVTYPER22_EL0 (line 734) | pub const PMEVTYPER22_EL0: Self = Self::System(0b11_011_1110_1110_110);
constant PMEVTYPER23_EL0 (line 736) | pub const PMEVTYPER23_EL0: Self = Self::System(0b11_011_1110_1110_111);
constant PMEVTYPER24_EL0 (line 738) | pub const PMEVTYPER24_EL0: Self = Self::System(0b11_011_1110_1111_000);
constant PMEVTYPER25_EL0 (line 740) | pub const PMEVTYPER25_EL0: Self = Self::System(0b11_011_1110_1111_001);
constant PMEVTYPER26_EL0 (line 742) | pub const PMEVTYPER26_EL0: Self = Self::System(0b11_011_1110_1111_010);
constant PMEVTYPER27_EL0 (line 744) | pub const PMEVTYPER27_EL0: Self = Self::System(0b11_011_1110_1111_011);
constant PMEVTYPER28_EL0 (line 746) | pub const PMEVTYPER28_EL0: Self = Self::System(0b11_011_1110_1111_100);
constant PMEVTYPER29_EL0 (line 748) | pub const PMEVTYPER29_EL0: Self = Self::System(0b11_011_1110_1111_101);
constant PMEVTYPER30_EL0 (line 750) | pub const PMEVTYPER30_EL0: Self = Self::System(0b11_011_1110_1111_110);
constant PMCCFILTR_EL0 (line 752) | pub const PMCCFILTR_EL0: Self = Self::System(0b11_011_1110_1111_111);
constant VPIDR_EL2 (line 754) | pub const VPIDR_EL2: Self = Self::System(0b11_100_0000_0000_000);
constant VMPIDR_EL2 (line 756) | pub const VMPIDR_EL2: Self = Self::System(0b11_100_0000_0000_101);
constant SCTLR_EL2 (line 758) | pub const SCTLR_EL2: Self = Self::System(0b11_100_0001_0000_000);
constant ACTLR_EL2 (line 760) | pub const ACTLR_EL2: Self = Self::System(0b11_100_0001_0000_001);
constant HCR_EL2 (line 762) | pub const HCR_EL2: Self = Self::System(0b11_100_0001_0001_000);
constant MDCR_EL2 (line 764) | pub const MDCR_EL2: Self = Self::System(0b11_100_0001_0001_001);
constant CPTR_EL2 (line 766) | pub const CPTR_EL2: Self = Self::System(0b11_100_0001_0001_010);
constant HSTR_EL2 (line 768) | pub const HSTR_EL2: Self = Self::System(0b11_100_0001_0001_011);
constant HFGRTR_EL2 (line 770) | pub const HFGRTR_EL2: Self = Self::System(0b11_100_0001_0001_100);
constant HFGWTR_EL2 (line 772) | pub const HFGWTR_EL2: Self = Self::System(0b11_100_0001_0001_101);
constant HFGITR_EL2 (line 774) | pub const HFGITR_EL2: Self = Self::System(0b11_100_0001_0001_110);
constant HACR_EL2 (line 776) | pub const HACR_EL2: Self = Self::System(0b11_100_0001_0001_111);
constant ZCR_EL2 (line 778) | pub const ZCR_EL2: Self = Self::System(0b11_100_0001_0010_000);
constant TRFCR_EL2 (line 780) | pub const TRFCR_EL2: Self = Self::System(0b11_100_0001_0010_001);
constant HCRX_EL2 (line 782) | pub const HCRX_EL2: Self = Self::System(0b11_100_0001_0010_010);
constant SMPRIMAP_EL2 (line 784) | pub const SMPRIMAP_EL2: Self = Self::System(0b11_100_0001_0010_101);
constant SMCR_EL2 (line 786) | pub const SMCR_EL2: Self = Self::System(0b11_100_0001_0010_110);
constant SDER32_EL2 (line 788) | pub const SDER32_EL2: Self = Self::System(0b11_100_0001_0011_001);
constant TTBR0_EL2 (line 790) | pub const TTBR0_EL2: Self = Self::System(0b11_100_0010_0000_000);
constant TTBR1_EL2 (line 792) | pub const TTBR1_EL2: Self = Self::System(0b11_100_0010_0000_001);
constant TCR_EL2 (line 794) | pub const TCR_EL2: Self = Self::System(0b11_100_0010_0000_010);
constant VTTBR_EL2 (line 796) | pub const VTTBR_EL2: Self = Self::System(0b11_100_0010_0001_000);
constant VTCR_EL2 (line 798) | pub const VTCR_EL2: Self = Self::System(0b11_100_0010_0001_010);
constant VNCR_EL2 (line 800) | pub const VNCR_EL2: Self = Self::System(0b11_100_0010_0010_000);
constant VSTTBR_EL2 (line 802) | pub const VSTTBR_EL2: Self = Self::System(0b11_100_0010_0110_000);
constant VSTCR_EL2 (line 804) | pub const VSTCR_EL2: Self = Self::System(0b11_100_0010_0110_010);
constant DACR32_EL2 (line 806) | pub const DACR32_EL2: Self = Self::System(0b11_100_0011_0000_000);
constant HDFGRTR_EL2 (line 808) | pub const HDFGRTR_EL2: Self = Self::System(0b11_100_0011_0001_100);
constant HDFGWTR_EL2 (line 810) | pub const HDFGWTR_EL2: Self = Self::System(0b11_100_0011_0001_101);
constant HAFGRTR_EL2 (line 812) | pub const HAFGRTR_EL2: Self = Self::System(0b11_100_0011_0001_110);
constant SPSR_EL2 (line 814) | pub const SPSR_EL2: Self = Self::System(0b11_100_0100_0000_000);
constant ELR_EL2 (line 816) | pub const ELR_EL2: Self = Self::System(0b11_100_0100_0000_001);
constant SP_EL1 (line 818) | pub const SP_EL1: Self = Self::System(0b11_100_0100_0001_000);
constant SPSR_IRQ (line 820) | pub const SPSR_IRQ: Self = Self::System(0b11_100_0100_0011_000);
constant SPSR_ABT (line 822) | pub const SPSR_ABT: Self = Self::System(0b11_100_0100_0011_001);
constant SPSR_UND (line 824) | pub const SPSR_UND: Self = Self::System(0b11_100_0100_0011_010);
constant SPSR_FIQ (line 826) | pub const SPSR_FIQ: Self = Self::System(0b11_100_0100_0011_011);
constant IFSR32_EL2 (line 828) | pub const IFSR32_EL2: Self = Self::System(0b11_100_0101_0000_001);
constant AFSR0_EL2 (line 830) | pub const AFSR0_EL2: Self = Self::System(0b11_100_0101_0001_000);
constant AFSR1_EL2 (line 832) | pub const AFSR1_EL2: Self = Self::System(0b11_100_0101_0001_001);
constant ESR_EL2 (line 834) | pub const ESR_EL2: Self = Self::System(0b11_100_0101_0010_000);
constant VSESR_EL2 (line 836) | pub const VSESR_EL2: Self = Self::System(0b11_100_0101_0010_011);
constant FPEXC32_EL2 (line 838) | pub const FPEXC32_EL2: Self = Self::System(0b11_100_0101_0011_000);
constant TFSR_EL2 (line 840) | pub const TFSR_EL2: Self = Self::System(0b11_100_0101_0110_000);
constant FAR_EL2 (line 842) | pub const FAR_EL2: Self = Self::System(0b11_100_0110_0000_000);
constant HPFAR_EL2 (line 844) | pub const HPFAR_EL2: Self = Self::System(0b11_100_0110_0000_100);
constant PMSCR_EL2 (line 846) | pub const PMSCR_EL2: Self = Self::System(0b11_100_1001_1001_000);
constant MAIR_EL2 (line 848) | pub const MAIR_EL2: Self = Self::System(0b11_100_1010_0010_000);
constant AMAIR_EL2 (line 850) | pub const AMAIR_EL2: Self = Self::System(0b11_100_1010_0011_000);
constant MPAMHCR_EL2 (line 852) | pub const MPAMHCR_EL2: Self = Self::System(0b11_100_1010_0100_000);
constant MPAMVPMV_EL2 (line 854) | pub const MPAMVPMV_EL2: Self = Self::System(0b11_100_1010_0100_001);
constant MPAM2_EL2 (line 856) | pub const MPAM2_EL2: Self = Self::System(0b11_100_1010_0101_000);
constant MPAMVPM0_EL2 (line 858) | pub const MPAMVPM0_EL2: Self = Self::System(0b11_100_1010_0110_000);
constant MPAMVPM1_EL2 (line 860) | pub const MPAMVPM1_EL2: Self = Self::System(0b11_100_1010_0110_001);
constant MPAMVPM2_EL2 (line 862) | pub const MPAMVPM2_EL2: Self = Self::System(0b11_100_1010_0110_010);
constant MPAMVPM3_EL2 (line 864) | pub const MPAMVPM3_EL2: Self = Self::System(0b11_100_1010_0110_011);
constant MPAMVPM4_EL2 (line 866) | pub const MPAMVPM4_EL2: Self = Self::System(0b11_100_1010_0110_100);
constant MPAMVPM5_EL2 (line 868) | pub const MPAMVPM5_EL2: Self = Self::System(0b11_100_1010_0110_101);
constant MPAMVPM6_EL2 (line 870) | pub const MPAMVPM6_EL2: Self = Self::System(0b11_100_1010_0110_110);
constant MPAMVPM7_EL2 (line 872) | pub const MPAMVPM7_EL2: Self = Self::System(0b11_100_1010_0110_111);
constant VBAR_EL2 (line 874) | pub const VBAR_EL2: Self = Self::System(0b11_100_1100_0000_000);
constant RVBAR_EL2 (line 876) | pub const RVBAR_EL2: Self = Self::System(0b11_100_1100_0000_001);
constant RMR_EL2 (line 878) | pub const RMR_EL2: Self = Self::System(0b11_100_1100_0000_010);
constant VDISR_EL2 (line 880) | pub const VDISR_EL2: Self = Self::System(0b11_100_1100_0001_001);
constant ICH_AP0R0_EL2 (line 882) | pub const ICH_AP0R0_EL2: Self = Self::System(0b11_100_1100_1000_000);
constant ICH_AP0R1_EL2 (line 884) | pub const ICH_AP0R1_EL2: Self = Self::System(0b11_100_1100_1000_001);
constant ICH_AP0R2_EL2 (line 886) | pub const ICH_AP0R2_EL2: Self = Self::System(0b11_100_1100_1000_010);
constant ICH_AP0R3_EL2 (line 888) | pub const ICH_AP0R3_EL2: Self = Self::System(0b11_100_1100_1000_011);
constant ICH_AP1R0_EL2 (line 890) | pub const ICH_AP1R0_EL2: Self = Self::System(0b11_100_1100_1001_000);
constant ICH_AP1R1_EL2 (line 892) | pub const ICH_AP1R1_EL2: Self = Self::System(0b11_100_1100_1001_001);
constant ICH_AP1R2_EL2 (line 894) | pub const ICH_AP1R2_EL2: Self = Self::System(0b11_100_1100_1001_010);
constant ICH_AP1R3_EL2 (line 896) | pub const ICH_AP1R3_EL2: Self = Self::System(0b11_100_1100_1001_011);
constant ICC_SRE_EL2 (line 898) | pub const ICC_SRE_EL2: Self = Self::System(0b11_100_1100_1001_101);
constant ICH_HCR_EL2 (line 900) | pub const ICH_HCR_EL2: Self = Self::System(0b11_100_1100_1011_000);
constant ICH_VTR_EL2 (line 902) | pub const ICH_VTR_EL2: Self = Self::System(0b11_100_1100_1011_001);
constant ICH_MISR_EL2 (line 904) | pub const ICH_MISR_EL2: Self = Self::System(0b11_100_1100_1011_010);
constant ICH_EISR_EL2 (line 906) | pub const ICH_EISR_EL2: Self = Self::System(0b11_100_1100_1011_011);
constant ICH_ELRSR_EL2 (line 908) | pub const ICH_ELRSR_EL2: Self = Self::System(0b11_100_1100_1011_101);
constant ICH_VMCR_EL2 (line 910) | pub const ICH_VMCR_EL2: Self = Self::System(0b11_100_1100_1011_111);
constant ICH_LR0_EL2 (line 912) | pub const ICH_LR0_EL2: Self = Self::System(0b11_100_1100_1100_000);
constant ICH_LR1_EL2 (line 914) | pub const ICH_LR1_EL2: Self = Self::System(0b11_100_1100_1100_001);
constant ICH_LR2_EL2 (line 916) | pub const ICH_LR2_EL2: Self = Self::System(0b11_100_1100_1100_010);
constant ICH_LR3_EL2 (line 918) | pub const ICH_LR3_EL2: Self = Self::System(0b11_100_1100_1100_011);
constant ICH_LR4_EL2 (line 920) | pub const ICH_LR4_EL2: Self = Self::System(0b11_100_1100_1100_100);
constant ICH_LR5_EL2 (line 922) | pub const ICH_LR5_EL2: Self = Self::System(0b11_100_1100_1100_101);
constant ICH_LR6_EL2 (line 924) | pub const ICH_LR6_EL2: Self = Self::System(0b11_100_1100_1100_110);
constant ICH_LR7_EL2 (line 926) | pub const ICH_LR7_EL2: Self = Self::System(0b11_100_1100_1100_111);
constant ICH_LR8_EL2 (line 928) | pub const ICH_LR8_EL2: Self = Self::System(0b11_100_1100_1101_000);
constant ICH_LR9_EL2 (line 930) | pub const ICH_LR9_EL2: Self = Self::System(0b11_100_1100_1101_001);
constant ICH_LR10_EL2 (line 932) | pub const ICH_LR10_EL2: Self = Self::System(0b11_100_1100_1101_010);
constant ICH_LR11_EL2 (line 934) | pub const ICH_LR11_EL2: Self = Self::System(0b11_100_1100_1101_011);
constant ICH_LR12_EL2 (line 936) | pub const ICH_LR12_EL2: Self = Self::System(0b11_100_1100_1101_100);
constant ICH_LR13_EL2 (line 938) | pub const ICH_LR13_EL2: Self = Self::System(0b11_100_1100_1101_101);
constant ICH_LR14_EL2 (line 940) | pub const ICH_LR14_EL2: Self = Self::System(0b11_100_1100_1101_110);
constant ICH_LR15_EL2 (line 942) | pub const ICH_LR15_EL2: Self = Self::System(0b11_100_1100_1101_111);
constant CONTEXTIDR_EL2 (line 944) | pub const CONTEXTIDR_EL2: Self = Self::System(0b11_100_1101_0000_001);
constant TPIDR_EL2 (line 946) | pub const TPIDR_EL2: Self = Self::System(0b11_100_1101_0000_010);
constant SCXTNUM_EL2 (line 948) | pub const SCXTNUM_EL2: Self = Self::System(0b11_100_1101_0000_111);
constant AMEVCNTVOFF00_EL2 (line 950) | pub const AMEVCNTVOFF00_EL2: Self = Self::System(0b11_100_1101_1000_000);
constant AMEVCNTVOFF01_EL2 (line 952) | pub const AMEVCNTVOFF01_EL2: Self = Self::System(0b11_100_1101_1000_001);
constant AMEVCNTVOFF02_EL2 (line 954) | pub const AMEVCNTVOFF02_EL2: Self = Self::System(0b11_100_1101_1000_010);
constant AMEVCNTVOFF03_EL2 (line 956) | pub const AMEVCNTVOFF03_EL2: Self = Self::System(0b11_100_1101_1000_011);
constant AMEVCNTVOFF04_EL2 (line 958) | pub const AMEVCNTVOFF04_EL2: Self = Self::System(0b11_100_1101_1000_100);
constant AMEVCNTVOFF05_EL2 (line 960) | pub const AMEVCNTVOFF05_EL2: Self = Self::System(0b11_100_1101_1000_101);
constant AMEVCNTVOFF06_EL2 (line 962) | pub const AMEVCNTVOFF06_EL2: Self = Self::System(0b11_100_1101_1000_110);
constant AMEVCNTVOFF07_EL2 (line 964) | pub const AMEVCNTVOFF07_EL2: Self = Self::System(0b11_100_1101_1000_111);
constant AMEVCNTVOFF08_EL2 (line 966) | pub const AMEVCNTVOFF08_EL2: Self = Self::System(0b11_100_1101_1001_000);
constant AMEVCNTVOFF09_EL2 (line 968) | pub const AMEVCNTVOFF09_EL2: Self = Self::System(0b11_100_1101_1001_001);
constant AMEVCNTVOFF010_EL2 (line 970) | pub const AMEVCNTVOFF010_EL2: Self = Self::System(0b11_100_1101_1001_0...
constant AMEVCNTVOFF011_EL2 (line 972) | pub const AMEVCNTVOFF011_EL2: Self = Self::System(0b11_100_1101_1001_0...
constant AMEVCNTVOFF012_EL2 (line 974) | pub const AMEVCNTVOFF012_EL2: Self = Self::System(0b11_100_1101_1001_1...
constant AMEVCNTVOFF013_EL2 (line 976) | pub const AMEVCNTVOFF013_EL2: Self = Self::System(0b11_100_1101_1001_1...
constant AMEVCNTVOFF014_EL2 (line 978) | pub const AMEVCNTVOFF014_EL2: Self = Self::System(0b11_100_1101_1001_1...
constant AMEVCNTVOFF015_EL2 (line 980) | pub const AMEVCNTVOFF015_EL2: Self = Self::System(0b11_100_1101_1001_1...
constant AMEVCNTVOFF10_EL2 (line 982) | pub const AMEVCNTVOFF10_EL2: Self = Self::System(0b11_100_1101_1010_000);
constant AMEVCNTVOFF11_EL2 (line 984) | pub const AMEVCNTVOFF11_EL2: Self = Self::System(0b11_100_1101_1010_001);
constant AMEVCNTVOFF12_EL2 (line 986) | pub const AMEVCNTVOFF12_EL2: Self = Self::System(0b11_100_1101_1010_010);
constant AMEVCNTVOFF13_EL2 (line 988) | pub const AMEVCNTVOFF13_EL2: Self = Self::System(0b11_100_1101_1010_011);
constant AMEVCNTVOFF14_EL2 (line 990) | pub const AMEVCNTVOFF14_EL2: Self = Self::System(0b11_100_1101_1010_100);
constant AMEVCNTVOFF15_EL2 (line 992) | pub const AMEVCNTVOFF15_EL2: Self = Self::System(0b11_100_1101_1010_101);
constant AMEVCNTVOFF16_EL2 (line 994) | pub const AMEVCNTVOFF16_EL2: Self = Self::System(0b11_100_1101_1010_110);
constant AMEVCNTVOFF17_EL2 (line 996) | pub const AMEVCNTVOFF17_EL2: Self = Self::System(0b11_100_1101_1010_111);
constant AMEVCNTVOFF18_EL2 (line 998) | pub const AMEVCNTVOFF18_EL2: Self = Self::System(0b11_100_1101_1011_000);
constant AMEVCNTVOFF19_EL2 (line 1000) | pub const AMEVCNTVOFF19_EL2: Self = Self::System(0b11_100_1101_1011_001);
constant AMEVCNTVOFF110_EL2 (line 1002) | pub const AMEVCNTVOFF110_EL2: Self = Self::System(0b11_100_1101_1011_0...
constant AMEVCNTVOFF111_EL2 (line 1004) | pub const AMEVCNTVOFF111_EL2: Self = Self::System(0b11_100_1101_1011_0...
constant AMEVCNTVOFF112_EL2 (line 1006) | pub const AMEVCNTVOFF112_EL2: Self = Self::System(0b11_100_1101_1011_1...
constant AMEVCNTVOFF113_EL2 (line 1008) | pub const AMEVCNTVOFF113_EL2: Self = Self::System(0b11_100_1101_1011_1...
constant AMEVCNTVOFF114_EL2 (line 1010) | pub const AMEVCNTVOFF114_EL2: Self = Self::System(0b11_100_1101_1011_1...
constant AMEVCNTVOFF115_EL2 (line 1012) | pub const AMEVCNTVOFF115_EL2: Self = Self::System(0b11_100_1101_1011_1...
constant CNTVOFF_EL2 (line 1014) | pub const CNTVOFF_EL2: Self = Self::System(0b11_100_1110_0000_011);
constant CNTPOFF_EL2 (line 1016) | pub const CNTPOFF_EL2: Self = Self::System(0b11_100_1110_0000_110);
constant CNTHCTL_EL2 (line 1018) | pub const CNTHCTL_EL2: Self = Self::System(0b11_100_1110_0001_000);
constant CNTHP_TVAL_EL2 (line 1020) | pub const CNTHP_TVAL_EL2: Self = Self::System(0b11_100_1110_0010_000);
constant CNTHP_CTL_EL2 (line 1022) | pub const CNTHP_CTL_EL2: Self = Self::System(0b11_100_1110_0010_001);
constant CNTHP_CVAL_EL2 (line 1024) | pub const CNTHP_CVAL_EL2: Self = Self::System(0b11_100_1110_0010_010);
constant CNTHV_TVAL_EL2 (line 1026) | pub const CNTHV_TVAL_EL2: Self = Self::System(0b11_100_1110_0011_000);
constant CNTHV_CTL_EL2 (line 1028) | pub const CNTHV_CTL_EL2: Self = Self::System(0b11_100_1110_0011_001);
constant CNTHV_CVAL_EL2 (line 1030) | pub const CNTHV_CVAL_EL2: Self = Self::System(0b11_100_1110_0011_010);
constant CNTHVS_TVAL_EL2 (line 1032) | pub const CNTHVS_TVAL_EL2: Self = Self::System(0b11_100_1110_0100_000);
constant CNTHVS_CTL_EL2 (line 1034) | pub const CNTHVS_CTL_EL2: Self = Self::System(0b11_100_1110_0100_001);
constant CNTHVS_CVAL_EL2 (line 1036) | pub const CNTHVS_CVAL_EL2: Self = Self::System(0b11_100_1110_0100_010);
constant CNTHPS_TVAL_EL2 (line 1038) | pub const CNTHPS_TVAL_EL2: Self = Self::System(0b11_100_1110_0101_000);
constant CNTHPS_CTL_EL2 (line 1040) | pub const CNTHPS_CTL_EL2: Self = Self::System(0b11_100_1110_0101_001);
constant CNTHPS_CVAL_EL2 (line 1042) | pub const CNTHPS_CVAL_EL2: Self = Self::System(0b11_100_1110_0101_010);
constant SCTLR_EL3 (line 1044) | pub const SCTLR_EL3: Self = Self::System(0b11_110_0001_0000_000);
constant ACTLR_EL3 (line 1046) | pub const ACTLR_EL3: Self = Self::System(0b11_110_0001_0000_001);
constant SCR_EL3 (line 1048) | pub const SCR_EL3: Self = Self::System(0b11_110_0001_0001_000);
constant SDER32_EL3 (line 1050) | pub const SDER32_EL3: Self = Self::System(0b11_110_0001_0001_001);
constant CPTR_EL3 (line 1052) | pub const CPTR_EL3: Self = Self::System(0b11_110_0001_0001_010);
constant ZCR_EL3 (line 1054) | pub const ZCR_EL3: Self = Self::System(0b11_110_0001_0010_000);
constant SMCR_EL3 (line 1056) | pub const SMCR_EL3: Self = Self::System(0b11_110_0001_0010_110);
constant MDCR_EL3 (line 1058) | pub const MDCR_EL3: Self = Self::System(0b11_110_0001_0011_001);
constant TTBR0_EL3 (line 1060) | pub const TTBR0_EL3: Self = Self::System(0b11_110_0010_0000_000);
constant TCR_EL3 (line 1062) | pub const TCR_EL3: Self = Self::System(0b11_110_0010_0000_010);
constant GPTBR_EL3 (line 1064) | pub const GPTBR_EL3: Self = Self::System(0b11_110_0010_0001_100);
constant GPCCR_EL3 (line 1066) | pub const GPCCR_EL3: Self = Self::System(0b11_110_0010_0001_110);
constant SPSR_EL3 (line 1068) | pub const SPSR_EL3: Self = Self::System(0b11_110_0100_0000_000);
constant ELR_EL3 (line 1070) | pub const ELR_EL3: Self = Self::System(0b11_110_0100_0000_001);
constant SP_EL2 (line 1072) | pub const SP_EL2: Self = Self::System(0b11_110_0100_0001_000);
constant AFSR0_EL3 (line 1074) | pub const AFSR0_EL3: Self = Self::System(0b11_110_0101_0001_000);
constant AFSR1_EL3 (line 1076) | pub const AFSR1_EL3: Self = Self::System(0b11_110_0101_0001_001);
constant ESR_EL3 (line 1078) | pub const ESR_EL3: Self = Self::System(0b11_110_0101_0010_000);
constant TFSR_EL3 (line 1080) | pub const TFSR_EL3: Self = Self::System(0b11_110_0101_0110_000);
constant FAR_EL3 (line 1082) | pub const FAR_EL3: Self = Self::System(0b11_110_0110_0000_000);
constant MFAR_EL3 (line 1084) | pub const MFAR_EL3: Self = Self::System(0b11_110_0110_0000_101);
constant MAIR_EL3 (line 1086) | pub const MAIR_EL3: Self = Self::System(0b11_110_1010_0010_000);
constant AMAIR_EL3 (line 1088) | pub const AMAIR_EL3: Self = Self::System(0b11_110_1010_0011_000);
constant MPAM3_EL3 (line 1090) | pub const MPAM3_EL3: Self = Self::System(0b11_110_1010_0101_000);
constant VBAR_EL3 (line 1092) | pub const VBAR_EL3: Self = Self::System(0b11_110_1100_0000_000);
constant RVBAR_EL3 (line 1094) | pub const RVBAR_EL3: Self = Self::System(0b11_110_1100_0000_001);
constant RMR_EL3 (line 1096) | pub const RMR_EL3: Self = Self::System(0b11_110_1100_0000_010);
constant ICC_CTLR_EL3 (line 1098) | pub const ICC_CTLR_EL3: Self = Self::System(0b11_110_1100_1100_100);
constant ICC_SRE_EL3 (line 1100) | pub const ICC_SRE_EL3: Self = Self::System(0b11_110_1100_1100_101);
constant ICC_IGRPEN1_EL3 (line 1102) | pub const ICC_IGRPEN1_EL3: Self = Self::System(0b11_110_1100_1100_111);
constant TPIDR_EL3 (line 1104) | pub const TPIDR_EL3: Self = Self::System(0b11_110_1101_0000_010);
constant SCXTNUM_EL3 (line 1106) | pub const SCXTNUM_EL3: Self = Self::System(0b11_110_1101_0000_111);
constant CNTPS_TVAL_EL1 (line 1108) | pub const CNTPS_TVAL_EL1: Self = Self::System(0b11_111_1110_0010_000);
constant CNTPS_CTL_EL1 (line 1110) | pub const CNTPS_CTL_EL1: Self = Self::System(0b11_111_1110_0010_001);
constant CNTPS_CVAL_EL1 (line 1112) | pub const CNTPS_CVAL_EL1: Self = Self::System(0b11_111_1110_0010_010);
constant OSDTRRX_EL1 (line 1115) | pub const OSDTRRX_EL1: Self = Self::System(0b10_000_0000_0000_010);
constant DBGBVR0_EL1 (line 1117) | pub const DBGBVR0_EL1: Self = Self::System(0b10_000_0000_0000_100);
constant DBGBCR0_EL1 (line 1119) | pub const DBGBCR0_EL1: Self = Self::System(0b10_000_0000_0000_101);
constant DBGWVR0_EL1 (line 1121) | pub const DBGWVR0_EL1: Self = Self::System(0b10_000_0000_0000_110);
constant DBGWCR0_EL1 (line 1123) | pub const DBGWCR0_EL1: Self = Self::System(0b10_000_0000_0000_111);
constant DBGBVR1_EL1 (line 1125) | pub const DBGBVR1_EL1: Self = Self::System(0b10_000_0000_0001_100);
constant DBGBCR1_EL1 (line 1127) | pub const DBGBCR1_EL1: Self = Self::System(0b10_000_0000_0001_101);
constant DBGWVR1_EL1 (line 1129) | pub const DBGWVR1_EL1: Self = Self::System(0b10_000_0000_0001_110);
constant DBGWCR1_EL1 (line 1131) | pub const DBGWCR1_EL1: Self = Self::System(0b10_000_0000_0001_111);
constant MDCCINT_EL1 (line 1133) | pub const MDCCINT_EL1: Self = Self::System(0b10_000_0000_0010_000);
constant MDSCR_EL1 (line 1135) | pub const MDSCR_EL1: Self = Self::System(0b10_000_0000_0010_010);
constant DBGBVR2_EL1 (line 1137) | pub const DBGBVR2_EL1: Self = Self::System(0b10_000_0000_0010_100);
constant DBGBCR2_EL1 (line 1139) | pub const DBGBCR2_EL1: Self = Self::System(0b10_000_0000_0010_101);
constant DBGWVR2_EL1 (line 1141) | pub const DBGWVR2_EL1: Self = Self::System(0b10_000_0000_0010_110);
constant DBGWCR2_EL1 (line 1143) | pub const DBGWCR2_EL1: Self = Self::System(0b10_000_0000_0010_111);
constant OSDTRTX_EL1 (line 1145) | pub const OSDTRTX_EL1: Self = Self::System(0b10_000_0000_0011_010);
constant DBGBVR3_EL1 (line 1147) | pub const DBGBVR3_EL1: Self = Self::System(0b10_000_0000_0011_100);
constant DBGBCR3_EL1 (line 1149) | pub const DBGBCR3_EL1: Self = Self::System(0b10_000_0000_0011_101);
constant DBGWVR3_EL1 (line 1151) | pub const DBGWVR3_EL1: Self = Self::System(0b10_000_0000_0011_110);
constant DBGWCR3_EL1 (line 1153) | pub const DBGWCR3_EL1: Self = Self::System(0b10_000_0000_0011_111);
constant DBGBVR4_EL1 (line 1155) | pub const DBGBVR4_EL1: Self = Self::System(0b10_000_0000_0100_100);
constant DBGBCR4_EL1 (line 1157) | pub const DBGBCR4_EL1: Self = Self::System(0b10_000_0000_0100_101);
constant DBGWVR4_EL1 (line 1159) | pub const DBGWVR4_EL1: Self = Self::System(0b10_000_0000_0100_110);
constant DBGWCR4_EL1 (line 1161) | pub const DBGWCR4_EL1: Self = Self::System(0b10_000_0000_0100_111);
constant DBGBVR5_EL1 (line 1163) | pub const DBGBVR5_EL1: Self = Self::System(0b10_000_0000_0101_100);
constant DBGBCR5_EL1 (line 1165) | pub const DBGBCR5_EL1: Self = Self::System(0b10_000_0000_0101_101);
constant DBGWVR5_EL1 (line 1167) | pub const DBGWVR5_EL1: Self = Self::System(0b10_000_0000_0101_110);
constant DBGWCR5_EL1 (line 1169) | pub const DBGWCR5_EL1: Self = Self::System(0b10_000_0000_0101_111);
constant OSECCR_EL1 (line 1171) | pub const OSECCR_EL1: Self = Self::System(0b10_000_0000_0110_010);
constant DBGBVR6_EL1 (line 1173) | pub const DBGBVR6_EL1: Self = Self::System(0b10_000_0000_0110_100);
constant DBGBCR6_EL1 (line 1175) | pub const DBGBCR6_EL1: Self = Self::System(0b10_000_0000_0110_101);
constant DBGWVR6_EL1 (line 1177) | pub const DBGWVR6_EL1: Self = Self::System(0b10_000_0000_0110_110);
constant DBGWCR6_EL1 (line 1179) | pub const DBGWCR6_EL1: Self = Self::System(0b10_000_0000_0110_111);
constant DBGBVR7_EL1 (line 1181) | pub const DBGBVR7_EL1: Self = Self::System(0b10_000_0000_0111_100);
constant DBGBCR7_EL1 (line 1183) | pub const DBGBCR7_EL1: Self = Self::System(0b10_000_0000_0111_101);
constant DBGWVR7_EL1 (line 1185) | pub const DBGWVR7_EL1: Self = Self::System(0b10_000_0000_0111_110);
constant DBGWCR7_EL1 (line 1187) | pub const DBGWCR7_EL1: Self = Self::System(0b10_000_0000_0111_111);
constant DBGBVR8_EL1 (line 1189) | pub const DBGBVR8_EL1: Self = Self::System(0b10_000_0000_1000_100);
constant DBGBCR8_EL1 (line 1191) | pub const DBGBCR8_EL1: Self = Self::System(0b10_000_0000_1000_101);
constant DBGWVR8_EL1 (line 1193) | pub const DBGWVR8_EL1: Self = Self::System(0b10_000_0000_1000_110);
constant DBGWCR8_EL1 (line 1195) | pub const DBGWCR8_EL1: Self = Self::System(0b10_000_0000_1000_111);
constant DBGBVR9_EL1 (line 1197) | pub const DBGBVR9_EL1: Self = Self::System(0b10_000_0000_1001_100);
constant DBGBCR9_EL1 (line 1199) | pub const DBGBCR9_EL1: Self = Self::System(0b10_000_0000_1001_101);
constant DBGWVR9_EL1 (line 1201) | pub const DBGWVR9_EL1: Self = Self::System(0b10_000_0000_1001_110);
constant DBGWCR9_EL1 (line 1203) | pub const DBGWCR9_EL1: Self = Self::System(0b10_000_0000_1001_111);
constant DBGBVR10_EL1 (line 1205) | pub const DBGBVR10_EL1: Self = Self::System(0b10_000_0000_1010_100);
constant DBGBCR10_EL1 (line 1207) | pub const DBGBCR10_EL1: Self = Self::System(0b10_000_0000_1010_101);
constant DBGWVR10_EL1 (line 1209) | pub const DBGWVR10_EL1: Self = Self::System(0b10_000_0000_1010_110);
constant DBGWCR10_EL1 (line 1211) | pub const DBGWCR10_EL1: Self = Self::System(0b10_000_0000_1010_111);
constant DBGBVR11_EL1 (line 1213) | pub const DBGBVR11_EL1: Self = Self::System(0b10_000_0000_1011_100);
constant DBGBCR11_EL1 (line 1215) | pub const DBGBCR11_EL1: Self = Self::System(0b10_000_0000_1011_101);
constant DBGWVR11_EL1 (line 1217) | pub const DBGWVR11_EL1: Self = Self::System(0b10_000_0000_1011_110);
constant DBGWCR11_EL1 (line 1219) | pub const DBGWCR11_EL1: Self = Self::System(0b10_000_0000_1011_111);
constant DBGBVR12_EL1 (line 1221) | pub const DBGBVR12_EL1: Self = Self::System(0b10_000_0000_1100_100);
constant DBGBCR12_EL1 (line 1223) | pub const DBGBCR12_EL1: Self = Self::System(0b10_000_0000_1100_101);
constant DBGWVR12_EL1 (line 1225) | pub const DBGWVR12_EL1: Self = Self::System(0b10_000_0000_1100_110);
constant DBGWCR12_EL1 (line 1227) | pub const DBGWCR12_EL1: Self = Self::System(0b10_000_0000_1100_111);
constant DBGBVR13_EL1 (line 1229) | pub const DBGBVR13_EL1: Self = Self::System(0b10_000_0000_1101_100);
constant DBGBCR13_EL1 (line 1231) | pub const DBGBCR13_EL1: Self = Self::System(0b10_000_0000_1101_101);
constant DBGWVR13_EL1 (line 1233) | pub const DBGWVR13_EL1: Self = Self::System(0b10_000_0000_1101_110);
constant DBGWCR13_EL1 (line 1235) | pub const DBGWCR13_EL1: Self = Self::System(0b10_000_0000_1101_111);
constant DBGBVR14_EL1 (line 1237) | pub const DBGBVR14_EL1: Self = Self::System(0b10_000_0000_1110_100);
constant DBGBCR14_EL1 (line 1239) | pub const DBGBCR14_EL1: Self = Self::System(0b10_000_0000_1110_101);
constant DBGWVR14_EL1 (line 1241) | pub const DBGWVR14_EL1: Self = Self::System(0b10_000_0000_1110_110);
constant DBGWCR14_EL1 (line 1243) | pub const DBGWCR14_EL1: Self = Self::System(0b10_000_0000_1110_111);
constant DBGBVR15_EL1 (line 1245) | pub const DBGBVR15_EL1: Self = Self::System(0b10_000_0000_1111_100);
constant DBGBCR15_EL1 (line 1247) | pub const DBGBCR15_EL1: Self = Self::System(0b10_000_0000_1111_101);
constant DBGWVR15_EL1 (line 1249) | pub const DBGWVR15_EL1: Self = Self::System(0b10_000_0000_1111_110);
constant DBGWCR15_EL1 (line 1251) | pub const DBGWCR15_EL1: Self = Self::System(0b10_000_0000_1111_111);
constant MDRAR_EL1 (line 1253) | pub const MDRAR_EL1: Self = Self::System(0b10_000_0001_0000_000);
constant OSLAR_EL1 (line 1255) | pub const OSLAR_EL1: Self = Self::System(0b10_000_0001_0000_100);
constant OSLSR_EL1 (line 1257) | pub const OSLSR_EL1: Self = Self::System(0b10_000_0001_0001_100);
constant OSDLR_EL1 (line 1259) | pub const OSDLR_EL1: Self = Self::System(0b10_000_0001_0011_100);
constant DBGPRCR_EL1 (line 1261) | pub const DBGPRCR_EL1: Self = Self::System(0b10_000_0001_0100_100);
constant DBGCLAIMSET_EL1 (line 1263) | pub const DBGCLAIMSET_EL1: Self = Self::System(0b10_000_0111_1000_110);
constant DBGCLAIMCLR_EL1 (line 1265) | pub const DBGCLAIMCLR_EL1: Self = Self::System(0b10_000_0111_1001_110);
constant DBGAUTHSTATUS_EL1 (line 1267) | pub const DBGAUTHSTATUS_EL1: Self = Self::System(0b10_000_0111_1110_110);
constant TRCTRACEIDR (line 1269) | pub const TRCTRACEIDR: Self = Self::System(0b10_001_0000_0000_001);
constant TRCVICTLR (line 1271) | pub const TRCVICTLR: Self = Self::System(0b10_001_0000_0000_010);
constant TRCSEQEVR0 (line 1273) | pub const TRCSEQEVR0: Self = Self::System(0b10_001_0000_0000_100);
constant TRCCNTRLDVR0 (line 1275) | pub const TRCCNTRLDVR0: Self = Self::System(0b10_001_0000_0000_101);
constant TRCIDR8 (line 1277) | pub const TRCIDR8: Self = Self::System(0b10_001_0000_0000_110);
constant TRCIMSPEC0 (line 1279) | pub const TRCIMSPEC0: Self = Self::System(0b10_001_0000_0000_111);
constant TRCPRGCTLR (line 1281) | pub const TRCPRGCTLR: Self = Self::System(0b10_001_0000_0001_000);
constant TRCQCTLR (line 1283) | pub const TRCQCTLR: Self = Self::System(0b10_001_0000_0001_001);
constant TRCVIIECTLR (line 1285) | pub const TRCVIIECTLR: Self = Self::System(0b10_001_0000_0001_010);
constant TRCSEQEVR1 (line 1287) | pub const TRCSEQEVR1: Self = Self::System(0b10_001_0000_0001_100);
constant TRCCNTRLDVR1 (line 1289) | pub const TRCCNTRLDVR1: Self = Self::System(0b10_001_0000_0001_101);
constant TRCIDR9 (line 1291) | pub const TRCIDR9: Self = Self::System(0b10_001_0000_0001_110);
constant TRCIMSPEC1 (line 1293) | pub const TRCIMSPEC1: Self = Self::System(0b10_001_0000_0001_111);
constant TRCVISSCTLR (line 1295) | pub const TRCVISSCTLR: Self = Self::System(0b10_001_0000_0010_010);
constant TRCSEQEVR2 (line 1297) | pub const TRCSEQEVR2: Self = Self::System(0b10_001_0000_0010_100);
constant TRCCNTRLDVR2 (line 1299) | pub const TRCCNTRLDVR2: Self = Self::System(0b10_001_0000_0010_101);
constant TRCIDR10 (line 1301) | pub const TRCIDR10: Self = Self::System(0b10_001_0000_0010_110);
constant TRCIMSPEC2 (line 1303) | pub const TRCIMSPEC2: Self = Self::System(0b10_001_0000_0010_111);
constant TRCSTATR (line 1305) | pub const TRCSTATR: Self = Self::System(0b10_001_0000_0011_000);
constant TRCVIPCSSCTLR (line 1307) | pub const TRCVIPCSSCTLR: Self = Self::System(0b10_001_0000_0011_010);
constant TRCCNTRLDVR3 (line 1309) | pub const TRCCNTRLDVR3: Self = Self::System(0b10_001_0000_0011_101);
constant TRCIDR11 (line 1311) | pub const TRCIDR11: Self = Self::System(0b10_001_0000_0011_110);
constant TRCIMSPEC3 (line 1313) | pub const TRCIMSPEC3: Self = Self::System(0b10_001_0000_0011_111);
constant TRCCONFIGR (line 1315) | pub const TRCCONFIGR: Self = Self::System(0b10_001_0000_0100_000);
constant TRCCNTCTLR0 (line 1317) | pub const TRCCNTCTLR0: Self = Self::System(0b10_001_0000_0100_101);
constant TRCIDR12 (line 1319) | pub const TRCIDR12: Self = Self::System(0b10_001_0000_0100_110);
constant TRCIMSPEC4 (line 1321) | pub const TRCIMSPEC4: Self = Self::System(0b10_001_0000_0100_111);
constant TRCCNTCTLR1 (line 1323) | pub const TRCCNTCTLR1: Self = Self::System(0b10_001_0000_0101_101);
constant TRCIDR13 (line 1325) | pub const TRCIDR13: Self = Self::System(0b10_001_0000_0101_110);
constant TRCIMSPEC5 (line 1327) | pub const TRCIMSPEC5: Self = Self::System(0b10_001_0000_0101_111);
constant TRCAUXCTLR (line 1329) | pub const TRCAUXCTLR: Self = Self::System(0b10_001_0000_0110_000);
constant TRCSEQRSTEVR (line 1331) | pub const TRCSEQRSTEVR: Self = Self::System(0b10_001_0000_0110_100);
constant TRCCNTCTLR2 (line 1333) | pub const TRCCNTCTLR2: Self = Self::System(0b10_001_0000_0110_101);
constant TRCIMSPEC6 (line 1335) | pub const TRCIMSPEC6: Self = Self::System(0b10_001_0000_0110_111);
constant TRCSEQSTR (line 1337) | pub const TRCSEQSTR: Self = Self::System(0b10_001_0000_0111_100);
constant TRCCNTCTLR3 (line 1339) | pub const TRCCNTCTLR3: Self = Self::System(0b10_001_0000_0111_101);
constant TRCIMSPEC7 (line 1341) | pub const TRCIMSPEC7: Self = Self::System(0b10_001_0000_0111_111);
constant TRCEVENTCTL0R (line 1343) | pub const TRCEVENTCTL0R: Self = Self::System(0b10_001_0000_1000_000);
constant TRCEXTINSELR0 (line 1345) | pub const TRCEXTINSELR0: Self = Self::System(0b10_001_0000_1000_100);
constant TRCCNTVR0 (line 1347) | pub const TRCCNTVR0: Self = Self::System(0b10_001_0000_1000_101);
constant TRCIDR0 (line 1349) | pub const TRCIDR0: Self = Self::System(0b10_001_0000_1000_111);
constant TRCEVENTCTL1R (line 1351) | pub const TRCEVENTCTL1R: Self = Self::System(0b10_001_0000_1001_000);
constant TRCEXTINSELR1 (line 1353) | pub const TRCEXTINSELR1: Self = Self::System(0b10_001_0000_1001_100);
constant TRCCNTVR1 (line 1355) | pub const TRCCNTVR1: Self = Self::System(0b10_001_0000_1001_101);
constant TRCIDR1 (line 1357) | pub const TRCIDR1: Self = Self::System(0b10_001_0000_1001_111);
constant TRCRSR (line 1359) | pub const TRCRSR: Self = Self::System(0b10_001_0000_1010_000);
constant TRCEXTINSELR2 (line 1361) | pub const TRCEXTINSELR2: Self = Self::System(0b10_001_0000_1010_100);
constant TRCCNTVR2 (line 1363) | pub const TRCCNTVR2: Self = Self::System(0b10_001_0000_1010_101);
constant TRCIDR2 (line 1365) | pub const TRCIDR2: Self = Self::System(0b10_001_0000_1010_111);
constant TRCSTALLCTLR (line 1367) | pub const TRCSTALLCTLR: Self = Self::System(0b10_001_0000_1011_000);
constant TRCEXTINSELR3 (line 1369) | pub const TRCEXTINSELR3: Self = Self::System(0b10_001_0000_1011_100);
constant TRCCNTVR3 (line 1371) | pub const TRCCNTVR3: Self = Self::System(0b10_001_0000_1011_101);
constant TRCIDR3 (line 1373) | pub const TRCIDR3: Self = Self::System(0b10_001_0000_1011_111);
constant TRCTSCTLR (line 1375) | pub const TRCTSCTLR: Self = Self::System(0b10_001_0000_1100_000);
constant TRCIDR4 (line 1377) | pub const TRCIDR4: Self = Self::System(0b10_001_0000_1100_111);
constant TRCSYNCPR (line 1379) | pub const TRCSYNCPR: Self = Self::System(0b10_001_0000_1101_000);
constant TRCIDR5 (line 1381) | pub const TRCIDR5: Self = Self::System(0b10_001_0000_1101_111);
constant TRCCCCTLR (line 1383) | pub const TRCCCCTLR: Self = Self::System(0b10_001_0000_1110_000);
constant TRCIDR6 (line 1385) | pub const TRCIDR6: Self = Self::System(0b10_001_0000_1110_111);
constant TRCBBCTLR (line 1387) | pub const TRCBBCTLR: Self = Self::System(0b10_001_0000_1111_000);
constant TRCIDR7 (line 1389) | pub const TRCIDR7: Self = Self::System(0b10_001_0000_1111_111);
constant TRCRSCTLR16 (line 1391) | pub const TRCRSCTLR16: Self = Self::System(0b10_001_0001_0000_001);
constant TRCSSCCR0 (line 1393) | pub const TRCSSCCR0: Self = Self::System(0b10_001_0001_0000_010);
constant TRCSSPCICR0 (line 1395) | pub const TRCSSPCICR0: Self = Self::System(0b10_001_0001_0000_011);
constant TRCRSCTLR17 (line 1397) | pub const TRCRSCTLR17: Self = Self::System(0b10_001_0001_0001_001);
constant TRCSSCCR1 (line 1399) | pub const TRCSSCCR1: Self = Self::System(0b10_001_0001_0001_010);
constant TRCSSPCICR1 (line 1401) | pub const TRCSSPCICR1: Self = Self::System(0b10_001_0001_0001_011);
constant TRCOSLSR (line 1403) | pub const TRCOSLSR: Self = Self::System(0b10_001_0001_0001_100);
constant TRCRSCTLR2 (line 1405) | pub const TRCRSCTLR2: Self = Self::System(0b10_001_0001_0010_000);
constant TRCRSCTLR18 (line 1407) | pub const TRCRSCTLR18: Self = Self::System(0b10_001_0001_0010_001);
constant TRCSSCCR2 (line 1409) | pub const TRCSSCCR2: Self = Self::System(0b10_001_0001_0010_010);
constant TRCSSPCICR2 (line 1411) | pub const TRCSSPCICR2: Self = Self::System(0b10_001_0001_0010_011);
constant TRCRSCTLR3 (line 1413) | pub const TRCRSCTLR3: Self = Self::System(0b10_001_0001_0011_000);
constant TRCRSCTLR19 (line 1415) | pub const TRCRSCTLR19: Self = Self::System(0b10_001_0001_0011_001);
constant TRCSSCCR3 (line 1417) | pub const TRCSSCCR3: Self = Self::System(0b10_001_0001_0011_010);
constant TRCSSPCICR3 (line 1419) | pub const TRCSSPCICR3: Self = Self::System(0b10_001_0001_0011_011);
constant TRCRSCTLR4 (line 1421) | pub const TRCRSCTLR4: Self = Self::System(0b10_001_0001_0100_000);
constant TRCRSCTLR20 (line 1423) | pub const TRCRSCTLR20: Self = Self::System(0b10_001_0001_0100_001);
constant TRCSSCCR4 (line 1425) | pub const TRCSSCCR4: Self = Self::System(0b10_001_0001_0100_010);
constant TRCSSPCICR4 (line 1427) | pub const TRCSSPCICR4: Self = Self::System(0b10_001_0001_0100_011);
constant TRCRSCTLR5 (line 1429) | pub const TRCRSCTLR5: Self = Self::System(0b10_001_0001_0101_000);
constant TRCRSCTLR21 (line 1431) | pub const TRCRSCTLR21: Self = Self::System(0b10_001_0001_0101_001);
constant TRCSSCCR5 (line 1433) | pub const TRCSSCCR5: Self = Self::System(0b10_001_0001_0101_010);
constant TRCSSPCICR5 (line 1435) | pub const TRCSSPCICR5: Self = Self::System(0b10_001_0001_0101_011);
constant TRCRSCTLR6 (line 1437) | pub const TRCRSCTLR6: Self = Self::System(0b10_001_0001_0110_000);
constant TRCRSCTLR22 (line 1439) | pub const TRCRSCTLR22: Self = Self::System(0b10_001_0001_0110_001);
constant TRCSSCCR6 (line 1441) | pub const TRCSSCCR6: Self = Self::System(0b10_001_0001_0110_010);
constant TRCSSPCICR6 (line 1443) | pub const TRCSSPCICR6: Self = Self::System(0b10_001_0001_0110_011);
constant TRCRSCTLR7 (line 1445) | pub const TRCRSCTLR7: Self = Self::System(0b10_001_0001_0111_000);
constant TRCRSCTLR23 (line 1447) | pub const TRCRSCTLR23: Self = Self::System(0b10_001_0001_0111_001);
constant TRCSSCCR7 (line 1449) | pub const TRCSSCCR7: Self = Self::System(0b10_001_0001_0111_010);
constant TRCSSPCICR7 (line 1451) | pub const TRCSSPCICR7: Self = Self::System(0b10_001_0001_0111_011);
constant TRCRSCTLR8 (line 1453) | pub const TRCRSCTLR8: Self = Self::System(0b10_001_0001_1000_000);
constant TRCRSCTLR24 (line 1455) | pub const TRCRSCTLR24: Self = Self::System(0b10_001_0001_1000_001);
constant TRCSSCSR0 (line 1457) | pub const TRCSSCSR0: Self = Self::System(0b10_001_0001_1000_010);
constant TRCRSCTLR9 (line 1459) | pub const TRCRSCTLR9: Self = Self::System(0b10_001_0001_1001_000);
constant TRCRSCTLR25 (line 1461) | pub const TRCRSCTLR25: Self = Self::System(0b10_001_0001_1001_001);
constant TRCSSCSR1 (line 1463) | pub const TRCSSCSR1: Self = Self::System(0b10_001_0001_1001_010);
constant TRCRSCTLR10 (line 1465) | pub const TRCRSCTLR10: Self = Self::System(0b10_001_0001_1010_000);
constant TRCRSCTLR26 (line 1467) | pub const TRCRSCTLR26: Self = Self::System(0b10_001_0001_1010_001);
constant TRCSSCSR2 (line 1469) | pub const TRCSSCSR2: Self = Self::System(0b10_001_0001_1010_010);
constant TRCRSCTLR11 (line 1471) | pub const TRCRSCTLR11: Self = Self::System(0b10_001_0001_1011_000);
constant TRCRSCTLR27 (line 1473) | pub const TRCRSCTLR27: Self = Self::System(0b10_001_0001_1011_001);
constant TRCSSCSR3 (line 1475) | pub const TRCSSCSR3: Self = Self::System(0b10_001_0001_1011_010);
constant TRCRSCTLR12 (line 1477) | pub const TRCRSCTLR12: Self = Self::System(0b10_001_0001_1100_000);
constant TRCRSCTLR28 (line 1479) | pub const TRCRSCTLR28: Self = Self::System(0b10_001_0001_1100_001);
constant TRCSSCSR4 (line 1481) | pub const TRCSSCSR4: Self = Self::System(0b10_001_0001_1100_010);
constant TRCRSCTLR13 (line 1483) | pub const TRCRSCTLR13: Self = Self::System(0b10_001_0001_1101_000);
constant TRCRSCTLR29 (line 1485) | pub const TRCRSCTLR29: Self = Self::System(0b10_001_0001_1101_001);
constant TRCSSCSR5 (line 1487) | pub const TRCSSCSR5: Self = Self::System(0b10_001_0001_1101_010);
constant TRCRSCTLR14 (line 1489) | pub const TRCRSCTLR14: Self = Self::System(0b10_001_0001_1110_000);
constant TRCRSCTLR30 (line 1491) | pub const TRCRSCTLR30: Self = Self::System(0b10_001_0001_1110_001);
constant TRCSSCSR6 (line 1493) | pub const TRCSSCSR6: Self = Self::System(0b10_001_0001_1110_010);
constant TRCRSCTLR15 (line 1495) | pub const TRCRSCTLR15: Self = Self::System(0b10_001_0001_1111_000);
constant TRCRSCTLR31 (line 1497) | pub const TRCRSCTLR31: Self = Self::System(0b10_001_0001_1111_001);
constant TRCSSCSR7 (line 1499) | pub const TRCSSCSR7: Self = Self::System(0b10_001_0001_1111_010);
constant TRCACVR0 (line 1501) | pub const TRCACVR0: Self = Self::System(0b10_001_0010_0000_000);
constant TRCACVR8 (line 1503) | pub const TRCACVR8: Self = Self::System(0b10_001_0010_0000_001);
constant TRCACATR0 (line 1505) | pub const TRCACATR0: Self = Self::System(0b10_001_0010_0000_010);
constant TRCACATR8 (line 1507) | pub const TRCACATR8: Self = Self::System(0b10_001_0010_0000_011);
constant TRCACVR1 (line 1509) | pub const TRCACVR1: Self = Self::System(0b10_001_0010_0010_000);
constant TRCACVR9 (line 1511) | pub const TRCACVR9: Self = Self::System(0b10_001_0010_0010_001);
constant TRCACATR1 (line 1513) | pub const TRCACATR1: Self = Self::System(0b10_001_0010_0010_010);
constant TRCACATR9 (line 1515) | pub const TRCACATR9: Self = Self::System(0b10_001_0010_0010_011);
constant TRCACVR2 (line 1517) | pub const TRCACVR2: Self = Self::System(0b10_001_0010_0100_000);
constant TRCACVR10 (line 1519) | pub const TRCACVR10: Self = Self::System(0b10_001_0010_0100_001);
constant TRCACATR2 (line 1521) | pub const TRCACATR2: Self = Self::System(0b10_001_0010_0100_010);
constant TRCACATR10 (line 1523) | pub const TRCACATR10: Self = Self::System(0b10_001_0010_0100_011);
constant TRCACVR3 (line 1525) | pub const TRCACVR3: Self = Self::System(0b10_001_0010_0110_000);
constant TRCACVR11 (line 1527) | pub const TRCACVR11: Self = Self::System(0b10_001_0010_0110_001);
constant TRCACATR3 (line 1529) | pub const TRCACATR3: Self = Self::System(0b10_001_0010_0110_010);
constant TRCACATR11 (line 1531) | pub const TRCACATR11: Self = Self::System(0b10_001_0010_0110_011);
constant TRCACVR4 (line 1533) | pub const TRCACVR4: Self = Self::System(0b10_001_0010_1000_000);
constant TRCACVR12 (line 1535) | pub const TRCACVR12: Self = Self::System(0b10_001_0010_1000_001);
constant TRCACATR4 (line 1537) | pub const TRCACATR4: Self = Self::System(0b10_001_0010_1000_010);
constant TRCACATR12 (line 1539) | pub const TRCACATR12: Self = Self::System(0b10_001_0010_1000_011);
constant TRCACVR5 (line 1541) | pub const TRCACVR5: Self = Self::System(0b10_001_0010_1010_000);
constant TRCACVR13 (line 1543) | pub const TRCACVR13: Self = Self::System(0b10_001_0010_1010_001);
constant TRCACATR5 (line 1545) | pub const TRCACATR5: Self = Self::System(0b10_001_0010_1010_010);
constant TRCACATR13 (line 1547) | pub const TRCACATR13: Self = Self::System(0b10_001_0010_1010_011);
constant TRCACVR6 (line 1549) | pub const TRCACVR6: Self = Self::System(0b10_001_0010_1100_000);
constant TRCACVR14 (line 1551) | pub const TRCACVR14: Self = Self::System(0b10_001_0010_1100_001);
constant TRCACATR6 (line 1553) | pub const TRCACATR6: Self = Self::System(0b10_001_0010_1100_010);
constant TRCACATR14 (line 1555) | pub const TRCACATR14: Self = Self::System(0b10_001_0010_1100_011);
constant TRCACVR7 (line 1557) | pub const TRCACVR7: Self = Self::System(0b10_001_0010_1110_000);
constant TRCACVR15 (line 1559) | pub const TRCACVR15: Self = Self::System(0b10_001_0010_1110_001);
constant TRCACATR7 (line 1561) | pub const TRCACATR7: Self = Self::System(0b10_001_0010_1110_010);
constant TRCACATR15 (line 1563) | pub const TRCACATR15: Self = Self::System(0b10_001_0010_1110_011);
constant TRCCIDCVR0 (line 1565) | pub const TRCCIDCVR0: Self = Self::System(0b10_001_0011_0000_000);
constant TRCVMIDCVR0 (line 1567) | pub const TRCVMIDCVR0: Self = Self::System(0b10_001_0011_0000_001);
constant TRCCIDCCTLR0 (line 1569) | pub const TRCCIDCCTLR0: Self = Self::System(0b10_001_0011_0000_010);
constant TRCCIDCCTLR1 (line 1571) | pub const TRCCIDCCTLR1: Self = Self::System(0b10_001_0011_0001_010);
constant TRCCIDCVR1 (line 1573) | pub const TRCCIDCVR1: Self = Self::System(0b10_001_0011_0010_000);
constant TRCVMIDCVR1 (line 1575) | pub const TRCVMIDCVR1: Self = Self::System(0b10_001_0011_0010_001);
constant TRCVMIDCCTLR0 (line 1577) | pub const TRCVMIDCCTLR0: Self = Self::System(0b10_001_0011_0010_010);
constant TRCVMIDCCTLR1 (line 1579) | pub const TRCVMIDCCTLR1: Self = Self::System(0b10_001_0011_0011_010);
constant TRCCIDCVR2 (line 1581) | pub const TRCCIDCVR2: Self = Self::System(0b10_001_0011_0100_000);
constant TRCVMIDCVR2 (line 1583) | pub const TRCVMIDCVR2: Self = Self::System(0b10_001_0011_0100_001);
constant TRCCIDCVR3 (line 1585) | pub const TRCCIDCVR3: Self = Self::System(0b10_001_0011_0110_000);
constant TRCVMIDCVR3 (line 1587) | pub const TRCVMIDCVR3: Self = Self::System(0b10_001_0011_0110_001);
constant TRCCIDCVR4 (line 1589) | pub const TRCCIDCVR4: Self = Self::System(0b10_001_0011_1000_000);
constant TRCVMIDCVR4 (line 1591) | pub const TRCVMIDCVR4: Self = Self::System(0b10_001_0011_1000_001);
constant TRCCIDCVR5 (line 1593) | pub const TRCCIDCVR5: Self = Self::System(0b10_001_0011_1010_000);
constant TRCVMIDCVR5 (line 1595) | pub const TRCVMIDCVR5: Self = Self::System(0b10_001_0011_1010_001);
constant TRCCIDCVR6 (line 1597) | pub const TRCCIDCVR6: Self = Self::System(0b10_001_0011_1100_000);
constant TRCVMIDCVR6 (line 1599) | pub const TRCVMIDCVR6: Self = Self::System(0b10_001_0011_1100_001);
constant TRCCIDCVR7 (line 1601) | pub const TRCCIDCVR7: Self = Self::System(0b10_001_0011_1110_000);
constant TRCVMIDCVR7 (line 1603) | pub const TRCVMIDCVR7: Self = Self::System(0b10_001_0011_1110_001);
constant TRCDEVID (line 1605) | pub const TRCDEVID: Self = Self::System(0b10_001_0111_0010_111);
constant TRCCLAIMSET (line 1607) | pub const TRCCLAIMSET: Self = Self::System(0b10_001_0111_1000_110);
constant TRCCLAIMCLR (line 1609) | pub const TRCCLAIMCLR: Self = Self::System(0b10_001_0111_1001_110);
constant TRCAUTHSTATUS (line 1611) | pub const TRCAUTHSTATUS: Self = Self::System(0b10_001_0111_1110_110);
constant TRCDEVARCH (line 1613) | pub const TRCDEVARCH: Self = Self::System(0b10_001_0111_1111_110);
constant BRBINF0_EL1 (line 1615) | pub const BRBINF0_EL1: Self = Self::System(0b10_001_1000_0000_000);
constant BRBSRC0_EL1 (line 1617) | pub const BRBSRC0_EL1: Self = Self::System(0b10_001_1000_0000_001);
constant BRBTGT0_EL1 (line 1619) | pub const BRBTGT0_EL1: Self = Self::System(0b10_001_1000_0000_010);
constant BRBINF16_EL1 (line 1621) | pub const BRBINF16_EL1: Self = Self::System(0b10_001_1000_0000_100);
constant BRBSRC16_EL1 (line 1623) | pub const BRBSRC16_EL1: Self = Self::System(0b10_001_1000_0000_101);
constant BRBTGT16_EL1 (line 1625) | pub const BRBTGT16_EL1: Self = Self::System(0b10_001_1000_0000_110);
constant BRBINF1_EL1 (line 1627) | pub const BRBINF1_EL1: Self = Self::System(0b10_001_1000_0001_000);
constant BRBSRC1_EL1 (line 1629) | pub const BRBSRC1_EL1: Self = Self::System(0b10_001_1000_0001_001);
constant BRBTGT1_EL1 (line 1631) | pub const BRBTGT1_EL1: Self = Self::System(0b10_001_1000_0001_010);
constant BRBINF17_EL1 (line 1633) | pub const BRBINF17_EL1: Self = Self::System(0b10_001_1000_0001_100);
constant BRBSRC17_EL1 (line 1635) | pub const BRBSRC17_EL1: Self = Self::System(0b10_001_1000_0001_101);
constant BRBTGT17_EL1 (line 1637) | pub const BRBTGT17_EL1: Self = Self::System(0b10_001_1000_0001_110);
constant BRBINF2_EL1 (line 1639) | pub const BRBINF2_EL1: Self = Self::System(0b10_001_1000_0010_000);
constant BRBSRC2_EL1 (line 1641) | pub const BRBSRC2_EL1: Self = Self::System(0b10_001_1000_0010_001);
constant BRBTGT2_EL1 (line 1643) | pub const BRBTGT2_EL1: Self = Self::System(0b10_001_1000_0010_010);
constant BRBINF18_EL1 (line 1645) | pub const BRBINF18_EL1: Self = Self::System(0b10_001_1000_0010_100);
constant BRBSRC18_EL1 (line 1647) | pub const BRBSRC18_EL1: Self = Self::System(0b10_001_1000_0010_101);
constant BRBTGT18_EL1 (line 1649) | pub const BRBTGT18_EL1: Self = Self::System(0b10_001_1000_0010_110);
constant BRBINF3_EL1 (line 1651) | pub const BRBINF3_EL1: Self = Self::System(0b10_001_1000_0011_000);
constant BRBSRC3_EL1 (line 1653) | pub const BRBSRC3_EL1: Self = Self::System(0b10_001_1000_0011_001);
constant BRBTGT3_EL1 (line 1655) | pub const BRBTGT3_EL1: Self = Self::System(0b10_001_1000_0011_010);
constant BRBINF19_EL1 (line 1657) | pub const BRBINF19_EL1: Self = Self::System(0b10_001_1000_0011_100);
constant BRBSRC19_EL1 (line 1659) | pub const BRBSRC19_EL1: Self = Self::System(0b10_001_1000_0011_101);
constant BRBTGT19_EL1 (line 1661) | pub const BRBTGT19_EL1: Self = Self::System(0b10_001_1000_0011_110);
constant BRBINF4_EL1 (line 1663) | pub const BRBINF4_EL1: Self = Self::System(0b10_001_1000_0100_000);
constant BRBSRC4_EL1 (line 1665) | pub const BRBSRC4_EL1: Self = Self::System(0b10_001_1000_0100_001);
constant BRBTGT4_EL1 (line 1667) | pub const BRBTGT4_EL1: Self = Self::System(0b10_001_1000_0100_010);
constant BRBINF20_EL1 (line 1669) | pub const BRBINF20_EL1: Self = Self::System(0b10_001_1000_0100_100);
constant BRBSRC20_EL1 (line 1671) | pub const BRBSRC20_EL1: Self = Self::System(0b10_001_1000_0100_101);
constant BRBTGT20_EL1 (line 1673) | pub const BRBTGT20_EL1: Self = Self::System(0b10_001_1000_0100_110);
constant BRBINF5_EL1 (line 1675) | pub const BRBINF5_EL1: Self = Self::System(0b10_001_1000_0101_000);
constant BRBSRC5_EL1 (line 1677) | pub const BRBSRC5_EL1: Self = Self::System(0b10_001_1000_0101_001);
constant BRBTGT5_EL1 (line 1679) | pub const BRBTGT5_EL1: Self = Self::System(0b10_001_1000_0101_010);
constant BRBINF21_EL1 (line 1681) | pub const BRBINF21_EL1: Self = Self::System(0b10_001_1000_0101_100);
constant BRBSRC21_EL1 (line 1683) | pub const BRBSRC21_EL1: Self = Self::System(0b10_001_1000_0101_101);
constant BRBTGT21_EL1 (line 1685) | pub const BRBTGT21_EL1: Self = Self::System(0b10_001_1000_0101_110);
constant BRBINF6_EL1 (line 1687) | pub const BRBINF6_EL1: Self = Self::System(0b10_001_1000_0110_000);
constant BRBSRC6_EL1 (line 1689) | pub const BRBSRC6_EL1: Self = Self::System(0b10_001_1000_0110_001);
constant BRBTGT6_EL1 (line 1691) | pub const BRBTGT6_EL1: Self = Self::System(0b10_001_1000_0110_010);
constant BRBINF22_EL1 (line 1693) | pub const BRBINF22_EL1: Self = Self::System(0b10_001_1000_0110_100);
constant BRBSRC22_EL1 (line 1695) | pub const BRBSRC22_EL1: Self = Self::System(0b10_001_1000_0110_101);
constant BRBTGT22_EL1 (line 1697) | pub const BRBTGT22_EL1: Self = Self::System(0b10_001_1000_0110_110);
constant BRBINF7_EL1 (line 1699) | pub const BRBINF7_EL1: Self = Self::System(0b10_001_1000_0111_000);
constant BRBSRC7_EL1 (line 1701) | pub const BRBSRC7_EL1: Self = Self::System(0b10_001_1000_0111_001);
constant BRBTGT7_EL1 (line 1703) | pub const BRBTGT7_EL1: Self = Self::System(0b10_001_1000_0111_010);
constant BRBINF23_EL1 (line 1705) | pub const BRBINF23_EL1: Self = Self::System(0b10_001_1000_0111_100);
constant BRBSRC23_EL1 (line 1707) | pub const BRBSRC23_EL1: Self = Self::System(0b10_001_1000_0111_101);
constant BRBTGT23_EL1 (line 1709) | pub const BRBTGT23_EL1: Self = Self::System(0b10_001_1000_0111_110);
constant BRBINF8_EL1 (line 1711) | pub const BRBINF8_EL1: Self = Self::System(0b10_001_1000_1000_000);
constant BRBSRC8_EL1 (line 1713) | pub const BRBSRC8_EL1: Self = Self::System(0b10_001_1000_1000_001);
constant BRBTGT8_EL1 (line 1715) | pub const BRBTGT8_EL1: Self = Self::System(0b10_001_1000_1000_010);
constant BRBINF24_EL1 (line 1717) | pub const BRBINF24_EL1: Self = Self::System(0b10_001_1000_1000_100);
constant BRBSRC24_EL1 (line 1719) | pub const BRBSRC24_EL1: Self = Self::System(0b10_001_1000_1000_101);
constant BRBTGT24_EL1 (line 1721) | pub const BRBTGT24_EL1: Self = Self::System(0b10_001_1000_1000_110);
constant BRBINF9_EL1 (line 1723) | pub const BRBINF9_EL1: Self = Self::System(0b10_001_1000_1001_000);
constant BRBSRC9_EL1 (line 1725) | pub const BRBSRC9_EL1: Self = Self::System(0b10_001_1000_1001_001);
constant BRBTGT9_EL1 (line 1727) | pub const BRBTGT9_EL1: Self = Self::System(0b10_001_1000_1001_010);
constant BRBINF25_EL1 (line 1729) | pub const BRBINF25_EL1: Self = Self::System(0b10_001_1000_1001_100);
constant BRBSRC25_EL1 (line 1731) | pub const BRBSRC25_EL1: Self = Self::System(0b10_001_1000_1001_101);
constant BRBTGT25_EL1 (line 1733) | pub const BRBTGT25_EL1: Self = Self::System(0b10_001_1000_1001_110);
constant BRBINF10_EL1 (line 1735) | pub const BRBINF10_EL1: Self = Self::System(0b10_001_1000_1010_000);
constant BRBSRC10_EL1 (line 1737) | pub const BRBSRC10_EL1: Self = Self::System(0b10_001_1000_1010_001);
constant BRBTGT10_EL1 (line 1739) | pub const BRBTGT10_EL1: Self = Self::System(0b10_001_1000_1010_010);
constant BRBINF26_EL1 (line 1741) | pub const BRBINF26_EL1: Self = Self::System(0b10_001_1000_1010_100);
constant BRBSRC26_EL1 (line 1743) | pub const BRBSRC26_EL1: Self = Self::System(0b10_001_1000_1010_101);
constant BRBTGT26_EL1 (line 1745) | pub const BRBTGT26_EL1: Self = Self::System(0b10_001_1000_1010_110);
constant BRBINF11_EL1 (line 1747) | pub const BRBINF11_EL1: Self = Self::System(0b10_001_1000_1011_000);
constant BRBSRC11_EL1 (line 1749) | pub const BRBSRC11_EL1: Self = Self::System(0b10_001_1000_1011_001);
constant BRBTGT11_EL1 (line 1751) | pub const BRBTGT11_EL1: Self = Self::System(0b10_001_1000_1011_010);
constant BRBINF27_EL1 (line 1753) | pub const BRBINF27_EL1: Self = Self::System(0b10_001_1000_1011_100);
constant BRBSRC27_EL1 (line 1755) | pub const BRBSRC27_EL1: Self = Self::System(0b10_001_1000_1011_101);
constant BRBTGT27_EL1 (line 1757) | pub const BRBTGT27_EL1: Self = Self::System(0b10_001_1000_1011_110);
constant BRBINF12_EL1 (line 1759) | pub const BRBINF12_EL1: Self = Self::System(0b10_001_1000_1100_000);
constant BRBSRC12_EL1 (line 1761) | pub const BRBSRC12_EL1: Self = Self::System(0b10_001_1000_1100_001);
constant BRBTGT12_EL1 (line 1763) | pub const BRBTGT12_EL1: Self = Self::System(0b10_001_1000_1100_010);
constant BRBINF28_EL1 (line 1765) | pub const BRBINF28_EL1: Self = Self::System(0b10_001_1000_1100_100);
constant BRBSRC28_EL1 (line 1767) | pub const BRBSRC28_EL1: Self = Self::System(0b10_001_1000_1100_101);
constant BRBTGT28_EL1 (line 1769) | pub const BRBTGT28_EL1: Self = Self::System(0b10_001_1000_1100_110);
constant BRBINF13_EL1 (line 1771) | pub const BRBINF13_EL1: Self = Self::System(0b10_001_1000_1101_000);
constant BRBSRC13_EL1 (line 1773) | pub const BRBSRC13_EL1: Self = Self::System(0b10_001_1000_1101_001);
constant BRBTGT13_EL1 (line 1775) | pub const BRBTGT13_EL1: Self = Self::System(0b10_001_1000_1101_010);
constant BRBINF29_EL1 (line 1777) | pub const BRBINF29_EL1: Self = Self::System(0b10_001_1000_1101_100);
constant BRBSRC29_EL1 (line 1779) | pub const BRBSRC29_EL1: Self = Self::System(0b10_001_1000_1101_101);
constant BRBTGT29_EL1 (line 1781) | pub const BRBTGT29_EL1: Self = Self::System(0b10_001_1000_1101_110);
constant BRBINF14_EL1 (line 1783) | pub const BRBINF14_EL1: Self = Self::System(0b10_001_1000_1110_000);
constant BRBSRC14_EL1 (line 1785) | pub const BRBSRC14_EL1: Self = Self::System(0b10_001_1000_1110_001);
constant BRBTGT14_EL1 (line 1787) | pub const BRBTGT14_EL1: Self = Self::System(0b10_001_1000_1110_010);
constant BRBINF30_EL1 (line 1789) | pub const BRBINF30_EL1: Self = Self::System(0b10_001_1000_1110_100);
constant BRBSRC30_EL1 (line 1791) | pub const BRBSRC30_EL1: Self = Self::System(0b10_001_1000_1110_101);
constant BRBTGT30_EL1 (line 1793) | pub const BRBTGT30_EL1: Self = Self::System(0b10_001_1000_1110_110);
constant BRBINF15_EL1 (line 1795) | pub const BRBINF15_EL1: Self = Self::System(0b10_001_1000_1111_000);
constant BRBSRC15_EL1 (line 1797) | pub const BRBSRC15_EL1: Self = Self::System(0b10_001_1000_1111_001);
constant BRBTGT15_EL1 (line 1799) | pub const BRBTGT15_EL1: Self = Self::System(0b10_001_1000_1111_010);
constant BRBINF31_EL1 (line 1801) | pub const BRBINF31_EL1: Self = Self::System(0b10_001_1000_1111_100);
constant BRBSRC31_EL1 (line 1803) | pub const BRBSRC31_EL1: Self = Self::System(0b10_001_1000_1111_101);
constant BRBTGT31_EL1 (line 1805) | pub const BRBTGT31_EL1: Self = Self::System(0b10_001_1000_1111_110);
constant BRBCR_EL1 (line 1807) | pub const BRBCR_EL1: Self = Self::System(0b10_001_1001_0000_000);
constant BRBCR_EL2 (line 1809) | pub const BRBCR_EL2: Self = Self::System(0b10_001_1001_0000_000);
constant BRBFCR_EL1 (line 1811) | pub const BRBFCR_EL1: Self = Self::System(0b10_001_1001_0000_001);
constant BRBTS_EL1 (line 1813) | pub const BRBTS_EL1: Self = Self::System(0b10_001_1001_0000_010);
constant BRBINFINJ_EL1 (line 1815) | pub const BRBINFINJ_EL1: Self = Self::System(0b10_001_1001_0001_000);
constant BRBSRCINJ_EL1 (line 1817) | pub const BRBSRCINJ_EL1: Self = Self::System(0b10_001_1001_0001_001);
constant BRBTGTINJ_EL1 (line 1819) | pub const BRBTGTINJ_EL1: Self = Self::System(0b10_001_1001_0001_010);
constant BRBIDR0_EL1 (line 1821) | pub const BRBIDR0_EL1: Self = Self::System(0b10_001_1001_0010_000);
constant MDCCSR_EL0 (line 1823) | pub const MDCCSR_EL0: Self = Self::System(0b10_011_0000_0001_000);
constant DBGDTR_EL0 (line 1825) | pub const DBGDTR_EL0: Self = Self::System(0b10_011_0000_0100_000);
constant DBGDTRRX_EL0 (line 1827) | pub const DBGDTRRX_EL0: Self = Self::System(0b10_011_0000_0101_000);
constant DBGDTRTX_EL0 (line 1829) | pub const DBGDTRTX_EL0: Self = Self::System(0b10_011_0000_0101_000);
constant DBGVCR32_EL2 (line 1831) | pub const DBGVCR32_EL2: Self = Self::System(0b10_100_0000_0111_000);
method from_raw_id (line 49) | fn from_raw_id(id: usize) -> Option<(Self, Option<NonZeroUsize>)> {
FILE: gdbstub_arch/src/arm/mod.rs
type ArmBreakpointKind (line 12) | pub enum ArmBreakpointKind {
method from_usize (line 22) | fn from_usize(kind: usize) -> Option<Self> {
type Armv4t (line 34) | pub enum Armv4t {}
type Usize (line 37) | type Usize = u32;
type Registers (line 38) | type Registers = reg::ArmCoreRegs;
type RegId (line 39) | type RegId = reg::id::ArmCoreRegId;
type BreakpointKind (line 40) | type BreakpointKind = ArmBreakpointKind;
method target_description_xml (line 42) | fn target_description_xml() -> Option<&'static str> {
FILE: gdbstub_arch/src/arm/reg/arm_core.rs
type ArmCoreRegs (line 7) | pub struct ArmCoreRegs {
type ProgramCounter (line 21) | type ProgramCounter = u32;
method pc (line 23) | fn pc(&self) -> Self::ProgramCounter {
method gdb_serialize (line 27) | fn gdb_serialize(&self, mut write_byte: impl FnMut(Option<u8>)) {
method gdb_deserialize (line 51) | fn gdb_deserialize(&mut self, mut bytes: &[u8]) -> Result<(), ()> {
FILE: gdbstub_arch/src/arm/reg/id.rs
type ArmCoreRegId (line 7) | pub enum ArmCoreRegId {
method from_raw_id (line 25) | fn from_raw_id(id: usize) -> Option<(Self, Option<NonZeroUsize>)> {
FILE: gdbstub_arch/src/mips/mod.rs
type MipsBreakpointKind (line 12) | pub enum MipsBreakpointKind {
method from_usize (line 27) | fn from_usize(kind: usize) -> Option<Self> {
type Mips (line 40) | pub enum Mips {}
type MipsWithDsp (line 43) | pub enum MipsWithDsp {}
type Mips64 (line 54) | pub enum Mips64 {}
type Mips64WithDsp (line 65) | pub enum Mips64WithDsp {}
type Usize (line 68) | type Usize = u32;
type Registers (line 69) | type Registers = reg::MipsCoreRegs<u32>;
type RegId (line 70) | type RegId = reg::id::MipsRegId<u32>;
type BreakpointKind (line 71) | type BreakpointKind = MipsBreakpointKind;
method target_description_xml (line 73) | fn target_description_xml() -> Option<&'static str> {
type Usize (line 79) | type Usize = u32;
type Registers (line 80) | type Registers = reg::MipsCoreRegsWithDsp<u32>;
type RegId (line 81) | type RegId = reg::id::MipsRegId<u32>;
type BreakpointKind (line 82) | type BreakpointKind = MipsBreakpointKind;
method target_description_xml (line 84) | fn target_description_xml() -> Option<&'static str> {
type Usize (line 93) | type Usize = u64;
type Registers (line 94) | type Registers = reg::MipsCoreRegs<u64>;
type RegId (line 95) | type RegId = reg::id::MipsRegId<u64>;
type BreakpointKind (line 96) | type BreakpointKind = MipsBreakpointKind;
method target_description_xml (line 98) | fn target_description_xml() -> Option<&'static str> {
type Usize (line 105) | type Usize = u64;
type Registers (line 106) | type Registers = reg::MipsCoreRegsWithDsp<u64>;
type RegId (line 107) | type RegId = reg::id::MipsRegId<u64>;
type BreakpointKind (line 108) | type BreakpointKind = MipsBreakpointKind;
method target_description_xml (line 110) | fn target_description_xml() -> Option<&'static str> {
FILE: gdbstub_arch/src/mips/reg/id.rs
type MipsRegId (line 7) | pub enum MipsRegId<U> {
function from_raw_id (line 48) | fn from_raw_id<U>(id: usize) -> Option<(MipsRegId<U>, Option<NonZeroUsiz...
method from_raw_id (line 77) | fn from_raw_id(id: usize) -> Option<(Self, Option<NonZeroUsize>)> {
method from_raw_id (line 83) | fn from_raw_id(id: usize) -> Option<(Self, Option<NonZeroUsize>)> {
function test (line 93) | fn test<Rs: Registers, RId: RegId>() {
function test_mips32 (line 116) | fn test_mips32() {
function test_mips64 (line 121) | fn test_mips64() {
FILE: gdbstub_arch/src/mips/reg/mips.rs
type MipsCoreRegs (line 12) | pub struct MipsCoreRegs<U> {
type MipsCp0Regs (line 31) | pub struct MipsCp0Regs<U> {
type MipsFpuRegs (line 44) | pub struct MipsFpuRegs<U> {
type MipsDspRegs (line 57) | pub struct MipsDspRegs<U> {
type MipsCoreRegsWithDsp (line 82) | pub struct MipsCoreRegsWithDsp<U> {
type ProgramCounter (line 93) | type ProgramCounter = U;
method pc (line 95) | fn pc(&self) -> Self::ProgramCounter {
method gdb_serialize (line 99) | fn gdb_serialize(&self, mut write_byte: impl FnMut(Option<u8>)) {
method gdb_deserialize (line 141) | fn gdb_deserialize(&mut self, bytes: &[u8]) -> Result<(), ()> {
type ProgramCounter (line 190) | type ProgramCounter = U;
method pc (line 192) | fn pc(&self) -> Self::ProgramCounter {
method gdb_serialize (line 196) | fn gdb_serialize(&self, mut write_byte: impl FnMut(Option<u8>)) {
method gdb_deserialize (line 227) | fn gdb_deserialize(&mut self, bytes: &[u8]) -> Result<(), ()> {
FILE: gdbstub_arch/src/msp430/mod.rs
type Msp430 (line 8) | pub struct Msp430 {}
type Usize (line 11) | type Usize = u16;
type Registers (line 12) | type Registers = reg::Msp430Regs<u16>;
type RegId (line 13) | type RegId = reg::id::Msp430RegId<u16>;
type BreakpointKind (line 14) | type BreakpointKind = usize;
method target_description_xml (line 16) | fn target_description_xml() -> Option<&'static str> {
type Msp430X (line 22) | pub struct Msp430X {}
type Usize (line 25) | type Usize = u32;
type Registers (line 26) | type Registers = reg::Msp430Regs<u32>;
type RegId (line 27) | type RegId = reg::id::Msp430RegId<u32>;
type BreakpointKind (line 28) | type BreakpointKind = usize;
method target_description_xml (line 30) | fn target_description_xml() -> Option<&'static str> {
FILE: gdbstub_arch/src/msp430/reg/id.rs
type Msp430RegId (line 10) | pub enum Msp430RegId<U> {
function from_raw_id (line 25) | fn from_raw_id<U>(id: usize) -> Option<(Msp430RegId<U>, Option<NonZeroUs...
method from_raw_id (line 40) | fn from_raw_id(id: usize) -> Option<(Self, Option<NonZeroUsize>)> {
method from_raw_id (line 46) | fn from_raw_id(id: usize) -> Option<(Self, Option<NonZeroUsize>)> {
function test (line 56) | fn test<Rs: Registers, RId: RegId>() {
function test_msp430 (line 83) | fn test_msp430() {
function test_msp430x (line 88) | fn test_msp430x() {
FILE: gdbstub_arch/src/msp430/reg/msp430.rs
type Msp430Regs (line 10) | pub struct Msp430Regs<U> {
type ProgramCounter (line 25) | type ProgramCounter = U;
method pc (line 27) | fn pc(&self) -> Self::ProgramCounter {
method gdb_serialize (line 31) | fn gdb_serialize(&self, mut write_byte: impl FnMut(Option<u8>)) {
method gdb_deserialize (line 53) | fn gdb_deserialize(&mut self, bytes: &[u8]) -> Result<(), ()> {
FILE: gdbstub_arch/src/ppc/mod.rs
type PowerPcAltivec32 (line 12) | pub enum PowerPcAltivec32<RegIdImpl: RegId> {
type Usize (line 18) | type Usize = u32;
type Registers (line 19) | type Registers = reg::PowerPcCommonRegs;
type RegId (line 20) | type RegId = RegIdImpl;
type BreakpointKind (line 21) | type BreakpointKind = usize;
method target_description_xml (line 23) | fn target_description_xml() -> Option<&'static str> {
FILE: gdbstub_arch/src/ppc/reg/common.rs
type PowerPcCommonRegs (line 13) | pub struct PowerPcCommonRegs {
type ProgramCounter (line 41) | type ProgramCounter = u32;
method pc (line 43) | fn pc(&self) -> Self::ProgramCounter {
method gdb_serialize (line 47) | fn gdb_serialize(&self, mut write_byte: impl FnMut(Option<u8>)) {
method gdb_deserialize (line 82) | fn gdb_deserialize(&mut self, bytes: &[u8]) -> Result<(), ()> {
function ppc_core_round_trip (line 135) | fn ppc_core_round_trip() {
FILE: gdbstub_arch/src/ppc/reg/mod.rs
type PpcVector (line 9) | type PpcVector = u128;
FILE: gdbstub_arch/src/riscv/mod.rs
type Riscv32 (line 10) | pub enum Riscv32 {}
type Riscv64 (line 13) | pub enum Riscv64 {}
type Usize (line 16) | type Usize = u32;
type Registers (line 17) | type Registers = reg::RiscvCoreRegs<u32>;
type BreakpointKind (line 18) | type BreakpointKind = usize;
type RegId (line 19) | type RegId = reg::id::RiscvRegId<u32>;
method target_description_xml (line 21) | fn target_description_xml() -> Option<&'static str> {
type Usize (line 27) | type Usize = u64;
type Registers (line 28) | type Registers = reg::RiscvCoreRegs<u64>;
type BreakpointKind (line 29) | type BreakpointKind = usize;
type RegId (line 30) | type RegId = reg::id::RiscvRegId<u64>;
method target_description_xml (line 32) | fn target_description_xml() -> Option<&'static str> {
FILE: gdbstub_arch/src/riscv/reg/id.rs
type RiscvRegId (line 7) | pub enum RiscvRegId<U> {
FILE: gdbstub_arch/src/riscv/reg/riscv.rs
type RiscvCoreRegs (line 13) | pub struct RiscvCoreRegs<U> {
type ProgramCounter (line 24) | type ProgramCounter = U;
method pc (line 26) | fn pc(&self) -> Self::ProgramCounter {
method gdb_serialize (line 30) | fn gdb_serialize(&self, mut write_byte: impl FnMut(Option<u8>)) {
method gdb_deserialize (line 52) | fn gdb_deserialize(&mut self, bytes: &[u8]) -> Result<(), ()> {
FILE: gdbstub_arch/src/wasm/addr.rs
type WasmAddrType (line 55) | pub enum WasmAddrType {
type WasmAddr (line 67) | pub struct WasmAddr(u64);
constant TYPE_BITS (line 70) | const TYPE_BITS: u32 = 2;
constant MODULE_BITS (line 71) | const MODULE_BITS: u32 = 30;
constant OFFSET_BITS (line 72) | const OFFSET_BITS: u32 = 32;
constant MODULE_SHIFT (line 74) | const MODULE_SHIFT: u32 = Self::OFFSET_BITS;
constant TYPE_SHIFT (line 75) | const TYPE_SHIFT: u32 = Self::OFFSET_BITS + Self::MODULE_BITS;
constant TYPE_MASK (line 77) | const TYPE_MASK: u64 = (1u64 << Self::TYPE_BITS) - 1;
constant MODULE_MASK (line 78) | const MODULE_MASK: u64 = (1u64 << Self::MODULE_BITS) - 1;
constant OFFSET_MASK (line 79) | const OFFSET_MASK: u64 = (1u64 << Self::OFFSET_BITS) - 1;
method from_raw (line 84) | pub fn from_raw(raw: u64) -> Option<Self> {
method as_raw (line 93) | pub fn as_raw(self) -> u64 {
method new (line 101) | pub fn new(addr_type: WasmAddrType, module_index: u32, offset: u32) ->...
method addr_type (line 119) | pub fn addr_type(self) -> WasmAddrType {
method module_index (line 134) | pub fn module_index(self) -> u32 {
method offset (line 140) | pub fn offset(self) -> u32 {
method fmt (line 146) | fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
method fmt (line 162) | fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
FILE: gdbstub_arch/src/wasm/mod.rs
type Wasm (line 72) | pub enum Wasm {}
type Usize (line 78) | type Usize = u64;
type Registers (line 79) | type Registers = reg::WasmRegisters;
type RegId (line 80) | type RegId = reg::id::WasmRegId;
type BreakpointKind (line 81) | type BreakpointKind = usize;
FILE: gdbstub_arch/src/wasm/reg/id.rs
type WasmRegId (line 7) | pub enum WasmRegId {
method from_raw_id (line 13) | fn from_raw_id(id: usize) -> Option<(Self, Option<NonZeroUsize>)> {
method to_raw_id (line 20) | fn to_raw_id(&self) -> Option<usize> {
FILE: gdbstub_arch/src/wasm/reg/wasm_regs.rs
type WasmRegisters (line 6) | pub struct WasmRegisters {
type ProgramCounter (line 13) | type ProgramCounter = u64;
method pc (line 15) | fn pc(&self) -> u64 {
method gdb_serialize (line 19) | fn gdb_serialize(&self, mut write_byte: impl FnMut(Option<u8>)) {
method gdb_deserialize (line 25) | fn gdb_deserialize(&mut self, bytes: &[u8]) -> Result<(), ()> {
FILE: gdbstub_arch/src/x86/mod.rs
type X86_64_SSE (line 9) | pub enum X86_64_SSE {}
type Usize (line 12) | type Usize = u64;
type Registers (line 13) | type Registers = reg::X86_64CoreRegs;
type RegId (line 14) | type RegId = reg::id::X86_64CoreRegId;
type BreakpointKind (line 15) | type BreakpointKind = usize;
method target_description_xml (line 17) | fn target_description_xml() -> Option<&'static str> {
type X86_SSE (line 26) | pub enum X86_SSE {}
type Usize (line 29) | type Usize = u32;
type Registers (line 30) | type Registers = reg::X86CoreRegs;
type RegId (line 31) | type RegId = reg::id::X86CoreRegId;
type BreakpointKind (line 32) | type BreakpointKind = usize;
method target_description_xml (line 34) | fn target_description_xml() -> Option<&'static str> {
FILE: gdbstub_arch/src/x86/reg/core32.rs
type X86CoreRegs (line 12) | pub struct X86CoreRegs {
type ProgramCounter (line 46) | type ProgramCounter = u32;
method pc (line 48) | fn pc(&self) -> Self::ProgramCounter {
method gdb_serialize (line 52) | fn gdb_serialize(&self, mut write_byte: impl FnMut(Option<u8>)) {
method gdb_deserialize (line 89) | fn gdb_deserialize(&mut self, bytes: &[u8]) -> Result<(), ()> {
function x86_core_round_trip (line 136) | fn x86_core_round_trip() {
FILE: gdbstub_arch/src/x86/reg/core64.rs
type X86_64CoreRegs (line 12) | pub struct X86_64CoreRegs {
type ProgramCounter (line 32) | type ProgramCounter = u64;
method pc (line 34) | fn pc(&self) -> Self::ProgramCounter {
method gdb_serialize (line 38) | fn gdb_serialize(&self, mut write_byte: impl FnMut(Option<u8>)) {
method gdb_deserialize (line 76) | fn gdb_deserialize(&mut self, bytes: &[u8]) -> Result<(), ()> {
function x86_64_core_round_trip (line 121) | fn x86_64_core_round_trip() {
FILE: gdbstub_arch/src/x86/reg/id.rs
type X87FpuInternalRegId (line 6) | pub enum X87FpuInternalRegId {
method from_u8 (line 26) | fn from_u8(val: u8) -> Option<Self> {
type X86SegmentRegId (line 47) | pub enum X86SegmentRegId {
method from_u8 (line 63) | fn from_u8(val: u8) -> Option<Self> {
type X86CoreRegId (line 85) | pub enum X86CoreRegId {
method from_raw_id (line 119) | fn from_raw_id(id: usize) -> Option<(Self, Option<NonZeroUsize>)> {
type X86_64CoreRegId (line 151) | pub enum X86_64CoreRegId {
method from_raw_id (line 172) | fn from_raw_id(id: usize) -> Option<(Self, Option<NonZeroUsize>)> {
function test (line 199) | fn test<Rs: Registers, RId: RegId>() {
function test_x86 (line 222) | fn test_x86() {
function test_x86_64 (line 227) | fn test_x86_64() {
FILE: gdbstub_arch/src/x86/reg/mod.rs
type F80 (line 16) | pub type F80 = [u8; 10];
type X87FpuInternalRegs (line 20) | pub struct X87FpuInternalRegs {
type ProgramCounter (line 40) | type ProgramCounter = u32;
method pc (line 44) | fn pc(&self) -> Self::ProgramCounter {
method gdb_serialize (line 48) | fn gdb_serialize(&self, mut write_byte: impl FnMut(Option<u8>)) {
method gdb_deserialize (line 69) | fn gdb_deserialize(&mut self, bytes: &[u8]) -> Result<(), ()> {
type X86SegmentRegs (line 95) | pub struct X86SegmentRegs {
type ProgramCounter (line 111) | type ProgramCounter = u32;
method pc (line 115) | fn pc(&self) -> Self::ProgramCounter {
method gdb_serialize (line 119) | fn gdb_serialize(&self, mut write_byte: impl FnMut(Option<u8>)) {
method gdb_deserialize (line 136) | fn gdb_deserialize(&mut self, bytes: &[u8]) -> Result<(), ()> {
FILE: src/arch.rs
type RegId (line 34) | pub trait RegId: Sized + Debug {
method from_raw_id (line 43) | fn from_raw_id(id: usize) -> Option<(Self, Option<NonZeroUsize>)>;
method to_raw_id (line 55) | fn to_raw_id(&self) -> Option<usize> {
method from_raw_id (line 62) | fn from_raw_id(_id: usize) -> Option<(Self, Option<NonZeroUsize>)> {
type Registers (line 75) | pub trait Registers: Default + Debug + Clone + PartialEq {
method pc (line 81) | fn pc(&self) -> Self::ProgramCounter;
method gdb_serialize (line 86) | fn gdb_serialize(&self, write_byte: impl FnMut(Option<u8>));
method gdb_deserialize (line 90) | fn gdb_deserialize(&mut self, bytes: &[u8]) -> Result<(), ()>;
type BreakpointKind (line 108) | pub trait BreakpointKind: Sized + Debug {
method from_usize (line 110) | fn from_usize(kind: usize) -> Option<Self>;
method from_usize (line 114) | fn from_usize(kind: usize) -> Option<Self> {
method from_usize (line 125) | fn from_usize(kind: usize) -> Option<Self> {
type Arch (line 137) | pub trait Arch {
method target_description_xml (line 174) | fn target_description_xml() -> Option<&'static str> {
method lldb_register_info (line 202) | fn lldb_register_info(reg_id: usize) -> Option<lldb::RegisterInfo<'sta...
type RegisterInfo (line 214) | pub enum RegisterInfo<'a> {
type Register (line 223) | pub struct Register<'a> {
type Encoding (line 258) | pub enum Encoding {
type Format (line 271) | pub enum Format {
type Generic (line 300) | pub enum Generic {
FILE: src/common/mod.rs
type Tid (line 20) | pub type Tid = NonZeroUsize;
type Pid (line 33) | pub type Pid = NonZeroUsize;
type Endianness (line 40) | pub enum Endianness {
FILE: src/common/signal.rs
type Signal (line 6) | pub struct Signal(pub u8);
constant SIGZERO (line 12) | pub const SIGZERO: Self = Self(0);
constant SIGHUP (line 13) | pub const SIGHUP: Self = Self(1);
constant SIGINT (line 14) | pub const SIGINT: Self = Self(2);
constant SIGQUIT (line 15) | pub const SIGQUIT: Self = Self(3);
constant SIGILL (line 16) | pub const SIGILL: Self = Self(4);
constant SIGTRAP (line 17) | pub const SIGTRAP: Self = Self(5);
constant SIGABRT (line 18) | pub const SIGABRT: Self = Self(6);
constant SIGEMT (line 19) | pub const SIGEMT: Self = Self(7);
constant SIGFPE (line 20) | pub const SIGFPE: Self = Self(8);
constant SIGKILL (line 21) | pub const SIGKILL: Self = Self(9);
constant SIGBUS (line 22) | pub const SIGBUS: Self = Self(10);
constant SIGSEGV (line 23) | pub const SIGSEGV: Self = Self(11);
constant SIGSYS (line 24) | pub const SIGSYS: Self = Self(12);
constant SIGPIPE (line 25) | pub const SIGPIPE: Self = Self(13);
constant SIGALRM (line 26) | pub const SIGALRM: Self = Self(14);
constant SIGTERM (line 27) | pub const SIGTERM: Self = Self(15);
constant SIGURG (line 28) | pub const SIGURG: Self = Self(16);
constant SIGSTOP (line 29) | pub const SIGSTOP: Self = Self(17);
constant SIGTSTP (line 30) | pub const SIGTSTP: Self = Self(18);
constant SIGCONT (line 31) | pub const SIGCONT: Self = Self(19);
constant SIGCHLD (line 32) | pub const SIGCHLD: Self = Self(20);
constant SIGTTIN (line 33) | pub const SIGTTIN: Self = Self(21);
constant SIGTTOU (line 34) | pub const SIGTTOU: Self = Self(22);
constant SIGIO (line 35) | pub const SIGIO: Self = Self(23);
constant SIGXCPU (line 36) | pub const SIGXCPU: Self = Self(24);
constant SIGXFSZ (line 37) | pub const SIGXFSZ: Self = Self(25);
constant SIGVTALRM (line 38) | pub const SIGVTALRM: Self = Self(26);
constant SIGPROF (line 39) | pub const SIGPROF: Self = Self(27);
constant SIGWINCH (line 40) | pub const SIGWINCH: Self = Self(28);
constant SIGLOST (line 41) | pub const SIGLOST: Self = Self(29);
constant SIGUSR1 (line 42) | pub const SIGUSR1: Self = Self(30);
constant SIGUSR2 (line 43) | pub const SIGUSR2: Self = Self(31);
constant SIGPWR (line 44) | pub const SIGPWR: Self = Self(32);
constant SIGPOLL (line 46) | pub const SIGPOLL: Self = Self(33);
constant SIGWIND (line 47) | pub const SIGWIND: Self = Self(34);
constant SIGPHONE (line 48) | pub const SIGPHONE: Self = Self(35);
constant SIGWAITING (line 49) | pub const SIGWAITING: Self = Self(36);
constant SIGLWP (line 50) | pub const SIGLWP: Self = Self(37);
constant SIGDANGER (line 51) | pub const SIGDANGER: Self = Self(38);
constant SIGGRANT (line 52) | pub const SIGGRANT: Self = Self(39);
constant SIGRETRACT (line 53) | pub const SIGRETRACT: Self = Self(40);
constant SIGMSG (line 54) | pub const SIGMSG: Self = Self(41);
constant SIGSOUND (line 55) | pub const SIGSOUND: Self = Self(42);
constant SIGSAK (line 56) | pub const SIGSAK: Self = Self(43);
constant SIGPRIO (line 57) | pub const SIGPRIO: Self = Self(44);
constant SIG33 (line 58) | pub const SIG33: Self = Self(45);
constant SIG34 (line 59) | pub const SIG34: Self = Self(46);
constant SIG35 (line 60) | pub const SIG35: Self = Self(47);
constant SIG36 (line 61) | pub const SIG36: Self = Self(48);
constant SIG37 (line 62) | pub const SIG37: Self = Self(49);
constant SIG38 (line 63) | pub const SIG38: Self = Self(50);
constant SIG39 (line 64) | pub const SIG39: Self = Self(51);
constant SIG40 (line 65) | pub const SIG40: Self = Self(52);
constant SIG41 (line 66) | pub const SIG41: Self = Self(53);
constant SIG42 (line 67) | pub const SIG42: Self = Self(54);
constant SIG43 (line 68) | pub const SIG43: Self = Self(55);
constant SIG44 (line 69) | pub const SIG44: Self = Self(56);
constant SIG45 (line 70) | pub const SIG45: Self = Self(57);
constant SIG46 (line 71) | pub const SIG46: Self = Self(58);
constant SIG47 (line 72) | pub const SIG47: Self = Self(59);
constant SIG48 (line 73) | pub const SIG48: Self = Self(60);
constant SIG49 (line 74) | pub const SIG49: Self = Self(61);
constant SIG50 (line 75) | pub const SIG50: Self = Self(62);
constant SIG51 (line 76) | pub const SIG51: Self = Self(63);
constant SIG52 (line 77) | pub const SIG52: Self = Self(64);
constant SIG53 (line 78) | pub const SIG53: Self = Self(65);
constant SIG54 (line 79) | pub const SIG54: Self = Self(66);
constant SIG55 (line 80) | pub const SIG55: Self = Self(67);
constant SIG56 (line 81) | pub const SIG56: Self = Self(68);
constant SIG57 (line 82) | pub const SIG57: Self = Self(69);
constant SIG58 (line 83) | pub const SIG58: Self = Self(70);
constant SIG59 (line 84) | pub const SIG59: Self = Self(71);
constant SIG60 (line 85) | pub const SIG60: Self = Self(72);
constant SIG61 (line 86) | pub const SIG61: Self = Self(73);
constant SIG62 (line 87) | pub const SIG62: Self = Self(74);
constant SIG63 (line 88) | pub const SIG63: Self = Self(75);
constant SIGCANCEL (line 90) | pub const SIGCANCEL: Self = Self(76);
constant SIG32 (line 95) | pub const SIG32: Self = Self(77);
constant SIG64 (line 97) | pub const SIG64: Self = Self(78);
constant SIG65 (line 99) | pub const SIG65: Self = Self(79);
constant SIG66 (line 100) | pub const SIG66: Self = Self(80);
constant SIG67 (line 101) | pub const SIG67: Self = Self(81);
constant SIG68 (line 102) | pub const SIG68: Self = Self(82);
constant SIG69 (line 103) | pub const SIG69: Self = Self(83);
constant SIG70 (line 104) | pub const SIG70: Self = Self(84);
constant SIG71 (line 105) | pub const SIG71: Self = Self(85);
constant SIG72 (line 106) | pub const SIG72: Self = Self(86);
constant SIG73 (line 107) | pub const SIG73: Self = Self(87);
constant SIG74 (line 108) | pub const SIG74: Self = Self(88);
constant SIG75 (line 109) | pub const SIG75: Self = Self(89);
constant SIG76 (line 110) | pub const SIG76: Self = Self(90);
constant SIG77 (line 111) | pub const SIG77: Self = Self(91);
constant SIG78 (line 112) | pub const SIG78: Self = Self(92);
constant SIG79 (line 113) | pub const SIG79: Self = Self(93);
constant SIG80 (line 114) | pub const SIG80: Self = Self(94);
constant SIG81 (line 115) | pub const SIG81: Self = Self(95);
constant SIG82 (line 116) | pub const SIG82: Self = Self(96);
constant SIG83 (line 117) | pub const SIG83: Self = Self(97);
constant SIG84 (line 118) | pub const SIG84: Self = Self(98);
constant SIG85 (line 119) | pub const SIG85: Self = Self(99);
constant SIG86 (line 120) | pub const SIG86: Self = Self(100);
constant SIG87 (line 121) | pub const SIG87: Self = Self(101);
constant SIG88 (line 122) | pub const SIG88: Self = Self(102);
constant SIG89 (line 123) | pub const SIG89: Self = Self(103);
constant SIG90 (line 124) | pub const SIG90: Self = Self(104);
constant SIG91 (line 125) | pub const SIG91: Self = Self(105);
constant SIG92 (line 126) | pub const SIG92: Self = Self(106);
constant SIG93 (line 127) | pub const SIG93: Self = Self(107);
constant SIG94 (line 128) | pub const SIG94: Self = Self(108);
constant SIG95 (line 129) | pub const SIG95: Self = Self(109);
constant SIG96 (line 130) | pub const SIG96: Self = Self(110);
constant SIG97 (line 131) | pub const SIG97: Self = Self(111);
constant SIG98 (line 132) | pub const SIG98: Self = Self(112);
constant SIG99 (line 133) | pub const SIG99: Self = Self(113);
constant SIG100 (line 134) | pub const SIG100: Self = Self(114);
constant SIG101 (line 135) | pub const SIG101: Self = Self(115);
constant SIG102 (line 136) | pub const SIG102: Self = Self(116);
constant SIG103 (line 137) | pub const SIG103: Self = Self(117);
constant SIG104 (line 138) | pub const SIG104: Self = Self(118);
constant SIG105 (line 139) | pub const SIG105: Self = Self(119);
constant SIG106 (line 140) | pub const SIG106: Self = Self(120);
constant SIG107 (line 141) | pub const SIG107: Self = Self(121);
constant SIG108 (line 142) | pub const SIG108: Self = Self(122);
constant SIG109 (line 143) | pub const SIG109: Self = Self(123);
constant SIG110 (line 144) | pub const SIG110: Self = Self(124);
constant SIG111 (line 145) | pub const SIG111: Self = Self(125);
constant SIG112 (line 146) | pub const SIG112: Self = Self(126);
constant SIG113 (line 147) | pub const SIG113: Self = Self(127);
constant SIG114 (line 148) | pub const SIG114: Self = Self(128);
constant SIG115 (line 149) | pub const SIG115: Self = Self(129);
constant SIG116 (line 150) | pub const SIG116: Self = Self(130);
constant SIG117 (line 151) | pub const SIG117: Self = Self(131);
constant SIG118 (line 152) | pub const SIG118: Self = Self(132);
constant SIG119 (line 153) | pub const SIG119: Self = Self(133);
constant SIG120 (line 154) | pub const SIG120: Self = Self(134);
constant SIG121 (line 155) | pub const SIG121: Self = Self(135);
constant SIG122 (line 156) | pub const SIG122: Self = Self(136);
constant SIG123 (line 157) | pub const SIG123: Self = Self(137);
constant SIG124 (line 158) | pub const SIG124: Self = Self(138);
constant SIG125 (line 159) | pub const SIG125: Self = Self(139);
constant SIG126 (line 160) | pub const SIG126: Self = Self(140);
constant SIG127 (line 161) | pub const SIG127: Self = Self(141);
constant SIGINFO (line 163) | pub const SIGINFO: Self = Self(142);
constant UNKNOWN (line 166) | pub const UNKNOWN: Self = Self(143);
constant INTERNAL_DEFAULT (line 171) | pub const INTERNAL_DEFAULT: Self = Self(144);
constant EXC_BAD_ACCESS (line 176) | pub const EXC_BAD_ACCESS: Self = Self(145);
constant EXC_BAD_INSTRUCTION (line 177) | pub const EXC_BAD_INSTRUCTION: Self = Self(146);
constant EXC_ARITHMETIC (line 178) | pub const EXC_ARITHMETIC: Self = Self(147);
constant EXC_EMULATION (line 179) | pub const EXC_EMULATION: Self = Self(148);
constant EXC_SOFTWARE (line 180) | pub const EXC_SOFTWARE: Self = Self(149);
constant EXC_BREAKPOINT (line 181) | pub const EXC_BREAKPOINT: Self = Self(150);
constant SIGLIBRT (line 183) | pub const SIGLIBRT: Self = Self(151);
method fmt (line 187) | fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
FILE: src/conn/impls/boxed.rs
type Error (line 6) | type Error = E;
method write (line 8) | fn write(&mut self, byte: u8) -> Result<(), Self::Error> {
method write_all (line 12) | fn write_all(&mut self, buf: &[u8]) -> Result<(), Self::Error> {
method flush (line 16) | fn flush(&mut self) -> Result<(), Self::Error> {
method on_session_start (line 20) | fn on_session_start(&mut self) -> Result<(), Self::Error> {
type Error (line 26) | type Error = E;
method write (line 28) | fn write(&mut self, byte: u8) -> Result<(), Self::Error> {
method write_all (line 32) | fn write_all(&mut self, buf: &[u8]) -> Result<(), Self::Error> {
method flush (line 36) | fn flush(&mut self) -> Result<(), Self::Error> {
method on_session_start (line 40) | fn on_session_start(&mut self) -> Result<(), Self::Error> {
method read (line 46) | fn read(&mut self) -> Result<u8, Self::Error> {
method peek (line 50) | fn peek(&mut self) -> Result<Option<u8>, Self::Error> {
FILE: src/conn/impls/mod.rs
type Error (line 17) | type Error = E;
method write (line 19) | fn write(&mut self, byte: u8) -> Result<(), Self::Error> {
method write_all (line 23) | fn write_all(&mut self, buf: &[u8]) -> Result<(), Self::Error> {
method flush (line 27) | fn flush(&mut self) -> Result<(), Self::Error> {
method on_session_start (line 31) | fn on_session_start(&mut self) -> Result<(), Self::Error> {
type Error (line 37) | type Error = E;
method write (line 39) | fn write(&mut self, byte: u8) -> Result<(), Self::Error> {
method write_all (line 43) | fn write_all(&mut self, buf: &[u8]) -> Result<(), Self::Error> {
method flush (line 47) | fn flush(&mut self) -> Result<(), Self::Error> {
method on_session_start (line 51) | fn on_session_start(&mut self) -> Result<(), Self::Error> {
method read (line 57) | fn read(&mut self) -> Result<u8, Self::Error> {
method peek (line 61) | fn peek(&mut self) -> Result<Option<u8>, Self::Error> {
FILE: src/conn/impls/tcpstream.rs
type Error (line 6) | type Error = std::io::Error;
method write (line 8) | fn write(&mut self, byte: u8) -> Result<(), Self::Error> {
method write_all (line 14) | fn write_all(&mut self, buf: &[u8]) -> Result<(), Self::Error> {
method flush (line 20) | fn flush(&mut self) -> Result<(), Self::Error> {
method on_session_start (line 26) | fn on_session_start(&mut self) -> Result<(), Self::Error> {
method read (line 33) | fn read(&mut self) -> Result<u8, Self::Error> {
method peek (line 45) | fn peek(&mut self) -> Result<Option<u8>, Self::Error> {
FILE: src/conn/impls/unixstream.rs
type PeekExt (line 7) | trait PeekExt {
method peek (line 8) | fn peek(&self, buf: &mut [u8]) -> io::Result<usize>;
method peek (line 14) | fn peek(&self, _buf: &mut [u8]) -> io::Result<usize> {
method peek (line 20) | fn peek(&self, buf: &mut [u8]) -> io::Result<usize> {
type Error (line 58) | type Error = std::io::Error;
method write (line 60) | fn write(&mut self, byte: u8) -> Result<(), Self::Error> {
method write_all (line 66) | fn write_all(&mut self, buf: &[u8]) -> Result<(), Self::Error> {
method flush (line 72) | fn flush(&mut self) -> Result<(), Self::Error> {
method read (line 80) | fn read(&mut self) -> Result<u8, Self::Error> {
method peek (line 92) | fn peek(&mut self) -> Result<Option<u8>, Self::Error> {
FILE: src/conn/mod.rs
type Connection (line 10) | pub trait Connection {
method write (line 15) | fn write(&mut self, byte: u8) -> Result<(), Self::Error>;
method write_all (line 23) | fn write_all(&mut self, buf: &[u8]) -> Result<(), Self::Error> {
method flush (line 36) | fn flush(&mut self) -> Result<(), Self::Error>;
method on_session_start (line 50) | fn on_session_start(&mut self) -> Result<(), Self::Error> {
type ConnectionExt (line 63) | pub trait ConnectionExt: Connection {
method read (line 65) | fn read(&mut self) -> Result<u8, Self::Error>;
method peek (line 72) | fn peek(&mut self) -> Result<Option<u8>, Self::Error>;
FILE: src/internal/be_bytes.rs
type BeBytes (line 3) | pub trait BeBytes: Sized {
method to_be_bytes (line 7) | fn to_be_bytes(self, buf: &mut [u8]) -> Option<usize>;
method from_be_bytes (line 11) | fn from_be_bytes(buf: &[u8]) -> Option<Self>;
function basic (line 63) | fn basic() {
function small (line 71) | fn small() {
function too_big (line 79) | fn too_big() {
FILE: src/internal/le_bytes.rs
type LeBytes (line 3) | pub trait LeBytes: Sized {
method to_le_bytes (line 7) | fn to_le_bytes(self, buf: &mut [u8]) -> Option<usize>;
method from_le_bytes (line 11) | fn from_le_bytes(buf: &[u8]) -> Option<Self>;
function basic (line 63) | fn basic() {
function small (line 71) | fn small() {
function too_big (line 79) | fn too_big() {
FILE: src/lib.rs
constant SINGLE_THREAD_TID (line 355) | const SINGLE_THREAD_TID: common::Tid = unwrap!(common::Tid::new(1));
constant FAKE_PID (line 358) | const FAKE_PID: common::Pid = unwrap!(common::Pid::new(1));
type IsValidTid (line 361) | pub trait IsValidTid {}
FILE: src/protocol/commands.rs
type ParseCommand (line 17) | pub trait ParseCommand<'a>: Sized {
method from_packet (line 19) | fn from_packet(buf: PacketBuf<'a>) -> Option<Self>;
FILE: src/protocol/commands/_QAgent.rs
type QAgent (line 4) | pub struct QAgent {
method from_packet (line 10) | fn from_packet(buf: PacketBuf<'a>) -> Option<Self> {
FILE: src/protocol/commands/_QCatchSyscalls.rs
type QCatchSyscalls (line 5) | pub enum QCatchSyscalls<'a> {
function from_packet (line 13) | fn from_packet(buf: PacketBuf<'a>) -> Option<Self> {
FILE: src/protocol/commands/_QDisableRandomization.rs
type QDisableRandomization (line 4) | pub struct QDisableRandomization {
method from_packet (line 10) | fn from_packet(buf: PacketBuf<'a>) -> Option<Self> {
FILE: src/protocol/commands/_QEnvironmentHexEncoded.rs
type QEnvironmentHexEncoded (line 4) | pub struct QEnvironmentHexEncoded<'a> {
function from_packet (line 11) | fn from_packet(buf: PacketBuf<'a>) -> Option<Self> {
FILE: src/protocol/commands/_QEnvironmentReset.rs
type QEnvironmentReset (line 4) | pub struct QEnvironmentReset;
method from_packet (line 8) | fn from_packet(buf: PacketBuf<'a>) -> Option<Self> {
FILE: src/protocol/commands/_QEnvironmentUnset.rs
type QEnvironmentUnset (line 4) | pub struct QEnvironmentUnset<'a> {
function from_packet (line 10) | fn from_packet(buf: PacketBuf<'a>) -> Option<Self> {
FILE: src/protocol/commands/_QSetWorkingDir.rs
type QSetWorkingDir (line 4) | pub struct QSetWorkingDir<'a> {
function from_packet (line 10) | fn from_packet(buf: PacketBuf<'a>) -> Option<Self> {
FILE: src/protocol/commands/_QStartNoAckMode.rs
type QStartNoAckMode (line 4) | pub struct QStartNoAckMode;
method from_packet (line 8) | fn from_packet(buf: PacketBuf<'a>) -> Option<Self> {
FILE: src/protocol/commands/_QStartupWithShell.rs
type QStartupWithShell (line 4) | pub struct QStartupWithShell {
method from_packet (line 10) | fn from_packet(buf: PacketBuf<'a>) -> Option<Self> {
FILE: src/protocol/commands/_QTBuffer_upcase.rs
type QTBuffer (line 6) | pub struct QTBuffer(pub TraceBufferConfig);
method from_packet (line 10) | fn from_packet(buf: PacketBuf<'_>) -> Option<Self> {
FILE: src/protocol/commands/_QTDP.rs
type QTDP (line 6) | pub enum QTDP<'a> {
type CreateTDP (line 12) | pub struct CreateTDP<'a> {
type ExtendTDP (line 23) | pub struct ExtendTDP<'a> {
function from_packet (line 31) | fn from_packet(buf: PacketBuf<'a>) -> Option<Self> {
FILE: src/protocol/commands/_QTDPsrc.rs
type QTDPsrc (line 5) | pub struct QTDPsrc<'a> {
function from_packet (line 16) | fn from_packet(buf: PacketBuf<'a>) -> Option<Self> {
FILE: src/protocol/commands/_QTFrame.rs
type QTFrame (line 6) | pub struct QTFrame<'a>(pub FrameRequest<&'a mut [u8]>);
function from_packet (line 10) | fn from_packet(buf: PacketBuf<'a>) -> Option<Self> {
FILE: src/protocol/commands/_QTStart.rs
type QTStart (line 4) | pub struct QTStart;
method from_packet (line 8) | fn from_packet(buf: PacketBuf<'a>) -> Option<Self> {
FILE: src/protocol/commands/_QTStop.rs
type QTStop (line 4) | pub struct QTStop;
method from_packet (line 8) | fn from_packet(buf: PacketBuf<'a>) -> Option<Self> {
FILE: src/protocol/commands/_QTinit.rs
type QTinit (line 4) | pub struct QTinit;
method from_packet (line 8) | fn from_packet(buf: PacketBuf<'a>) -> Option<Self> {
FILE: src/protocol/commands/_bc.rs
type bc (line 4) | pub struct bc;
method from_packet (line 8) | fn from_packet(buf: PacketBuf<'a>) -> Option<Self> {
FILE: src/protocol/commands/_bs.rs
type bs (line 4) | pub struct bs;
method from_packet (line 8) | fn from_packet(buf: PacketBuf<'a>) -> Option<Self> {
FILE: src/protocol/commands/_c.rs
type c (line 4) | pub struct c<'a> {
function from_packet (line 10) | fn from_packet(buf: PacketBuf<'a>) -> Option<Self> {
FILE: src/protocol/commands/_d_upcase.rs
type D (line 5) | pub struct D {
method from_packet (line 11) | fn from_packet(buf: PacketBuf<'a>) -> Option<Self> {
FILE: src/protocol/commands/_g.rs
type g (line 4) | pub struct g;
method from_packet (line 8) | fn from_packet(buf: PacketBuf<'a>) -> Option<Self> {
FILE: src/protocol/commands/_g_upcase.rs
type G (line 4) | pub struct G<'a> {
function from_packet (line 10) | fn from_packet(buf: PacketBuf<'a>) -> Option<Self> {
FILE: src/protocol/commands/_h_upcase.rs
type Op (line 5) | pub enum Op {
type H (line 11) | pub struct H {
method from_packet (line 18) | fn from_packet(buf: PacketBuf<'a>) -> Option<Self> {
FILE: src/protocol/commands/_k.rs
type k (line 4) | pub struct k;
method from_packet (line 8) | fn from_packet(buf: PacketBuf<'a>) -> Option<Self> {
FILE: src/protocol/commands/_m.rs
type m (line 4) | pub struct m<'a> {
function from_packet (line 13) | fn from_packet(buf: PacketBuf<'a>) -> Option<Self> {
FILE: src/protocol/commands/_m_upcase.rs
type M (line 4) | pub struct M<'a> {
function from_packet (line 11) | fn from_packet(buf: PacketBuf<'a>) -> Option<Self> {
FILE: src/protocol/commands/_p.rs
type p (line 4) | pub struct p<'a> {
function from_packet (line 12) | fn from_packet(buf: PacketBuf<'a>) -> Option<Self> {
FILE: src/protocol/commands/_p_upcase.rs
type P (line 4) | pub struct P<'a> {
function from_packet (line 11) | fn from_packet(buf: PacketBuf<'a>) -> Option<Self> {
FILE: src/protocol/commands/_qAttached.rs
type qAttached (line 5) | pub struct qAttached {
method from_packet (line 11) | fn from_packet(buf: PacketBuf<'a>) -> Option<Self> {
FILE: src/protocol/commands/_qC.rs
type qC (line 4) | pub struct qC;
method from_packet (line 8) | fn from_packet(buf: PacketBuf<'a>) -> Option<Self> {
FILE: src/protocol/commands/_qHostInfo.rs
type qHostInfo (line 4) | pub struct qHostInfo;
method from_packet (line 8) | fn from_packet(buf: PacketBuf<'a>) -> Option<Self> {
FILE: src/protocol/commands/_qOffsets.rs
type qOffsets (line 4) | pub struct qOffsets;
method from_packet (line 8) | fn from_packet(buf: PacketBuf<'a>) -> Option<Self> {
FILE: src/protocol/commands/_qProcessInfo.rs
type qProcessInfo (line 4) | pub struct qProcessInfo;
method from_packet (line 8) | fn from_packet(buf: PacketBuf<'a>) -> Option<Self> {
FILE: src/protocol/commands/_qRcmd.rs
type qRcmd (line 4) | pub struct qRcmd<'a> {
function from_packet (line 10) | fn from_packet(buf: PacketBuf<'a>) -> Option<Self> {
FILE: src/protocol/commands/_qRegisterInfo.rs
type qRegisterInfo (line 4) | pub struct qRegisterInfo {
method from_packet (line 10) | fn from_packet(buf: PacketBuf<'a>) -> Option<Self> {
FILE: src/protocol/commands/_qSupported.rs
type qSupported (line 4) | pub struct qSupported<'a> {
function from_packet (line 11) | fn from_packet(buf: PacketBuf<'a>) -> Option<Self> {
type Features (line 25) | pub struct Features<'a>(&'a [u8]);
function into_iter (line 28) | pub fn into_iter(self) -> impl Iterator<Item = Result<Option<(Feature, b...
type Feature (line 52) | pub enum Feature {
FILE: src/protocol/commands/_qTBuffer.rs
type qTBuffer (line 4) | pub struct qTBuffer {
method from_packet (line 11) | fn from_packet(buf: PacketBuf<'a>) -> Option<Self> {
FILE: src/protocol/commands/_qTP.rs
type qTP (line 5) | pub struct qTP<'a> {
function from_packet (line 12) | fn from_packet(buf: PacketBuf<'a>) -> Option<Self> {
FILE: src/protocol/commands/_qTStatus.rs
type qTStatus (line 4) | pub struct qTStatus;
method from_packet (line 8) | fn from_packet(buf: PacketBuf<'a>) -> Option<Self> {
FILE: src/protocol/commands/_qTfP.rs
type qTfP (line 4) | pub struct qTfP;
method from_packet (line 8) | fn from_packet(buf: PacketBuf<'a>) -> Option<Self> {
FILE: src/protocol/commands/_qTfV.rs
type qTfV (line 4) | pub struct qTfV;
method from_packet (line 8) | fn from_packet(buf: PacketBuf<'a>) -> Option<Self> {
FILE: src/protocol/commands/_qThreadExtraInfo.rs
type qThreadExtraInfo (line 6) | pub struct qThreadExtraInfo<'a> {
function from_packet (line 14) | fn from_packet(buf: PacketBuf<'a>) -> Option<Self> {
FILE: src/protocol/commands/_qTsP.rs
type qTsP (line 4) | pub struct qTsP;
method from_packet (line 8) | fn from_packet(buf: PacketBuf<'a>) -> Option<Self> {
FILE: src/protocol/commands/_qTsV.rs
type qTsV (line 4) | pub struct qTsV;
method from_packet (line 8) | fn from_packet(buf: PacketBuf<'a>) -> Option<Self> {
FILE: src/protocol/commands/_qWasmCallStack.rs
type qWasmCallStack (line 6) | pub struct qWasmCallStack {
method from_packet (line 12) | fn from_packet(buf: PacketBuf<'a>) -> Option<Self> {
FILE: src/protocol/commands/_qWasmGlobal.rs
type qWasmGlobal (line 4) | pub struct qWasmGlobal<'a> {
function from_packet (line 12) | fn from_packet(buf: PacketBuf<'a>) -> Option<Self> {
FILE: src/protocol/commands/_qWasmLocal.rs
type qWasmLocal (line 4) | pub struct qWasmLocal<'a> {
function from_packet (line 12) | fn from_packet(buf: PacketBuf<'a>) -> Option<Self> {
FILE: src/protocol/commands/_qWasmStackValue.rs
type qWasmStackValue (line 4) | pub struct qWasmStackValue<'a> {
function from_packet (line 12) | fn from_packet(buf: PacketBuf<'a>) -> Option<Self> {
FILE: src/protocol/commands/_qXfer_auxv_read.rs
type qXferAuxvRead (line 5) | pub type qXferAuxvRead<'a> = QXferReadBase<'a, AuxvAnnex>;
type AuxvAnnex (line 8) | pub struct AuxvAnnex;
method from_buf (line 12) | fn from_buf(buf: &[u8]) -> Option<Self> {
FILE: src/protocol/commands/_qXfer_exec_file.rs
type qXferExecFileRead (line 6) | pub type qXferExecFileRead<'a> = QXferReadBase<'a, ExecFileAnnex>;
type ExecFileAnnex (line 9) | pub struct ExecFileAnnex {
method from_buf (line 15) | fn from_buf(buf: &[u8]) -> Option<Self> {
FILE: src/protocol/commands/_qXfer_features_read.rs
type qXferFeaturesRead (line 5) | pub type qXferFeaturesRead<'a> = QXferReadBase<'a, FeaturesAnnex<'a>>;
type FeaturesAnnex (line 8) | pub struct FeaturesAnnex<'a> {
function from_buf (line 14) | fn from_buf(buf: &'a [u8]) -> Option<Self> {
FILE: src/protocol/commands/_qXfer_libraries_read.rs
type qXferLibrariesRead (line 4) | pub type qXferLibrariesRead<'a> = QXferReadBase<'a, LibrariesAnnex>;
type LibrariesAnnex (line 7) | pub struct LibrariesAnnex;
method from_buf (line 11) | fn from_buf(buf: &[u8]) -> Option<Self> {
FILE: src/protocol/commands/_qXfer_libraries_svr4_read.rs
type qXferLibrariesSvr4Read (line 4) | pub type qXferLibrariesSvr4Read<'a> = QXferReadBase<'a, LibrariesSvr4Ann...
type LibrariesSvr4Annex (line 7) | pub struct LibrariesSvr4Annex;
method from_buf (line 11) | fn from_buf(buf: &[u8]) -> Option<Self> {
FILE: src/protocol/commands/_qXfer_memory_map.rs
type qXferMemoryMapRead (line 5) | pub type qXferMemoryMapRead<'a> = QXferReadBase<'a, MemoryMapAnnex>;
type MemoryMapAnnex (line 8) | pub struct MemoryMapAnnex;
method from_buf (line 12) | fn from_buf(buf: &[u8]) -> Option<Self> {
FILE: src/protocol/commands/_qfThreadInfo.rs
type qfThreadInfo (line 4) | pub struct qfThreadInfo;
method from_packet (line 8) | fn from_packet(buf: PacketBuf<'a>) -> Option<Self> {
FILE: src/protocol/commands/_qsThreadInfo.rs
type qsThreadInfo (line 4) | pub struct qsThreadInfo;
method from_packet (line 8) | fn from_packet(buf: PacketBuf<'a>) -> Option<Self> {
FILE: src/protocol/commands/_r_upcase.rs
type R (line 4) | pub struct R;
method from_packet (line 8) | fn from_packet(buf: PacketBuf<'a>) -> Option<Self> {
FILE: src/protocol/commands/_s.rs
type s (line 4) | pub struct s<'a> {
function from_packet (line 10) | fn from_packet(buf: PacketBuf<'a>) -> Option<Self> {
FILE: src/protocol/commands/_t_upcase.rs
type T (line 5) | pub struct T {
method from_packet (line 11) | fn from_packet(buf: PacketBuf<'a>) -> Option<Self> {
FILE: src/protocol/commands/_vAttach.rs
type vAttach (line 5) | pub struct vAttach {
method from_packet (line 11) | fn from_packet(buf: PacketBuf<'a>) -> Option<Self> {
FILE: src/protocol/commands/_vCont.rs
type vCont (line 17) | pub enum vCont<'a> {
function from_packet (line 24) | fn from_packet(buf: PacketBuf<'a>) -> Option<Self> {
type Actions (line 34) | pub enum Actions<'a> {
function new_from_buf (line 41) | fn new_from_buf(buf: &'a [u8]) -> Actions<'a> {
function new_step (line 46) | pub fn new_step(tid: SpecificThreadId) -> Actions<'a> {
function new_continue (line 51) | pub fn new_continue(tid: SpecificThreadId) -> Actions<'a> {
function iter (line 55) | pub fn iter(&self) -> impl Iterator<Item = Option<VContAction<'a>>> + '_ {
type ActionsBuf (line 71) | pub struct ActionsBuf<'a>(&'a [u8]);
function iter (line 74) | fn iter(&self) -> impl Iterator<Item = Option<VContAction<'a>>> + '_ {
type VContAction (line 138) | pub struct VContAction<'a> {
type VContKind (line 144) | pub enum VContKind<'a> {
function from_bytes (line 155) | fn from_bytes(s: &[u8]) -> Option<VContKind<'_>> {
type EitherIter (line 177) | enum EitherIter<A, B> {
type Item (line 187) | type Item = T;
method next (line 190) | fn next(&mut self) -> Option<T> {
FILE: src/protocol/commands/_vFile_close.rs
type vFileClose (line 4) | pub struct vFileClose {
method from_packet (line 10) | fn from_packet(buf: PacketBuf<'a>) -> Option<Self> {
FILE: src/protocol/commands/_vFile_fstat.rs
type vFileFstat (line 4) | pub struct vFileFstat {
method from_packet (line 10) | fn from_packet(buf: PacketBuf<'a>) -> Option<Self> {
FILE: src/protocol/commands/_vFile_open.rs
type vFileOpen (line 6) | pub struct vFileOpen<'a> {
function from_packet (line 14) | fn from_packet(buf: PacketBuf<'a>) -> Option<Self> {
FILE: src/protocol/commands/_vFile_pread.rs
type vFilePread (line 4) | pub struct vFilePread<'a> {
function from_packet (line 14) | fn from_packet(buf: PacketBuf<'a>) -> Option<Self> {
FILE: src/protocol/commands/_vFile_pwrite.rs
type vFilePwrite (line 5) | pub struct vFilePwrite<'a> {
function from_packet (line 13) | fn from_packet(buf: PacketBuf<'a>) -> Option<Self> {
FILE: src/protocol/commands/_vFile_readlink.rs
type vFileReadlink (line 4) | pub struct vFileReadlink<'a> {
function from_packet (line 12) | fn from_packet(buf: PacketBuf<'a>) -> Option<Self> {
FILE: src/protocol/commands/_vFile_setfs.rs
type vFileSetfs (line 5) | pub struct vFileSetfs {
method from_packet (line 11) | fn from_packet(buf: PacketBuf<'a>) -> Option<Self> {
FILE: src/protocol/commands/_vFile_unlink.rs
type vFileUnlink (line 4) | pub struct vFileUnlink<'a> {
function from_packet (line 10) | fn from_packet(buf: PacketBuf<'a>) -> Option<Self> {
FILE: src/protocol/commands/_vFlashDone.rs
type vFlashDone (line 4) | pub struct vFlashDone;
method from_packet (line 8) | fn from_packet(_buf: PacketBuf<'a>) -> Option<Self> {
FILE: src/protocol/commands/_vFlashErase.rs
type vFlashErase (line 4) | pub struct vFlashErase<'a> {
function from_packet (line 11) | fn from_packet(buf: PacketBuf<'a>) -> Option<Self> {
function valid_vFlashErase (line 40) | fn valid_vFlashErase() {
function invalid_vFlashErase_wrong_address (line 50) | fn invalid_vFlashErase_wrong_address() {
function invalid_vFlashErase_wrong_length (line 57) | fn invalid_vFlashErase_wrong_length() {
function invalid_vFlashErase_missing_address (line 64) | fn invalid_vFlashErase_missing_address() {
function invalid_vFlashErase_missing_length (line 71) | fn invalid_vFlashErase_missing_length() {
FILE: src/protocol/commands/_vFlashWrite.rs
type vFlashWrite (line 5) | pub struct vFlashWrite<'a> {
function from_packet (line 12) | fn from_packet(buf: PacketBuf<'a>) -> Option<Self> {
function valid_vFlashWrite (line 42) | fn valid_vFlashWrite() {
function invalid_vFlashWrite_wrong_address (line 55) | fn invalid_vFlashWrite_wrong_address() {
function invalid_vFlashWrite_missing_data (line 65) | fn invalid_vFlashWrite_missing_data() {
function invalid_vFlashWrite_missing_address (line 72) | fn invalid_vFlashWrite_missing_address() {
FILE: src/protocol/commands/_vKill.rs
type vKill (line 5) | pub struct vKill {
method from_packet (line 11) | fn from_packet(buf: PacketBuf<'a>) -> Option<Self> {
FILE: src/protocol/commands/_vRun.rs
type vRun (line 5) | pub struct vRun<'a> {
function from_packet (line 12) | fn from_packet(buf: PacketBuf<'a>) -> Option<Self> {
function valid_vRun_foobarbaz (line 47) | fn valid_vRun_foobarbaz() {
function valid_vRun_noname (line 58) | fn valid_vRun_noname() {
function valid_vRun_noargs (line 69) | fn valid_vRun_noargs() {
function valid_vRun_args (line 80) | fn valid_vRun_args() {
function invalid_vRun_args (line 91) | fn invalid_vRun_args() {
function invalid_vRun (line 98) | fn invalid_vRun() {
FILE: src/protocol/commands/_x_lowcase.rs
type x (line 4) | pub struct x<'a> {
function from_packet (line 14) | fn from_packet(buf: PacketBuf<'a>) -> Option<Self> {
FILE: src/protocol/commands/_x_upcase.rs
type X (line 5) | pub struct X<'a> {
function from_packet (line 12) | fn from_packet(buf: PacketBuf<'a>) -> Option<Self> {
FILE: src/protocol/commands/breakpoint.rs
type BasicBreakpoint (line 18) | pub struct BasicBreakpoint<'a> {
function from_slice (line 26) | pub fn from_slice(body: &'a mut [u8]) -> Option<BasicBreakpoint<'a>> {
type BytecodeBreakpoint (line 38) | pub struct BytecodeBreakpoint<'a> {
function from_slice (line 45) | pub fn from_slice(body: &'a mut [u8]) -> Option<BytecodeBreakpoint<'a>> {
function strip_suffix_mut (line 88) | fn strip_suffix_mut<'a, T>(slice: &'a mut [T], suffix: &[T]) -> Option<&...
type BytecodeList (line 104) | pub struct BytecodeList<'a>(&'a mut [u8]);
function into_iter (line 108) | pub fn into_iter(self) -> impl Iterator<Item = Option<&'a [u8]>> + 'a {
FILE: src/protocol/commands/exclamation_mark.rs
type ExclamationMark (line 4) | pub struct ExclamationMark;
method from_packet (line 8) | fn from_packet(buf: PacketBuf<'a>) -> Option<Self> {
FILE: src/protocol/commands/question_mark.rs
type QuestionMark (line 4) | pub struct QuestionMark;
method from_packet (line 8) | fn from_packet(buf: PacketBuf<'a>) -> Option<Self> {
FILE: src/protocol/common/hex.rs
type DecodeHexError (line 7) | pub enum DecodeHexError {
function decode_hex (line 18) | pub fn decode_hex<I>(buf: &[u8]) -> Result<I, DecodeHexError>
type HexString (line 44) | pub struct HexString<'a>(pub &'a [u8]);
function decode (line 47) | pub fn decode<I>(&self) -> Result<I, DecodeHexError>
type DecodeHexBufError (line 56) | pub enum DecodeHexBufError {
function ascii2byte (line 61) | fn ascii2byte(c: u8) -> Option<u8> {
function is_hex (line 73) | pub fn is_hex(c: u8) -> bool {
function decode_hex_buf (line 90) | pub fn decode_hex_buf(base_buf: &mut [u8]) -> Result<&mut [u8], DecodeHe...
function decode_hex_buf (line 157) | pub fn decode_hex_buf(base_buf: &mut [u8]) -> Result<&mut [u8], DecodeHe...
function decode_bin_buf (line 180) | pub fn decode_bin_buf(buf: &mut [u8]) -> Option<&mut [u8]> {
function decode_hex_buf_odd (line 205) | fn decode_hex_buf_odd() {
function decode_hex_buf_even (line 212) | fn decode_hex_buf_even() {
function decode_hex_buf_odd_alt (line 219) | fn decode_hex_buf_odd_alt() {
function decode_hex_buf_short (line 226) | fn decode_hex_buf_short() {
function decode_hex_buf_empty (line 233) | fn decode_hex_buf_empty() {
function decode_bin_buf_escaped (line 240) | fn decode_bin_buf_escaped() {
FILE: src/protocol/common/lists.rs
type ArgListHex (line 6) | pub struct ArgListHex<'a>(&'a mut [u8]);
function from_packet (line 9) | pub fn from_packet(args: &'a mut [u8]) -> Option<Self> {
function into_iter (line 18) | pub fn into_iter(self) -> impl Iterator<Item = &'a [u8]> + 'a {
FILE: src/protocol/common/qxfer.rs
type ParseAnnex (line 7) | pub trait ParseAnnex<'a>: Sized {
method from_buf (line 8) | fn from_buf(buf: &'a [u8]) -> Option<Self>;
type QXferReadBase (line 12) | pub struct QXferReadBase<'a, T: ParseAnnex<'a>> {
function from_packet (line 22) | fn from_packet(buf: PacketBuf<'a>) -> Option<Self> {
FILE: src/protocol/common/thread_id.rs
type IdKind (line 8) | pub enum IdKind {
type Error (line 56) | type Error = ();
method try_from (line 58) | fn try_from(s: &[u8]) -> Result<Self, ()> {
type Error (line 76) | type Error = ();
method try_from (line 78) | fn try_from(s: &mut [u8]) -> Result<Self, ()> {
type ThreadId (line 19) | pub struct ThreadId {
type Error (line 27) | type Error = ();
method try_from (line 29) | fn try_from(s: &[u8]) -> Result<Self, ()> {
type Error (line 68) | type Error = ();
method try_from (line 70) | fn try_from(s: &mut [u8]) -> Result<Self, ()> {
type SpecificIdKind (line 86) | pub enum SpecificIdKind {
type Error (line 104) | type Error = ();
method try_from (line 106) | fn try_from(id: IdKind) -> Result<SpecificIdKind, ()> {
type SpecificThreadId (line 96) | pub struct SpecificThreadId {
type Error (line 116) | type Error = ();
method try_from (line 118) | fn try_from(thread: ThreadId) -> Result<SpecificThreadId, ()> {
type ConcreteThreadId (line 131) | pub struct ConcreteThreadId {
type Error (line 139) | type Error = ();
method try_from (line 141) | fn try_from(thread: ThreadId) -> Result<ConcreteThreadId, ()> {
type Error (line 153) | type Error = ();
method try_from (line 155) | fn try_from(value: IdKind) -> Result<NonZeroUsize, ()> {
FILE: src/protocol/console_output.rs
type ConsoleOutput (line 21) | pub struct ConsoleOutput<'a> {
function write_str (line 28) | fn write_str(&mut self, s: &str) -> fmt::Result {
function new (line 35) | pub(crate) fn new(callback: &'a mut dyn FnMut(&[u8])) -> ConsoleOutput<'...
function write_raw (line 44) | pub fn write_raw(&mut self, bytes: &[u8]) {
function flush (line 58) | pub fn flush(&mut self) {
method drop (line 67) | fn drop(&mut self) {
FILE: src/protocol/packet.rs
type PacketParseError (line 7) | pub enum PacketParseError {
type Packet (line 22) | pub enum Packet<'a> {
type PacketBuf (line 41) | pub struct PacketBuf<'a> {
function new (line 49) | pub fn new(pkt_buf: &'a mut [u8]) -> Result<PacketBuf<'a>, PacketParseEr...
function new_with_raw_body (line 85) | pub fn new_with_raw_body(body: &'a mut [u8]) -> Result<PacketBuf<'a>, Pa...
function strip_prefix (line 95) | pub fn strip_prefix(&mut self, prefix: &[u8]) -> bool {
function into_body (line 120) | pub fn into_body(self) -> &'a mut [u8] {
function into_raw_buf (line 134) | pub fn into_raw_buf(self) -> (&'a mut [u8], core::ops::Range<usize>) {
function full_len (line 143) | pub fn full_len(&self) -> usize {
function from_buf (line 149) | pub fn from_buf(
FILE: src/protocol/recv_packet.rs
type State (line 7) | enum State {
type RecvPacketStateMachine (line 15) | pub struct RecvPacketStateMachine {
method new (line 21) | pub fn new() -> Self {
method pump (line 28) | pub fn pump<'b>(
FILE: src/protocol/response_writer.rs
type Error (line 17) | pub struct Error<C>(pub C);
type ResponseWriter (line 21) | pub struct ResponseWriter<'a, C: Connection> {
function new (line 37) | pub fn new(inner: &'a mut C, rle_enabled: bool) -> Self {
function flush (line 53) | pub fn flush(mut self) -> Result<(), Error<C::Error>> {
function as_conn (line 82) | pub fn as_conn(&mut self) -> &mut C {
function inner_write (line 86) | fn inner_write(&mut self, byte: u8) -> Result<(), Error<C::Error>> {
function write (line 114) | fn write(&mut self, byte: u8) -> Result<(), Error<C::Error>> {
function write_str (line 160) | pub fn write_str(&mut self, s: &str) -> Result<(), Error<C::Error>> {
function write_hex (line 168) | fn write_hex(&mut self, byte: u8) -> Result<(), Error<C::Error>> {
function write_hex_buf (line 194) | pub fn write_hex_buf(&mut self, data: &[u8]) -> Result<(), Error<C::Erro...
function write_binary (line 202) | pub fn write_binary(&mut self, data: &[u8]) -> Result<(), Error<C::Error...
function write_num (line 217) | pub fn write_num<D: BeBytes + PrimInt>(&mut self, digit: D) -> Result<()...
function write_dec (line 234) | pub fn write_dec<D: PrimInt + CheckedRem>(
function write_specific_id_kind (line 269) | fn write_specific_id_kind(&mut self, tid: SpecificIdKind) -> Result<(), ...
function write_specific_thread_id (line 277) | pub fn write_specific_thread_id(
type MockConnection (line 297) | struct MockConnection {
method new (line 302) | fn new() -> Self {
type Error (line 308) | type Error = ();
method write (line 310) | fn write(&mut self, byte: u8) -> Result<(), Self::Error> {
method write_all (line 315) | fn write_all(&mut self, buf: &[u8]) -> Result<(), Self::Error> {
method flush (line 320) | fn flush(&mut self) -> Result<(), Self::Error> {
function assert_no_special_chars_in_body (line 326) | fn assert_no_special_chars_in_body(data: &[u8]) {
function rle_avoids_hash (line 339) | fn rle_avoids_hash() {
function rle_avoids_dollar (line 349) | fn rle_avoids_dollar() {
FILE: src/stub/builder.rs
type GdbStubBuilderError (line 12) | pub enum GdbStubBuilderError {
method fmt (line 20) | fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
type GdbStubBuilder (line 39) | pub struct GdbStubBuilder<'a, T: Target, C: Connection> {
function new (line 49) | pub fn new(conn: C) -> GdbStubBuilder<'static, T, C> {
function with_packet_buffer (line 62) | pub fn with_packet_buffer(mut self, packet_buffer: &'a mut [u8]) -> Self {
function packet_buffer_size (line 71) | pub fn packet_buffer_size(mut self, size: usize) -> Self {
function build (line 77) | pub fn build(self) -> Result<GdbStub<'a, T, C>, GdbStubBuilderError> {
FILE: src/stub/core_impl.rs
type TargetResultExt (line 60) | pub(super) trait TargetResultExt<V, T, C> {
method handle_error (line 64) | fn handle_error(self) -> Result<V, InternalError<T, C>>;
function handle_error (line 68) | fn handle_error(self) -> Result<V, InternalError<T, C>> {
type DisconnectReason (line 87) | pub enum DisconnectReason {
type State (line 98) | pub enum State {
type GdbStubImpl (line 105) | pub(crate) struct GdbStubImpl<T: Target, C: Connection> {
type HandlerStatus (line 114) | pub enum HandlerStatus {
function new (line 122) | pub fn new() -> GdbStubImpl<T, C> {
function handle_packet (line 141) | pub fn handle_packet(
function handle_command (line 196) | fn handle_command(
type ProtocolFeatures (line 268) | struct ProtocolFeatures(u8);
method no_ack_mode (line 282) | fn no_ack_mode(&self) -> bool {
method set_no_ack_mode (line 287) | fn set_no_ack_mode(&mut self, val: bool) {
method multiprocess (line 292) | fn multiprocess(&self) -> bool {
method set_multiprocess (line 297) | fn set_multiprocess(&mut self, val: bool) {
FILE: src/stub/core_impl/auxv.rs
function handle_auxv (line 5) | pub(crate) fn handle_auxv(
FILE: src/stub/core_impl/base.rs
function get_sane_any_tid (line 18) | fn get_sane_any_tid(
function get_current_pid (line 41) | pub(crate) fn get_current_pid(
function report_reasonable_stop_reason (line 61) | pub(crate) fn report_reasonable_stop_reason(
function handle_base (line 84) | pub(crate) fn handle_base(
function read_addr_handler (line 463) | pub(crate) fn read_addr_handler<C: Connection, T: Target>(
FILE: src/stub/core_impl/breakpoints.rs
type CmdKind (line 6) | enum CmdKind {
function handle_breakpoint_common (line 13) | fn handle_breakpoint_common(
function handle_breakpoints (line 79) | pub(crate) fn handle_breakpoints(
FILE: src/stub/core_impl/catch_syscalls.rs
function handle_catch_syscalls (line 8) | pub(crate) fn handle_catch_syscalls(
FILE: src/stub/core_impl/exec_file.rs
function handle_exec_file (line 5) | pub(crate) fn handle_exec_file(
FILE: src/stub/core_impl/extended_mode.rs
function handle_extended_mode (line 9) | pub(crate) fn handle_extended_mode(
FILE: src/stub/core_impl/flash.rs
function handle_flash_operations (line 6) | pub(crate) fn handle_flash_operations(
FILE: src/stub/core_impl/host_io.rs
function handle_host_io (line 8) | pub(crate) fn handle_host_io(
FILE: src/stub/core_impl/host_process_info.rs
type InfoResponse (line 12) | pub(crate) enum InfoResponse<'a> {
function write_response (line 20) | pub(crate) fn write_response<C: Connection>(
function from (line 51) | fn from(resp: &HostInfoResponse<'a>) -> Self {
function from (line 61) | fn from(resp: &ProcessInfoResponse<'a>) -> Self {
function handle_process_info (line 72) | pub(crate) fn handle_process_info(
function handle_host_info (line 105) | pub(crate) fn handle_host_info(
FILE: src/stub/core_impl/libraries.rs
function handle_libraries_svr4 (line 6) | pub(crate) fn handle_libraries_svr4(
function handle_libraries (line 38) | pub(crate) fn handle_libraries(
FILE: src/stub/core_impl/lldb_register_info.rs
function handle_lldb_register_info (line 11) | pub(crate) fn handle_lldb_register_info(
FILE: src/stub/core_impl/memory_map.rs
function handle_memory_map (line 5) | pub(crate) fn handle_memory_map(
FILE: src/stub/core_impl/monitor_cmd.rs
function handle_monitor_cmd (line 6) | pub(crate) fn handle_monitor_cmd(
FILE: src/stub/core_impl/no_ack_mode.rs
function handle_no_ack_mode (line 5) | pub(crate) fn handle_no_ack_mode(
FILE: src/stub/core_impl/resume.rs
function handle_stop_resume (line 16) | pub(crate) fn handle_stop_resume(
function do_vcont_single_thread (line 83) | fn do_vcont_single_thread(
function do_vcont_multi_thread (line 160) | fn do_vcont_multi_thread(
function do_vcont (line 274) | fn do_vcont(
function write_stop_common (line 287) | fn write_stop_common(
function finish_exec (line 315) | pub(crate) fn finish_exec(
type FinishExecStatus (line 512) | pub(crate) enum FinishExecStatus {
FILE: src/stub/core_impl/reverse_exec.rs
function handle_reverse_cont (line 41) | pub(crate) fn handle_reverse_cont(
function handle_reverse_step (line 73) | pub(crate) fn handle_reverse_step(
FILE: src/stub/core_impl/section_offsets.rs
function handle_section_offsets (line 5) | pub(crate) fn handle_section_offsets(
FILE: src/stub/core_impl/single_register_access.rs
function inner (line 8) | fn inner<Tid>(
function handle_single_register_access (line 70) | pub(crate) fn handle_single_register_access(
FILE: src/stub/core_impl/target_xml.rs
function handle_target_xml (line 6) | pub(crate) fn handle_target_xml(
FILE: src/stub/core_impl/thread_extra_info.rs
function handle_thread_extra_info (line 6) | pub(crate) fn handle_thread_extra_info(
FILE: src/stub/core_impl/tracepoints.rs
function from_tdp (line 30) | fn from_tdp(ctdp: CreateTDP<'_>) -> Option<(Self, bool)> {
function write (line 46) | pub(crate) fn write<T: Target, C: Connection>(
type ExtendTracepoint (line 67) | pub(crate) struct ExtendTracepoint<'a, U> {
function from_tdp (line 81) | fn from_tdp(dtdp: ExtendTDP<'a>) -> Option<Self> {
function actions (line 96) | pub(crate) fn actions<T, C>(
function parse_raw_actions (line 103) | fn parse_raw_actions<T, C>(
function from_src (line 188) | fn from_src(src: QTDPsrc<'a>) -> Option<Self> {
function write (line 201) | pub(crate) fn write<T: Target, C: Connection>(
function write (line 233) | pub(crate) fn write<T: Target, C: Connection>(
function write (line 277) | pub(crate) fn write<C: Connection>(
function write (line 319) | pub(crate) fn write<T: Target, C: Connection>(
function from (line 357) | fn from(s: FrameRequest<&'a mut [u8]>) -> Self {
function handle_tracepoints (line 373) | pub(crate) fn handle_tracepoints(
function handle_tracepoint_state_machine_step (line 672) | fn handle_tracepoint_state_machine_step(
FILE: src/stub/core_impl/wasm.rs
function handle_wasm (line 5) | pub(crate) fn handle_wasm(
FILE: src/stub/core_impl/x_lowcase_packet.rs
function handle_x_lowcase_packet (line 6) | pub(crate) fn handle_x_lowcase_packet(
FILE: src/stub/core_impl/x_upcase_packet.rs
function handle_x_upcase_packet (line 7) | pub(crate) fn handle_x_upcase_packet(
FILE: src/stub/error.rs
type ConnectionErrorKind (line 15) | pub enum ConnectionErrorKind {
type InternalError (line 25) | pub(crate) enum InternalError<T, C> {
function conn_read (line 59) | pub fn conn_read(e: C) -> Self {
function conn_write (line 63) | pub fn conn_write(e: C) -> Self {
function conn_init (line 67) | pub fn conn_init(e: C) -> Self {
function from (line 73) | fn from(e: ResponseWriterError<C>) -> Self {
type GdbStubError (line 123) | pub struct GdbStubError<T, C> {
method fmt (line 132) | fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
function is_target_error (line 170) | pub fn is_target_error(&self) -> bool {
function into_target_error (line 175) | pub fn into_target_error(self) -> Option<T> {
function is_connection_error (line 183) | pub fn is_connection_error(&self) -> bool {
function into_connection_error (line 189) | pub fn into_connection_error(self) -> Option<(C, ConnectionErrorKind)> {
function from (line 198) | fn from(kind: InternalError<T, C>) -> Self {
function from (line 204) | fn from(_: CapacityError<A>) -> Self {
FILE: src/stub/mod.rs
type BlockingEventLoop (line 39) | pub trait BlockingEventLoop {
method wait_for_stop_reason (line 60) | fn wait_for_stop_reason(
method on_interrupt (line 85) | fn on_interrupt(
type Event (line 92) | pub enum Event<StopReason> {
type WaitForStopReasonError (line 101) | pub enum WaitForStopReasonError<T, C> {
type GdbStub (line 111) | pub struct GdbStub<'a, T: Target, C: Connection> {
function builder (line 119) | pub fn builder(conn: C) -> GdbStubBuilder<'a, T, C> {
function new (line 132) | pub fn new(conn: C) -> GdbStub<'a, T, C> {
function run_blocking (line 157) | pub fn run_blocking<E>(
function run_state_machine (line 218) | pub fn run_state_machine(
FILE: src/stub/state_machine.rs
type GdbStubStateMachine (line 55) | pub enum GdbStubStateMachine<'a, T, C>
constant MODULE_PATH (line 87) | pub(crate) const MODULE_PATH: &str = concat!(module_path!(), "::");
type Idle (line 91) | pub struct Idle<T: Target> {
type Running (line 98) | pub struct Running {}
type CtrlCInterrupt (line 102) | pub struct CtrlCInterrupt {
type Disconnected (line 108) | pub struct Disconnected {
type Transition (line 137) | trait Transition<'a, T, C>
method transition (line 143) | fn transition<S2>(self, state: S2) -> GdbStubStateMachineInner<'a, S2,...
function transition (line 152) | fn transition<S2>(self, state: S2) -> GdbStubStateMachineInner<'a, S2, T...
type GdbStubStateMachineReallyInner (line 169) | struct GdbStubStateMachineReallyInner<'a, T: Target, C: Connection> {
type GdbStubStateMachineInner (line 179) | pub struct GdbStubStateMachineInner<'a, S, T: Target, C: Connection> {
function borrow_conn (line 187) | pub fn borrow_conn(&mut self) -> &mut C {
function from_plain_gdbstub (line 196) | pub(crate) fn from_plain_gdbstub(
function incoming_data (line 213) | pub fn incoming_data(
function report_stop (line 255) | pub fn report_stop(
function report_stop_with_regs (line 281) | pub fn report_stop_with_regs(
function report_stop_impl (line 295) | fn report_stop_impl(
function incoming_data (line 332) | pub fn incoming_data(
function interrupt_handled (line 385) | pub fn interrupt_handled(
function get_reason (line 412) | pub fn get_reason(&self) -> DisconnectReason {
function return_to_idle (line 417) | pub fn return_to_idle(self) -> GdbStubStateMachine<'a, T, C> {
FILE: src/stub/stop_reason.rs
type BaseStopReason (line 30) | pub enum BaseStopReason<Tid, U> {
function is_t_packet (line 140) | pub(crate) fn is_t_packet(&self) -> bool {
type SingleThreadStopReason (line 161) | pub type SingleThreadStopReason<U> = BaseStopReason<(), U>;
type MultiThreadStopReason (line 166) | pub type MultiThreadStopReason<U> = BaseStopReason<Tid, U>;
function from (line 169) | fn from(st_stop_reason: BaseStopReason<(), U>) -> BaseStopReason<Tid, U> {
type Sealed (line 209) | pub trait Sealed {}
type IntoStopReason (line 217) | pub trait IntoStopReason<T: Target>:
FILE: src/target/ext/auxv.rs
type Auxv (line 6) | pub trait Auxv: Target {
method get_auxv (line 14) | fn get_auxv(&self, offset: u64, length: usize, buf: &mut [u8]) -> Targ...
FILE: src/target/ext/base/mod.rs
type BaseOps (line 17) | pub enum BaseOps<'a, A, E> {
type ResumeOps (line 24) | pub(crate) enum ResumeOps<'a, A, E> {
function resume_ops (line 33) | pub(crate) fn resume_ops(self) -> Option<ResumeOps<'a, A, E>> {
FILE: src/target/ext/base/multithread.rs
type MultiThreadBase (line 10) | pub trait MultiThreadBase: Target {
method read_registers (line 15) | fn read_registers(
method write_registers (line 25) | fn write_registers(
method support_single_register_access (line 41) | fn support_single_register_access(
method read_addrs (line 60) | fn read_addrs(
method write_addrs (line 72) | fn write_addrs(
method list_active_threads (line 87) | fn list_active_threads(
method is_thread_alive (line 99) | fn is_thread_alive(&mut self, tid: Tid) -> Result<bool, Self::Error> {
method support_resume (line 111) | fn support_resume(&mut self) -> Option<MultiThreadResumeOps<'_, Self>> {
method support_thread_extra_info (line 117) | fn support_thread_extra_info(
type MultiThreadResume (line 125) | pub trait MultiThreadResume: Target {
method resume (line 198) | fn resume(&mut self) -> Result<(), Self::Error>;
method clear_resume_actions (line 201) | fn clear_resume_actions(&mut self) -> Result<(), Self::Error>;
method set_resume_action_continue (line 210) | fn set_resume_action_continue(
method support_single_step (line 220) | fn support_single_step(&mut self) -> Option<MultiThreadSingleStepOps<'...
method support_range_step (line 228) | fn support_range_step(&mut self) -> Option<MultiThreadRangeSteppingOps...
method support_reverse_step (line 236) | fn support_reverse_step(
method support_reverse_cont (line 246) | fn support_reverse_cont(
method support_scheduler_locking (line 256) | fn support_scheduler_locking(&mut self) -> Option<MultiThreadScheduler...
type MultiThreadSingleStep (line 265) | pub trait MultiThreadSingleStep: Target + MultiThreadResume {
method set_resume_action_step (line 279) | fn set_resume_action_step(
type MultiThreadRangeStepping (line 290) | pub trait MultiThreadRangeStepping: Target + MultiThreadResume {
method set_resume_action_range_step (line 307) | fn set_resume_action_range_step(
type MultiThreadSchedulerLocking (line 319) | pub trait MultiThreadSchedulerLocking: Target + MultiThreadResume {
method set_resume_action_scheduler_lock (line 335) | fn set_resume_action_scheduler_lock(&mut self) -> Result<(), Self::Err...
FILE: src/target/ext/base/reverse_exec.rs
type ReverseCont (line 6) | pub trait ReverseCont<Tid>: Target
method reverse_cont (line 16) | fn reverse_cont(&mut self) -> Result<(), Self::Error>;
type ReverseContOps (line 20) | pub type ReverseContOps<'a, Tid, T> =
type ReverseStep (line 24) | pub trait ReverseStep<Tid>: Target
method reverse_step (line 36) | fn reverse_step(&mut self, tid: Tid) -> Result<(), Self::Error>;
type ReverseStepOps (line 40) | pub type ReverseStepOps<'a, Tid, T> =
type ReplayLogPosition (line 46) | pub enum ReplayLogPosition {
FILE: src/target/ext/base/single_register_access.rs
type SingleRegisterAccess (line 21) | pub trait SingleRegisterAccess<Tid>: Target
method read_register (line 38) | fn read_register(
method write_register (line 56) | fn write_register(
type SingleRegisterAccessOps (line 65) | pub type SingleRegisterAccessOps<'a, Tid, T> =
FILE: src/target/ext/base/singlethread.rs
type SingleThreadBase (line 9) | pub trait SingleThreadBase: Target {
method read_registers (line 11) | fn read_registers(
method write_registers (line 17) | fn write_registers(&mut self, regs: &<Self::Arch as Arch>::Registers)
method support_single_register_access (line 30) | fn support_single_register_access(
method read_addrs (line 49) | fn read_addrs(
method write_addrs (line 60) | fn write_addrs(
method support_resume (line 68) | fn support_resume(&mut self) -> Option<SingleThreadResumeOps<'_, Self>> {
type SingleThreadResume (line 74) | pub trait SingleThreadResume: Target {
method resume (line 95) | fn resume(&mut self, signal: Option<Signal>) -> Result<(), Self::Error>;
method support_single_step (line 101) | fn support_single_step(&mut self) -> Option<SingleThreadSingleStepOps<...
method support_range_step (line 109) | fn support_range_step(&mut self) -> Option<SingleThreadRangeSteppingOp...
method support_reverse_step (line 117) | fn support_reverse_step(
method support_reverse_cont (line 127) | fn support_reverse_cont(
type SingleThreadSingleStep (line 138) | pub trait SingleThreadSingleStep: Target + SingleThreadResume {
method step (line 147) | fn step(&mut self, signal: Option<Signal>) -> Result<(), Self::Error>;
type SingleThreadRangeStepping (line 154) | pub trait SingleThreadRangeStepping: Target + SingleThreadResume {
method resume_range_step (line 171) | fn resume_range_step(
FILE: src/target/ext/breakpoints.rs
type Breakpoints (line 8) | pub trait Breakpoints: Target {
method support_sw_breakpoint (line 11) | fn support_sw_breakpoint(&mut self) -> Option<SwBreakpointOps<'_, Self...
method support_hw_breakpoint (line 17) | fn support_hw_breakpoint(&mut self) -> Option<HwBreakpointOps<'_, Self...
method support_hw_watchpoint (line 23) | fn support_hw_watchpoint(&mut self) -> Option<HwWatchpointOps<'_, Self...
type SwBreakpoint (line 39) | pub trait SwBreakpoint: Target + Breakpoints {
method add_sw_breakpoint (line 43) | fn add_sw_breakpoint(
method remove_sw_breakpoint (line 52) | fn remove_sw_breakpoint(
type HwBreakpoint (line 70) | pub trait HwBreakpoint: Target + Breakpoints {
method add_hw_breakpoint (line 74) | fn add_hw_breakpoint(
method remove_hw_breakpoint (line 83) | fn remove_hw_breakpoint(
type WatchKind (line 94) | pub enum WatchKind {
type HwWatchpoint (line 112) | pub trait HwWatchpoint: Target + Breakpoints {
method add_hw_watchpoint (line 117) | fn add_hw_watchpoint(
method remove_hw_watchpoint (line 128) | fn remove_hw_watchpoint(
FILE: src/target/ext/catch_syscalls.rs
type CatchSyscalls (line 13) | pub trait CatchSyscalls: Target {
method enable_catch_syscalls (line 22) | fn enable_catch_syscalls(
method disable_catch_syscalls (line 28) | fn disable_catch_syscalls(&mut self) -> TargetResult<(), Self>;
type CatchSyscallPosition (line 35) | pub enum CatchSyscallPosition {
type SyscallNumbers (line 43) | pub struct SyscallNumbers<'a, U> {
type Item (line 48) | type Item = U;
method next (line 50) | fn next(&mut self) -> Option<Self::Item> {
FILE: src/target/ext/exec_file.rs
type ExecFile (line 11) | pub trait ExecFile: Target {
method get_exec_file (line 23) | fn get_exec_file(
FILE: src/target/ext/extended_mode.rs
type ShouldTerminate (line 15) | pub enum ShouldTerminate {
method into_bool (line 25) | pub fn into_bool(self) -> bool {
type AttachKind (line 34) | pub enum AttachKind {
method was_attached (line 42) | pub(crate) fn was_attached(self) -> bool {
type ExtendedMode (line 61) | pub trait ExtendedMode: Target {
method run (line 80) | fn run(&mut self, filename: Option<&[u8]>, args: Args<'_, '_>) -> Targ...
method attach (line 95) | fn attach(&mut self, pid: Pid) -> TargetResult<(), Self>;
method query_if_attached (line 102) | fn query_if_attached(&mut self, pid: Pid) -> TargetResult<AttachKind, ...
method kill (line 117) | fn kill(&mut self, pid: Option<Pid>) -> TargetResult<ShouldTerminate, ...
method restart (line 134) | fn restart(&mut self) -> Result<(), Self::Error>;
method on_start (line 142) | fn on_start(&mut self) -> Result<(), Self::Error> {
method support_configure_aslr (line 148) | fn support_configure_aslr(&mut self) -> Option<ConfigureAslrOps<'_, Se...
method support_configure_env (line 155) | fn support_configure_env(&mut self) -> Option<ConfigureEnvOps<'_, Self...
method support_configure_startup_shell (line 162) | fn support_configure_startup_shell(&mut self) -> Option<ConfigureStart...
method support_configure_working_dir (line 168) | fn support_configure_working_dir(&mut self) -> Option<ConfigureWorking...
method support_current_active_pid (line 175) | fn support_current_active_pid(&mut self) -> Option<CurrentActivePidOps...
type Args (line 184) | pub struct Args<'a, 'args> {
function fmt (line 189) | fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
function new (line 195) | pub(crate) fn new(inner: &'a mut dyn Iterator<Item = &'b [u8]>) -> Args<...
type Item (line 201) | type Item = &'args [u8];
method next (line 203) | fn next(&mut self) -> Option<Self::Item> {
type ConfigureAslr (line 212) | pub trait ConfigureAslr: ExtendedMode {
method cfg_aslr (line 214) | fn cfg_aslr(&mut self, enabled: bool) -> TargetResult<(), Self>;
type ConfigureEnv (line 227) | pub trait ConfigureEnv: ExtendedMode {
method set_env (line 229) | fn set_env(&mut self, key: &[u8], val: Option<&[u8]>) -> TargetResult<...
method remove_env (line 232) | fn remove_env(&mut self, key: &[u8]) -> TargetResult<(), Self>;
method reset_env (line 236) | fn reset_env(&mut self) -> TargetResult<(), Self>;
type ConfigureStartupShell (line 245) | pub trait ConfigureStartupShell: ExtendedMode {
method cfg_startup_with_shell (line 250) | fn cfg_startup_with_shell(&mut self, enabled: bool) -> TargetResult<()...
type ConfigureWorkingDir (line 259) | pub trait ConfigureWorkingDir: ExtendedMode {
method cfg_working_dir (line 268) | fn cfg_working_dir(&mut self, dir: Option<&[u8]>) -> TargetResult<(), ...
type CurrentActivePid (line 274) | pub trait CurrentActivePid: ExtendedMode {
method current_active_pid (line 289) | fn current_active_pid(&mut self) -> Result<Pid, Self::Error>;
FILE: src/target/ext/flash.rs
type Flash (line 16) | pub trait Flash: Target {
method flash_erase (line 22) | fn flash_erase(
method flash_write (line 37) | fn flash_write(
method flash_done (line 47) | fn flash_done(&mut self) -> TargetResult<(), Self>;
FILE: src/target/ext/host_info.rs
type HostInfoResponse (line 24) | pub enum HostInfoResponse<'a> {
type HostInfo (line 34) | pub trait HostInfo: Target {
method host_info (line 38) | fn host_info(
FILE: src/target/ext/host_io.rs
type HostIoOpenFlags (line 14) | pub struct HostIoOpenFlags(u32);
type HostIoOpenMode (line 50) | pub struct HostIoOpenMode(u32);
type HostIoStat (line 84) | pub struct HostIoStat {
type FsKind (line 116) | pub enum FsKind {
type HostIoErrno (line 128) | pub enum HostIoErrno {
type HostIoError (line 182) | pub enum HostIoError<E> {
function from (line 205) | fn from(e: std::io::Error) -> HostIoError<E> {
type HostIoResult (line 223) | pub type HostIoResult<T, Tgt> = Result<T, HostIoError<<Tgt as Target>::E...
type HostIo (line 226) | pub trait HostIo: Target {
method support_open (line 229) | fn support_open(&mut self) -> Option<HostIoOpenOps<'_, Self>> {
method support_close (line 235) | fn support_close(&mut self) -> Option<HostIoCloseOps<'_, Self>> {
method support_pread (line 241) | fn support_pread(&mut self) -> Option<HostIoPreadOps<'_, Self>> {
method support_pwrite (line 247) | fn support_pwrite(&mut self) -> Option<HostIoPwriteOps<'_, Self>> {
method support_fstat (line 253) | fn support_fstat(&mut self) -> Option<HostIoFstatOps<'_, Self>> {
method support_unlink (line 259) | fn support_unlink(&mut self) -> Option<HostIoUnlinkOps<'_, Self>> {
method support_readlink (line 265) | fn support_readlink(&mut self) -> Option<HostIoReadlinkOps<'_, Self>> {
method support_setfs (line 271) | fn support_setfs(&mut self) -> Option<HostIoSetfsOps<'_, Self>> {
type HostIoOpen (line 279) | pub trait HostIoOpen: HostIo {
method open (line 286) | fn open(
type HostIoClose (line 297) | pub trait HostIoClose: HostIo {
method close (line 299) | fn close(&mut self, fd: u32) -> HostIoResult<(), Self>;
type HostIoPread (line 305) | pub trait HostIoPread: HostIo {
method pread (line 316) | fn pread(
type HostIoPwrite (line 328) | pub trait HostIoPwrite: HostIo {
method pwrite (line 335) | fn pwrite(
type HostIoFstat (line 346) | pub trait HostIoFstat: HostIo {
method fstat (line 351) | fn fstat(&mut self, fd: u32) -> HostIoResult<HostIoStat, Self>;
type HostIoUnlink (line 357) | pub trait HostIoUnlink: HostIo {
method unlink (line 359) | fn unlink(&mut self, filename: &[u8]) -> HostIoResult<(), Self>;
type HostIoReadlink (line 365) | pub trait HostIoReadlink: HostIo {
method readlink (line 373) | fn readlink(&mut self, filename: &[u8], buf: &mut [u8]) -> HostIoResul...
type HostIoSetfs (line 379) | pub trait HostIoSetfs: HostIo {
method setfs (line 389) | fn setfs(&mut self, fs: FsKind) -> HostIoResult<(), Self>;
FILE: src/target/ext/libraries.rs
type LibrariesSvr4 (line 9) | pub trait LibrariesSvr4: Target {
method get_libraries_svr4 (line 21) | fn get_libraries_svr4(
type Libraries (line 36) | pub trait Libraries: Target {
method get_libraries (line 60) | fn get_libraries(
FILE: src/target/ext/lldb_register_info_override.rs
type CallbackToken (line 10) | pub struct CallbackToken<'a>(pub(crate) core::marker::PhantomData<&'a *m...
type Callback (line 13) | pub struct Callback<'a> {
function done (line 21) | pub fn done(self) -> CallbackToken<'a> {
function write (line 28) | pub fn write(self, reg: Register<'_>) -> CallbackToken<'a> {
type LldbRegisterInfoOverride (line 40) | pub trait LldbRegisterInfoOverride: Target {
method lldb_register_info (line 44) | fn lldb_register_info<'a>(
FILE: src/target/ext/memory_map.rs
type MemoryMap (line 6) | pub trait MemoryMap: Target {
method memory_map_xml (line 18) | fn memory_map_xml(
FILE: src/target/ext/monitor_cmd.rs
type MonitorCmd (line 11) | pub trait MonitorCmd: Target {
method handle_monitor_cmd (line 29) | fn handle_monitor_cmd(&mut self, cmd: &[u8], out: ConsoleOutput<'_>)
FILE: src/target/ext/process_info.rs
type ProcessInfoResponse (line 25) | pub enum ProcessInfoResponse<'a> {
type ProcessInfo (line 37) | pub trait ProcessInfo: Target {
method process_info (line 41) | fn process_info(
FILE: src/target/ext/section_offsets.rs
type Offsets (line 37) | pub enum Offsets<U> {
type SectionOffsets (line 68) | pub trait SectionOffsets: Target {
method get_section_offsets (line 70) | fn get_section_offsets(&mut self) -> Result<Offsets<<Self::Arch as Arc...
FILE: src/target/ext/target_description_xml_override.rs
type TargetDescriptionXmlOverride (line 11) | pub trait TargetDescriptionXmlOverride: Target {
method target_description_xml (line 29) | fn target_description_xml(
FILE: src/target/ext/thread_extra_info.rs
type ThreadExtraInfo (line 6) | pub trait ThreadExtraInfo: Target {
method thread_extra_info (line 19) | fn thread_extra_info(&self, tid: Tid, buf: &mut [u8]) -> Result<usize,...
FILE: src/target/ext/tracepoints.rs
type Tracepoint (line 27) | pub struct Tracepoint(pub usize);
type StateVariable (line 31) | pub struct StateVariable(usize);
type NewTracepoint (line 36) | pub struct NewTracepoint<U> {
type TracepointAction (line 53) | pub enum TracepointAction<'a, U> {
type TracepointSourceType (line 83) | pub enum TracepointSourceType {
type SourceTracepoint (line 99) | pub struct SourceTracepoint<'a, U> {
function get_owned (line 119) | pub fn get_owned<'b>(&self) -> SourceTracepoint<'b, U> {
function get_owned (line 134) | pub fn get_owned<'b>(&self) -> TracepointAction<'b, U> {
type ExperimentStatus (line 158) | pub enum ExperimentStatus<'a> {
type ExperimentExplanation (line 184) | pub enum ExperimentExplanation<'a> {
type BufferShap
Condensed preview — 266 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (1,070K chars).
[
{
"path": ".cargo/config.toml",
"chars": 1857,
"preview": "[target.'cfg(all())']\nrustflags = [\n \"-Dfuture_incompatible\",\n \"-Dnonstandard_style\",\n \"-Drust_2018_idioms\",\n\n "
},
{
"path": ".git-blame-ignore-revs",
"chars": 93,
"preview": "# fmt everything using imports_granularity = \"Item\"\ne2329b80c2d51ee0ab4678365a35b27b51f32235\n"
},
{
"path": ".github/FUNDING.yml",
"chars": 60,
"preview": "# These are supported funding model platforms\nko_fi: prilik\n"
},
{
"path": ".github/pull_request_template.md",
"chars": 10083,
"preview": "### Description\n\n<!-- Please include a brief description of what is being added/changed -->\n\ne.g: This PR implements the"
},
{
"path": ".github/workflows/ci.yml",
"chars": 1800,
"preview": "on: [push, pull_request]\n\nname: ci\n\njobs:\n test:\n name: clippy + tests + docs\n runs-on: ubuntu-latest\n steps:\n"
},
{
"path": ".gitignore",
"chars": 136,
"preview": "/target\n**/*.rs.bk\nCargo.lock\n\n**/.gdb_history\n# The GDB client may core dump if the target is implemented incorrectly\n*"
},
{
"path": "CHANGELOG.md",
"chars": 27915,
"preview": "All notable changes to this project will be documented in this file.\n\nThis project adheres to [Semantic Versioning](http"
},
{
"path": "Cargo.toml",
"chars": 1389,
"preview": "[package]\nname = \"gdbstub\"\ndescription = \"An implementation of the GDB Remote Serial Protocol in Rust\"\nauthors = [\"Danie"
},
{
"path": "LICENSE",
"chars": 225,
"preview": "gdbstub is dual-licensed under either\n\n* MIT License (docs/LICENSE-MIT or http://opensource.org/licenses/MIT)\n* Apache L"
},
{
"path": "README.md",
"chars": 21761,
"preview": "# gdbstub\n\n[](https://crates.io/crates/gdbstub)\n[ 2021 Daniel Prilik\n\nPermission is hereby granted, free of charge, to any person obtaining a c"
},
{
"path": "docs/transition_guide.md",
"chars": 21690,
"preview": "# Transition Guide\n\nThis document provides a brief overview of breaking changes between major `gdbstub` releases, along "
},
{
"path": "example_no_std/.gitignore",
"chars": 25,
"preview": "/target\n.gdb_history\n*.s\n"
},
{
"path": "example_no_std/Cargo.toml",
"chars": 588,
"preview": "[package]\nname = \"gdbstub-nostd\"\nversion = \"0.1.0\"\nauthors = [\"Daniel Prilik <danielprilik@gmail.com>\"]\nedition = \"2018\""
},
{
"path": "example_no_std/README.md",
"chars": 826,
"preview": "# example_no_std\n\nThis basic example is used to benchmark how large `gdbstub`'s binary footprint is in `#![no_std]` cont"
},
{
"path": "example_no_std/check_size.sh",
"chars": 276,
"preview": "#!/bin/bash\nset -e\n\ncd \"$(dirname \"$(realpath $0)\")\"\n\n# checks the size of the resulting --release level binary (that's "
},
{
"path": "example_no_std/dump_asm.sh",
"chars": 671,
"preview": "#!/bin/bash\nset -e\n\ncd \"$(dirname \"$(realpath \"$0\")\")\"\n\nif ! command -v rustfilt &> /dev/null\nthen\n cargo install rus"
},
{
"path": "example_no_std/rustfmt.toml",
"chars": 20,
"preview": "wrap_comments = true"
},
{
"path": "example_no_std/src/conn.rs",
"chars": 3524,
"preview": "use gdbstub::conn::Connection;\n\npub struct TcpConnection {\n sock: i32,\n fd: i32,\n}\n\nimpl TcpConnection {\n pub f"
},
{
"path": "example_no_std/src/gdb.rs",
"chars": 4733,
"preview": "use crate::print_str::print_str;\nuse gdbstub::common::Signal;\nuse gdbstub::common::Tid;\nuse gdbstub::target;\nuse gdbstub"
},
{
"path": "example_no_std/src/main.rs",
"chars": 2854,
"preview": "//! A basic `no_std` example that's used to ballpark estimate how large\n//! `gdbstub`'s binary footprint is resource-res"
},
{
"path": "example_no_std/src/print_str.rs",
"chars": 146,
"preview": "pub fn print_str(s: &str) {\n unsafe {\n libc::write(1, s.as_ptr() as _, s.len());\n libc::write(1, \"\\n\".a"
},
{
"path": "examples/armv4t/README.md",
"chars": 1042,
"preview": "# armv4t\n\nAn incredibly simple emulator to run elf binaries compiled with `arm-none-eabi-cc -march=armv4t`.\n\nThis emulat"
},
{
"path": "examples/armv4t/emu.rs",
"chars": 7677,
"preview": "use crate::mem_sniffer::AccessKind;\nuse crate::mem_sniffer::MemSniffer;\nuse crate::DynResult;\nuse armv4t_emu::reg;\nuse a"
},
{
"path": "examples/armv4t/gdb/auxv.rs",
"chars": 366,
"preview": "use super::copy_range_to_buf;\nuse crate::emu::Emu;\nuse gdbstub::target;\nuse gdbstub::target::TargetResult;\n\nimpl target:"
},
{
"path": "examples/armv4t/gdb/breakpoints.rs",
"chars": 2285,
"preview": "use crate::emu::Emu;\nuse gdbstub::target;\nuse gdbstub::target::ext::breakpoints::WatchKind;\nuse gdbstub::target::TargetR"
},
{
"path": "examples/armv4t/gdb/catch_syscalls.rs",
"chars": 870,
"preview": "use crate::gdb::Emu;\nuse gdbstub::target;\nuse gdbstub::target::ext::catch_syscalls::SyscallNumbers;\n\n// This implementat"
},
{
"path": "examples/armv4t/gdb/exec_file.rs",
"chars": 457,
"preview": "use super::copy_range_to_buf;\nuse crate::emu::Emu;\nuse gdbstub::common::Pid;\nuse gdbstub::target;\nuse gdbstub::target::T"
},
{
"path": "examples/armv4t/gdb/extended_mode.rs",
"chars": 5647,
"preview": "use crate::emu::Emu;\nuse gdbstub::common::Pid;\nuse gdbstub::target;\nuse gdbstub::target::ext::extended_mode::Args;\nuse g"
},
{
"path": "examples/armv4t/gdb/flash.rs",
"chars": 604,
"preview": "use crate::emu::Emu;\nuse gdbstub::target;\nuse gdbstub::target::TargetResult;\n\nimpl target::ext::flash::Flash for Emu {\n "
},
{
"path": "examples/armv4t/gdb/host_io.rs",
"chars": 8952,
"preview": "use super::copy_range_to_buf;\nuse super::copy_to_buf;\nuse crate::emu::Emu;\nuse crate::TEST_PROGRAM_ELF;\nuse gdbstub::tar"
},
{
"path": "examples/armv4t/gdb/libraries.rs",
"chars": 1621,
"preview": "use super::copy_range_to_buf;\nuse crate::emu::Emu;\nuse gdbstub::target;\nuse gdbstub::target::TargetResult;\n\nimpl target:"
},
{
"path": "examples/armv4t/gdb/lldb_register_info_override.rs",
"chars": 4991,
"preview": "use crate::gdb::custom_arch::ArmCoreRegIdCustom;\nuse crate::gdb::Emu;\nuse gdbstub::arch::lldb::Encoding;\nuse gdbstub::ar"
},
{
"path": "examples/armv4t/gdb/memory_map.rs",
"chars": 891,
"preview": "use super::copy_range_to_buf;\nuse crate::emu::Emu;\nuse gdbstub::target;\nuse gdbstub::target::TargetResult;\n\nimpl target:"
},
{
"path": "examples/armv4t/gdb/mod.rs",
"chars": 22592,
"preview": "use crate::emu::Emu;\nuse crate::emu::ExecMode;\nuse armv4t_emu::reg;\nuse armv4t_emu::Memory;\nuse core::convert::TryInto;\n"
},
{
"path": "examples/armv4t/gdb/monitor_cmd.rs",
"chars": 817,
"preview": "use crate::gdb::Emu;\nuse gdbstub::target;\nuse gdbstub::target::ext::monitor_cmd::outputln;\nuse gdbstub::target::ext::mon"
},
{
"path": "examples/armv4t/gdb/section_offsets.rs",
"chars": 499,
"preview": "use crate::gdb::Emu;\nuse gdbstub::target;\nuse gdbstub::target::ext::section_offsets::Offsets;\n\n// This implementation is"
},
{
"path": "examples/armv4t/gdb/target_description_xml_override.rs",
"chars": 3831,
"preview": "use super::copy_range_to_buf;\nuse crate::emu::Emu;\nuse gdbstub::target;\nuse gdbstub::target::TargetError;\nuse gdbstub::t"
},
{
"path": "examples/armv4t/gdb/tracepoints.rs",
"chars": 8771,
"preview": "use crate::emu::Emu;\nuse gdbstub::target;\nuse gdbstub::target::ext::tracepoints::ExperimentExplanation;\nuse gdbstub::tar"
},
{
"path": "examples/armv4t/main.rs",
"chars": 7493,
"preview": "//! An incredibly simple emulator to run elf binaries compiled with\n//! `arm-none-eabi-cc -march=armv4t`. It's not model"
},
{
"path": "examples/armv4t/mem_sniffer.rs",
"chars": 1929,
"preview": "use armv4t_emu::Memory;\n\npub enum AccessKind {\n Read,\n Write,\n}\n\npub struct Access {\n pub kind: AccessKind,\n "
},
{
"path": "examples/armv4t/test_bin/.gdbinit",
"chars": 75,
"preview": "# set remote multiprocess-feature-packet off\n\ntarget extended-remote :9001\n"
},
{
"path": "examples/armv4t/test_bin/.gitignore",
"chars": 17,
"preview": "*.o\n.gdb_history\n"
},
{
"path": "examples/armv4t/test_bin/compile_test.sh",
"chars": 140,
"preview": "arm-none-eabi-gcc -c test.c -march=armv4t -O0 -g -std=c11 -fdebug-prefix-map=$(pwd)=.\narm-none-eabi-ld -static -Ttest.ld"
},
{
"path": "examples/armv4t/test_bin/test.c",
"chars": 204,
"preview": "int main() {\n int x = 4;\n int y = 3;\n\n x += 1;\n y += 3;\n\n // big, useless loop to test ctrl-c functionali"
},
{
"path": "examples/armv4t/test_bin/test.ld",
"chars": 748,
"preview": "ENTRY(main)\n\nMEMORY {\n ram : ORIGIN = 0x55550000, LENGTH = 0x10000000\n}\n\nSECTIONS {\n . = 0x55550000;\n\n .text : "
},
{
"path": "examples/armv4t_multicore/README.md",
"chars": 1355,
"preview": "# armv4t-multicore\n\nAn incredibly simple emulator to run elf binaries compiled with `arm-none-eabi-cc -march=armv4t`. Us"
},
{
"path": "examples/armv4t_multicore/emu.rs",
"chars": 7842,
"preview": "//! ------------------------------------------------------------------------ !//\n//! ------------------------------ DISC"
},
{
"path": "examples/armv4t_multicore/gdb.rs",
"chars": 9205,
"preview": "use crate::emu::CpuId;\nuse crate::emu::Emu;\nuse crate::emu::ExecMode;\nuse armv4t_emu::reg;\nuse armv4t_emu::Memory;\nuse g"
},
{
"path": "examples/armv4t_multicore/main.rs",
"chars": 7636,
"preview": "//! An incredibly simple emulator to run elf binaries compiled with\n//! `arm-none-eabi-cc -march=armv4t`. Uses a dual-co"
},
{
"path": "examples/armv4t_multicore/mem_sniffer.rs",
"chars": 1963,
"preview": "use armv4t_emu::Memory;\n\n#[derive(Debug)]\npub enum AccessKind {\n Read,\n Write,\n}\n\n#[derive(Debug)]\npub struct Acce"
},
{
"path": "examples/armv4t_multicore/test_bin/.gdbinit",
"chars": 34,
"preview": "file test.elf\ntarget remote :9001\n"
},
{
"path": "examples/armv4t_multicore/test_bin/.gitignore",
"chars": 17,
"preview": "*.o\n.gdb_history\n"
},
{
"path": "examples/armv4t_multicore/test_bin/compile_test.sh",
"chars": 140,
"preview": "arm-none-eabi-gcc -c test.c -march=armv4t -O0 -g -std=c11 -fdebug-prefix-map=$(pwd)=.\narm-none-eabi-ld -static -Ttest.ld"
},
{
"path": "examples/armv4t_multicore/test_bin/test.c",
"chars": 498,
"preview": "#define CPU_ID *((volatile unsigned char*)0xffff4200)\n\nint main() {\n // try switching between threads using `thread 1"
},
{
"path": "examples/armv4t_multicore/test_bin/test.ld",
"chars": 748,
"preview": "ENTRY(main)\n\nMEMORY {\n ram : ORIGIN = 0x55550000, LENGTH = 0x10000000\n}\n\nSECTIONS {\n . = 0x55550000;\n\n .text : "
},
{
"path": "gdbstub_arch/CHANGELOG.md",
"chars": 1926,
"preview": "All notable changes to this project will be documented in this file.\n\nThis project adheres to [Semantic Versioning](http"
},
{
"path": "gdbstub_arch/Cargo.toml",
"chars": 689,
"preview": "[package]\nname = \"gdbstub_arch\"\ndescription = \"Implementations of `gdbstub::arch::Arch` for various architectures.\"\nauth"
},
{
"path": "gdbstub_arch/LICENSE",
"chars": 236,
"preview": "gdbstub_arch is dual-licensed under either\n\n* MIT License (../docs/LICENSE-MIT or http://opensource.org/licenses/MIT)\n* "
},
{
"path": "gdbstub_arch/README.md",
"chars": 1168,
"preview": "# gdbstub_arch\n\n[](https://crates.io/crates/gdbstub_arch)\n[\n//! ARM architecture.\n//!\n//! See P"
},
{
"path": "gdbstub_arch/src/aarch64/reg/aarch64_core.rs",
"chars": 3002,
"preview": "use core::convert::TryInto;\nuse gdbstub::arch::Registers;\n\n/// AArch64 core registers.\n///\n/// Registers from the `org.g"
},
{
"path": "gdbstub_arch/src/aarch64/reg/id.rs",
"chars": 111186,
"preview": "use core::num::NonZeroUsize;\nuse gdbstub::arch::RegId;\n\n/// AArch64 Architectural Registers.\n///\n/// Represents architec"
},
{
"path": "gdbstub_arch/src/aarch64/reg/mod.rs",
"chars": 187,
"preview": "//! `Register` structs for the AArch64 ARM architecture.\n\n/// `RegId` definitions for the ARM AArch64 Architecture.\npub "
},
{
"path": "gdbstub_arch/src/aarch64/sysregs.xml",
"chars": 62517,
"preview": "<feature name=\"org.rust.gdb.arm.sys.regs\">\n\n <!-- Generated from the XML description of ARMv8-A system registers, provi"
},
{
"path": "gdbstub_arch/src/arm/mod.rs",
"chars": 1250,
"preview": "//! Implementations for various ARM architectures.\n\nuse gdbstub::arch::Arch;\n\npub mod reg;\n\n/// ARM-specific breakpoint "
},
{
"path": "gdbstub_arch/src/arm/reg/arm_core.rs",
"chars": 2198,
"preview": "use gdbstub::arch::Registers;\n\n/// 32-bit ARM core registers.\n///\n/// Source: <https://github.com/bminor/binutils-gdb/bl"
},
{
"path": "gdbstub_arch/src/arm/reg/id.rs",
"chars": 954,
"preview": "use core::num::NonZeroUsize;\nuse gdbstub::arch::RegId;\n\n/// 32-bit ARM core register identifier.\n#[derive(Debug, Clone, "
},
{
"path": "gdbstub_arch/src/arm/reg/mod.rs",
"chars": 161,
"preview": "//! `Register` structs for various ARM architectures.\n\n/// `RegId` definitions for ARM architectures.\npub mod id;\n\nmod a"
},
{
"path": "gdbstub_arch/src/lib.rs",
"chars": 3226,
"preview": "//! Community-created implementations of [`gdbstub::arch::Arch`] for various\n//! architectures.\n//!\n//! _Note:_ If an ar"
},
{
"path": "gdbstub_arch/src/mips/mod.rs",
"chars": 3407,
"preview": "//! Implementations for the MIPS architecture.\n\nuse gdbstub::arch::Arch;\n\npub mod reg;\n\n/// MIPS-specific breakpoint kin"
},
{
"path": "gdbstub_arch/src/mips/reg/id.rs",
"chars": 3251,
"preview": "use core::num::NonZeroUsize;\nuse gdbstub::arch::RegId;\n\n/// MIPS register identifier.\n#[derive(Debug, Clone, Copy)]\n#[no"
},
{
"path": "gdbstub_arch/src/mips/reg/mips.rs",
"chars": 8005,
"preview": "use core::convert::TryInto;\nuse gdbstub::arch::Registers;\nuse gdbstub::internal::LeBytes;\nuse num_traits::PrimInt;\n\n/// "
},
{
"path": "gdbstub_arch/src/mips/reg/mod.rs",
"chars": 237,
"preview": "//! `Register` structs for MIPS architectures.\n\n/// `RegId` definitions for MIPS architectures.\npub mod id;\n\nmod mips;\n\n"
},
{
"path": "gdbstub_arch/src/msp430/mod.rs",
"chars": 893,
"preview": "//! Implementations for the TI-MSP430 family of MCUs.\n\nuse gdbstub::arch::Arch;\n\npub mod reg;\n\n/// Implements `Arch` for"
},
{
"path": "gdbstub_arch/src/msp430/reg/id.rs",
"chars": 2597,
"preview": "use core::num::NonZeroUsize;\nuse gdbstub::arch::RegId;\n\n/// TI-MSP430 register identifier.\n///\n/// GDB does not provide "
},
{
"path": "gdbstub_arch/src/msp430/reg/mod.rs",
"chars": 158,
"preview": "//! `Register` structs for various TI-MSP430 CPUs.\n\n/// `RegId` definitions for various TI-MSP430 CPUs.\npub mod id;\n\nmod"
},
{
"path": "gdbstub_arch/src/msp430/reg/msp430.rs",
"chars": 2340,
"preview": "use gdbstub::arch::Registers;\nuse gdbstub::internal::LeBytes;\nuse num_traits::PrimInt;\n\n/// TI-MSP430 registers.\n///\n///"
},
{
"path": "gdbstub_arch/src/ppc/mod.rs",
"chars": 955,
"preview": "//! Implementations for various PowerPC architectures.\n\nuse gdbstub::arch::Arch;\nuse gdbstub::arch::RegId;\n\npub mod reg;"
},
{
"path": "gdbstub_arch/src/ppc/reg/common.rs",
"chars": 4303,
"preview": "use super::PpcVector;\nuse core::convert::TryInto;\nuse gdbstub::arch::Registers;\n\n/// 32-bit PowerPC core registers, FPU "
},
{
"path": "gdbstub_arch/src/ppc/reg/id.rs",
"chars": 139,
"preview": "// TODO: Add proper `RegId` implementation. See [issue #29](https://github.com/daniel5151/gdbstub/issues/29)\n// pub enum"
},
{
"path": "gdbstub_arch/src/ppc/reg/mod.rs",
"chars": 185,
"preview": "//! `Register` structs for PowerPC architectures\n\n/// `RegId` definitions for PowerPC architectures.\npub mod id;\n\nmod co"
},
{
"path": "gdbstub_arch/src/riscv/mod.rs",
"chars": 856,
"preview": "//! Implementations for the [RISC-V](https://riscv.org/) architecture.\n//!\n//! *Note*: currently only supports integer v"
},
{
"path": "gdbstub_arch/src/riscv/reg/id.rs",
"chars": 1239,
"preview": "use core::num::NonZeroUsize;\nuse gdbstub::arch::RegId;\n\n/// RISC-V Register identifier.\n#[derive(Debug, Clone, Copy)]\n#["
},
{
"path": "gdbstub_arch/src/riscv/reg/mod.rs",
"chars": 155,
"preview": "//! `Register` structs for RISC-V architectures.\n\n/// `RegId` definitions for RISC-V architectures.\npub mod id;\n\nmod ris"
},
{
"path": "gdbstub_arch/src/riscv/reg/riscv.rs",
"chars": 2084,
"preview": "use gdbstub::arch::Registers;\nuse gdbstub::internal::LeBytes;\nuse num_traits::PrimInt;\n\n/// RISC-V Integer registers.\n//"
},
{
"path": "gdbstub_arch/src/riscv/rv32i.xml",
"chars": 2004,
"preview": "<?xml version=\"1.0\"?>\n<!-- Copyright (C) 2018-2024 Free Software Foundation, Inc.\n\n Copying and distribution of this"
},
{
"path": "gdbstub_arch/src/riscv/rv64i.xml",
"chars": 2004,
"preview": "<?xml version=\"1.0\"?>\n<!-- Copyright (C) 2018-2024 Free Software Foundation, Inc.\n\n Copying and distribution of this"
},
{
"path": "gdbstub_arch/src/wasm/addr.rs",
"chars": 6517,
"preview": "//! Synthetic 64-bit Wasm address space expected by the LLDB Wasm extensions.\n//!\n//! WebAssembly is natively *multi-mem"
},
{
"path": "gdbstub_arch/src/wasm/mod.rs",
"chars": 3772,
"preview": "//! Implementation for the WebAssembly architecture.\n//!\n//! This implementation follows the [LLDB-specific Wasm extensi"
},
{
"path": "gdbstub_arch/src/wasm/reg/id.rs",
"chars": 564,
"preview": "use core::num::NonZeroUsize;\nuse gdbstub::arch::RegId;\n\n/// The only register exposed to GDB: `pc` (register index 0).\n#"
},
{
"path": "gdbstub_arch/src/wasm/reg/mod.rs",
"chars": 324,
"preview": "//! `Register` structs for the WebAssembly architecture.\n//!\n//! Because Wasm is mostly stack-based, it only has one \"re"
},
{
"path": "gdbstub_arch/src/wasm/reg/wasm_regs.rs",
"chars": 834,
"preview": "use core::convert::TryInto;\nuse gdbstub::arch::Registers;\n\n/// The register state for WebAssembly.\n#[derive(Clone, Copy,"
},
{
"path": "gdbstub_arch/src/x86/mod.rs",
"chars": 1148,
"preview": "//! Implementations for various x86 architectures.\n\nuse gdbstub::arch::Arch;\n\npub mod reg;\n\n/// Implements `Arch` for 64"
},
{
"path": "gdbstub_arch/src/x86/reg/core32.rs",
"chars": 4662,
"preview": "use super::X86SegmentRegs;\nuse super::X87FpuInternalRegs;\nuse super::F80;\nuse core::convert::TryInto;\nuse gdbstub::arch:"
},
{
"path": "gdbstub_arch/src/x86/reg/core64.rs",
"chars": 4340,
"preview": "use super::X86SegmentRegs;\nuse super::X87FpuInternalRegs;\nuse super::F80;\nuse core::convert::TryInto;\nuse gdbstub::arch:"
},
{
"path": "gdbstub_arch/src/x86/reg/id.rs",
"chars": 6035,
"preview": "use core::num::NonZeroUsize;\nuse gdbstub::arch::RegId;\n\n/// FPU register identifier.\n#[derive(Debug, Clone, Copy)]\npub e"
},
{
"path": "gdbstub_arch/src/x86/reg/mod.rs",
"chars": 4469,
"preview": "//! `Register` structs for x86 architectures.\n\nuse core::convert::TryInto;\nuse gdbstub::arch::Registers;\n\n/// `RegId` de"
},
{
"path": "rustfmt.toml",
"chars": 50,
"preview": "imports_granularity = \"Item\"\nwrap_comments = true\n"
},
{
"path": "scripts/check_target_delegation.sh",
"chars": 974,
"preview": "#!/bin/bash\n\nset -e\n\n# Script to enforce that each Target method has a corresponding entry in impl_dyn_target\n\n# Get the"
},
{
"path": "scripts/test_dead_code_elim.sh",
"chars": 731,
"preview": "#!/bin/bash\n\n# Must be run from the project's root directory.\n\n# checks if a certain packet has been dead-code-eliminate"
},
{
"path": "src/arch.rs",
"chars": 12693,
"preview": "//! Traits to encode architecture-specific target information.\n//!\n//! # Community created `Arch` Implementations\n//!\n//"
},
{
"path": "src/common/mod.rs",
"chars": 1400,
"preview": "//! Common types and definitions used across `gdbstub`.\n\nmod signal;\n\npub use self::signal::Signal;\nuse core::num::NonZe"
},
{
"path": "src/common/signal.rs",
"chars": 25988,
"preview": "/// Cross-platform signal numbers defined by the GDB Remote Serial Protocol.\n///\n/// Transcribed from <https://github.co"
},
{
"path": "src/conn/impls/boxed.rs",
"chars": 1281,
"preview": "use crate::conn::Connection;\nuse crate::conn::ConnectionExt;\nuse alloc::boxed::Box;\n\nimpl<E> Connection for Box<dyn Conn"
},
{
"path": "src/conn/impls/mod.rs",
"chars": 1540,
"preview": "//! Implementations of the [`Connection`] trait for various built-in types\n// TODO: impl Connection for all `Read + Writ"
},
{
"path": "src/conn/impls/tcpstream.rs",
"chars": 1329,
"preview": "use crate::conn::Connection;\nuse crate::conn::ConnectionExt;\nuse std::net::TcpStream;\n\nimpl Connection for TcpStream {\n "
},
{
"path": "src/conn/impls/unixstream.rs",
"chars": 2765,
"preview": "use crate::conn::Connection;\nuse crate::conn::ConnectionExt;\nuse std::io;\nuse std::os::unix::net::UnixStream;\n\n// TODO: "
},
{
"path": "src/conn/mod.rs",
"chars": 2879,
"preview": "//! Traits to perform in-order, serial, byte-wise I/O.\n\nmod impls;\n\n/// A trait to perform in-order, serial, byte-wise I"
},
{
"path": "src/internal/be_bytes.rs",
"chars": 2553,
"preview": "/// A trait for working with structs as big-endian byte arrays. Automatically\n/// implemented for all built-in signed/un"
},
{
"path": "src/internal/le_bytes.rs",
"chars": 2548,
"preview": "/// A trait for working with structs as little-endian byte arrays. Automatically\n/// implemented for all built-in signed"
},
{
"path": "src/internal/mod.rs",
"chars": 199,
"preview": "//! Types / traits which are part of `gdbstub`'s public API, but don't need to\n//! be implemented by consumers of the li"
},
{
"path": "src/lib.rs",
"chars": 15015,
"preview": "//! An ergonomic, featureful, and easy-to-integrate implementation of the [GDB\n//! Remote Serial Protocol](https://sourc"
},
{
"path": "src/protocol/commands/_QAgent.rs",
"chars": 416,
"preview": "use super::prelude::*;\n\n#[derive(Debug)]\npub struct QAgent {\n pub value: bool,\n}\n\nimpl<'a> ParseCommand<'a> for QAgen"
},
{
"path": "src/protocol/commands/_QCatchSyscalls.rs",
"chars": 667,
"preview": "use super::prelude::*;\nuse crate::protocol::common::lists::ArgListHex;\n\n#[derive(Debug)]\npub enum QCatchSyscalls<'a> {\n "
},
{
"path": "src/protocol/commands/_QDisableRandomization.rs",
"chars": 461,
"preview": "use super::prelude::*;\n\n#[derive(Debug)]\npub struct QDisableRandomization {\n pub value: bool,\n}\n\nimpl<'a> ParseComman"
},
{
"path": "src/protocol/commands/_QEnvironmentHexEncoded.rs",
"chars": 841,
"preview": "use super::prelude::*;\n\n#[derive(Debug)]\npub struct QEnvironmentHexEncoded<'a> {\n pub key: &'a [u8],\n pub value: O"
},
{
"path": "src/protocol/commands/_QEnvironmentReset.rs",
"chars": 317,
"preview": "use super::prelude::*;\n\n#[derive(Debug)]\npub struct QEnvironmentReset;\n\nimpl<'a> ParseCommand<'a> for QEnvironmentReset "
},
{
"path": "src/protocol/commands/_QEnvironmentUnset.rs",
"chars": 451,
"preview": "use super::prelude::*;\n\n#[derive(Debug)]\npub struct QEnvironmentUnset<'a> {\n pub key: &'a [u8],\n}\n\nimpl<'a> ParseComm"
},
{
"path": "src/protocol/commands/_QSetWorkingDir.rs",
"chars": 539,
"preview": "use super::prelude::*;\n\n#[derive(Debug)]\npub struct QSetWorkingDir<'a> {\n pub dir: Option<&'a [u8]>,\n}\n\nimpl<'a> Pars"
},
{
"path": "src/protocol/commands/_QStartNoAckMode.rs",
"chars": 311,
"preview": "use super::prelude::*;\n\n#[derive(Debug)]\npub struct QStartNoAckMode;\n\nimpl<'a> ParseCommand<'a> for QStartNoAckMode {\n "
},
{
"path": "src/protocol/commands/_QStartupWithShell.rs",
"chars": 449,
"preview": "use super::prelude::*;\n\n#[derive(Debug)]\npub struct QStartupWithShell {\n pub value: bool,\n}\n\nimpl<'a> ParseCommand<'a"
},
{
"path": "src/protocol/commands/_QTBuffer_upcase.rs",
"chars": 1444,
"preview": "use super::prelude::*;\nuse crate::target::ext::tracepoints::BufferShape;\nuse crate::target::ext::tracepoints::TraceBuffe"
},
{
"path": "src/protocol/commands/_QTDP.rs",
"chars": 3325,
"preview": "use super::prelude::*;\nuse crate::target::ext::tracepoints::Tracepoint;\n\n#[derive(Debug)]\n#[allow(clippy::upper_case_acr"
},
{
"path": "src/protocol/commands/_QTDPsrc.rs",
"chars": 1621,
"preview": "use super::prelude::*;\nuse crate::target::ext::tracepoints::Tracepoint;\nuse crate::target::ext::tracepoints::TracepointS"
},
{
"path": "src/protocol/commands/_QTFrame.rs",
"chars": 1723,
"preview": "use super::prelude::*;\nuse crate::target::ext::tracepoints::FrameRequest;\nuse crate::target::ext::tracepoints::Tracepoin"
},
{
"path": "src/protocol/commands/_QTStart.rs",
"chars": 287,
"preview": "use super::prelude::*;\n\n#[derive(Debug)]\npub struct QTStart;\n\nimpl<'a> ParseCommand<'a> for QTStart {\n #[inline(alway"
},
{
"path": "src/protocol/commands/_QTStop.rs",
"chars": 284,
"preview": "use super::prelude::*;\n\n#[derive(Debug)]\npub struct QTStop;\n\nimpl<'a> ParseCommand<'a> for QTStop {\n #[inline(always)"
},
{
"path": "src/protocol/commands/_QTinit.rs",
"chars": 284,
"preview": "use super::prelude::*;\n\n#[derive(Debug)]\npub struct QTinit;\n\nimpl<'a> ParseCommand<'a> for QTinit {\n #[inline(always)"
},
{
"path": "src/protocol/commands/_bc.rs",
"chars": 272,
"preview": "use super::prelude::*;\n\n#[derive(Debug)]\npub struct bc;\n\nimpl<'a> ParseCommand<'a> for bc {\n #[inline(always)]\n fn"
},
{
"path": "src/protocol/commands/_bs.rs",
"chars": 272,
"preview": "use super::prelude::*;\n\n#[derive(Debug)]\npub struct bs;\n\nimpl<'a> ParseCommand<'a> for bs {\n #[inline(always)]\n fn"
},
{
"path": "src/protocol/commands/_c.rs",
"chars": 490,
"preview": "use super::prelude::*;\n\n#[derive(Debug)]\npub struct c<'a> {\n pub addr: Option<&'a [u8]>,\n}\n\nimpl<'a> ParseCommand<'a>"
},
{
"path": "src/protocol/commands/_d_upcase.rs",
"chars": 427,
"preview": "use super::prelude::*;\nuse crate::common::Pid;\n\n#[derive(Debug)]\npub struct D {\n pub pid: Option<Pid>,\n}\n\nimpl<'a> Pa"
},
{
"path": "src/protocol/commands/_g.rs",
"chars": 269,
"preview": "use super::prelude::*;\n\n#[derive(Debug)]\npub struct g;\n\nimpl<'a> ParseCommand<'a> for g {\n #[inline(always)]\n fn f"
},
{
"path": "src/protocol/commands/_g_upcase.rs",
"chars": 297,
"preview": "use super::prelude::*;\n\n#[derive(Debug)]\npub struct G<'a> {\n pub vals: &'a [u8],\n}\n\nimpl<'a> ParseCommand<'a> for G<'"
},
{
"path": "src/protocol/commands/_h_upcase.rs",
"chars": 676,
"preview": "use super::prelude::*;\nuse crate::protocol::common::thread_id::ThreadId;\n\n#[derive(Debug)]\npub enum Op {\n StepContinu"
},
{
"path": "src/protocol/commands/_k.rs",
"chars": 269,
"preview": "use super::prelude::*;\n\n#[derive(Debug)]\npub struct k;\n\nimpl<'a> ParseCommand<'a> for k {\n #[inline(always)]\n fn f"
},
{
"path": "src/protocol/commands/_m.rs",
"chars": 1920,
"preview": "use super::prelude::*;\n\n#[derive(Debug)]\npub struct m<'a> {\n pub addr: &'a [u8],\n pub len: usize,\n\n pub buf: &'"
},
{
"path": "src/protocol/commands/_m_upcase.rs",
"chars": 1311,
"preview": "use super::prelude::*;\n\n#[derive(Debug)]\npub struct M<'a> {\n pub addr: &'a [u8],\n pub val: &'a [u8],\n}\n\nimpl<'a> P"
},
{
"path": "src/protocol/commands/_p.rs",
"chars": 498,
"preview": "use super::prelude::*;\n\n#[derive(Debug)]\npub struct p<'a> {\n pub reg_id: usize,\n\n pub buf: &'a mut [u8],\n}\n\nimpl<'"
},
{
"path": "src/protocol/commands/_p_upcase.rs",
"chars": 464,
"preview": "use super::prelude::*;\n\n#[derive(Debug)]\npub struct P<'a> {\n pub reg_id: usize,\n pub val: &'a [u8],\n}\n\nimpl<'a> Pa"
},
{
"path": "src/protocol/commands/_qAttached.rs",
"chars": 451,
"preview": "use super::prelude::*;\nuse crate::common::Pid;\n\n#[derive(Debug)]\npub struct qAttached {\n pub pid: Option<Pid>,\n}\n\nimp"
},
{
"path": "src/protocol/commands/_qC.rs",
"chars": 272,
"preview": "use super::prelude::*;\n\n#[derive(Debug)]\npub struct qC;\n\nimpl<'a> ParseCommand<'a> for qC {\n #[inline(always)]\n fn"
},
{
"path": "src/protocol/commands/_qHostInfo.rs",
"chars": 293,
"preview": "use super::prelude::*;\n\n#[derive(Debug)]\npub struct qHostInfo;\n\nimpl<'a> ParseCommand<'a> for qHostInfo {\n #[inline(a"
},
{
"path": "src/protocol/commands/_qOffsets.rs",
"chars": 354,
"preview": "use super::prelude::*;\n\n#[derive(Debug)]\npub struct qOffsets;\n\nimpl<'a> ParseCommand<'a> for qOffsets {\n #[inline(alw"
},
{
"path": "src/protocol/commands/_qProcessInfo.rs",
"chars": 302,
"preview": "use super::prelude::*;\n\n#[derive(Debug)]\npub struct qProcessInfo;\n\nimpl<'a> ParseCommand<'a> for qProcessInfo {\n #[in"
},
{
"path": "src/protocol/commands/_qRcmd.rs",
"chars": 543,
"preview": "use super::prelude::*;\n\n#[derive(Debug)]\npub struct qRcmd<'a> {\n pub hex_cmd: &'a [u8],\n}\n\nimpl<'a> ParseCommand<'a> "
},
{
"path": "src/protocol/commands/_qRegisterInfo.rs",
"chars": 349,
"preview": "use super::prelude::*;\n\n#[derive(Debug)]\npub struct qRegisterInfo {\n pub reg_id: usize,\n}\n\nimpl<'a> ParseCommand<'a> "
},
{
"path": "src/protocol/commands/_qSupported.rs",
"chars": 1597,
"preview": "use super::prelude::*;\n\n#[derive(Debug)]\npub struct qSupported<'a> {\n pub packet_buffer_len: usize,\n pub features:"
},
{
"path": "src/protocol/commands/_qTBuffer.rs",
"chars": 730,
"preview": "use super::prelude::*;\n\n#[derive(Debug)]\npub struct qTBuffer {\n pub offset: u64,\n pub length: usize,\n}\n\nimpl<'a> P"
},
{
"path": "src/protocol/commands/_qTP.rs",
"chars": 677,
"preview": "use super::prelude::*;\nuse crate::target::ext::tracepoints::Tracepoint;\n\n#[derive(Debug)]\npub struct qTP<'a> {\n pub t"
},
{
"path": "src/protocol/commands/_qTStatus.rs",
"chars": 290,
"preview": "use super::prelude::*;\n\n#[derive(Debug)]\npub struct qTStatus;\n\nimpl<'a> ParseCommand<'a> for qTStatus {\n #[inline(alw"
},
{
"path": "src/protocol/commands/_qTfP.rs",
"chars": 278,
"preview": "use super::prelude::*;\n\n#[derive(Debug)]\npub struct qTfP;\n\nimpl<'a> ParseCommand<'a> for qTfP {\n #[inline(always)]\n "
},
{
"path": "src/protocol/commands/_qTfV.rs",
"chars": 278,
"preview": "use super::prelude::*;\n\n#[derive(Debug)]\npub struct qTfV;\n\nimpl<'a> ParseCommand<'a> for qTfV {\n #[inline(always)]\n "
},
{
"path": "src/protocol/commands/_qThreadExtraInfo.rs",
"chars": 792,
"preview": "use super::prelude::*;\nuse crate::protocol::common::thread_id::ThreadId;\nuse crate::protocol::ConcreteThreadId;\n\n#[deriv"
},
{
"path": "src/protocol/commands/_qTsP.rs",
"chars": 278,
"preview": "use super::prelude::*;\n\n#[derive(Debug)]\npub struct qTsP;\n\nimpl<'a> ParseCommand<'a> for qTsP {\n #[inline(always)]\n "
},
{
"path": "src/protocol/commands/_qTsV.rs",
"chars": 278,
"preview": "use super::prelude::*;\n\n#[derive(Debug)]\npub struct qTsV;\n\nimpl<'a> ParseCommand<'a> for qTsV {\n #[inline(always)]\n "
},
{
"path": "src/protocol/commands/_qWasmCallStack.rs",
"chars": 595,
"preview": "use super::prelude::*;\nuse crate::protocol::common::thread_id::ThreadId;\nuse crate::protocol::ConcreteThreadId;\n\n#[deriv"
},
{
"path": "src/protocol/commands/_qWasmGlobal.rs",
"chars": 955,
"preview": "use super::prelude::*;\n\n#[derive(Debug)]\npub struct qWasmGlobal<'a> {\n pub frame: usize,\n pub global: usize,\n p"
},
{
"path": "src/protocol/commands/_qWasmLocal.rs",
"chars": 947,
"preview": "use super::prelude::*;\n\n#[derive(Debug)]\npub struct qWasmLocal<'a> {\n pub frame: usize,\n pub local: usize,\n pub"
},
{
"path": "src/protocol/commands/_qWasmStackValue.rs",
"chars": 962,
"preview": "use super::prelude::*;\n\n#[derive(Debug)]\npub struct qWasmStackValue<'a> {\n pub frame: usize,\n pub index: usize,\n "
},
{
"path": "src/protocol/commands/_qXfer_auxv_read.rs",
"chars": 432,
"preview": "// use super::prelude::*; // unused\nuse crate::protocol::common::qxfer::ParseAnnex;\nuse crate::protocol::common::qxfer::"
},
{
"path": "src/protocol/commands/_qXfer_exec_file.rs",
"chars": 565,
"preview": "use super::prelude::*;\nuse crate::common::Pid;\nuse crate::protocol::common::qxfer::ParseAnnex;\nuse crate::protocol::comm"
},
{
"path": "src/protocol/commands/_qXfer_features_read.rs",
"chars": 452,
"preview": "// use super::prelude::*; // unused\nuse crate::protocol::common::qxfer::ParseAnnex;\nuse crate::protocol::common::qxfer::"
},
{
"path": "src/protocol/commands/_qXfer_libraries_read.rs",
"chars": 421,
"preview": "use crate::protocol::common::qxfer::ParseAnnex;\nuse crate::protocol::common::qxfer::QXferReadBase;\n\npub type qXferLibrar"
},
{
"path": "src/protocol/commands/_qXfer_libraries_svr4_read.rs",
"chars": 441,
"preview": "use crate::protocol::common::qxfer::ParseAnnex;\nuse crate::protocol::common::qxfer::QXferReadBase;\n\npub type qXferLibrar"
},
{
"path": "src/protocol/commands/_qXfer_memory_map.rs",
"chars": 457,
"preview": "// use super::prelude::*; // unused\nuse crate::protocol::common::qxfer::ParseAnnex;\nuse crate::protocol::common::qxfer::"
},
{
"path": "src/protocol/commands/_qfThreadInfo.rs",
"chars": 302,
"preview": "use super::prelude::*;\n\n#[derive(Debug)]\npub struct qfThreadInfo;\n\nimpl<'a> ParseCommand<'a> for qfThreadInfo {\n #[in"
},
{
"path": "src/protocol/commands/_qsThreadInfo.rs",
"chars": 302,
"preview": "use super::prelude::*;\n\n#[derive(Debug)]\npub struct qsThreadInfo;\n\nimpl<'a> ParseCommand<'a> for qsThreadInfo {\n #[in"
},
{
"path": "src/protocol/commands/_r_upcase.rs",
"chars": 772,
"preview": "use super::prelude::*;\n\n#[derive(Debug)]\npub struct R;\n\nimpl<'a> ParseCommand<'a> for R {\n #[inline(always)]\n fn f"
},
{
"path": "src/protocol/commands/_s.rs",
"chars": 490,
"preview": "use super::prelude::*;\n\n#[derive(Debug)]\npub struct s<'a> {\n pub addr: Option<&'a [u8]>,\n}\n\nimpl<'a> ParseCommand<'a>"
},
{
"path": "src/protocol/commands/_t_upcase.rs",
"chars": 363,
"preview": "use super::prelude::*;\nuse crate::protocol::common::thread_id::ThreadId;\n\n#[derive(Debug)]\npub struct T {\n pub thread"
},
{
"path": "src/protocol/commands/_vAttach.rs",
"chars": 501,
"preview": "use super::prelude::*;\nuse crate::common::Pid;\n\n#[derive(Debug)]\npub struct vAttach {\n pub pid: Pid,\n}\n\nimpl<'a> Pars"
},
{
"path": "src/protocol/commands/_vCont.rs",
"chars": 6740,
"preview": "use super::prelude::*;\nuse crate::common::Signal;\nuse crate::protocol::common::hex::HexString;\nuse crate::protocol::comm"
},
{
"path": "src/protocol/commands/_vFile_close.rs",
"chars": 508,
"preview": "use super::prelude::*;\n\n#[derive(Debug)]\npub struct vFileClose {\n pub fd: u32,\n}\n\nimpl<'a> ParseCommand<'a> for vFile"
},
{
"path": "src/protocol/commands/_vFile_fstat.rs",
"chars": 508,
"preview": "use super::prelude::*;\n\n#[derive(Debug)]\npub struct vFileFstat {\n pub fd: u32,\n}\n\nimpl<'a> ParseCommand<'a> for vFile"
},
{
"path": "src/protocol/commands/_vFile_open.rs",
"chars": 1042,
"preview": "use super::prelude::*;\nuse crate::target::ext::host_io::HostIoOpenFlags;\nuse crate::target::ext::host_io::HostIoOpenMode"
},
{
"path": "src/protocol/commands/_vFile_pread.rs",
"chars": 985,
"preview": "use super::prelude::*;\n\n#[derive(Debug)]\npub struct vFilePread<'a> {\n pub fd: u32,\n pub count: usize,\n pub offs"
},
{
"path": "src/protocol/commands/_vFile_pwrite.rs",
"chars": 831,
"preview": "use super::prelude::*;\nuse crate::protocol::common::hex::decode_bin_buf;\n\n#[derive(Debug)]\npub struct vFilePwrite<'a> {\n"
},
{
"path": "src/protocol/commands/_vFile_readlink.rs",
"chars": 741,
"preview": "use super::prelude::*;\n\n#[derive(Debug)]\npub struct vFileReadlink<'a> {\n pub filename: &'a [u8],\n\n pub buf: &'a mu"
},
{
"path": "src/protocol/commands/_vFile_setfs.rs",
"chars": 696,
"preview": "use super::prelude::*;\nuse crate::target::ext::host_io::FsKind;\n\n#[derive(Debug)]\npub struct vFileSetfs {\n pub fs: Fs"
},
{
"path": "src/protocol/commands/_vFile_unlink.rs",
"chars": 546,
"preview": "use super::prelude::*;\n\n#[derive(Debug)]\npub struct vFileUnlink<'a> {\n pub filename: &'a [u8],\n}\n\nimpl<'a> ParseComma"
},
{
"path": "src/protocol/commands/_vFlashDone.rs",
"chars": 221,
"preview": "use super::prelude::*;\n\n#[derive(Debug)]\npub struct vFlashDone;\n\nimpl<'a> ParseCommand<'a> for vFlashDone {\n #[inline"
},
{
"path": "src/protocol/commands/_vFlashErase.rs",
"chars": 1962,
"preview": "use super::prelude::*;\n\n#[derive(Debug)]\npub struct vFlashErase<'a> {\n pub addr: &'a [u8],\n pub length: &'a [u8],\n"
},
{
"path": "src/protocol/commands/_vFlashWrite.rs",
"chars": 1964,
"preview": "use super::prelude::*;\nuse crate::protocol::common::hex::decode_bin_buf;\n\n#[derive(Debug)]\npub struct vFlashWrite<'a> {\n"
},
{
"path": "src/protocol/commands/_vKill.rs",
"chars": 432,
"preview": "use super::prelude::*;\nuse crate::common::Pid;\n\n#[derive(Debug)]\npub struct vKill {\n pub pid: Pid,\n}\n\nimpl<'a> ParseC"
},
{
"path": "src/protocol/commands/_vRun.rs",
"chars": 2630,
"preview": "use super::prelude::*;\nuse crate::protocol::common::lists::ArgListHex;\n\n#[derive(Debug)]\npub struct vRun<'a> {\n pub f"
},
{
"path": "src/protocol/commands/_x_lowcase.rs",
"chars": 1994,
"preview": "use super::prelude::*;\n\n#[derive(Debug)]\npub struct x<'a> {\n pub addr: &'a [u8],\n pub len: usize,\n\n /// Reuse P"
},
{
"path": "src/protocol/commands/_x_upcase.rs",
"chars": 813,
"preview": "use super::prelude::*;\nuse crate::protocol::common::hex::decode_bin_buf;\n\n#[derive(Debug)]\npub struct X<'a> {\n pub ad"
},
{
"path": "src/protocol/commands/breakpoint.rs",
"chars": 3599,
"preview": "use crate::protocol::common::hex::decode_hex;\nuse crate::protocol::common::hex::decode_hex_buf;\n\n// Breakpoint packets a"
},
{
"path": "src/protocol/commands/exclamation_mark.rs",
"chars": 311,
"preview": "use super::prelude::*;\n\n#[derive(Debug)]\npub struct ExclamationMark;\n\nimpl<'a> ParseCommand<'a> for ExclamationMark {\n "
},
{
"path": "src/protocol/commands/question_mark.rs",
"chars": 302,
"preview": "use super::prelude::*;\n\n#[derive(Debug)]\npub struct QuestionMark;\n\nimpl<'a> ParseCommand<'a> for QuestionMark {\n #[in"
},
{
"path": "src/protocol/commands.rs",
"chars": 14190,
"preview": "use crate::protocol::packet::PacketBuf;\nuse crate::target::Target;\nuse pastey::paste;\n\n/// Common imports used by >50% o"
},
{
"path": "src/protocol/common/hex.rs",
"chars": 7102,
"preview": "use num_traits::CheckedAdd;\nuse num_traits::CheckedMul;\nuse num_traits::FromPrimitive;\nuse num_traits::Zero;\n\n#[derive(D"
},
{
"path": "src/protocol/common/lists.rs",
"chars": 1006,
"preview": "use crate::protocol::common::hex::decode_hex_buf;\nuse crate::protocol::common::hex::is_hex;\n\n/// A wrapper type around a"
},
{
"path": "src/protocol/common/mod.rs",
"chars": 62,
"preview": "pub mod hex;\npub mod lists;\npub mod qxfer;\npub mod thread_id;\n"
},
{
"path": "src/protocol/common/qxfer.rs",
"chars": 1549,
"preview": "use crate::protocol::commands::ParseCommand;\nuse crate::protocol::common::hex::decode_hex;\nuse crate::protocol::packet::"
}
]
// ... and 66 more files (download for full content)
About this extraction
This page contains the full source code of the daniel5151/gdbstub GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 266 files (993.2 KB), approximately 274.4k tokens, and a symbol index with 2247 extracted functions, classes, methods, constants, and types. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.
Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.