Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tracepoint extension support #160

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

cczetier
Copy link

Description

This PR adds basic tracepoint extension support to GDB stub. Closes #157.

API Stability

  • This PR does not require a breaking API change

Checklist

  • 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.

Validation

GDB output
(gdb) trace test.c:10
Tracepoint 1 at 0x55550040: file test.c, line 10.
(gdb) break *0x55550044
Breakpoint 2 at 0x55550044: file test.c, line 10.
(gdb) break main
Breakpoint 3 at 0x5555000c: file test.c, line 2.
(gdb) r
The program being debugged has been started already.
Start it from the beginning? (y or n) y
Starting program: target:/test.elf 
Reading /test.elf from remote target...

Breakpoint 3, main () at test.c:2
2	in test.c
(gdb) tstart
warning: Target does not support trace user/notes, info ignored
(gdb) c
Continuing.

Breakpoint 2, 0x55550044 in main () at test.c:10
10	in test.c
(gdb) tstop
warning: Target does not support trace notes, note ignored
(gdb) tstatus
Trace stopped for an unknown reason.
Collected 1 trace frames.
Trace will stop if GDB disconnects.
Not looking at any trace frame.
(gdb) info tracepoints
Num     Type           Disp Enb Address    What
1       tracepoint     keep y   0x55550040 in main at test.c:10
	tracepoint already hit 1 time
	installed on target
(gdb) tfind
Found trace frame 0, tracepoint 1
#0  main () at test.c:10
10	in test.c
(gdb) i r
r0             0x0                 0
r1             0x0                 0
r2             0x0                 0
r3             0x0                 0
r4             0x0                 0
r5             0x0                 0
r6             0x0                 0
r7             0x0                 0
r8             0x0                 0
r9             0x0                 0
r10            0x0                 0
r11            0xffffffc           268435452
r12            0x0                 0
sp             0xfffffe8           0xfffffe8
lr             0x12345678          305419896
pc             0x55550040          0x55550040 <main+64>
cpsr           0x80000010          -2147483632
custom         0x12345678          305419896
time           0xb6fdf9ec          3070097900
unavailable    <unavailable>
loading section ".text" into memory from [0x55550000..0x55550078] Setting PC to 0x55550000 Waiting for a GDB connection on "127.0.0.1:9001"...

