diff options
author | Corinna Vinschen <corinna@vinschen.de> | 2013-04-23 09:44:36 +0000 |
---|---|---|
committer | Corinna Vinschen <corinna@vinschen.de> | 2013-04-23 09:44:36 +0000 |
commit | 61522196c71593da09572fce9af9e0d7dad61bc3 (patch) | |
tree | 9bf74facd67974fa2f780d6ce68b14eb7a94e371 /winsup/utils/strace.cc | |
parent | 1875ee55d31d3673059373c8f9837bf98f93c713 (diff) | |
download | newlib-61522196c71593da09572fce9af9e0d7dad61bc3.zip newlib-61522196c71593da09572fce9af9e0d7dad61bc3.tar.gz newlib-61522196c71593da09572fce9af9e0d7dad61bc3.tar.bz2 |
* Merge in cygwin-64bit-branch.
Diffstat (limited to 'winsup/utils/strace.cc')
-rw-r--r-- | winsup/utils/strace.cc | 25 |
1 files changed, 17 insertions, 8 deletions
diff --git a/winsup/utils/strace.cc b/winsup/utils/strace.cc index 62d4086..73096ab 100644 --- a/winsup/utils/strace.cc +++ b/winsup/utils/strace.cc @@ -1,7 +1,7 @@ /* strace.cc Copyright 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, - 2009, 2010, 2011 Red Hat Inc. + 2009, 2010, 2011, 2012, 2013 Red Hat Inc. Written by Chris Faylor <cgf@redhat.com> @@ -265,7 +265,7 @@ ctrl_c (DWORD) } extern "C" { -unsigned long (*cygwin_internal) (int, ...); +uintptr_t (*cygwin_internal) (int, ...); WCHAR cygwin_dll_path[32768]; }; @@ -286,7 +286,7 @@ load_cygwin () return 0; } GetModuleFileNameW (h, cygwin_dll_path, 32768); - if (!(cygwin_internal = (DWORD (*) (int, ...)) GetProcAddress (h, "cygwin_internal"))) + if (!(cygwin_internal = (uintptr_t (*) (int, ...)) GetProcAddress (h, "cygwin_internal"))) { errno = ENOSYS; return 0; @@ -437,7 +437,7 @@ handle_output_debug_string (DWORD id, LPVOID p, unsigned mask, FILE *ofile) int len; int special; char alen[3 + 8 + 1]; - DWORD nbytes; + SIZE_T nbytes; child_list *child = get_child (id); if (!child) error (0, "no process id %d found", id); @@ -482,7 +482,11 @@ handle_output_debug_string (DWORD id, LPVOID p, unsigned mask, FILE *ofile) buf[len] = '\0'; char *s = strtok (buf, " "); +#ifdef __x86_64__ + unsigned long long n = strtoull (s, NULL, 16); +#else unsigned long n = strtoul (s, NULL, 16); +#endif s = strchr (s, '\0') + 1; @@ -619,7 +623,11 @@ handle_output_debug_string (DWORD id, LPVOID p, unsigned mask, FILE *ofile) if (include_hex) { s -= 8; - sprintf (s, "%p", (void *) n); +#ifdef __x86_64__ + sprintf (s, "%012I64x", n); +#else + sprintf (s, "%08lx", n); +#endif strchr (s, '\0')[0] = ' '; } child->last_usecs = usecs; @@ -691,8 +699,9 @@ proc_child (unsigned mask, FILE *ofile, pid_t pid) { status = DBG_EXCEPTION_NOT_HANDLED; if (ev.u.Exception.dwFirstChance) - fprintf (ofile, "--- Process %lu, exception %p at %p\n", ev.dwProcessId, - (void *) ev.u.Exception.ExceptionRecord.ExceptionCode, + fprintf (ofile, "--- Process %lu, exception %08lx at %p\n", + ev.dwProcessId, + ev.u.Exception.ExceptionRecord.ExceptionCode, ev.u.Exception.ExceptionRecord.ExceptionAddress); } break; @@ -966,7 +975,7 @@ main (int argc, char **argv) if (load_cygwin ()) { char **av = (char **) cygwin_internal (CW_ARGV); - if (av && (DWORD) av != (DWORD) -1) + if (av && (uintptr_t) av != (uintptr_t) -1) for (argc = 0, argv = av; *av; av++) argc++; } |