GDB (xrefs)

Functions | Variables
/tmp/gdb-8.1/gdb/ravenscar-thread.c File Reference
`#include "defs.h"`
`#include "gdbcore.h"`
`#include "gdbthread.h"`
`#include "ada-lang.h"`
`#include "target.h"`
`#include "inferior.h"`
`#include "command.h"`
`#include "ravenscar-thread.h"`
`#include "observer.h"`
`#include "gdbcmd.h"`
`#include "top.h"`
`#include "regcache.h"`
`#include "objfiles.h"`

Go to the source code of this file.

## Functions
static void | ravenscar_update_thread_list (struct target_ops *ops)
static ptid_t | ravenscar_active_task (int cpu)
static const char * | ravenscar_extra_thread_info (struct target_ops *self, struct thread_info *tp)
static int | ravenscar_thread_alive (struct target_ops *ops, ptid_t ptid)
static void | ravenscar_fetch_registers (struct target_ops *ops, struct regcache *regcache, int regnum)
static void | ravenscar_store_registers (struct target_ops *ops, struct regcache *regcache, int regnum)
static void | ravenscar_prepare_to_store (struct target_ops *self, struct regcache *regcache)
static void | ravenscar_resume (struct target_ops *ops, ptid_t ptid, int step, enum gdb_signal siggnal)
static void | ravenscar_mourn_inferior (struct target_ops *ops)
static void | ravenscar_update_inferior_ptid (void)
static int | has_ravenscar_runtime (void)
static int | ravenscar_runtime_initialized (void)
static void | ravenscar_inferior_created (struct target_ops *target, int from_tty)
static int | is_ravenscar_task (ptid_t ptid)
static int | ravenscar_get_thread_base_cpu (ptid_t ptid)
static int | ravenscar_task_is_currently_active (ptid_t ptid)
static ptid_t | get_base_thread_from_ravenscar_task (ptid_t ptid)
static struct bound_minimal_symbol | get_running_thread_msymbol (void)
static CORE_ADDR | get_running_thread_id (int cpu)
static ptid_t | ravenscar_wait (struct target_ops *ops, ptid_t ptid, struct target_waitstatus *status, int options)
static void | ravenscar_add_thread (struct ada_task_info *task)
static const char * | ravenscar_pid_to_str (struct target_ops *ops, ptid_t ptid)
static int | ravenscar_stopped_by_sw_breakpoint (struct target_ops *ops)
static int | ravenscar_stopped_by_hw_breakpoint (struct target_ops *ops)
static int | ravenscar_stopped_by_watchpoint (struct target_ops *ops)
static int | ravenscar_stopped_data_address (struct target_ops *ops, CORE_ADDR *addr_p)
static int | ravenscar_core_of_thread (struct target_ops *ops, ptid_t ptid)
static ptid_t | ravenscar_get_ada_task_ptid (struct target_ops *self, long lwp, long thread)
static void | init_ravenscar_thread_ops (void)
static void | set_ravenscar_command (const char *arg, int from_tty)
static void | show_ravenscar_command (const char *args, int from_tty)
static void | show_ravenscar_task_switching_command (struct ui_file *file, int from_tty, struct cmd_list_element *c, const char *value)
void | _initialize_ravenscar (void)

## Variables
static int | ravenscar_task_support = 1
static struct target_ops | ravenscar_ops
static ptid_t | base_ptid
static const char | running_thread_name [] = "__gnat_running_thread_table"
static const char | known_tasks_name [] = "system__tasking__debug__known_tasks"
static const char | first_task_name [] = "system__tasking__debug__first_task"
static const char | ravenscar_runtime_initializer []
static struct cmd_list_element * | set_ravenscar_list
static struct cmd_list_element * | show_ravenscar_list

## Function Documentation

## ◆ _initialize_ravenscar()

void _initialize_ravenscar | ( | void |  | ) |

Definition at line 628 of file ravenscar-thread.c.

References _, add_prefix_cmd(), add_setshow_boolean_cmd(), base_ptid, class_obscure, complete_target_initialization(), init_ravenscar_thread_ops(), no_class, null_ptid, observer_attach_inferior_created(), ravenscar_inferior_created(), ravenscar_ops, ravenscar_task_support, set_ravenscar_command(), set_ravenscar_list, setlist, show_ravenscar_command(), show_ravenscar_list, show_ravenscar_task_switching_command(), and showlist.

## ◆ get_base_thread_from_ravenscar_task()

static ptid_t get_base_thread_from_ravenscar_task | ( | ptid_t | ptid | ) |
| static

