From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 42731 invoked by alias); 4 Apr 2017 17:32:08 -0000 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 Received: (qmail 42605 invoked by uid 89); 4 Apr 2017 17:32:06 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-26.9 required=5.0 tests=BAYES_00,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,RP_MATCHES_RCVD,SPF_HELO_PASS autolearn=ham version=3.3.2 spammy= X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 04 Apr 2017 17:32:05 +0000 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 521183DBC2 for ; Tue, 4 Apr 2017 17:26:09 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 521183DBC2 Authentication-Results: ext-mx06.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx06.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=palves@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 521183DBC2 Received: from cascais.lan (ovpn04.gateway.prod.ext.phx2.redhat.com [10.5.9.4]) by smtp.corp.redhat.com (Postfix) with ESMTP id DB21418247 for ; Tue, 4 Apr 2017 17:26:08 +0000 (UTC) From: Pedro Alves To: gdb-patches@sourceware.org Subject: [PATCH 11/18] -Wwrite-strings: gdbserver/win32-low.c and TARGET_WAITKIND_EXECD Date: Tue, 04 Apr 2017 17:32:00 -0000 Message-Id: <1491326751-16180-12-git-send-email-palves@redhat.com> In-Reply-To: <1491326751-16180-1-git-send-email-palves@redhat.com> References: <1491326751-16180-1-git-send-email-palves@redhat.com> X-SW-Source: 2017-04/txt/msg00044.txt.bz2 src/gdb/gdbserver/win32-low.c:1499:39: error: ISO C++ forbids converting a string constant to 'char*' [-Werror=write-strings] ourstatus->value.execd_pathname = "Main executable"; ^ This reporting via TARGET_WAITKIND_EXECD it's totally unnecessary. get_child_debug_event returns a TARGET_WAITKIND_SPURIOUS by default, which works just as well here, and is what the equivalent code in gdb/windows-nat.c does too. gdb/gdbserver/ChangeLog: yyyy-mm-dd Pedro Alves * win32-low.c (get_child_debug_event) : Don't report TARGET_WAITKIND_EXECD. Report TARGET_WAITKIND_SPURIOUS instead. --- gdb/gdbserver/win32-low.c | 5 ----- 1 file changed, 5 deletions(-) diff --git a/gdb/gdbserver/win32-low.c b/gdb/gdbserver/win32-low.c index d3ddbf5..7b09f4b 100644 --- a/gdb/gdbserver/win32-low.c +++ b/gdb/gdbserver/win32-low.c @@ -1495,16 +1495,12 @@ get_child_debug_event (struct target_waitstatus *ourstatus) current_process_handle = current_event.u.CreateProcessInfo.hProcess; main_thread_id = current_event.dwThreadId; - ourstatus->kind = TARGET_WAITKIND_EXECD; - ourstatus->value.execd_pathname = "Main executable"; - /* Add the main thread. */ child_add_thread (current_event.dwProcessId, main_thread_id, current_event.u.CreateProcessInfo.hThread, current_event.u.CreateProcessInfo.lpThreadLocalBase); - ourstatus->value.related_pid = debug_event_ptid (¤t_event); #ifdef _WIN32_WCE if (!attaching) { @@ -1632,7 +1628,6 @@ win32_wait (ptid_t ptid, struct target_waitstatus *ourstatus, int options) OUTMSG (("Ignoring unknown internal event, %d\n", ourstatus->kind)); /* fall-through */ case TARGET_WAITKIND_SPURIOUS: - case TARGET_WAITKIND_EXECD: /* do nothing, just continue */ child_continue (DBG_CONTINUE, -1); break; -- 2.5.5