probe-rs-tools 0.29.1

A collection of on chip debugging tools to communicate with microchips.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
use super::super::target::utils::copy_to_buf;
use super::RuntimeTarget;

use gdbstub::target::ext::thread_extra_info::ThreadExtraInfo;

impl ThreadExtraInfo for RuntimeTarget<'_> {
    fn thread_extra_info(
        &self,
        tid: gdbstub::common::Tid,
        buf: &mut [u8],
    ) -> Result<usize, Self::Error> {
        let session = self.session.lock();
        let name = &session.target().cores[tid.get() - 1].name;

        Ok(copy_to_buf(name.as_bytes(), buf))
    }
}