Definition at line 167 of file ravenscar-thread.c.

References ada_task_info::base_cpu, is_ravenscar_task(), ada_task_info::ptid, ptid_build(), ptid_get_pid(), and ravenscar_get_thread_base_cpu().

Referenced by ravenscar_core_of_thread(), ravenscar_stopped_by_hw_breakpoint(), ravenscar_stopped_by_sw_breakpoint(), ravenscar_stopped_by_watchpoint(), and ravenscar_stopped_data_address().

## ◆ get_running_thread_id()

static CORE_ADDR get_running_thread_id | ( | int | cpu | ) |
| static

Definition at line 262 of file ravenscar-thread.c.

References BMSYMBOL_VALUE_ADDRESS, builtin_type::builtin_data_ptr, builtin_type(), extract_typed_address(), get_running_thread_msymbol(), bound_minimal_symbol::minsym, read_memory(), target_gdbarch(), and TYPE_LENGTH.

Referenced by ravenscar_active_task().

## ◆ get_running_thread_msymbol()

static struct bound_minimal_symbol get_running_thread_msymbol | ( | void |  | ) |
| static

Definition at line 214 of file ravenscar-thread.c.

References lookup_minimal_symbol(), and running_thread_name.

Referenced by get_running_thread_id(), and has_ravenscar_runtime().

## ◆ has_ravenscar_runtime()

static int has_ravenscar_runtime | ( | void |  | ) |
| static

Definition at line 233 of file ravenscar-thread.c.

References first_task_name, get_running_thread_msymbol(), known_tasks_name, lookup_minimal_symbol(), bound_minimal_symbol::minsym, and ravenscar_runtime_initializer.

Referenced by ravenscar_inferior_created().

## ◆ init_ravenscar_thread_ops()

static void init_ravenscar_thread_ops | ( | void |  | ) |
| static

Definition at line 555 of file ravenscar-thread.c.

References default_child_has_all_memory(), default_child_has_execution(), default_child_has_memory(), default_child_has_registers(), default_child_has_stack(), OPS_MAGIC, ravenscar_core_of_thread(), ravenscar_extra_thread_info(), ravenscar_fetch_registers(), ravenscar_get_ada_task_ptid(), ravenscar_mourn_inferior(), ravenscar_ops, ravenscar_pid_to_str(), ravenscar_prepare_to_store(), ravenscar_resume(), ravenscar_stopped_by_hw_breakpoint(), ravenscar_stopped_by_sw_breakpoint(), ravenscar_stopped_by_watchpoint(), ravenscar_stopped_data_address(), ravenscar_store_registers(), ravenscar_thread_alive(), ravenscar_update_thread_list(), ravenscar_wait(), thread_stratum, target_ops::to_core_of_thread, target_ops::to_doc, target_ops::to_extra_thread_info, target_ops::to_fetch_registers, target_ops::to_get_ada_task_ptid, target_ops::to_has_all_memory, target_ops::to_has_execution, target_ops::to_has_memory, target_ops::to_has_registers, target_ops::to_has_stack, target_ops::to_longname, target_ops::to_magic, target_ops::to_mourn_inferior, target_ops::to_pid_to_str, target_ops::to_prepare_to_store, target_ops::to_resume, target_ops::to_shortname, target_ops::to_stopped_by_hw_breakpoint, target_ops::to_stopped_by_sw_breakpoint, target_ops::to_stopped_by_watchpoint, target_ops::to_stopped_data_address, target_ops::to_store_registers, target_ops::to_stratum, target_ops::to_thread_alive, target_ops::to_update_thread_list, and target_ops::to_wait.

Referenced by _initialize_ravenscar().

## ◆ is_ravenscar_task()

static int is_ravenscar_task | ( | ptid_t | ptid | ) |
| static

Definition at line 102 of file ravenscar-thread.c.

References ptid_get_lwp(), and ptid_get_tid().

Referenced by get_base_thread_from_ravenscar_task(), ravenscar_fetch_registers(), ravenscar_get_thread_base_cpu(), ravenscar_prepare_to_store(), ravenscar_store_registers(), and ravenscar_update_inferior_ptid().

## ◆ ravenscar_active_task()

static ptid_t ravenscar_active_task | ( | int | cpu | ) |
| static

Definition at line 345 of file ravenscar-thread.c.

References base_ptid, get_running_thread_id(), null_ptid, ptid_build(), ptid_get_pid(), and selftests::ptid::tid.

