print_array: change tracee address type from unsigned long to kernel_ureg_t
* defs.h (print_array): Change start_addr type from unsigned long to kernel_ureg_t. * util.c (print_array): Likewise. Change the type of all tracee address variables from unsigned long to kernel_ureg_t.
This commit is contained in:
parent
c239ebc31b
commit
399fceeb06
14
defs.h
14
defs.h
@ -508,19 +508,19 @@ extern int upoke(int pid, long, long);
|
||||
|
||||
extern bool
|
||||
print_array(struct tcb *tcp,
|
||||
const unsigned long start_addr,
|
||||
const size_t nmemb,
|
||||
void *const elem_buf,
|
||||
const size_t elem_size,
|
||||
int (*const umoven_func)(struct tcb *,
|
||||
kernel_ureg_t start_addr,
|
||||
size_t nmemb,
|
||||
void *elem_buf,
|
||||
size_t elem_size,
|
||||
int (*umoven_func)(struct tcb *,
|
||||
long,
|
||||
unsigned int,
|
||||
void *),
|
||||
bool (*const print_func)(struct tcb *,
|
||||
bool (*print_func)(struct tcb *,
|
||||
void *elem_buf,
|
||||
size_t elem_size,
|
||||
void *opaque_data),
|
||||
void *const opaque_data);
|
||||
void *opaque_data);
|
||||
|
||||
#if defined ALPHA || defined IA64 || defined MIPS \
|
||||
|| defined SH || defined SPARC || defined SPARC64
|
||||
|
10
util.c
10
util.c
@ -1420,8 +1420,8 @@ umovestr(struct tcb *tcp, long addr, unsigned int len, char *laddr)
|
||||
* - umoven_func has not returned false.
|
||||
*/
|
||||
bool
|
||||
print_array(struct tcb *tcp,
|
||||
const unsigned long start_addr,
|
||||
print_array(struct tcb *const tcp,
|
||||
const kernel_ureg_t start_addr,
|
||||
const size_t nmemb,
|
||||
void *const elem_buf,
|
||||
const size_t elem_size,
|
||||
@ -1446,17 +1446,17 @@ print_array(struct tcb *tcp,
|
||||
}
|
||||
|
||||
const size_t size = nmemb * elem_size;
|
||||
const unsigned long end_addr = start_addr + size;
|
||||
const kernel_ureg_t end_addr = start_addr + size;
|
||||
|
||||
if (end_addr <= start_addr || size / elem_size != nmemb) {
|
||||
printaddr(start_addr);
|
||||
return false;
|
||||
}
|
||||
|
||||
const unsigned long abbrev_end =
|
||||
const kernel_ureg_t abbrev_end =
|
||||
(abbrev(tcp) && max_strlen < nmemb) ?
|
||||
start_addr + elem_size * max_strlen : end_addr;
|
||||
unsigned long cur;
|
||||
kernel_ureg_t cur;
|
||||
|
||||
for (cur = start_addr; cur < end_addr; cur += elem_size) {
|
||||
if (cur != start_addr)
|
||||
|
Loading…
Reference in New Issue
Block a user