aboutsummaryrefslogtreecommitdiff
path: root/src/target/ext/thread_extra_info.rs
blob: 9923d4d6cb55df7decd98ffc246d5db38afeacd1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
//! Provide extra information for a thread
use crate::common::Tid;
use crate::target::Target;

/// Target Extension - Provide extra information for a thread
pub trait ThreadExtraInfo: Target {
    /// Provide extra information about a thread
    ///
    /// GDB queries for extra information for a thread as part of the
    /// `info threads` command.  This function will be called once
    /// for each active thread.
    ///
    /// A string can be copied into `buf` that will then be displayed
    /// to the client.  The string is displayed as `(value)`, such as:
    ///
    /// `Thread 1.1 (value)`
    ///
    /// Return the number of bytes written into `buf`.
    fn thread_extra_info(&self, tid: Tid, buf: &mut [u8]) -> Result<usize, Self::Error>;
}

define_ext!(ThreadExtraInfoOps, ThreadExtraInfo);