GDBserver

Classes | Functions
regcache.h File Reference
`#include "common-regcache.h"`

Go to the source code of this file.

## Classes
struct | regcache

## Functions
struct regcache * | init_register_cache (struct regcache *regcache, const struct target_desc *tdesc, unsigned char *regbuf)
void | regcache_cpy (struct regcache *dst, struct regcache *src)
struct regcache * | new_register_cache (const struct target_desc *tdesc)
struct regcache * | get_thread_regcache (struct thread_info *thread, int fetch)
void | free_register_cache (struct regcache *regcache)
void | regcache_invalidate_thread (struct thread_info *)
void | regcache_invalidate_pid (int pid)
void | regcache_invalidate (void)
void | regcache_release (void)
void | registers_to_string (struct regcache *regcache, char *buf)
void | registers_from_string (struct regcache *regcache, char *buf)
void | regcache_write_pc (struct regcache *regcache, CORE_ADDR pc)
struct reg * | find_register_by_number (const struct target_desc *tdesc, int n)
int | register_cache_size (const struct target_desc *tdesc)
int | register_size (const struct target_desc *tdesc, int n)
int | find_regno (const struct target_desc *tdesc, const char *name)
void | supply_register (struct regcache *regcache, int n, const void *buf)
void | supply_register_zeroed (struct regcache *regcache, int n)
void | supply_register_by_name (struct regcache *regcache, const char *name, const void *buf)
void | supply_regblock (struct regcache *regcache, const void *buf)
void | collect_register (struct regcache *regcache, int n, void *buf)
void | collect_register_as_string (struct regcache *regcache, int n, char *buf)
void | collect_register_by_name (struct regcache *regcache, const char *name, void *buf)

## Function Documentation

## ◆ collect_register()

void collect_register | ( | struct regcache * | regcache,
|  | int | n,
|  | void * | buf
| ) |  |

Definition at line 402 of file regcache.c.

References register_data(), register_size(), and regcache::tdesc.

Referenced by aarch64_fill_fpregset(), aarch64_fill_gregset(), arm_fill_gregset(), arm_fill_vfpregset_num(), arm_fill_wmmxregset(), arm_store_inferior_register(), collect_16bit_register(), collect_register_by_name(), cris_fill_gregset(), gdb_eval_agent_expr(), get_next_pcs_syscall_next_pc(), i386_store_inferior_register(), i387_cache_to_fsave(), i387_cache_to_fxsave(), i387_cache_to_xsave(), lynx_i386_fill_fpregset(), lynx_ppc_fill_fpregset(), lynx_ppc_fill_gregset(), nios2_collect_register(), nto_store_registers(), ppc_collect_ptrace_register(), ppc_fill_evrregset(), ppc_fill_vrregset(), ppc_fill_vsxregset(), regcache_raw_read_unsigned(), s390_collect_ptrace_register(), s390_fill_gprs_high(), s390_fill_gs(), s390_fill_gsbc(), s390_fill_vxrs_high(), s390_fill_vxrs_low(), s390_supply_ptrace_register(), sh_fill_gregset(), sparc_fill_fpregset(), sparc_fill_gregset(), sparc_fill_gregset_to_stack(), spu_store_registers(), tic6x_collect_register(), tile_fill_gregset(), x86_fill_gregset(), and xtensa_fill_gregset().

## ◆ collect_register_as_string()

void collect_register_as_string | ( | struct regcache * | regcache,
|  | int | n,
|  | char * | buf
| ) |  |

Definition at line 434 of file regcache.c.

References bin2hex(), register_data(), register_size(), and regcache::tdesc.

Referenced by outreg().

## ◆ collect_register_by_name()

void collect_register_by_name | ( | struct regcache * | regcache,
|  | const char * | name,
|  | void * | buf
| ) |  |

Definition at line 441 of file regcache.c.

References collect_register(), find_regno(), name, and regcache::tdesc.

