From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8695 invoked by alias); 27 Feb 2013 19:50:37 -0000 Received: (qmail 8670 invoked by uid 22791); 27 Feb 2013 19:50:27 -0000 X-Spam-Check-By: sourceware.org Received: from aquarius.hirmke.de (HELO calimero.vinschen.de) (217.91.18.234) by sourceware.org (qpsmtpd/0.83/v0.83-20-g38e4449) with ESMTP; Wed, 27 Feb 2013 19:50:16 +0000 Received: by calimero.vinschen.de (Postfix, from userid 500) id 1E50B520243; Wed, 27 Feb 2013 20:50:13 +0100 (CET) Date: Wed, 27 Feb 2013 20:03:00 -0000 From: Corinna Vinschen To: gdb-patches@sourceware.org Subject: [patch] gdbserver/win32-low.c: Fix printf-like formatting (was Re: [patch]: Replace stryoul call to fetch address) Message-ID: <20130227195013.GC30418@calimero.vinschen.de> Reply-To: gdb-patches@sourceware.org Mail-Followup-To: gdb-patches@sourceware.org References: <20130227164419.GA16975@calimero.vinschen.de> <512E404E.6070504@redhat.com> <20130227183805.GA30418@calimero.vinschen.de> <512E5B26.7050104@redhat.com> <20130227194235.GB30418@calimero.vinschen.de> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20130227194235.GB30418@calimero.vinschen.de> User-Agent: Mutt/1.5.21 (2010-09-15) X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2013-02/txt/msg00708.txt.bz2 On Feb 27 20:42, Corinna Vinschen wrote: > > > Ok, I apply it then with only the int changed to unsigned. > > > > Thanks. > > Applied. Here's an equivalent patch to gdbserver/win32-low.c. Ok to apply? Thanks, Corinna * win32-low.c: Throughout, fix format strings and casts of printf-like functions to avoid type related warnings on all platforms. (get_child_debug_event): Print dwDebugEventCode as hex since that's how it's usually documented. Index: win32-low.c =================================================================== RCS file: /cvs/src/src/gdb/gdbserver/win32-low.c,v retrieving revision 1.62 diff -u -p -r1.62 win32-low.c --- win32-low.c 1 Jan 2013 06:33:00 -0000 1.62 +++ win32-low.c 27 Feb 2013 19:47:47 -0000 @@ -448,7 +448,7 @@ strwinerror (DWORD error) LocalFree (msgbuf); } else - sprintf (buf, "unknown win32 error (%ld)", error); + sprintf (buf, "unknown win32 error (%u)", (unsigned) error); SetLastError (lasterr); return buf; @@ -1317,10 +1317,10 @@ handle_exception (struct target_waitstat ourstatus->kind = TARGET_WAITKIND_SPURIOUS; return; } - OUTMSG2 (("gdbserver: unknown target exception 0x%08lx at 0x%s", - current_event.u.Exception.ExceptionRecord.ExceptionCode, - phex_nz ((uintptr_t) current_event.u.Exception.ExceptionRecord. - ExceptionAddress, sizeof (uintptr_t)))); + OUTMSG2 (("gdbserver: unknown target exception 0x%08x at 0x%s", + (unsigned) current_event.u.Exception.ExceptionRecord.ExceptionCode, + phex_nz ((uintptr_t) current_event.u.Exception.ExceptionRecord. + ExceptionAddress, sizeof (uintptr_t)))); ourstatus->value.sig = GDB_SIGNAL_UNKNOWN; break; } @@ -1452,7 +1452,7 @@ get_child_debug_event (struct target_wai { case CREATE_THREAD_DEBUG_EVENT: OUTMSG2 (("gdbserver: kernel event CREATE_THREAD_DEBUG_EVENT " - "for pid=%d tid=%x)\n", + "for pid=%u tid=%x)\n", (unsigned) current_event.dwProcessId, (unsigned) current_event.dwThreadId)); @@ -1465,7 +1465,7 @@ get_child_debug_event (struct target_wai case EXIT_THREAD_DEBUG_EVENT: OUTMSG2 (("gdbserver: kernel event EXIT_THREAD_DEBUG_EVENT " - "for pid=%d tid=%x\n", + "for pid=%u tid=%x\n", (unsigned) current_event.dwProcessId, (unsigned) current_event.dwThreadId)); child_delete_thread (current_event.dwProcessId, @@ -1476,7 +1476,7 @@ get_child_debug_event (struct target_wai case CREATE_PROCESS_DEBUG_EVENT: OUTMSG2 (("gdbserver: kernel event CREATE_PROCESS_DEBUG_EVENT " - "for pid=%d tid=%x\n", + "for pid=%u tid=%x\n", (unsigned) current_event.dwProcessId, (unsigned) current_event.dwThreadId)); CloseHandle (current_event.u.CreateProcessInfo.hFile); @@ -1510,7 +1510,7 @@ get_child_debug_event (struct target_wai case EXIT_PROCESS_DEBUG_EVENT: OUTMSG2 (("gdbserver: kernel event EXIT_PROCESS_DEBUG_EVENT " - "for pid=%d tid=%x\n", + "for pid=%u tid=%x\n", (unsigned) current_event.dwProcessId, (unsigned) current_event.dwThreadId)); ourstatus->kind = TARGET_WAITKIND_EXITED; @@ -1522,7 +1522,7 @@ get_child_debug_event (struct target_wai case LOAD_DLL_DEBUG_EVENT: OUTMSG2 (("gdbserver: kernel event LOAD_DLL_DEBUG_EVENT " - "for pid=%d tid=%x\n", + "for pid=%u tid=%x\n", (unsigned) current_event.dwProcessId, (unsigned) current_event.dwThreadId)); CloseHandle (current_event.u.LoadDll.hFile); @@ -1534,7 +1534,7 @@ get_child_debug_event (struct target_wai case UNLOAD_DLL_DEBUG_EVENT: OUTMSG2 (("gdbserver: kernel event UNLOAD_DLL_DEBUG_EVENT " - "for pid=%d tid=%x\n", + "for pid=%u tid=%x\n", (unsigned) current_event.dwProcessId, (unsigned) current_event.dwThreadId)); handle_unload_dll (); @@ -1544,7 +1544,7 @@ get_child_debug_event (struct target_wai case EXCEPTION_DEBUG_EVENT: OUTMSG2 (("gdbserver: kernel event EXCEPTION_DEBUG_EVENT " - "for pid=%d tid=%x\n", + "for pid=%u tid=%x\n", (unsigned) current_event.dwProcessId, (unsigned) current_event.dwThreadId)); handle_exception (ourstatus); @@ -1553,7 +1553,7 @@ get_child_debug_event (struct target_wai case OUTPUT_DEBUG_STRING_EVENT: /* A message from the kernel (or Cygwin). */ OUTMSG2 (("gdbserver: kernel event OUTPUT_DEBUG_STRING_EVENT " - "for pid=%d tid=%x\n", + "for pid=%u tid=%x\n", (unsigned) current_event.dwProcessId, (unsigned) current_event.dwThreadId)); handle_output_debug_string (ourstatus); @@ -1561,10 +1561,10 @@ get_child_debug_event (struct target_wai default: OUTMSG2 (("gdbserver: kernel event unknown " - "for pid=%d tid=%x code=%ld\n", + "for pid=%u tid=%x code=%x\n", (unsigned) current_event.dwProcessId, (unsigned) current_event.dwThreadId, - current_event.dwDebugEventCode)); + (unsigned) current_event.dwDebugEventCode)); break; } -- Corinna Vinschen Cygwin Maintainer Red Hat