From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca (simark.ca [158.69.221.121]) by sourceware.org (Postfix) with ESMTPS id 4E37E385DC1B for ; Thu, 16 Apr 2020 01:11:50 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 4E37E385DC1B Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=simark.ca Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=simark@simark.ca Received: from [10.0.0.11] (unknown [192.222.164.54]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by simark.ca (Postfix) with ESMTPSA id BC3A41E581; Wed, 15 Apr 2020 21:11:49 -0400 (EDT) Subject: [pushed] gdbserver: fix format string warning in win32-low.cc (was: Re: [PATCH v3 29/29] Add pending stop support to gdbserver's Windows port) To: Tom Tromey , gdb-patches@sourceware.org References: <20200313190855.28662-1-tromey@adacore.com> <20200313190855.28662-30-tromey@adacore.com> From: Simon Marchi Message-ID: Date: Wed, 15 Apr 2020 21:11:49 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.7.0 MIME-Version: 1.0 In-Reply-To: <20200313190855.28662-30-tromey@adacore.com> Content-Type: text/plain; charset=utf-8 Content-Language: fr Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-23.7 required=5.0 tests=BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, KAM_DMARC_STATUS, SPF_HELO_PASS, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Apr 2020 01:11:51 -0000 On 2020-03-13 3:08 p.m., Tom Tromey wrote: > This changes gdbserver to also handle pending stops, the same way that > gdb does. This is PR gdb/22992. > > gdbserver/ChangeLog > 2020-03-13 Tom Tromey > > PR gdb/22992 > * win32-low.c (child_continue): Call matching_pending_stop. > (get_child_debug_event): Call fetch_pending_stop. Push pending > stop when needed. > --- > gdbserver/ChangeLog | 7 +++++++ > gdbserver/win32-low.cc | 34 +++++++++++++++++++++++++++++++--- > 2 files changed, 38 insertions(+), 3 deletions(-) I pushed the following patch to fix a compilation error on Cygwin following this patch. >From e2275c6ee8caa98d6526422743a97d5dd5ac040d Mon Sep 17 00:00:00 2001 From: Simon Marchi Date: Wed, 15 Apr 2020 21:09:17 -0400 Subject: [PATCH] gdbserver: fix format string warning in win32-low.cc MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When compiling on Cygwin, we get: CXX win32-low.o /home/smarchi/src/binutils-gdb/gdbserver/win32-low.cc: In function ‘int get_child_debug_event(DWORD*, target_waitstatus*)’: /home/smarchi/src/binutils-gdb/gdbserver/win32-low.cc:1459:17: error: format ‘%x’ expects argument of type ‘unsigned int’, but argument 2 has type ‘long int’ [-Werror=format=] 1459 | OUTMSG2 (("get_windows_debug_event - " | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ 1460 | "unexpected stop in 0x%x (expecting 0x%x)\n", | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 1461 | ptid.lwp (), desired_stop_thread_id)); | ~~~~~~~~~~~ | | | long int /home/smarchi/src/binutils-gdb/gdbserver/win32-low.cc:52:11: note: in definition of macro ‘OUTMSG2’ 52 | printf X; \ | ^ /home/smarchi/src/binutils-gdb/gdbserver/win32-low.cc:1460:26: note: format string is defined here 1460 | "unexpected stop in 0x%x (expecting 0x%x)\n", | ~^ | | | unsigned int | %lx `ptid.lwp ()` is a `long` value, so it indeed needs the `l` size modifier. gdbserver/ChangeLog: * win32-low.cc (get_child_debug_event): Fix format string warning. --- gdbserver/ChangeLog | 4 ++++ gdbserver/win32-low.cc | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/gdbserver/ChangeLog b/gdbserver/ChangeLog index 2b381455ed79..2abe0f1268c2 100644 --- a/gdbserver/ChangeLog +++ b/gdbserver/ChangeLog @@ -1,3 +1,7 @@ +2020-04-15 Simon Marchi + + * win32-low.cc (get_child_debug_event): Fix format string warning. + 2020-04-13 Tom Tromey * server.h (gdb_fildes_t): Remove typedef. diff --git a/gdbserver/win32-low.cc b/gdbserver/win32-low.cc index e1226b4b0db0..75305a4cfabb 100644 --- a/gdbserver/win32-low.cc +++ b/gdbserver/win32-low.cc @@ -1457,7 +1457,7 @@ get_child_debug_event (DWORD *continue_status, /* Pending stop. See the comment by the definition of "pending_stops" for details on why this is needed. */ OUTMSG2 (("get_windows_debug_event - " - "unexpected stop in 0x%x (expecting 0x%x)\n", + "unexpected stop in 0x%lx (expecting 0x%x)\n", ptid.lwp (), desired_stop_thread_id)); maybe_adjust_pc (); pending_stops.push_back ({(DWORD) ptid.lwp (), *ourstatus, current_event}); -- 2.26.0