diff options
author | cognet <cognet@FreeBSD.org> | 2007-11-17 21:30:03 +0000 |
---|---|---|
committer | cognet <cognet@FreeBSD.org> | 2007-11-17 21:30:03 +0000 |
commit | 6ebbe5e1f801ebbb225bda3c1a4ad0e363590a28 (patch) | |
tree | b6d5b1ffff47c43d5e92bec952022089905ba98a /gnu | |
parent | 13be848a1345db206d1468c11eb68790d03a1e3c (diff) | |
download | FreeBSD-src-6ebbe5e1f801ebbb225bda3c1a4ad0e363590a28.zip FreeBSD-src-6ebbe5e1f801ebbb225bda3c1a4ad0e363590a28.tar.gz |
Add thread support for arm.
MFC After: 1 week
Diffstat (limited to 'gnu')
-rw-r--r-- | gnu/usr.bin/gdb/arch/arm/Makefile | 2 | ||||
-rw-r--r-- | gnu/usr.bin/gdb/arch/arm/armfbsd-nat.c | 40 | ||||
-rw-r--r-- | gnu/usr.bin/gdb/arch/arm/armfbsd-tdep.c | 1 | ||||
-rw-r--r-- | gnu/usr.bin/gdb/arch/arm/init.c | 2 |
4 files changed, 40 insertions, 5 deletions
diff --git a/gnu/usr.bin/gdb/arch/arm/Makefile b/gnu/usr.bin/gdb/arch/arm/Makefile index 3638a6c..50ff34b 100644 --- a/gnu/usr.bin/gdb/arch/arm/Makefile +++ b/gnu/usr.bin/gdb/arch/arm/Makefile @@ -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 diff --git a/gnu/usr.bin/gdb/arch/arm/armfbsd-nat.c b/gnu/usr.bin/gdb/arch/arm/armfbsd-nat.c index 2e17046..84599d9 100644 --- a/gnu/usr.bin/gdb/arch/arm/armfbsd-nat.c +++ b/gnu/usr.bin/gdb/arch/arm/armfbsd-nat.c @@ -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) { diff --git a/gnu/usr.bin/gdb/arch/arm/armfbsd-tdep.c b/gnu/usr.bin/gdb/arch/arm/armfbsd-tdep.c index d0e7274..785897d 100644 --- a/gnu/usr.bin/gdb/arch/arm/armfbsd-tdep.c +++ b/gnu/usr.bin/gdb/arch/arm/armfbsd-tdep.c @@ -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) { diff --git a/gnu/usr.bin/gdb/arch/arm/init.c b/gnu/usr.bin/gdb/arch/arm/init.c index 342129d..d4064da 100644 --- a/gnu/usr.bin/gdb/arch/arm/init.c +++ b/gnu/usr.bin/gdb/arch/arm/init.c @@ -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 (); |