From patchwork Tue Apr 24 20:31:19 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Baldwin X-Patchwork-Id: 26930 Received: (qmail 5685 invoked by alias); 24 Apr 2018 20:37:51 -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 5670 invoked by uid 89); 24 Apr 2018 20:37:50 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-24.9 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, SPF_HELO_PASS, SPF_SOFTFAIL autolearn=ham version=3.3.2 spammy=HContent-Transfer-Encoding:7Bit, elected X-HELO: mail.baldwin.cx Received: from bigwig.baldwin.cx (HELO mail.baldwin.cx) (96.47.65.170) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 24 Apr 2018 20:37:48 +0000 Received: from ralph.baldwin.cx (ralph.baldwin.cx [66.234.199.215]) by mail.baldwin.cx (Postfix) with ESMTPSA id 1949B10AFD6; Tue, 24 Apr 2018 16:37:46 -0400 (EDT) From: John Baldwin To: gdb-patches@sourceware.org Cc: Tom Tromey Subject: Re: [RFA 5/9] Add fall-through comment to i386-tdep.c Date: Tue, 24 Apr 2018 13:31:19 -0700 Message-ID: <2811000.1AMpcQedXF@ralph.baldwin.cx> User-Agent: KMail/4.14.10 (FreeBSD/11.1-STABLE; KDE/4.14.30; amd64; ; ) In-Reply-To: <20180421183056.29292-6-tom@tromey.com> References: <20180421183056.29292-1-tom@tromey.com> <20180421183056.29292-6-tom@tromey.com> MIME-Version: 1.0 X-IsSubscribed: yes On Saturday, April 21, 2018 12:30:52 PM Tom Tromey wrote: > This adds a fall-through comment in i386-tdep.c. I am not sure if > this should be a fall-through or a break (it's possible even that it > does not matter), so I elected to preserve the status quo. > > ChangeLog > 2018-04-21 Tom Tromey > > * i386-tdep.c (i386_process_record): Add fall-through comment. > --- > gdb/ChangeLog | 4 ++++ > gdb/i386-tdep.c | 1 + > 2 files changed, 5 insertions(+) > > diff --git a/gdb/i386-tdep.c b/gdb/i386-tdep.c > index bf4ca54303..8ab7b005b8 100644 > --- a/gdb/i386-tdep.c > +++ b/gdb/i386-tdep.c > @@ -7130,6 +7130,7 @@ Do you want to stop the program?"), > else if (ir.rm == 1) > break; > } > + /* Fall through. */ > case 3: /* lidt */ > if (ir.mod == 3) > { I believe this is correct based on the diff that added the special cases for xgetbv and xsetbv as previously ldgt and lidt were treated the same: diff --git a/gdb/i386-tdep.c b/gdb/i386-tdep.c index b4dc646b37..b354462cb9 100644 --- a/gdb/i386-tdep.c +++ b/gdb/i386-tdep.c @@ -5172,6 +5172,19 @@ reswitch: break; /* lgdt */ case 2: + if (ir.mod == 3) + { + /* xgetbv */ + if (ir.rm == 0) + { + I386_RECORD_ARCH_LIST_ADD_REG (X86_RECORD_REAX_REGNUM); + I386_RECORD_ARCH_LIST_ADD_REG (X86_RECORD_REDX_REGNUM); + break; + } + /* xsetbv */ + else if (ir.rm == 1) + break; + } /* lidt */ case 3: if (ir.mod == 3)