Referenced by aarch64_get_syscall_trapinfo(), arm_fill_vfpregset_num(), arm_get_syscall_trapinfo(), arm_is_thumb_mode(), arm_sigreturn_next_pc(), cris_insert_point(), cris_remove_point(), cris_stopped_by_watchpoint(), cris_stopped_data_address(), i387_cache_to_fsave(), i387_cache_to_fxsave(), i387_cache_to_xsave(), linux_get_pc_32bit(), linux_get_pc_64bit(), mips_get_pc(), parse_spufs_run(), ppc_arch_setup(), ppc_fill_evrregset(), ppc_fill_vrregset(), ppc_get_pc(), ppc_get_thread_area(), s390_arch_setup(), s390_fill_system_call(), s390_get_pc(), s390_set_pc(), tic6x_get_pc(), x86_fill_gregset(), x86_get_pc(), x86_get_syscall_trapinfo(), x86_get_thread_area(), xtensa_fill_gregset(), and xtensa_fill_xtregset().

## ◆ find_register_by_number()

struct reg* find_register_by_number | ( | const struct target_desc * | tdesc,
|  | int | n
| ) |  |

Definition at line 259 of file regcache.c.

References target_desc::reg_defs.

Referenced by register_data(), and register_size().

## ◆ find_regno()

int find_regno | ( | const struct target_desc * | tdesc,
|  | const char * | name
| ) |  |

Definition at line 243 of file regcache.c.

References internal_error(), name, and target_desc::reg_defs.

Referenced by arm_fill_vfpregset_num(), arm_store_vfpregset_num(), collect_register_by_name(), i387_cache_to_fsave(), i387_cache_to_fxsave(), i387_cache_to_xsave(), i387_fsave_to_cache(), i387_fxsave_to_cache(), i387_xsave_to_cache(), mips_cannot_fetch_register(), mips_cannot_store_register(), ppc_arch_setup(), ppc_cannot_store_register(), ppc_fill_evrregset(), ppc_fill_vrregset(), ppc_fill_vsxregset(), ppc_store_evrregset(), ppc_store_vrregset(), ppc_store_vsxregset(), prepare_resume_reply(), s390_arch_setup(), s390_fill_gprs_high(), s390_fill_gs(), s390_fill_gsbc(), s390_fill_vxrs_high(), s390_fill_vxrs_low(), s390_store_gprs_high(), s390_store_gs(), s390_store_gsbc(), s390_store_tdb(), s390_store_vxrs_high(), s390_store_vxrs_low(), sparc_fill_gregset_to_stack(), sparc_store_gregset_from_stack(), supply_register_by_name(), xtensa_fill_gregset(), and xtensa_store_gregset().

## ◆ free_register_cache()

void free_register_cache | ( | struct regcache * | regcache | ) |

Definition at line 170 of file regcache.c.

References free(), regcache::register_status, regcache::registers, and regcache::registers_owned.

Referenced by free_one_thread(), free_register_cache_thread(), ppc_arch_setup(), process_serial_event(), and s390_arch_setup().

## ◆ get_thread_regcache()

struct regcache* get_thread_regcache | ( | struct thread_info * | thread,
|  | int | fetch
| ) |  |

Definition at line 27 of file regcache.c.

References current_thread, fetch_inferior_registers, gdb_assert, get_thread_process(), memset(), new_register_cache(), target_desc::reg_defs, REG_UNAVAILABLE, regcache::register_status, regcache::registers_valid, set_thread_regcache_data(), regcache::tdesc, process_info::tdesc, and thread_regcache_data().

Referenced by arm_is_thumb_mode(), cris_insert_point(), cris_remove_point(), cris_stopped_by_watchpoint(), cris_stopped_data_address(), gdb_condition_true_at_breakpoint_z_type(), get_pc(), get_syscall_trapinfo(), get_thread_regcache_for_ptid(), install_software_single_step_breakpoints(), is_64bit_tdesc(), linux_resume_one_lwp_throw(), linux_wait_1(), maybe_move_out_of_jump_pad(), ppc_emit_ops(), ppc_get_ipa_tdesc_idx(), ppc_get_thread_area(), ppc_install_fast_tracepoint_jump_pad(), prepare_resume_reply(), process_serial_event(), ps_lgetregs(), run_breakpoint_commands_z_type(), s390_emit_ops(), s390_get_ipa_tdesc_idx(), s390_get_thread_area(), s390_install_fast_tracepoint_jump_pad(), save_stop_reason(), tracepoint_finished_step(), tracepoint_was_hit(), win32_wait(), x86_get_ipa_tdesc_idx(), and x86_get_thread_area().

## ◆ init_register_cache()

