Handle CPU offset for Ravenscar
authorTom Tromey <tromey@adacore.com>
Tue, 17 Nov 2020 18:25:02 +0000 (11:25 -0700)
committerTom Tromey <tromey@adacore.com>
Fri, 11 Dec 2020 15:01:47 +0000 (08:01 -0700)
commita9f14fa5499a9f8d089c188f72c154de731551a0
treee22499752cf8c5f8376fe699092911e550c34d27
parentb143e2d506bee1020752597f979d5af174edc36d
Handle CPU offset for Ravenscar

The Ravenscar support assumes that the thread ID is the same as the
CPU ID that appears in the Ada task structure.  However, on some
systems, gdbserver will report thread IDs that are off by some
constant.  This can happen, e.g., with qemu in a scenario where there
is an additional (unreported) CPU in the emulation.

The Ada Ravenscar runtimes have been modified to store this offset in
a global variable.  This patch changes gdb to read this variable, when
it exists, and apply the offset to the base CPU ID.  This fixes some
crashes that otherwise occur.

2020-12-11  Tom Tromey  <tromey@adacore.com>

* ada-tasks.c (struct ada_tasks_pspace_data) <cpu_id_offset>: New
field.
(ada_get_tcb_types_info): Look for __gnat_gdb_cpu_first_id.
(read_atcb): Use cpu_id_offset.
gdb/ChangeLog
gdb/ada-tasks.c
This page took 0.023889 seconds and 4 git commands to generate.