(The start of the cargo run output is corrupted by binary data that's printed, so I cut out the portion of the output relevant for tracepoint packets)

TRACE gdbstub::protocol::recv_packet     > <-- $QTinit#59
 TRACE gdbstub::protocol::response_writer > --> $OK#9a
 TRACE gdbstub::protocol::recv_packet     > <-- $QTDP:1:0000000055550040:E:0:0#49
 TRACE gdbstub::protocol::response_writer > --> $OK#9a
 TRACE gdbstub::protocol::recv_packet     > <-- $QTro:55550000,55550078#23
 INFO  gdbstub::stub::core_impl           > Unknown command: Ok("QTro:55550000,55550078")
 TRACE gdbstub::protocol::response_writer > --> $#00
 TRACE gdbstub::protocol::recv_packet     > <-- $QTBuffer:circular:0#f8
 TRACE gdbstub::protocol::response_writer > --> $OK#9a
 TRACE gdbstub::protocol::recv_packet     > <-- $QTBuffer:size:-1#8c
 TRACE gdbstub::protocol::response_writer > --> $OK#9a
 TRACE gdbstub::protocol::recv_packet     > <-- $QTNotes:user:;notes:;#ba
 INFO  gdbstub::stub::core_impl           > Unknown command: Ok("QTNotes:user:;notes:;")
 TRACE gdbstub::protocol::response_writer > --> $#00
 TRACE gdbstub::protocol::recv_packet     > <-- $QTStart#b3
 TRACE gdbstub::protocol::response_writer > --> $OK#9a
 TRACE gdbstub::protocol::recv_packet     > <-- $Z0,55550044,4#b2
 TRACE gdbstub::protocol::response_writer > --> $OK#9a
 TRACE gdbstub::protocol::recv_packet     > <-- $qTStatus#49
 TRACE gdbstub::protocol::response_writer > --> $T1;tframes:00#4c
 TRACE gdbstub::protocol::recv_packet     > <-- $vCont;s:p1.1#f2
 TRACE gdbstub::stub::state_machine       > transition: "Idle<armv4t::emu::Emu>" --> "Running"
 TRACE armv4t_emu::arm                    > ARM: pc: 0x5555000c, inst: 0xe3a03004, cond: 0xe, cflags: 0000
 TRACE armv4t_emu::arm                    > Instruction: DataProc2
 TRACE gdbstub::protocol::response_writer > --> $S05#b8
 TRACE gdbstub::stub::state_machine       > transition: "Running" --> "Idle<armv4t::emu::Emu>"
 TRACE gdbstub::protocol::recv_packet     > <-- $g#67
 TRACE gdbstub::protocol::response_writer > --> $0000000000000000000000000400000000000000000000000000000000000000000000000000000000000000fcffff0f00000000e8ffff0f7856341210005555xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx1000000078563412#7d
 TRACE gdbstub::protocol::recv_packet     > <-- $Z0,5555000c,4#dd
 TRACE gdbstub::protocol::response_writer > --> $OK#9a
 TRACE gdbstub::protocol::recv_packet     > <-- $qTStatus#49
 TRACE gdbstub::protocol::response_writer > --> $T1;tframes:00#4c
 TRACE gdbstub::protocol::recv_packet     > <-- $vCont;c:p1.-1#0f
 TRACE gdbstub::stub::state_machine       > transition: "Idle<armv4t::emu::Emu>" --> "Running"
 TRACE armv4t_emu::arm                    > ARM: pc: 0x55550010, inst: 0xe50b3008, cond: 0xe, cflags: 0000
 TRACE armv4t_emu::arm                    > Instruction: SingleXferI
 TRACE armv4t_emu::arm                    > ARM: pc: 0x55550014, inst: 0xe3a03003, cond: 0xe, cflags: 0000
 TRACE armv4t_emu::arm                    > Instruction: DataProc2
 TRACE armv4t_emu::arm                    > ARM: pc: 0x55550018, inst: 0xe50b3010, cond: 0xe, cflags: 0000
 TRACE armv4t_emu::arm                    > Instruction: SingleXferI
 TRACE armv4t_emu::arm                    > ARM: pc: 0x5555001c, inst: 0xe51b3008, cond: 0xe, cflags: 0000
 TRACE armv4t_emu::arm                    > Instruction: SingleXferI
 TRACE armv4t_emu::arm                    > ARM: pc: 0x55550020, inst: 0xe2833001, cond: 0xe, cflags: 0000
 TRACE armv4t_emu::arm                    > Instruction: DataProc2
 TRACE armv4t_emu::arm                    > ARM: pc: 0x55550024, inst: 0xe50b3008, cond: 0xe, cflags: 0000
 TRACE armv4t_emu::arm                    > Instruction: SingleXferI
 TRACE armv4t_emu::arm                    > ARM: pc: 0x55550028, inst: 0xe51b3010, cond: 0xe, cflags: 0000
 TRACE armv4t_emu::arm                    > Instruction: SingleXferI
 TRACE armv4t_emu::arm                    > ARM: pc: 0x5555002c, inst: 0xe2833003, cond: 0xe, cflags: 0000
 TRACE armv4t_emu::arm                    > Instruction: DataProc2
 TRACE armv4t_emu::arm                    > ARM: pc: 0x55550030, inst: 0xe50b3010, cond: 0xe, cflags: 0000
 TRACE armv4t_emu::arm                    > Instruction: SingleXferI
 TRACE armv4t_emu::arm                    > ARM: pc: 0x55550034, inst: 0xe3a03000, cond: 0xe, cflags: 0000
 TRACE armv4t_emu::arm                    > Instruction: DataProc2
 TRACE armv4t_emu::arm                    > ARM: pc: 0x55550038, inst: 0xe50b300c, cond: 0xe, cflags: 0000
 TRACE armv4t_emu::arm                    > Instruction: SingleXferI
 TRACE armv4t_emu::arm                    > ARM: pc: 0x5555003c, inst: 0xea000005, cond: 0xe, cflags: 0000
 TRACE armv4t_emu::arm                    > Instruction: Branch
 TRACE armv4t_emu::arm                    > ARM: pc: 0x55550058, inst: 0xe51b300c, cond: 0xe, cflags: 0000
 TRACE armv4t_emu::arm                    > Instruction: SingleXferI
 TRACE armv4t_emu::arm                    > ARM: pc: 0x5555005c, inst: 0xe3530902, cond: 0xe, cflags: 0000
 TRACE armv4t_emu::arm                    > Instruction: DataProc2
 TRACE armv4t_emu::arm                    > ARM: pc: 0x55550060, inst: 0xbafffff6, cond: 0xb, cflags: 1000
 TRACE armv4t_emu::arm                    > Instruction: Branch
 TRACE armv4t_emu::arm                    > ARM: pc: 0x55550040, inst: 0xe51b3008, cond: 0xe, cflags: 1000
 TRACE armv4t_emu::arm                    > Instruction: SingleXferI
 TRACE gdbstub::protocol::response_writer > --> $T05thread:p01.01;swbreak:;#6a
 TRACE gdbstub::stub::state_machine       > transition: "Running" --> "Idle<armv4t::emu::Emu>"
 TRACE gdbstub::protocol::recv_packet     > <-- $g#67
 TRACE gdbstub::protocol::response_writer > --> $0000000000000000000000000500000000000000000000000000000000000000000000000000000000000000fcffff0f00000000e8ffff0f7856341244005555xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx1000008078563412#8d
 TRACE gdbstub::protocol::recv_packet     > <-- $qfThreadInfo#bb
 TRACE gdbstub::protocol::response_writer > --> $mp01.01#cd
 TRACE gdbstub::protocol::recv_packet     > <-- $qsThreadInfo#c8
 TRACE gdbstub::protocol::response_writer > --> $l#6c
 TRACE gdbstub::protocol::recv_packet     > <-- $z0,5555000c,4#fd
 TRACE gdbstub::protocol::response_writer > --> $OK#9a
 TRACE gdbstub::protocol::recv_packet     > <-- $z0,55550044,4#d2
 TRACE gdbstub::protocol::response_writer > --> $OK#9a
 TRACE gdbstub::protocol::recv_packet     > <-- $m55550044,4#69
 TRACE gdbstub::protocol::response_writer > --> $013083e2#c6
 TRACE gdbstub::protocol::recv_packet     > <-- $m55550040,4#65
 TRACE gdbstub::protocol::response_writer > --> $08301be5#f8
 TRACE gdbstub::protocol::recv_packet     > <-- $m55550044,4#69
 TRACE gdbstub::protocol::response_writer > --> $013083e2#c6
 TRACE gdbstub::protocol::recv_packet     > <-- $m55550040,4#65
 TRACE gdbstub::protocol::response_writer > --> $08301be5#f8
 TRACE gdbstub::protocol::recv_packet     > <-- $m55550044,2#67
 TRACE gdbstub::protocol::response_writer > --> $0130#c4
 TRACE gdbstub::protocol::recv_packet     > <-- $m55550042,2#65
 TRACE gdbstub::protocol::response_writer > --> $1be5#2d
 TRACE gdbstub::protocol::recv_packet     > <-- $m55550040,2#63
 TRACE gdbstub::protocol::response_writer > --> $0830#cb
 TRACE gdbstub::protocol::recv_packet     > <-- $m55550044,2#67
 TRACE gdbstub::protocol::response_writer > --> $0130#c4
 TRACE gdbstub::protocol::recv_packet     > <-- $m55550042,2#65
 TRACE gdbstub::protocol::response_writer > --> $1be5#2d
 TRACE gdbstub::protocol::recv_packet     > <-- $m55550040,2#63
 TRACE gdbstub::protocol::response_writer > --> $0830#cb
 TRACE gdbstub::protocol::recv_packet     > <-- $m55550044,4#69
 TRACE gdbstub::protocol::response_writer > --> $013083e2#c6
 TRACE gdbstub::protocol::recv_packet     > <-- $m55550040,4#65
 TRACE gdbstub::protocol::response_writer > --> $08301be5#f8
 TRACE gdbstub::protocol::recv_packet     > <-- $m55550044,4#69
 TRACE gdbstub::protocol::response_writer > --> $013083e2#c6
 TRACE gdbstub::protocol::recv_packet     > <-- $m55550040,4#65
 TRACE gdbstub::protocol::response_writer > --> $08301be5#f8
 TRACE gdbstub::protocol::recv_packet     > <-- $m55550044,4#69
 TRACE gdbstub::protocol::response_writer > --> $013083e2#c6
 TRACE gdbstub::protocol::recv_packet     > <-- $m55550044,4#69
 TRACE gdbstub::protocol::response_writer > --> $013083e2#c6
 TRACE gdbstub::protocol::recv_packet     > <-- $m55550044,4#69
 TRACE gdbstub::protocol::response_writer > --> $013083e2#c6
 TRACE gdbstub::protocol::recv_packet     > <-- $QTStop#4b
 TRACE gdbstub::protocol::response_writer > --> $OK#9a
 TRACE gdbstub::protocol::recv_packet     > <-- $QTNotes:tstop:;#97
 INFO  gdbstub::stub::core_impl           > Unknown command: Ok("QTNotes:tstop:;")
 TRACE gdbstub::protocol::response_writer > --> $#00
 TRACE gdbstub::protocol::recv_packet     > <-- $qTStatus#49
 TRACE gdbstub::protocol::response_writer > --> $T0;tframes:01#4c
 TRACE gdbstub::protocol::recv_packet     > <-- $qTP:1:55550040#52
 TRACE gdbstub::protocol::response_writer > --> $V01:00#51
 TRACE gdbstub::protocol::recv_packet     > <-- $QTFrame:0#fa
 TRACE gdbstub::protocol::response_writer > --> $F 00T 01#9b
 TRACE gdbstub::protocol::recv_packet     > <-- $QTFrame:0#fa
 TRACE gdbstub::protocol::response_writer > --> $F 00T 01#9b
 TRACE gdbstub::protocol::recv_packet     > <-- $g#67
 TRACE gdbstub::protocol::response_writer > --> $0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000fcffff0f00000000e8ffff0f7856341240005555xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx1000008078563412#df
 TRACE gdbstub::protocol::recv_packet     > <-- $m55550040,4#65
 TRACE gdbstub::protocol::response_writer > --> $#00
 TRACE gdbstub::protocol::recv_packet     > <-- $m5555003c,4#97
 TRACE gdbstub::protocol::response_writer > --> $#00
 TRACE gdbstub::protocol::recv_packet     > <-- $m55550040,4#65
 TRACE gdbstub::protocol::response_writer > --> $#00
 TRACE gdbstub::protocol::recv_packet     > <-- $m5555003c,4#97
 TRACE gdbstub::protocol::response_writer > --> $#00
 TRACE gdbstub::protocol::recv_packet     > <-- $m55550040,2#63
 TRACE gdbstub::protocol::response_writer > --> $#00
 TRACE gdbstub::protocol::recv_packet     > <-- $m5555003e,2#97
 TRACE gdbstub::protocol::response_writer > --> $#00
 TRACE gdbstub::protocol::recv_packet     > <-- $m5555003c,2#95
 TRACE gdbstub::protocol::response_writer > --> $#00
 TRACE gdbstub::protocol::recv_packet     > <-- $m55550040,2#63
 TRACE gdbstub::protocol::response_writer > --> $#00
 TRACE gdbstub::protocol::recv_packet     > <-- $m5555003e,2#97
 TRACE gdbstub::protocol::response_writer > --> $#00
 TRACE gdbstub::protocol::recv_packet     > <-- $m5555003c,2#95
 TRACE gdbstub::protocol::response_writer > --> $#00
 TRACE gdbstub::protocol::recv_packet     > <-- $m55550040,4#65
 TRACE gdbstub::protocol::response_writer > --> $#00
 TRACE gdbstub::protocol::recv_packet     > <-- $m5555003c,4#97
 TRACE gdbstub::protocol::response_writer > --> $#00
 TRACE gdbstub::protocol::recv_packet     > <-- $m55550040,4#65
 TRACE gdbstub::protocol::response_writer > --> $#00
 TRACE gdbstub::protocol::recv_packet     > <-- $m5555003c,4#97
 TRACE gdbstub::protocol::response_writer > --> $#00
 TRACE gdbstub::protocol::recv_packet     > <-- $m55550040,4#65
 TRACE gdbstub::protocol::response_writer > --> $#00
 TRACE gdbstub::protocol::recv_packet     > <-- $m55550040,4#65
 TRACE gdbstub::protocol::response_writer > --> $#00
 TRACE gdbstub::protocol::recv_packet     > <-- $m55550040,4#65
 TRACE gdbstub::protocol::response_writer > --> $#00
 TRACE gdbstub::protocol::recv_packet     > <-- $p1b#03
 TRACE gdbstub::protocol::response_writer > --> $ecf9fdb6#c9
 TRACE gdbstub::protocol::recv_packet     > <-- $p1c#04
 TRACE gdbstub::protocol::response_writer > --> $xxxxxxxx#c6
Before/After `./example_no_std/check_size.sh` output

Before

Analyzing target/release/gdbstub-nostd

File  .text    Size          Crate Name
2.4%  71.2% 11.9KiB      [Unknown] main
0.2%   5.7%    969B        gdbstub gdbstub::stub::state_machine::GdbStubStateMachineInner<gdbstub::stub::state_machi...
0.1%   2.2%    374B        gdbstub gdbstub::protocol::commands::breakpoint::BasicBreakpoint::from_slice
0.1%   1.7%    295B        gdbstub <gdbstub::protocol::common::thread_id::ThreadId as core::convert::TryFrom<&[u8]>>...
0.1%   1.7%    295B        gdbstub gdbstub::stub::core_impl::resume::<impl gdbstub::stub::core_impl::GdbStubImpl<T,C...
0.1%   1.6%    278B        gdbstub gdbstub::protocol::packet::PacketBuf::new
0.1%   1.6%    277B        gdbstub gdbstub::protocol::common::hex::decode_hex_buf
0.1%   1.6%    273B        gdbstub gdbstub::protocol::response_writer::ResponseWriter<C>::write_specific_thread_id
0.0%   1.2%    213B        gdbstub gdbstub::protocol::response_writer::ResponseWriter<C>::write
0.0%   0.8%    132B        gdbstub gdbstub::protocol::common::hex::decode_hex
0.0%   0.7%    122B        gdbstub gdbstub::protocol::response_writer::ResponseWriter<C>::inner_write
0.0%   0.6%    111B        gdbstub gdbstub::protocol::response_writer::ResponseWriter<C>::flush
0.0%   0.6%    107B        gdbstub gdbstub::protocol::common::hex::decode_hex
0.0%   0.6%    106B gdbstub_nostd? <gdbstub_nostd::gdb::DummyTarget as gdbstub::target::ext::base::multithread::Mult...
0.0%   0.6%    104B        gdbstub gdbstub::protocol::response_writer::ResponseWriter<C>::write_num
0.0%   0.6%    101B      [Unknown] __libc_csu_init
0.0%   0.6%     97B        gdbstub gdbstub::protocol::response_writer::ResponseWriter<C>::write_num
0.0%   0.6%     95B        gdbstub gdbstub::protocol::response_writer::ResponseWriter<C>::write_hex
0.0%   0.5%     92B        gdbstub <gdbstub::protocol::common::thread_id::IdKind as core::convert::TryFrom<&[u8]>>::...
0.0%   0.5%     87B        gdbstub <usize as gdbstub::internal::be_bytes::BeBytes>::from_be_bytes
0.0%   0.5%     85B        gdbstub <u32 as gdbstub::internal::be_bytes::BeBytes>::from_be_bytes
0.0%   0.4%     71B   gdbstub_arch <gdbstub_arch::arm::reg::arm_core::ArmCoreRegs as gdbstub::arch::Registers>::gdb_...
0.0%   0.4%     65B gdbstub_nostd? <gdbstub_nostd::gdb::DummyTarget as gdbstub::target::ext::base::multithread::Mult...
0.0%   0.4%     65B gdbstub_nostd? <gdbstub_nostd::gdb::DummyTarget as gdbstub::target::ext::base::multithread::Mult...
0.0%   0.4%     65B gdbstub_nostd? <gdbstub_nostd::gdb::DummyTarget as gdbstub::target::ext::base::multithread::Mult...
0.0%   0.3%     50B gdbstub_nostd? <gdbstub_nostd::gdb::DummyTarget as gdbstub::target::ext::base::multithread::Mult...
0.0%   0.3%     50B gdbstub_nostd? <gdbstub_nostd::gdb::DummyTarget as gdbstub::target::ext::base::multithread::Mult...
0.0%   0.3%     50B gdbstub_nostd? <gdbstub_nostd::gdb::DummyTarget as gdbstub::target::ext::base::multithread::Mult...
0.0%   0.3%     43B      [Unknown] _start
0.0%   0.0%      6B gdbstub_nostd? <gdbstub_nostd::gdb::DummyTarget as gdbstub::target::ext::breakpoints::SwBreakpoi...
0.0%   0.0%      2B      [Unknown] __libc_csu_fini
3.4% 100.0% 16.7KiB                .text section size, the file size is 488.4KiB
target/release/gdbstub-nostd  :
section               size      addr
.interp                 28       568
.note.ABI-tag           32       596
.note.gnu.build-id      36       628
.gnu.hash               28       664
.dynsym                360       696
.dynstr                193      1056
.gnu.version            30      1250
.gnu.version_r          48      1280
.rela.dyn              408      1328
.init                   23      1736
.plt                    16      1760
.plt.got                 8      1776
.text                17106      1792
.fini                    9     18900
.rodata                920     18912
.eh_frame_hdr          276     19832
.eh_frame             1488     20112
.init_array              8   2121128
.fini_array              8   2121136
.dynamic               448   2121144
.got                   136   2121592
.data                    8   2121728
.bss                     8   2121736
.comment                93         0
Total                21718

After

Analyzing target/release/gdbstub-nostd

File  .text    Size          Crate Name
2.1%  71.1% 11.8KiB      [Unknown] main
0.2%   5.7%    969B        gdbstub gdbstub::stub::state_machine::GdbStubStateMachineInner<gdbstub::stub::state_machine::state::Running,T,C>::r...
0.1%   2.2%    374B        gdbstub gdbstub::protocol::commands::breakpoint::BasicBreakpoint::from_slice
0.1%   1.7%    295B        gdbstub <gdbstub::protocol::common::thread_id::ThreadId as core::convert::TryFrom<&[u8]>>::try_from
0.1%   1.7%    295B        gdbstub gdbstub::stub::core_impl::resume::<impl gdbstub::stub::core_impl::GdbStubImpl<T,C>>::write_stop_common
0.0%   1.6%    278B        gdbstub gdbstub::protocol::packet::PacketBuf::new
0.0%   1.6%    277B        gdbstub gdbstub::protocol::common::hex::decode_hex_buf
0.0%   1.6%    273B        gdbstub gdbstub::protocol::response_writer::ResponseWriter<C>::write_specific_thread_id
0.0%   1.3%    213B        gdbstub gdbstub::protocol::response_writer::ResponseWriter<C>::write
0.0%   0.8%    132B        gdbstub gdbstub::protocol::common::hex::decode_hex
0.0%   0.7%    122B        gdbstub gdbstub::protocol::response_writer::ResponseWriter<C>::inner_write
0.0%   0.7%    111B        gdbstub gdbstub::protocol::response_writer::ResponseWriter<C>::flush
0.0%   0.6%    107B        gdbstub gdbstub::protocol::common::hex::decode_hex
0.0%   0.6%    106B gdbstub_nostd? <gdbstub_nostd::gdb::DummyTarget as gdbstub::target::ext::base::multithread::MultiThreadBase>::read_addrs
0.0%   0.6%    104B        gdbstub gdbstub::protocol::response_writer::ResponseWriter<C>::write_num
0.0%   0.6%    101B      [Unknown] __libc_csu_init
0.0%   0.6%     97B        gdbstub gdbstub::protocol::response_writer::ResponseWriter<C>::write_num
0.0%   0.6%     95B        gdbstub gdbstub::protocol::response_writer::ResponseWriter<C>::write_hex
0.0%   0.5%     92B        gdbstub <gdbstub::protocol::common::thread_id::IdKind as core::convert::TryFrom<&[u8]>>::try_from
0.0%   0.5%     87B        gdbstub <usize as gdbstub::internal::be_bytes::BeBytes>::from_be_bytes
0.0%   0.5%     85B        gdbstub <u32 as gdbstub::internal::be_bytes::BeBytes>::from_be_bytes
0.0%   0.4%     71B   gdbstub_arch <gdbstub_arch::arm::reg::arm_core::ArmCoreRegs as gdbstub::arch::Registers>::gdb_deserialize
0.0%   0.4%     65B gdbstub_nostd? <gdbstub_nostd::gdb::DummyTarget as gdbstub::target::ext::base::multithread::MultiThreadBase>::write_addrs
0.0%   0.4%     65B gdbstub_nostd? <gdbstub_nostd::gdb::DummyTarget as gdbstub::target::ext::base::multithread::MultiThreadBase>::write_registers
0.0%   0.4%     65B gdbstub_nostd? <gdbstub_nostd::gdb::DummyTarget as gdbstub::target::ext::base::multithread::MultiThreadBase>::read_registers
0.0%   0.3%     50B gdbstub_nostd? <gdbstub_nostd::gdb::DummyTarget as gdbstub::target::ext::base::multithread::MultiThreadResume>::set_resume...
0.0%   0.3%     50B gdbstub_nostd? <gdbstub_nostd::gdb::DummyTarget as gdbstub::target::ext::base::multithread::MultiThreadResume>::clear_resu...
0.0%   0.3%     50B gdbstub_nostd? <gdbstub_nostd::gdb::DummyTarget as gdbstub::target::ext::base::multithread::MultiThreadResume>::resume
0.0%   0.3%     43B      [Unknown] _start
0.0%   0.0%      6B gdbstub_nostd? <gdbstub_nostd::gdb::DummyTarget as gdbstub::target::ext::breakpoints::SwBreakpoint>::add_sw_breakpoint
0.0%   0.0%      2B      [Unknown] __libc_csu_fini
3.0% 100.0% 16.6KiB                .text section size, the file size is 553.4KiB
target/release/gdbstub-nostd  :
section               size      addr
.interp                 28       568
.note.ABI-tag           32       596
.note.gnu.build-id      36       628
.gnu.hash               28       664
.dynsym                360       696
.dynstr                193      1056
.gnu.version            30      1250
.gnu.version_r          48      1280
.rela.dyn              408      1328
.init                   23      1736
.plt                    16      1760
.plt.got                 8      1776
.text                17010      1792
.fini                    9     18804
.rodata                920     18816
.eh_frame_hdr          276     19736
.eh_frame             1488     20016
.init_array              8   2121128
.fini_array              8   2121136
.dynamic               448   2121144
.got                   136   2121592
.data                    8   2121728
.bss                     8   2121736
.comment                93         0
Total                21622

@cczetier
Copy link
Author

I wasn't sure how the zero panic verification guarantee can be checked - there isn't a how to section in the README about it. I tried to write code as panic-free as I could, but I may have missed some pieces.

@daniel5151
Copy link
Owner

Thanks for sending in this PR - I'm excited to dig in here!

Unfortunately, I'm just about to leave for a vacation where I'll be completely AFK, so I'll only be able to take a look sometime in the range of ~Dec 20th to ~Dec 23rd.

Just wanted to give you a heads up, so that you're not worried about the lack of movement here 😅

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Tracepoints support
2 participants