From patchwork Sat Feb 8 21:09:21 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: "Terekhov, Mikhail via Gdb-patches" X-Patchwork-Id: 37778 Received: (qmail 107486 invoked by alias); 8 Feb 2020 21:09:27 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 107476 invoked by uid 89); 8 Feb 2020 21:09:27 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-21.9 required=5.0 tests=AWL, BAYES_00, FREEMAIL_FROM, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.1 spammy=HX-Languages-Length:2057, H*x:5.0, H*x:Windows X-HELO: sonic314-20.consmr.mail.ir2.yahoo.com Received: from sonic314-20.consmr.mail.ir2.yahoo.com (HELO sonic314-20.consmr.mail.ir2.yahoo.com) (77.238.177.146) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sat, 08 Feb 2020 21:09:25 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.de; s=s2048; t=1581196163; bh=qwC2TqL4KYZdW1Ymaw0ZY+pQsebQ2bYcXnJdLtcFUm4=; h=Date:From:To:In-Reply-To:References:Subject:From:Subject; b=oHgPgKPkDItdxMv5b6u/Y7eFmdavlwQOz8oeuxGLtiFsWerk7Rmhwd5CcUQC6B4ubd2oKHYEz4nWCCUVNe8TWp7e+O6k8vjrgXhLmbsFv6c4V8QPhoJNndsUopB0AcKAYXRKEkzzxWVc3gSktDnoCN+P/yZ36ORQozzscW7Hd1xbXhi92lh+YLcmp9sib8toqJVGqZwemJfnom3HqVOnINQqR1ux16iJmQLo5IfTncaZTkgPlzMzJ0nCNwuFxjDSmmGv1BdOFKhf11WxxhjX9cmjNONrOdFC48ADCsE7mGX8USNPGfnjUttsxAB4D5WPm7uJo3A81aPVBBWQb1l83g== Received: from sonic.gate.mail.ne1.yahoo.com by sonic314.consmr.mail.ir2.yahoo.com with HTTP; Sat, 8 Feb 2020 21:09:23 +0000 Date: Sat, 8 Feb 2020 21:09:21 +0000 (UTC) X-Patchwork-Original-From: "Hannes Domani via gdb-patches" From: "Terekhov, Mikhail via Gdb-patches" Reply-To: Hannes Domani To: Gdb-patches Message-ID: <955533175.395475.1581196161533@mail.yahoo.com> In-Reply-To: <83r1z4dehn.fsf@gnu.org> References: <20200208162614.4918-1-ssbssa.ref@yahoo.de> <20200208162614.4918-1-ssbssa@yahoo.de> <83r1z4dehn.fsf@gnu.org> Subject: Re: [PATCH v2 1/2] Display ExceptionRecord for $_siginfo MIME-Version: 1.0 Content-Length: 2138 X-IsSubscribed: yes Am Samstag, 8. Februar 2020, 21:13:54 MEZ hat Eli Zaretskii Folgendes geschrieben: > > From: Simon Marchi > > Date: Sat, 8 Feb 2020 15:00:10 -0500 > > > > > Program received signal SIGSEGV, Segmentation fault. > > > main () at crasher.c:4 > > > 4        *(int*)0x123 = 0; > > > (gdb) p $_siginfo > > > $1 = { > > >  ExceptionCode = 3221225477, > > >  ExceptionFlags = 0, > > >  ExceptionRecord = 0x0, > > >  ExceptionAddress = 0x401632 , > > >  NumberParameters = 2, > > >  ExceptionInformation = {1, 291, 0 } > > > } > > > (gdb) p/x $_siginfo.ExceptionCode > > > $2 = 0xc0000005 > > > (gdb) p/x $_siginfo.ExceptionInformation[1] > > > $3 = 0x123 > > > > > > And 0xc0000005 is the value of EXCEPTION_ACCESS_VIOLATION. > > > > > > [1] https://docs.microsoft.com/en-us/windows/win32/api/winnt/ns-winnt-exception_record > > > > Eli, could you please comment on this from a Windows user point of view, if this looks > > correct to you? > > LGTM, although I'd prefer to have ExceptionCode be printed in hex by > default.  But I guess that could be tricky, and the next patch makes > then print as symbolic names anyway. These were basically the same thoughts I had when I made this. > > Also, does this need a manual/NEWS update? > > > I think only NEWS, because the manual already says "on some targets", > and gives an example from GNU/Linux only. Is it fine if I add the following to this patch?:     * NEWS: Mention $_siginfo support for Windows. diff --git a/gdb/NEWS b/gdb/NEWS index d4e2e70f38..c202fe06de 100644 --- a/gdb/NEWS +++ b/gdb/NEWS @@ -10,6 +10,9 @@    that support it (see entry for GDB 9, below), providing faster    performance for programs with many symbols. +* The $_siginfo convenience variable now also works on Windows targets, +  and will display the EXCEPTION_RECORD of the last handled exception. +  * New commands  set exec-file-mismatch -- Set exec-file-mismatch handling (ask|warn|off).