2010-09-28 23:39:31 +02:00
|
|
|
/* Ravenscar SPARC target support.
|
|
|
|
|
2019-01-01 07:01:51 +01:00
|
|
|
Copyright (C) 2004-2019 Free Software Foundation, Inc.
|
2010-09-28 23:39:31 +02:00
|
|
|
|
|
|
|
This file is part of GDB.
|
|
|
|
|
|
|
|
This program is free software; you can redistribute it and/or modify
|
|
|
|
it under the terms of the GNU General Public License as published by
|
|
|
|
the Free Software Foundation; either version 3 of the License, or
|
|
|
|
(at your option) any later version.
|
|
|
|
|
|
|
|
This program is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
GNU General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
|
|
along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
|
|
|
|
|
|
|
#include "defs.h"
|
|
|
|
#include "gdbcore.h"
|
|
|
|
#include "regcache.h"
|
|
|
|
#include "sparc-tdep.h"
|
|
|
|
#include "inferior.h"
|
|
|
|
#include "ravenscar-thread.h"
|
2012-12-15 15:29:00 +01:00
|
|
|
#include "sparc-ravenscar-thread.h"
|
Don't include gdbarch.h from defs.h
I touched symtab.h and was surprised to see how many files were
rebuilt. I looked into it a bit, and found that defs.h includes
gdbarch.h, which in turn includes many things.
gdbarch.h is only needed by a minority ofthe files in gdb, so this
patch removes the include from defs.h and updates the fallout.
I did "wc -l" on the files in build/gdb/.deps; this patch reduces the
line count from 139935 to 137030; so there are definitely future
build-time savings here.
Note that while I configured with --enable-targets=all, it's possible
that some *-nat.c file needs an update. I could not test all of
these. The buildbot caught a few problems along these lines.
gdb/ChangeLog
2019-07-10 Tom Tromey <tom@tromey.com>
* defs.h: Don't include gdbarch.h.
* aarch64-ravenscar-thread.c, aarch64-tdep.c, alpha-bsd-tdep.h,
alpha-linux-tdep.c, alpha-mdebug-tdep.c, arch-utils.h, arm-tdep.h,
ax-general.c, btrace.c, buildsym-legacy.c, buildsym.h, c-lang.c,
cli/cli-decode.h, cli/cli-dump.c, cli/cli-script.h,
cli/cli-style.h, coff-pe-read.h, compile/compile-c-support.c,
compile/compile-cplus.h, compile/compile-loc2c.c, corefile.c,
cp-valprint.c, cris-linux-tdep.c, ctf.c, d-lang.c, d-namespace.c,
dcache.c, dicos-tdep.c, dictionary.c, disasm-selftests.c,
dummy-frame.c, dummy-frame.h, dwarf2-frame-tailcall.c,
dwarf2expr.c, expression.h, f-lang.c, frame-base.c,
frame-unwind.c, frv-linux-tdep.c, gdbarch-selftests.c, gdbtypes.h,
go-lang.c, hppa-nbsd-tdep.c, hppa-obsd-tdep.c, i386-dicos-tdep.c,
i386-tdep.h, ia64-vms-tdep.c, interps.h, language.c,
linux-record.c, location.h, m2-lang.c, m32r-linux-tdep.c,
mem-break.c, memattr.c, mn10300-linux-tdep.c, nios2-linux-tdep.c,
objfiles.h, opencl-lang.c, or1k-linux-tdep.c, p-lang.c,
parser-defs.h, ppc-tdep.h, probe.h, python/py-record-btrace.c,
record-btrace.c, record.h, regcache-dump.c, regcache.h,
riscv-fbsd-tdep.c, riscv-linux-tdep.c, rust-exp.y,
sh-linux-tdep.c, sh-nbsd-tdep.c, source-cache.c,
sparc-nbsd-tdep.c, sparc-obsd-tdep.c, sparc-ravenscar-thread.c,
sparc64-fbsd-tdep.c, std-regs.c, target-descriptions.h,
target-float.c, tic6x-linux-tdep.c, tilegx-linux-tdep.c, top.c,
tracefile.c, trad-frame.c, type-stack.h, ui-style.c, utils.c,
utils.h, valarith.c, valprint.c, varobj.c, x86-tdep.c,
xml-support.h, xtensa-linux-tdep.c, cli/cli-cmds.h: Update.
* s390-linux-nat.c, procfs.c, inf-ptrace.c: Likewise.
2019-06-09 23:21:02 +02:00
|
|
|
#include "gdbarch.h"
|
2010-09-28 23:39:31 +02:00
|
|
|
|
2019-02-05 11:08:02 +01:00
|
|
|
struct sparc_ravenscar_ops : public ravenscar_arch_ops
|
|
|
|
{
|
|
|
|
void fetch_registers (struct regcache *, int) override;
|
|
|
|
void store_registers (struct regcache *, int) override;
|
|
|
|
};
|
2010-09-28 23:39:31 +02:00
|
|
|
|
|
|
|
/* Register offsets from a referenced address (exempli gratia the
|
2011-01-10 21:38:51 +01:00
|
|
|
Thread_Descriptor). The referenced address depends on the register
|
|
|
|
number. The Thread_Descriptor layout and the stack layout are documented
|
2010-09-28 23:39:31 +02:00
|
|
|
in the GNAT sources, in sparc-bb.h. */
|
|
|
|
|
|
|
|
static const int sparc_register_offsets[] =
|
|
|
|
{
|
|
|
|
/* G0 - G7 */
|
|
|
|
-1, 0x24, 0x28, 0x2C, 0x30, 0x34, 0x38, 0x3C,
|
|
|
|
/* O0 - O7 */
|
|
|
|
0x00, 0x04, 0x08, 0x0C, 0x10, 0x14, 0x18, 0x1C,
|
|
|
|
/* L0 - L7 */
|
|
|
|
0x00, 0x04, 0x08, 0x0C, 0x10, 0x14, 0x18, 0x1C,
|
|
|
|
/* I0 - I7 */
|
|
|
|
0x20, 0x24, 0x28, 0x2C, 0x30, 0x34, 0x38, 0x3C,
|
|
|
|
/* F0 - F31 */
|
|
|
|
0x50, 0x54, 0x58, 0x5C, 0x60, 0x64, 0x68, 0x6C,
|
|
|
|
0x70, 0x74, 0x78, 0x7C, 0x80, 0x84, 0x88, 0x8C,
|
|
|
|
0x90, 0x94, 0x99, 0x9C, 0xA0, 0xA4, 0xA8, 0xAC,
|
|
|
|
0xB0, 0xB4, 0xBB, 0xBC, 0xC0, 0xC4, 0xC8, 0xCC,
|
|
|
|
/* Y PSR WIM TBR PC NPC FPSR CPSR */
|
|
|
|
0x40, 0x20, 0x44, -1, 0x1C, -1, 0x4C, -1
|
|
|
|
};
|
|
|
|
|
|
|
|
/* supply register REGNUM, which has been saved on REGISTER_ADDR, to the
|
|
|
|
regcache. */
|
|
|
|
|
|
|
|
static void
|
|
|
|
supply_register_at_address (struct regcache *regcache, int regnum,
|
|
|
|
CORE_ADDR register_addr)
|
|
|
|
{
|
2017-10-25 17:37:03 +02:00
|
|
|
struct gdbarch *gdbarch = regcache->arch ();
|
2010-09-28 23:39:31 +02:00
|
|
|
int buf_size = register_size (gdbarch, regnum);
|
-Wpointer-sign: char -> gdb_byte.
-Wpointer-sign catches all these cases across the codebase that should
be using gdb_byte for raw target bytes. I think these are all
obvious, hence I've collapsed into a single patch.
gdb/
2013-04-19 Pedro Alves <palves@redhat.com>
* aarch64-tdep.c (aarch64_default_breakpoint): Change type to
gdb_byte[].
(aarch64_breakpoint_from_pc): Change return type to gdb_byte *.
* ada-lang.c (ada_value_assign): Use gdb_byte.
* alphanbsd-tdep.c (sigtramp_retcode): Change type to gdb_byte[].
(alphanbsd_sigtramp_offset): Use gdb_byte.
* arm-linux-tdep.c (arm_linux_arm_le_breakpoint)
(arm_linux_arm_be_breakpoint, eabi_linux_arm_le_breakpoint)
(eabi_linux_arm_be_breakpoint, arm_linux_thumb_be_breakpoint)
(arm_linux_thumb_le_breakpoint, arm_linux_thumb2_be_breakpoint)
(arm_linux_thumb2_le_breakpoint): Change type to gdb_byte[].
* arm-tdep.c (arm_stub_unwind_sniffer)
(arm_displaced_init_closure): Use gdb_byte.
(arm_default_arm_le_breakpoint, arm_default_arm_be_breakpoint)
(arm_default_thumb_le_breakpoint)
(arm_default_thumb_be_breakpoint): Change type to gdb_byte[].
* arm-tdep.h (struct gdbarch_tdep) <arm_breakpoint,
thumb_breakpoint, thumb2_breakpoint>: Change type to gdb_byte *.
* arm-wince-tdep.c (arm_wince_le_breakpoint)
(arm_wince_thumb_le_breakpoint): Change type to gdb_byte[].
* armnbsd-tdep.c (arm_nbsd_arm_le_breakpoint)
(arm_nbsd_arm_be_breakpoint, arm_nbsd_thumb_le_breakpoint)
(arm_nbsd_thumb_be_breakpoint): Change type to gdb_byte[].
* armobsd-tdep.c (arm_obsd_thumb_le_breakpoint)
(arm_obsd_thumb_be_breakpoint): Change type to gdb_byte[].
* cris-tdep.c (push_stack_item, cris_push_dummy_call)
(cris_store_return_value, cris_extract_return_value): Use
gdb_byte.
(constraint): Change type of parameter to char * from signed
char*. Use gdb_byte.
* dwarf2loc.c (read_pieced_value, write_pieced_value): Change type
of local buffer to gdb_byte *.
* dwarf2read.c (read_index_from_section): Use gdb_byte.
(create_dwp_hash_table): Change type of locals to gdb_byte *.
(add_address_entry): Change type of local buffer to gdb_byte[].
* frv-tdep.c (frv_adjust_breakpoint_address, find_func_descr)
(frv_push_dummy_call): Use gdb_byte.
* hppa-hpux-tdep.c (hppa_hpux_push_dummy_code)
(hppa_hpux_supply_ss_fpblock, hppa_hpux_supply_ss_wide)
(hppa_hpux_supply_save_state): Use gdb_byte.
* hppa-tdep.c (hppa32_push_dummy_call)
(hppa64_convert_code_addr_to_fptr): Use gdb_byte.
* ia64-tdep.c (extract_bit_field, replace_bit_field)
(slotN_contents, replace_slotN_contents): Change type of parameter
to gdb_byte *.
(fetch_instruction, ia64_pseudo_register_write)
(ia64_register_to_value, ia64_value_to_register)
(ia64_extract_return_value, ia64_store_return_value)
(ia64_push_dummy_call): Use gdb_byte.
* m32c-tdep.c (m32c_return_value): Remove cast.
* m68hc11-tdep.c (m68hc11_pseudo_register_write)
(m68hc11_push_dummy_call, m68hc11_store_return_value): Use
gdb_byte.
* mipsnbsd-tdep.c (mipsnbsd_get_longjmp_target): Use gdb_byte.
* mn10300-tdep.c (mn10300_store_return_value)
(mn10300_breakpoint_from_pc, mn10300_push_dummy_call): Use
gdb_byte.
* moxie-tdep.c (moxie_process_readu): Use gdb_byte.
(moxie_process_record): Remove casts.
* ppc-ravenscar-thread.c (supply_register_at_address)
(ppc_ravenscar_generic_store_registers): Use gdb_byte.
* ravenscar-thread.c (get_running_thread_id): Use gdb_byte.
* remote-m32r-sdi.c (m32r_fetch_register): Use gdb_byte.
* remote-mips.c (mips_xfer_memory): Use gdb_byte.
* remote.c (compare_sections_command): Use gdb_byte.
* score-tdep.c (score7_free_memblock): Change type of parameter to
gdb_byte *.
* sh-tdep.c (sh_justify_value_in_reg): Change return type to
gdb_byte *. Use gdb_byte.
(sh_push_dummy_call_fpu): Use gdb_byte.
(sh_extract_return_value_nofpu, sh_extract_return_value_fpu)
(sh_store_return_value_nofpu, sh_store_return_value_fpu)
(sh_register_convert_to_virtual, sh_register_convert_to_raw):
Change parameter type to 'gdb_byte *'. Use gdb_byte.
(sh_pseudo_register_read, sh_pseudo_register_write): Use gdb_byte.
* sh64-tdep.c (sh64_push_dummy_call): Use gdb_byte.
(sh64_store_return_value, sh64_register_convert_to_virtual):
Change parameter type to 'gdb_byte *'. Use gdb_byte.
(sh64_pseudo_register_write): Use gdb_byte.
* solib-darwin.c (darwin_current_sos): Add casts to 'gdb_byte *'.
* solib-irix.c (fetch_lm_info): Likewise. Use gdb_byte for byte
buffer.
(irix_current_sos): Use gdb_byte.
* solib-som.c (som_current_sos): Use gdb_byte.
* sparc-ravenscar-thread.c (supply_register_at_address)
(sparc_ravenscar_generic_store_registers): Use gdb_byte.
* spu-multiarch.c (spu_xfer_partial): Add cast to 'char *'.
* spu-tdep.c (spu_get_overlay_table): Use gdb_byte.
* tic6x-tdep.c (tic6x_breakpoint_from_pc): Change return type to
'gdb_byte *'.
* tic6x-tdep.h (struct gdbarch_tdep) <breakpoint>: Change type to
'gdb_byte *'.
* tracepoint.c (tfile_fetch_registers): Use gdb_byte.
* xstormy16-tdep.c (xstormy16_extract_return_value)
(xstormy16_store_return_value): Change parameter type to
'gdb_byte *'. Adjust.
(xstormy16_push_dummy_call): Use gdb_byte.
* xtensa-tdep.c (xtensa_scan_prologue, call0_ret)
(call0_analyze_prologue, execute_code): Use gdb_byte.
2013-04-19 17:09:46 +02:00
|
|
|
gdb_byte *buf;
|
2010-09-28 23:39:31 +02:00
|
|
|
|
2015-09-25 20:08:06 +02:00
|
|
|
buf = (gdb_byte *) alloca (buf_size);
|
2010-09-28 23:39:31 +02:00
|
|
|
read_memory (register_addr, buf, buf_size);
|
2018-05-30 20:54:45 +02:00
|
|
|
regcache->raw_supply (regnum, buf);
|
2010-09-28 23:39:31 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
/* Return true if, for a non-running thread, REGNUM has been saved on the
|
|
|
|
stack. */
|
|
|
|
|
|
|
|
static int
|
|
|
|
register_on_stack_p (int regnum)
|
|
|
|
{
|
|
|
|
return (regnum >= SPARC_L0_REGNUM && regnum <= SPARC_L7_REGNUM)
|
|
|
|
|| (regnum >= SPARC_I0_REGNUM && regnum <= SPARC_I7_REGNUM);
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Return true if, for a non-running thread, REGNUM has been saved on the
|
|
|
|
Thread_Descriptor. */
|
|
|
|
|
|
|
|
static int
|
|
|
|
register_in_thread_descriptor_p (int regnum)
|
|
|
|
{
|
|
|
|
return (regnum >= SPARC_O0_REGNUM && regnum <= SPARC_O7_REGNUM)
|
|
|
|
|| (regnum == SPARC32_PSR_REGNUM)
|
|
|
|
|| (regnum >= SPARC_G1_REGNUM && regnum <= SPARC_G7_REGNUM)
|
|
|
|
|| (regnum == SPARC32_Y_REGNUM)
|
|
|
|
|| (regnum == SPARC32_WIM_REGNUM)
|
|
|
|
|| (regnum == SPARC32_FSR_REGNUM)
|
|
|
|
|| (regnum >= SPARC_F0_REGNUM && regnum <= SPARC_F0_REGNUM + 31)
|
|
|
|
|| (regnum == SPARC32_PC_REGNUM);
|
|
|
|
}
|
|
|
|
|
|
|
|
/* to_fetch_registers when inferior_ptid is different from the running
|
|
|
|
thread. */
|
|
|
|
|
2019-02-05 11:08:02 +01:00
|
|
|
void
|
|
|
|
sparc_ravenscar_ops::fetch_registers (struct regcache *regcache, int regnum)
|
2010-09-28 23:39:31 +02:00
|
|
|
{
|
2017-10-25 17:37:03 +02:00
|
|
|
struct gdbarch *gdbarch = regcache->arch ();
|
2010-09-28 23:39:31 +02:00
|
|
|
const int sp_regnum = gdbarch_sp_regnum (gdbarch);
|
|
|
|
const int num_regs = gdbarch_num_regs (gdbarch);
|
|
|
|
int current_regnum;
|
|
|
|
CORE_ADDR current_address;
|
|
|
|
CORE_ADDR thread_descriptor_address;
|
|
|
|
ULONGEST stack_address;
|
|
|
|
|
2012-10-24 21:08:16 +02:00
|
|
|
/* The tid is the thread_id field, which is a pointer to the thread. */
|
2018-06-11 20:14:34 +02:00
|
|
|
thread_descriptor_address = (CORE_ADDR) inferior_ptid.tid ();
|
2012-10-24 21:08:16 +02:00
|
|
|
|
|
|
|
/* Read the saved SP in the context buffer. */
|
2010-09-28 23:39:31 +02:00
|
|
|
current_address = thread_descriptor_address
|
|
|
|
+ sparc_register_offsets [sp_regnum];
|
|
|
|
supply_register_at_address (regcache, sp_regnum, current_address);
|
|
|
|
regcache_cooked_read_unsigned (regcache, sp_regnum, &stack_address);
|
|
|
|
|
2012-10-24 21:08:16 +02:00
|
|
|
/* Read registers. */
|
2010-09-28 23:39:31 +02:00
|
|
|
for (current_regnum = 0; current_regnum < num_regs; current_regnum ++)
|
|
|
|
{
|
|
|
|
if (register_in_thread_descriptor_p (current_regnum))
|
|
|
|
{
|
|
|
|
current_address = thread_descriptor_address
|
|
|
|
+ sparc_register_offsets [current_regnum];
|
|
|
|
supply_register_at_address (regcache, current_regnum,
|
|
|
|
current_address);
|
|
|
|
}
|
|
|
|
else if (register_on_stack_p (current_regnum))
|
|
|
|
{
|
|
|
|
current_address = stack_address
|
|
|
|
+ sparc_register_offsets [current_regnum];
|
|
|
|
supply_register_at_address (regcache, current_regnum,
|
|
|
|
current_address);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/* to_store_registers when inferior_ptid is different from the running
|
|
|
|
thread. */
|
|
|
|
|
2019-02-05 11:08:02 +01:00
|
|
|
void
|
|
|
|
sparc_ravenscar_ops::store_registers (struct regcache *regcache, int regnum)
|
2010-09-28 23:39:31 +02:00
|
|
|
{
|
2017-10-25 17:37:03 +02:00
|
|
|
struct gdbarch *gdbarch = regcache->arch ();
|
2010-09-28 23:39:31 +02:00
|
|
|
int buf_size = register_size (gdbarch, regnum);
|
-Wpointer-sign: char -> gdb_byte.
-Wpointer-sign catches all these cases across the codebase that should
be using gdb_byte for raw target bytes. I think these are all
obvious, hence I've collapsed into a single patch.
gdb/
2013-04-19 Pedro Alves <palves@redhat.com>
* aarch64-tdep.c (aarch64_default_breakpoint): Change type to
gdb_byte[].
(aarch64_breakpoint_from_pc): Change return type to gdb_byte *.
* ada-lang.c (ada_value_assign): Use gdb_byte.
* alphanbsd-tdep.c (sigtramp_retcode): Change type to gdb_byte[].
(alphanbsd_sigtramp_offset): Use gdb_byte.
* arm-linux-tdep.c (arm_linux_arm_le_breakpoint)
(arm_linux_arm_be_breakpoint, eabi_linux_arm_le_breakpoint)
(eabi_linux_arm_be_breakpoint, arm_linux_thumb_be_breakpoint)
(arm_linux_thumb_le_breakpoint, arm_linux_thumb2_be_breakpoint)
(arm_linux_thumb2_le_breakpoint): Change type to gdb_byte[].
* arm-tdep.c (arm_stub_unwind_sniffer)
(arm_displaced_init_closure): Use gdb_byte.
(arm_default_arm_le_breakpoint, arm_default_arm_be_breakpoint)
(arm_default_thumb_le_breakpoint)
(arm_default_thumb_be_breakpoint): Change type to gdb_byte[].
* arm-tdep.h (struct gdbarch_tdep) <arm_breakpoint,
thumb_breakpoint, thumb2_breakpoint>: Change type to gdb_byte *.
* arm-wince-tdep.c (arm_wince_le_breakpoint)
(arm_wince_thumb_le_breakpoint): Change type to gdb_byte[].
* armnbsd-tdep.c (arm_nbsd_arm_le_breakpoint)
(arm_nbsd_arm_be_breakpoint, arm_nbsd_thumb_le_breakpoint)
(arm_nbsd_thumb_be_breakpoint): Change type to gdb_byte[].
* armobsd-tdep.c (arm_obsd_thumb_le_breakpoint)
(arm_obsd_thumb_be_breakpoint): Change type to gdb_byte[].
* cris-tdep.c (push_stack_item, cris_push_dummy_call)
(cris_store_return_value, cris_extract_return_value): Use
gdb_byte.
(constraint): Change type of parameter to char * from signed
char*. Use gdb_byte.
* dwarf2loc.c (read_pieced_value, write_pieced_value): Change type
of local buffer to gdb_byte *.
* dwarf2read.c (read_index_from_section): Use gdb_byte.
(create_dwp_hash_table): Change type of locals to gdb_byte *.
(add_address_entry): Change type of local buffer to gdb_byte[].
* frv-tdep.c (frv_adjust_breakpoint_address, find_func_descr)
(frv_push_dummy_call): Use gdb_byte.
* hppa-hpux-tdep.c (hppa_hpux_push_dummy_code)
(hppa_hpux_supply_ss_fpblock, hppa_hpux_supply_ss_wide)
(hppa_hpux_supply_save_state): Use gdb_byte.
* hppa-tdep.c (hppa32_push_dummy_call)
(hppa64_convert_code_addr_to_fptr): Use gdb_byte.
* ia64-tdep.c (extract_bit_field, replace_bit_field)
(slotN_contents, replace_slotN_contents): Change type of parameter
to gdb_byte *.
(fetch_instruction, ia64_pseudo_register_write)
(ia64_register_to_value, ia64_value_to_register)
(ia64_extract_return_value, ia64_store_return_value)
(ia64_push_dummy_call): Use gdb_byte.
* m32c-tdep.c (m32c_return_value): Remove cast.
* m68hc11-tdep.c (m68hc11_pseudo_register_write)
(m68hc11_push_dummy_call, m68hc11_store_return_value): Use
gdb_byte.
* mipsnbsd-tdep.c (mipsnbsd_get_longjmp_target): Use gdb_byte.
* mn10300-tdep.c (mn10300_store_return_value)
(mn10300_breakpoint_from_pc, mn10300_push_dummy_call): Use
gdb_byte.
* moxie-tdep.c (moxie_process_readu): Use gdb_byte.
(moxie_process_record): Remove casts.
* ppc-ravenscar-thread.c (supply_register_at_address)
(ppc_ravenscar_generic_store_registers): Use gdb_byte.
* ravenscar-thread.c (get_running_thread_id): Use gdb_byte.
* remote-m32r-sdi.c (m32r_fetch_register): Use gdb_byte.
* remote-mips.c (mips_xfer_memory): Use gdb_byte.
* remote.c (compare_sections_command): Use gdb_byte.
* score-tdep.c (score7_free_memblock): Change type of parameter to
gdb_byte *.
* sh-tdep.c (sh_justify_value_in_reg): Change return type to
gdb_byte *. Use gdb_byte.
(sh_push_dummy_call_fpu): Use gdb_byte.
(sh_extract_return_value_nofpu, sh_extract_return_value_fpu)
(sh_store_return_value_nofpu, sh_store_return_value_fpu)
(sh_register_convert_to_virtual, sh_register_convert_to_raw):
Change parameter type to 'gdb_byte *'. Use gdb_byte.
(sh_pseudo_register_read, sh_pseudo_register_write): Use gdb_byte.
* sh64-tdep.c (sh64_push_dummy_call): Use gdb_byte.
(sh64_store_return_value, sh64_register_convert_to_virtual):
Change parameter type to 'gdb_byte *'. Use gdb_byte.
(sh64_pseudo_register_write): Use gdb_byte.
* solib-darwin.c (darwin_current_sos): Add casts to 'gdb_byte *'.
* solib-irix.c (fetch_lm_info): Likewise. Use gdb_byte for byte
buffer.
(irix_current_sos): Use gdb_byte.
* solib-som.c (som_current_sos): Use gdb_byte.
* sparc-ravenscar-thread.c (supply_register_at_address)
(sparc_ravenscar_generic_store_registers): Use gdb_byte.
* spu-multiarch.c (spu_xfer_partial): Add cast to 'char *'.
* spu-tdep.c (spu_get_overlay_table): Use gdb_byte.
* tic6x-tdep.c (tic6x_breakpoint_from_pc): Change return type to
'gdb_byte *'.
* tic6x-tdep.h (struct gdbarch_tdep) <breakpoint>: Change type to
'gdb_byte *'.
* tracepoint.c (tfile_fetch_registers): Use gdb_byte.
* xstormy16-tdep.c (xstormy16_extract_return_value)
(xstormy16_store_return_value): Change parameter type to
'gdb_byte *'. Adjust.
(xstormy16_push_dummy_call): Use gdb_byte.
* xtensa-tdep.c (xtensa_scan_prologue, call0_ret)
(call0_analyze_prologue, execute_code): Use gdb_byte.
2013-04-19 17:09:46 +02:00
|
|
|
gdb_byte buf[buf_size];
|
2010-09-28 23:39:31 +02:00
|
|
|
ULONGEST register_address;
|
|
|
|
|
|
|
|
if (register_in_thread_descriptor_p (regnum))
|
|
|
|
register_address =
|
2018-06-11 20:14:34 +02:00
|
|
|
inferior_ptid.tid () + sparc_register_offsets [regnum];
|
2010-09-28 23:39:31 +02:00
|
|
|
else if (register_on_stack_p (regnum))
|
|
|
|
{
|
|
|
|
regcache_cooked_read_unsigned (regcache, SPARC_SP_REGNUM,
|
|
|
|
®ister_address);
|
|
|
|
register_address += sparc_register_offsets [regnum];
|
|
|
|
}
|
|
|
|
else
|
|
|
|
return;
|
|
|
|
|
2018-05-30 20:54:46 +02:00
|
|
|
regcache->raw_collect (regnum, buf);
|
2010-09-28 23:39:31 +02:00
|
|
|
write_memory (register_address,
|
|
|
|
buf,
|
|
|
|
buf_size);
|
|
|
|
}
|
|
|
|
|
2019-02-05 11:08:02 +01:00
|
|
|
static struct sparc_ravenscar_ops sparc_ravenscar_ops;
|
2012-12-15 15:27:56 +01:00
|
|
|
|
|
|
|
/* Register ravenscar_arch_ops in GDBARCH. */
|
2012-03-09 01:31:15 +01:00
|
|
|
|
2010-09-28 23:39:31 +02:00
|
|
|
void
|
2012-12-15 15:27:56 +01:00
|
|
|
register_sparc_ravenscar_ops (struct gdbarch *gdbarch)
|
2010-09-28 23:39:31 +02:00
|
|
|
{
|
2012-12-15 15:29:31 +01:00
|
|
|
set_gdbarch_ravenscar_ops (gdbarch, &sparc_ravenscar_ops);
|
2010-09-28 23:39:31 +02:00
|
|
|
}
|