Skip to content

Commit 79e64bc

Browse files
author
Petr Machata
committed
Type umovebytes properly
1 parent b882ba7 commit 79e64bc

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

backend.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,8 @@ void os_ltrace_exiting(void);
171171

172172
/* Should copy COUNT bytes from address ADDR of process PROC to local
173173
* buffer BUF. */
174-
size_t umovebytes(struct process *proc, void *addr, void *buf, size_t count);
174+
size_t umovebytes(struct process *proc, arch_addr_t addr,
175+
void *buf, size_t count);
175176

176177
/* Find out an address of symbol SYM in process PROC, and return.
177178
* Returning NULL delays breakpoint insertion and enables heaps of

sysdeps/linux-gnu/trace.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
* This file is part of ltrace.
3-
* Copyright (C) 2007,2011,2012,2013 Petr Machata, Red Hat Inc.
3+
* Copyright (C) 2007,2011,2012,2013,2014 Petr Machata, Red Hat Inc.
44
* Copyright (C) 2010 Joe Damato
55
* Copyright (C) 1998,2002,2003,2004,2008,2009 Juan Cespedes
66
* Copyright (C) 2006 Ian Wienand
@@ -1194,7 +1194,7 @@ os_ltrace_exiting_sighandler(void)
11941194
}
11951195

11961196
size_t
1197-
umovebytes(struct process *proc, void *addr, void *laddr, size_t len)
1197+
umovebytes(struct process *proc, arch_addr_t addr, void *buf, size_t len)
11981198
{
11991199

12001200
union {
@@ -1215,11 +1215,11 @@ umovebytes(struct process *proc, void *addr, void *laddr, size_t len)
12151215
started = 1;
12161216

12171217
if (len - offset >= sizeof(long)) {
1218-
memcpy(laddr + offset, &a.c[0], sizeof(long));
1218+
memcpy(buf + offset, &a.c[0], sizeof(long));
12191219
bytes_read += sizeof(long);
12201220
}
12211221
else {
1222-
memcpy(laddr + offset, &a.c[0], len - offset);
1222+
memcpy(buf + offset, &a.c[0], len - offset);
12231223
bytes_read += (len - offset);
12241224
}
12251225
offset += sizeof(long);

0 commit comments

Comments
 (0)