+2007-05-08 Ulrich Weigand <uweigand@de.ibm.com>
+
+ * spu-linux-nat.c: Include "gdb_stdint.h".
+ (fetch_ppc_register): Use uint64_t instead of unsigned long long.
+ (fetch_ppc_memory_1, store_ppc_memory_1): Likewise.
+ (fetch_ppc_memory, store_ppc_memory): Fix coding style.
+ (spu_symbol_file_add_from_memory): Use strtoulst instead of sscanf.
+ (spu_child_wait): Mark up string for translation.
+
2007-05-08 Paul Gilliam <pgilliam@us.ibm.com>
Luis Machado <luisgpm@br.ibm.com>
#include "regcache.h"
#include "symfile.h"
#include "gdb_wait.h"
+#include "gdb_stdint.h"
#include <sys/ptrace.h>
#include <asm/ptrace.h>
ptrace (PPC_PTRACE_PEEKUSR_3264, tid,
(PTRACE_TYPE_ARG3) (regno * 8 + 4), buf + 4);
if (errno == 0)
- return (ULONGEST) *(unsigned long long *)buf;
+ return (ULONGEST) *(uint64_t *)buf;
}
#endif
#ifndef __powerpc64__
if (memaddr >> 32)
{
- unsigned long long addr_8 = (unsigned long long) memaddr;
+ uint64_t addr_8 = (uint64_t) memaddr;
ptrace (PPC_PTRACE_PEEKTEXT_3264, tid, (PTRACE_TYPE_ARG3) &addr_8, word);
}
else
#ifndef __powerpc64__
if (memaddr >> 32)
{
- unsigned long long addr_8 = (unsigned long long) memaddr;
+ uint64_t addr_8 = (uint64_t) memaddr;
ptrace (PPC_PTRACE_POKEDATA_3264, tid, (PTRACE_TYPE_ARG3) &addr_8, word);
}
else
buffer = (PTRACE_TYPE_RET *) alloca (count * sizeof (PTRACE_TYPE_RET));
for (i = 0; i < count; i++, addr += sizeof (PTRACE_TYPE_RET))
- if ((ret = fetch_ppc_memory_1 (tid, addr, &buffer[i])) != 0)
- return ret;
+ {
+ ret = fetch_ppc_memory_1 (tid, addr, &buffer[i]);
+ if (ret)
+ return ret;
+ }
memcpy (myaddr,
(char *) buffer + (memaddr & (sizeof (PTRACE_TYPE_RET) - 1)),
buffer = (PTRACE_TYPE_RET *) alloca (count * sizeof (PTRACE_TYPE_RET));
if (addr != memaddr || len < (int) sizeof (PTRACE_TYPE_RET))
- if ((ret = fetch_ppc_memory_1 (tid, addr, &buffer[0])) != 0)
- return ret;
+ {
+ ret = fetch_ppc_memory_1 (tid, addr, &buffer[0]);
+ if (ret)
+ return ret;
+ }
if (count > 1)
- if ((ret = fetch_ppc_memory_1 (tid, addr + (count - 1)
+ {
+ ret = fetch_ppc_memory_1 (tid, addr + (count - 1)
* sizeof (PTRACE_TYPE_RET),
- &buffer[count - 1])) != 0)
- return ret;
+ &buffer[count - 1]);
+ if (ret)
+ return ret;
+ }
memcpy ((char *) buffer + (memaddr & (sizeof (PTRACE_TYPE_RET) - 1)),
myaddr, len);
for (i = 0; i < count; i++, addr += sizeof (PTRACE_TYPE_RET))
- if ((ret = store_ppc_memory_1 (tid, addr, buffer[i])) != 0)
- return ret;
+ {
+ ret = store_ppc_memory_1 (tid, addr, buffer[i]);
+ if (ret)
+ return ret;
+ }
return 0;
}
if (len <= 0 || len >= sizeof id)
return;
id[len] = 0;
- if (sscanf (id, "0x%llx", &addr) != 1)
+ addr = strtoulst (id, NULL, 16);
+ if (!addr)
return;
/* Open BFD representing SPE executable and read its symbols. */
if (pid == -1)
{
- warning ("Child process unexpectedly missing: %s",
+ warning (_("Child process unexpectedly missing: %s"),
safe_strerror (save_errno));
/* Claim it exited with unknown signal. */