Referenced by ravenscar_runtime_initialized(), ravenscar_task_is_currently_active(), and ravenscar_update_inferior_ptid().

## ◆ ravenscar_add_thread()

static void ravenscar_add_thread | ( | struct ada_task_info * | task | ) |
| static

Definition at line 325 of file ravenscar-thread.c.

References add_thread(), find_thread_ptid(), and ada_task_info::ptid.

Referenced by ravenscar_update_thread_list().

## ◆ ravenscar_core_of_thread()

static int ravenscar_core_of_thread | ( | struct target_ops * | ops,
|  | ptid_t | ptid
| ) |  |
| static

Definition at line 513 of file ravenscar-thread.c.

References target_ops::beneath, find_target_beneath(), get_base_thread_from_ravenscar_task(), inferior_ptid, and target_ops::to_core_of_thread.

Referenced by init_ravenscar_thread_ops().

## ◆ ravenscar_extra_thread_info()

static const char * ravenscar_extra_thread_info | ( | struct target_ops * | self,
|  | struct thread_info * | tp
| ) |  |
| static

Definition at line 356 of file ravenscar-thread.c.

Referenced by init_ravenscar_thread_ops().

## ◆ ravenscar_fetch_registers()

static void ravenscar_fetch_registers | ( | struct target_ops * | ops,
|  | struct regcache * | regcache,
|  | int | regnum
| ) |  |
| static

Definition at line 378 of file ravenscar-thread.c.

References regcache::arch(), target_ops::beneath, find_target_beneath(), gdbarch_ravenscar_ops(), is_ravenscar_task(), ravenscar_runtime_initialized(), ravenscar_task_is_currently_active(), regcache_get_ptid(), regnum, ravenscar_arch_ops::to_fetch_registers, and target_ops::to_fetch_registers.

Referenced by init_ravenscar_thread_ops().

## ◆ ravenscar_get_ada_task_ptid()

static ptid_t ravenscar_get_ada_task_ptid | ( | struct target_ops * | self,
|  | long | lwp,
|  | long | thread
| ) |  |
| static

Definition at line 549 of file ravenscar-thread.c.

References base_ptid, ptid_build(), and ptid_get_pid().

Referenced by init_ravenscar_thread_ops().

## ◆ ravenscar_get_thread_base_cpu()

static int ravenscar_get_thread_base_cpu | ( | ptid_t | ptid | ) |
| static

Definition at line 121 of file ravenscar-thread.c.

References ada_get_task_info_from_ptid(), ada_task_info::base_cpu, gdb_assert, is_ravenscar_task(), ada_task_info::ptid, and ptid_get_lwp().

Referenced by get_base_thread_from_ravenscar_task(), ravenscar_task_is_currently_active(), and ravenscar_update_inferior_ptid().

## ◆ ravenscar_inferior_created()

static void ravenscar_inferior_created | ( | struct target_ops * | target,
|  | int | from_tty
| ) |  |
| static

Definition at line 528 of file ravenscar-thread.c.

References _, ada_get_tcb_types_info(), gdbarch_ravenscar_ops(), has_ravenscar_runtime(), push_target(), ravenscar_ops, ravenscar_task_support, ravenscar_update_inferior_ptid(), target_gdbarch(), and warning().

Referenced by _initialize_ravenscar().

## ◆ ravenscar_mourn_inferior()

static void ravenscar_mourn_inferior | ( | struct target_ops * | ops | ) |
| static

Definition at line 501 of file ravenscar-thread.c.

References base_ptid, target_ops::beneath, find_target_beneath(), null_ptid, ravenscar_ops, target_ops::to_mourn_inferior, and unpush_target().

Referenced by init_ravenscar_thread_ops().

## ◆ ravenscar_pid_to_str()

static const char* ravenscar_pid_to_str | ( | struct target_ops * | ops,
|  | ptid_t | ptid
| ) |  |
| static

Definition at line 369 of file ravenscar-thread.c.

References ptid_get_tid().

Referenced by init_ravenscar_thread_ops().

## ◆ ravenscar_prepare_to_store()

static void ravenscar_prepare_to_store | ( | struct target_ops * | self,
|  | struct regcache * | regcache
| ) |  |
| static

Definition at line 420 of file ravenscar-thread.c.

References regcache::arch(), target_ops::beneath, find_target_beneath(), gdbarch_ravenscar_ops(), is_ravenscar_task(), ravenscar_runtime_initialized(), ravenscar_task_is_currently_active(), regcache_get_ptid(), ravenscar_arch_ops::to_prepare_to_store, and target_ops::to_prepare_to_store.