struct regcache* init_register_cache | ( | struct regcache * | regcache,
|  | const struct target_desc * | tdesc,
|  | unsigned char * | regbuf
| ) |  |

Definition at line 119 of file regcache.c.

References gdb_assert_not_reached, memset(), target_desc::reg_defs, REG_UNAVAILABLE, regcache::register_status, regcache::registers, regcache::registers_owned, target_desc::registers_size, regcache::registers_valid, regcache::tdesc, xcalloc(), and xmalloc().

Referenced by do_action_at_tracepoint(), get_context_regcache(), new_register_cache(), and traceframe_get_pc().

## ◆ new_register_cache()

struct regcache* new_register_cache | ( | const struct target_desc * | tdesc | ) |

Definition at line 160 of file regcache.c.

References gdb_assert, init_register_cache(), target_desc::registers_size, regcache::tdesc, and XCNEW.

Referenced by get_thread_regcache(), ppc_arch_setup(), process_serial_event(), and s390_arch_setup().

## ◆ regcache_cpy()

void regcache_cpy | ( | struct regcache * | dst,
|  | struct regcache * | src
| ) |  |

Definition at line 184 of file regcache.c.

References gdb_assert, target_desc::reg_defs, regcache::register_status, regcache::registers, target_desc::registers_size, regcache::registers_valid, and regcache::tdesc.

Referenced by do_action_at_tracepoint().

## ◆ regcache_invalidate()

void regcache_invalidate | ( | void |  | ) |

Definition at line 108 of file regcache.c.

References current_thread, thread_info::id, ptid_t::pid(), and regcache_invalidate_pid().

Referenced by nto_resume(), spu_resume(), and win32_resume().

## ◆ regcache_invalidate_pid()

void regcache_invalidate_pid | ( | int | pid | ) |

Definition at line 99 of file regcache.c.

References for_each_thread(), and regcache_invalidate_thread().

Referenced by lynx_resume(), and regcache_invalidate().

## ◆ regcache_invalidate_thread()

void regcache_invalidate_thread | ( | struct thread_info * |  | ) |

Definition at line 75 of file regcache.c.

References current_thread, regcache::registers_valid, store_inferior_registers, and thread_regcache_data().

Referenced by free_register_cache_thread(), linux_detach_one_lwp(), linux_resume_one_lwp_throw(), and regcache_invalidate_pid().

## ◆ regcache_release()

void regcache_release | ( | void |  | ) |

Definition at line 279 of file regcache.c.

References for_each_thread(), and free_register_cache_thread().

Referenced by x86_linux_update_xmltarget().

## ◆ regcache_write_pc()

void regcache_write_pc | ( | struct regcache * | regcache,
|  | CORE_ADDR | pc
| ) |  |

Definition at line 464 of file regcache.c.

References internal_error(), the_target, and target_ops::write_pc.

Referenced by do_action_at_tracepoint(), and fetch_traceframe_registers().

## ◆ register_cache_size()

int register_cache_size | ( | const struct target_desc * | tdesc | ) |

Definition at line 287 of file regcache.c.

References target_desc::registers_size, and regcache::tdesc.

Referenced by do_action_at_tracepoint().

## ◆ register_size()

int register_size | ( | const struct target_desc * | tdesc,
|  | int | n
| ) |  |

Definition at line 293 of file regcache.c.

References find_register_by_number(), and regcache::tdesc.

Referenced by aarch64_get_pc(), aarch64_get_syscall_trapinfo(), aarch64_set_pc(), collect_register(), collect_register_as_string(), gdb_eval_agent_expr(), i387_cache_to_fxsave(), i387_cache_to_xsave(), i387_fxsave_to_cache(), i387_xsave_to_cache(), ia64_fetch_register(), is_64bit_tdesc(), mips_get_pc(), mips_set_pc(), outreg(), parse_spufs_run(), ppc_arch_setup(), ppc_collect_ptrace_register(), ppc_emit_ops(), ppc_get_auxv(), ppc_get_pc(), ppc_get_thread_area(), ppc_install_fast_tracepoint_jump_pad(), ppc_set_pc(), ppc_supply_ptrace_register(), regcache_raw_read_unsigned(), regcache_register_size(), registers_to_string(), s390_collect_ptrace_register(), s390_emit_ops(), s390_get_hwcap(), s390_get_pc(), s390_get_thread_area(), s390_install_fast_tracepoint_jump_pad(), s390_regs_info(), s390_set_pc(), s390_store_last_break(), s390_supply_ptrace_register(), supply_register(), supply_register_zeroed(), x86_fill_gregset(), x86_get_pc(), x86_get_syscall_trapinfo(), x86_set_pc(), x86_store_gregset(), xtensa_fill_gregset(), and xtensa_store_gregset().

