trgt_arm.c (162303) | trgt_arm.c (163440) |
---|---|
1/* 2 * Copyright (c) 2004 Marcel Moolenaar 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * --- 11 unchanged lines hidden (view full) --- 20 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 21 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 22 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 23 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 24 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25 */ 26 27#include <sys/cdefs.h> | 1/* 2 * Copyright (c) 2004 Marcel Moolenaar 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * --- 11 unchanged lines hidden (view full) --- 20 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 21 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 22 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 23 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 24 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25 */ 26 27#include <sys/cdefs.h> |
28__FBSDID("$FreeBSD: head/gnu/usr.bin/gdb/kgdb/trgt_arm.c 162303 2006-09-14 07:51:52Z imp $"); | 28__FBSDID("$FreeBSD: head/gnu/usr.bin/gdb/kgdb/trgt_arm.c 163440 2006-10-16 20:07:23Z jhb $"); |
29 30#include <sys/types.h> 31#ifndef CROSS_DEBUGGER 32#include <machine/pcb.h> 33#include <machine/frame.h> 34#include <machine/armreg.h> 35#endif 36#include <err.h> --- 12 unchanged lines hidden (view full) --- 49 50void 51kgdb_trgt_fetch_registers(int regno __unused) 52{ 53#ifndef CROSS_DEBUGGER 54 struct kthr *kt; 55 struct pcb pcb; 56 int i, reg; | 29 30#include <sys/types.h> 31#ifndef CROSS_DEBUGGER 32#include <machine/pcb.h> 33#include <machine/frame.h> 34#include <machine/armreg.h> 35#endif 36#include <err.h> --- 12 unchanged lines hidden (view full) --- 49 50void 51kgdb_trgt_fetch_registers(int regno __unused) 52{ 53#ifndef CROSS_DEBUGGER 54 struct kthr *kt; 55 struct pcb pcb; 56 int i, reg; |
57 | 57 |
58 kt = kgdb_thr_lookup_tid(ptid_get_tid(inferior_ptid)); 59 if (kt == NULL) 60 return; 61 if (kvm_read(kvm, kt->pcb, &pcb, sizeof(pcb)) != sizeof(pcb)) { 62 warnx("kvm_read: %s", kvm_geterr(kvm)); 63 memset(&pcb, 0, sizeof(pcb)); 64 } 65 for (i = ARM_A1_REGNUM + 8; i <= ARM_SP_REGNUM; i++) { | 58 kt = kgdb_thr_lookup_tid(ptid_get_tid(inferior_ptid)); 59 if (kt == NULL) 60 return; 61 if (kvm_read(kvm, kt->pcb, &pcb, sizeof(pcb)) != sizeof(pcb)) { 62 warnx("kvm_read: %s", kvm_geterr(kvm)); 63 memset(&pcb, 0, sizeof(pcb)); 64 } 65 for (i = ARM_A1_REGNUM + 8; i <= ARM_SP_REGNUM; i++) { |
66 supply_register(i, (char *)&pcb.un_32.pcb32_r8 + | 66 supply_register(i, (char *)&pcb.un_32.pcb32_r8 + |
67 (i - (ARM_A1_REGNUM + 8 )) * 4); 68 } 69 if (pcb.un_32.pcb32_sp != 0) { 70 for (i = 0; i < 4; i++) { 71 if (kvm_read(kvm, pcb.un_32.pcb32_sp + (i) * 4, 72 ®, 4) != 4) { 73 warnx("kvm_read: %s", kvm_geterr(kvm)); 74 break; --- 94 unchanged lines hidden (view full) --- 169 *realnump = -1; 170 171 ofs = (regnum >= 0 && regnum <= ARM_PS_REGNUM) 172 ? kgdb_trgt_frame_offset[regnum] : -1; 173 if (ofs == -1) 174 return; 175 176 cache = kgdb_trgt_frame_cache(next_frame, this_cache); | 67 (i - (ARM_A1_REGNUM + 8 )) * 4); 68 } 69 if (pcb.un_32.pcb32_sp != 0) { 70 for (i = 0; i < 4; i++) { 71 if (kvm_read(kvm, pcb.un_32.pcb32_sp + (i) * 4, 72 ®, 4) != 4) { 73 warnx("kvm_read: %s", kvm_geterr(kvm)); 74 break; --- 94 unchanged lines hidden (view full) --- 169 *realnump = -1; 170 171 ofs = (regnum >= 0 && regnum <= ARM_PS_REGNUM) 172 ? kgdb_trgt_frame_offset[regnum] : -1; 173 if (ofs == -1) 174 return; 175 176 cache = kgdb_trgt_frame_cache(next_frame, this_cache); |
177 | 177 |
178 if (is_undef && (regnum == ARM_SP_REGNUM || regnum == ARM_PC_REGNUM)) { 179 *addrp = cache->sp + offsetof(struct trapframe, tf_spsr); 180 target_read_memory(*addrp, valuep, regsz); 181 is_undefined = 1; 182 ofs = kgdb_trgt_frame_offset[ARM_SP_REGNUM]; 183 184 } 185 *addrp = cache->sp + ofs; --- 47 unchanged lines hidden --- | 178 if (is_undef && (regnum == ARM_SP_REGNUM || regnum == ARM_PC_REGNUM)) { 179 *addrp = cache->sp + offsetof(struct trapframe, tf_spsr); 180 target_read_memory(*addrp, valuep, regsz); 181 is_undefined = 1; 182 ofs = kgdb_trgt_frame_offset[ARM_SP_REGNUM]; 183 184 } 185 *addrp = cache->sp + ofs; --- 47 unchanged lines hidden --- |