mirror of
https://sourceware.org/git/binutils-gdb.git
synced 2024-11-21 01:12:32 +08:00
x86-nat: Add x86_lookup_debug_reg_state.
This function returns nullptr if debug register state does not yet exist for a given process rather than creating new state.
This commit is contained in:
parent
922c2fc18e
commit
b1babce7c3
@ -46,6 +46,18 @@ struct x86_dr_low_type x86_dr_low;
|
||||
static std::unordered_map<pid_t,
|
||||
struct x86_debug_reg_state> x86_debug_process_state;
|
||||
|
||||
/* See x86-nat.h. */
|
||||
|
||||
struct x86_debug_reg_state *
|
||||
x86_lookup_debug_reg_state (pid_t pid)
|
||||
{
|
||||
auto it = x86_debug_process_state.find (pid);
|
||||
if (it != x86_debug_process_state.end ())
|
||||
return &it->second;
|
||||
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
/* Get debug registers state for process PID. */
|
||||
|
||||
struct x86_debug_reg_state *
|
||||
|
@ -40,6 +40,11 @@ extern void x86_set_debug_register_length (int len);
|
||||
|
||||
extern void x86_cleanup_dregs (void);
|
||||
|
||||
/* Return the debug register state for process PID. If no existing
|
||||
state is found for this process, return nullptr. */
|
||||
|
||||
struct x86_debug_reg_state *x86_lookup_debug_reg_state (pid_t pid);
|
||||
|
||||
/* Called whenever GDB is no longer debugging process PID. It deletes
|
||||
data structures that keep track of debug register state. */
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user