Referenced by init_ravenscar_thread_ops().

## ◆ ravenscar_resume()

static void ravenscar_resume | ( | struct target_ops * | ops,
|  | ptid_t | ptid,
|  | int | step,
|  | enum gdb_signal | siggnal
| ) |  |
| static

Definition at line 285 of file ravenscar-thread.c.

References base_ptid, target_ops::beneath, find_target_beneath(), inferior_ptid, and target_ops::to_resume.

Referenced by init_ravenscar_thread_ops().

## ◆ ravenscar_runtime_initialized()

static int ravenscar_runtime_initialized | ( | void |  | ) |
| static

Definition at line 253 of file ravenscar-thread.c.

References null_ptid, ptid_equal(), and ravenscar_active_task().

Referenced by ravenscar_fetch_registers(), ravenscar_prepare_to_store(), ravenscar_store_registers(), and ravenscar_update_inferior_ptid().

## ◆ ravenscar_stopped_by_hw_breakpoint()

static int ravenscar_stopped_by_hw_breakpoint | ( | struct target_ops * | ops | ) |
| static

Definition at line 458 of file ravenscar-thread.c.

References target_ops::beneath, find_target_beneath(), get_base_thread_from_ravenscar_task(), inferior_ptid, and target_ops::to_stopped_by_hw_breakpoint.

Referenced by init_ravenscar_thread_ops().

## ◆ ravenscar_stopped_by_sw_breakpoint()

static int ravenscar_stopped_by_sw_breakpoint | ( | struct target_ops * | ops | ) |
| static

Definition at line 443 of file ravenscar-thread.c.

References target_ops::beneath, find_target_beneath(), get_base_thread_from_ravenscar_task(), inferior_ptid, and target_ops::to_stopped_by_sw_breakpoint.

Referenced by init_ravenscar_thread_ops().

## ◆ ravenscar_stopped_by_watchpoint()

static int ravenscar_stopped_by_watchpoint | ( | struct target_ops * | ops | ) |
| static

Definition at line 473 of file ravenscar-thread.c.

References target_ops::beneath, find_target_beneath(), get_base_thread_from_ravenscar_task(), inferior_ptid, and target_ops::to_stopped_by_watchpoint.

Referenced by init_ravenscar_thread_ops().

## ◆ ravenscar_stopped_data_address()

static int ravenscar_stopped_data_address | ( | struct target_ops * | ops,
|  | CORE_ADDR * | addr_p
| ) |  |
| static

Definition at line 488 of file ravenscar-thread.c.

References target_ops::beneath, find_target_beneath(), get_base_thread_from_ravenscar_task(), inferior_ptid, and target_ops::to_stopped_data_address.

Referenced by init_ravenscar_thread_ops().

## ◆ ravenscar_store_registers()

static void ravenscar_store_registers | ( | struct target_ops * | ops,
|  | struct regcache * | regcache,
|  | int | regnum
| ) |  |
| static

Definition at line 399 of file ravenscar-thread.c.

References regcache::arch(), target_ops::beneath, find_target_beneath(), gdbarch_ravenscar_ops(), is_ravenscar_task(), ravenscar_runtime_initialized(), ravenscar_task_is_currently_active(), regcache_get_ptid(), regnum, ravenscar_arch_ops::to_store_registers, and target_ops::to_store_registers.

Referenced by init_ravenscar_thread_ops().

## ◆ ravenscar_task_is_currently_active()

static int ravenscar_task_is_currently_active | ( | ptid_t | ptid | ) |
| static

Definition at line 152 of file ravenscar-thread.c.

References ada_task_info::ptid, ptid_equal(), ravenscar_active_task(), and ravenscar_get_thread_base_cpu().

Referenced by ravenscar_fetch_registers(), ravenscar_prepare_to_store(), and ravenscar_store_registers().

## ◆ ravenscar_thread_alive()

static int ravenscar_thread_alive | ( | struct target_ops * | ops,
|  | ptid_t | ptid
| ) |  |
| static

Definition at line 362 of file ravenscar-thread.c.

Referenced by init_ravenscar_thread_ops().

## ◆ ravenscar_update_inferior_ptid()

static void ravenscar_update_inferior_ptid | ( | void |  | ) |
| static

Definition at line 182 of file ravenscar-thread.c.

References add_thread(), ada_task_info::base_cpu, base_ptid, find_thread_ptid(), gdb_assert, inferior_ptid, is_ravenscar_task(), null_ptid, ptid_equal(), ravenscar_active_task(), ravenscar_get_thread_base_cpu(), and ravenscar_runtime_initialized().