## ◆ registers_from_string()

void registers_from_string | ( | struct regcache * | regcache,
|  | char * | buf
| ) |  |

Definition at line 226 of file regcache.c.

References hex2bin(), regcache::registers, target_desc::registers_size, regcache::tdesc, and warning().

Referenced by process_serial_event().

## ◆ registers_to_string()

void registers_to_string | ( | struct regcache * | regcache,
|  | char * | buf
| ) |  |

Definition at line 203 of file regcache.c.

References bin2hex(), memset(), target_desc::reg_defs, REG_VALID, register_size(), regcache::register_status, regcache::registers, and regcache::tdesc.

Referenced by process_serial_event().

## ◆ supply_regblock()

void supply_regblock | ( | struct regcache * | regcache,
|  | const void * | buf
| ) |  |

Definition at line 358 of file regcache.c.

References memset(), target_desc::reg_defs, REG_UNAVAILABLE, REG_VALID, regcache::register_status, regcache::registers, target_desc::registers_size, and regcache::tdesc.

Referenced by fetch_traceframe_registers(), and get_context_regcache().

## ◆ supply_register()

void supply_register | ( | struct regcache * | regcache,
|  | int | n,
|  | const void * | buf
| ) |  |

Definition at line 318 of file regcache.c.

References memset(), REG_UNAVAILABLE, REG_VALID, register_data(), register_size(), regcache::register_status, and regcache::tdesc.

Referenced by aarch64_store_fpregset(), aarch64_store_gregset(), arm_fetch_inferior_register(), arm_store_gregset(), arm_store_vfpregset_num(), arm_store_wmmxregset(), cris_store_gregset(), i386_fetch_inferior_register(), i387_fsave_to_cache(), i387_fxsave_to_cache(), i387_xsave_to_cache(), ia64_fetch_register(), lynx_i386_store_fpregset(), lynx_ppc_store_fpregset(), lynx_ppc_store_gregset(), nios2_supply_register(), nto_fetch_registers(), ppc_store_evrregset(), ppc_store_vrregset(), ppc_store_vsxregset(), ppc_supply_ptrace_register(), s390_store_gprs_high(), s390_store_gs(), s390_store_gsbc(), s390_store_tdb(), s390_store_vxrs_high(), s390_store_vxrs_low(), s390_supply_ptrace_register(), sparc_store_fpregset(), sparc_store_gregset(), sparc_store_gregset_from_stack(), spu_fetch_registers(), supply_16bit_register(), supply_fast_tracepoint_registers(), supply_register_by_name(), tic6x_supply_register(), tile_store_gregset(), x86_store_gregset(), and xtensa_store_gregset().

## ◆ supply_register_by_name()

void supply_register_by_name | ( | struct regcache * | regcache,
|  | const char * | name,
|  | const void * | buf
| ) |  |

Definition at line 393 of file regcache.c.

References find_regno(), name, supply_register(), and regcache::tdesc.

Referenced by arm_store_vfpregset_num(), cris_insert_point(), cris_remove_point(), cris_write_data_breakpoint(), i387_fsave_to_cache(), i387_fxsave_to_cache(), i387_xsave_to_cache(), linux_set_pc_32bit(), linux_set_pc_64bit(), mips_set_pc(), ppc_set_pc(), ppc_store_evrregset(), ppc_store_vrregset(), s390_set_pc(), s390_store_last_break(), s390_store_system_call(), tic6x_set_pc(), x86_set_pc(), x86_store_gregset(), xtensa_store_gregset(), and xtensa_store_xtregset().

## ◆ supply_register_zeroed()

void supply_register_zeroed | ( | struct regcache * | regcache,
|  | int | n
| ) |  |

Definition at line 343 of file regcache.c.

References memset(), REG_VALID, register_data(), register_size(), regcache::register_status, and regcache::tdesc.

Referenced by i387_xsave_to_cache().