From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 43030 invoked by alias); 3 Aug 2015 10:59:03 -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 43015 invoked by uid 89); 3 Aug 2015 10:59:00 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.1 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-pd0-f169.google.com Received: from mail-pd0-f169.google.com (HELO mail-pd0-f169.google.com) (209.85.192.169) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Mon, 03 Aug 2015 10:58:59 +0000 Received: by pdrg1 with SMTP id g1so72996908pdr.2 for ; Mon, 03 Aug 2015 03:58:58 -0700 (PDT) X-Received: by 10.70.90.230 with SMTP id bz6mr34278236pdb.120.1438599538152; Mon, 03 Aug 2015 03:58:58 -0700 (PDT) Received: from E107787-LIN (gcc1-power7.osuosl.org. [140.211.15.137]) by smtp.gmail.com with ESMTPSA id fv5sm17154763pdb.19.2015.08.03.03.58.55 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Mon, 03 Aug 2015 03:58:56 -0700 (PDT) From: Yao Qi To: Pedro Alves Cc: gdb-patches@sourceware.org Subject: Re: [PATCH/7.10 1/2] Linux gdbserver confused when event randomization returns a process exit event References: <1438362229-27653-1-git-send-email-palves@redhat.com> <1438362229-27653-2-git-send-email-palves@redhat.com> Date: Mon, 03 Aug 2015 10:59:00 -0000 In-Reply-To: <1438362229-27653-2-git-send-email-palves@redhat.com> (Pedro Alves's message of "Fri, 31 Jul 2015 18:03:48 +0100") Message-ID: <86io8weize.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-IsSubscribed: yes X-SW-Source: 2015-08/txt/msg00017.txt.bz2 Pedro Alves writes: > @@ -3128,7 +3116,7 @@ linux_wait_1 (ptid_t ptid, > || (gdb_breakpoint_here (event_child->stop_pc) > && gdb_condition_true_at_breakpoint (event_child->stop_pc) > && gdb_no_commands_at_breakpoint (event_child->stop_pc)) > - || extended_event_reported (&event_child->waitstatus)); > + || event_child->waitstatus.kind !=3D TARGET_WAITKIND_IGNORE); >=20=20 > run_breakpoint_commands (event_child->stop_pc); >=20=20 > @@ -3150,9 +3138,11 @@ linux_wait_1 (ptid_t ptid, > paddress (event_child->stop_pc), > paddress (event_child->step_range_start), > paddress (event_child->step_range_end)); > - if (extended_event_reported (&event_child->waitstatus)) > + if (event_child->waitstatus.kind !=3D TARGET_WAITKIND_IGNORE) > { > - char *str =3D target_waitstatus_to_string (ourstatus); > + char *str; > + > + str =3D target_waitstatus_to_string (&event_child->waitstatus); > debug_printf ("LWP %ld: extended event with waitstatus %s\n", > lwpid_of (get_lwp_thread (event_child)), str); > xfree (str); Looks this code is dead code even without your patch. This code is guarded by "if (!report_to_gdb)", but if report_to_gdb is false, "(event_child->waitstatus.kind !=3D TARGET_WAITKIND_IGNORE)" is false too. --=20 Yao (=E9=BD=90=E5=B0=A7)