1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-05 09:14:03 +00:00

Add thread support for arm.

MFC After:	1 week
This commit is contained in:
Olivier Houchard 2007-11-17 21:30:03 +00:00
parent f0aa484471
commit 796677a89e
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=173705
4 changed files with 40 additions and 5 deletions

View File

@ -2,7 +2,7 @@
GENSRCS+= xm.h
LIBSRCS+= armfbsd-nat.c
LIBSRCS+= arm-tdep.c armfbsd-tdep.c solib.c solib-svr4.c
LIBSRCS+= arm-tdep.c armfbsd-tdep.c solib.c solib-svr4.c fbsd-threads.c
nm.h:
#XXX this should be arm/nm-fbsd.h but won't until it's merged into the gdb repo

View File

@ -78,9 +78,7 @@ supply_gregset (struct reg *gregset)
supply_register (ARM_SP_REGNUM, (char *) &gregset->r_sp);
supply_register (ARM_LR_REGNUM, (char *) &gregset->r_lr);
/* This is ok: we're running native... */
r_pc = ADDR_BITS_REMOVE (gregset->r_pc);
supply_register (ARM_PC_REGNUM, (char *) &r_pc);
supply_register (ARM_PC_REGNUM, (char *) &gregset->r_pc);
if (arm_apcs_32)
supply_register (ARM_PS_REGNUM, (char *) &gregset->r_cpsr);
@ -88,6 +86,28 @@ supply_gregset (struct reg *gregset)
supply_register (ARM_PS_REGNUM, (char *) &gregset->r_pc);
}
/* Fill register REGNO (if it is a general-purpose register) in
*GREGSETPS with the value in GDB's register array. If REGNO is -1,
do this for all registers. */
void
fill_gregset (struct reg *gregset, int regno)
{
int i;
for (i = ARM_A1_REGNUM; i < ARM_SP_REGNUM; i++)
if ((regno == -1 || regno == i))
regcache_collect (i, &gregset->r[i]);
if (regno == -1 || regno == ARM_SP_REGNUM)
regcache_collect (ARM_SP_REGNUM, &gregset->r_sp);
if (regno == -1 || regno == ARM_LR_REGNUM)
regcache_collect (ARM_LR_REGNUM, &gregset->r_lr);
if (regno == -1 || regno == ARM_PC_REGNUM)
regcache_collect (ARM_PC_REGNUM, &gregset->r_pc);
if (regno == -1 || regno == ARM_PS_REGNUM)
regcache_collect (ARM_PS_REGNUM, &gregset->r_cpsr);
}
void
supply_fpregset (struct fpreg *fparegset)
{
@ -100,6 +120,20 @@ supply_fpregset (struct fpreg *fparegset)
supply_register (ARM_FPS_REGNUM, (char *) &fparegset->fpr_fpsr);
}
void
fill_fpregset (struct fpreg *fparegset, int regno)
{
int i;
for (i = ARM_F0_REGNUM; i <= ARM_F7_REGNUM; i++)
if (regno == -1 || regno == i)
regcache_raw_supply(current_regcache, i,
&fparegset->fpr[i - ARM_F0_REGNUM]);
if (regno == -1 || regno == ARM_FPS_REGNUM)
regcache_raw_supply(current_regcache, ARM_FPS_REGNUM,
&fparegset->fpr_fpsr);
}
static void
fetch_register (int regno)
{

View File

@ -60,7 +60,6 @@ arm_freebsd_elf_init_abi (struct gdbarch_info info,
tdep->fp_model = ARM_FLOAT_SOFT_VFP;
}
void
_initialize_armfbsd_tdep (void)
{

View File

@ -105,6 +105,7 @@ extern initialize_file_ftype _initialize_mi_cmds;
extern initialize_file_ftype _initialize_mi_cmd_env;
extern initialize_file_ftype _initialize_mi_interp;
extern initialize_file_ftype _initialize_mi_main;
extern initialize_file_ftype _initialize_thread_db;
extern initialize_file_ftype _initialize_tui_hooks;
extern initialize_file_ftype _initialize_tui_interp;
extern initialize_file_ftype _initialize_tui_layout;
@ -128,6 +129,7 @@ initialize_all_files (void)
_initialize_kernel_u_addr ();
_initialize_infptrace ();
_initialize_inftarg ();
_initialize_thread_db ();
#endif
_initialize_arm_fbsdnat ();
_initialize_remote ();