summaryrefslogtreecommitdiff
path: root/gnu
diff options
context:
space:
mode:
authorJohn Baldwin <jhb@FreeBSD.org>2008-01-29 23:36:42 +0000
committerJohn Baldwin <jhb@FreeBSD.org>2008-01-29 23:36:42 +0000
commitc989eb07bb87a275c2c632a45587ad32a64d8652 (patch)
tree5c26d43173395be254ddb1f45bf337dc4d749b71 /gnu
parenta4d5f8a2b7545b01ac4cbfc664158fd518d1b513 (diff)
Notes
Diffstat (limited to 'gnu')
-rw-r--r--gnu/usr.bin/gdb/kgdb/kld.c23
1 files changed, 5 insertions, 18 deletions
diff --git a/gnu/usr.bin/gdb/kgdb/kld.c b/gnu/usr.bin/gdb/kgdb/kld.c
index 5995286251e3..95158ea04a1b 100644
--- a/gnu/usr.bin/gdb/kgdb/kld.c
+++ b/gnu/usr.bin/gdb/kgdb/kld.c
@@ -136,25 +136,12 @@ find_kld_path (char *filename, char *path, size_t path_size)
static CORE_ADDR
read_pointer (CORE_ADDR address)
{
- union {
- uint32_t d32;
- uint64_t d64;
- } val;
+ CORE_ADDR value;
- switch (TARGET_PTR_BIT) {
- case 32:
- if (kvm_read(kvm, address, &val.d32, sizeof(val.d32)) !=
- sizeof(val.d32))
- return (0);
- return (val.d32);
- case 64:
- if (kvm_read(kvm, address, &val.d64, sizeof(val.d64)) !=
- sizeof(val.d64))
- return (0);
- return (val.d64);
- default:
- return (0);
- }
+ if (target_read_memory(address, (char *)&value, TARGET_PTR_BIT / 8) !=
+ 0)
+ return (0);
+ return (extract_unsigned_integer(&value, TARGET_PTR_BIT / 8));
}
/*