Referenced by ravenscar_inferior_created(), and ravenscar_wait().

## ◆ ravenscar_update_thread_list()

static void ravenscar_update_thread_list | ( | struct target_ops * | ops | ) |
| static

Definition at line 332 of file ravenscar-thread.c.

References ada_build_task_list(), iterate_over_live_ada_tasks(), and ravenscar_add_thread().

Referenced by init_ravenscar_thread_ops(), and ravenscar_wait().

## ◆ ravenscar_wait()

static ptid_t ravenscar_wait | ( | struct target_ops * | ops,
|  | ptid_t | ptid,
|  | struct target_waitstatus * | status,
|  | int | options
| ) |  |
| static

Definition at line 295 of file ravenscar-thread.c.

References base_ptid, target_ops::beneath, find_target_beneath(), inferior_ptid, ravenscar_update_inferior_ptid(), ravenscar_update_thread_list(), status, TARGET_WAITKIND_EXITED, TARGET_WAITKIND_SIGNALLED, and target_ops::to_wait.

Referenced by init_ravenscar_thread_ops().

## ◆ set_ravenscar_command()

static void set_ravenscar_command | ( | const char * | arg,
|  | int | from_tty
| ) |  |
| static

Definition at line 594 of file ravenscar-thread.c.

References _, all_commands, gdb_stdout, help_list(), printf_unfiltered(), and set_ravenscar_list.

Referenced by _initialize_ravenscar().

## ◆ show_ravenscar_command()

static void show_ravenscar_command | ( | const char * | args,
|  | int | from_tty
| ) |  |
| static

Definition at line 604 of file ravenscar-thread.c.

References cmd_show_list(), and show_ravenscar_list.

Referenced by _initialize_ravenscar().

## ◆ show_ravenscar_task_switching_command()

static void show_ravenscar_task_switching_command | ( | struct ui_file * | file,
|  | int | from_tty,
|  | struct cmd_list_element * | c,
|  | const char * | value
| ) |  |
| static

Definition at line 612 of file ravenscar-thread.c.

References _, fprintf_filtered(), and ravenscar_task_support.

Referenced by _initialize_ravenscar().

## Variable Documentation

## ◆ base_ptid

ptid_t base_ptid
| static

Definition at line 69 of file ravenscar-thread.c.

Referenced by _initialize_ravenscar(), ravenscar_active_task(), ravenscar_get_ada_task_ptid(), ravenscar_mourn_inferior(), ravenscar_resume(), ravenscar_update_inferior_ptid(), and ravenscar_wait().

## ◆ first_task_name

const char first_task_name[] = "system__tasking__debug__first_task"
| static

Definition at line 74 of file ravenscar-thread.c.

Referenced by has_ravenscar_runtime().

## ◆ known_tasks_name

const char known_tasks_name[] = "system__tasking__debug__known_tasks"
| static

Definition at line 73 of file ravenscar-thread.c.

Referenced by has_ravenscar_runtime().

## ◆ ravenscar_ops

struct target_ops ravenscar_ops
| static

Definition at line 64 of file ravenscar-thread.c.

Referenced by _initialize_ravenscar(), init_ravenscar_thread_ops(), ravenscar_inferior_created(), ravenscar_mourn_inferior(), and set_gdbarch_ravenscar_ops().

## ◆ ravenscar_runtime_initializer

const char ravenscar_runtime_initializer[]
| static

Initial value:
=
"system__bb__threads__initialize"

Definition at line 76 of file ravenscar-thread.c.

Referenced by has_ravenscar_runtime().

## ◆ ravenscar_task_support

int ravenscar_task_support = 1
| static

Definition at line 61 of file ravenscar-thread.c.

Referenced by _initialize_ravenscar(), ravenscar_inferior_created(), and show_ravenscar_task_switching_command().

## ◆ running_thread_name

const char running_thread_name[] = "__gnat_running_thread_table"
| static

Definition at line 71 of file ravenscar-thread.c.

Referenced by get_running_thread_msymbol().

## ◆ set_ravenscar_list

struct cmd_list_element* set_ravenscar_list
| static

Definition at line 588 of file ravenscar-thread.c.

Referenced by _initialize_ravenscar(), and set_ravenscar_command().

## ◆ show_ravenscar_list

struct cmd_list_element* show_ravenscar_list
| static

Definition at line 589 of file ravenscar-thread.c.

Referenced by _initialize_ravenscar(), and show_ravenscar_command().