From patchwork Mon May 6 18:03:23 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kevin Buettner X-Patchwork-Id: 32572 Received: (qmail 43575 invoked by alias); 6 May 2019 18:03:50 -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 43566 invoked by uid 89); 6 May 2019 18:03:50 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-16.3 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, SPF_HELO_PASS autolearn=ham version=3.3.1 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; Mon, 06 May 2019 18:03:49 +0000 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 0407B81DFF for ; Mon, 6 May 2019 18:03:48 +0000 (UTC) Received: from f30-1.lan (ovpn-116-84.phx2.redhat.com [10.3.116.84]) by smtp.corp.redhat.com (Postfix) with ESMTP id CF3A55DD6D; Mon, 6 May 2019 18:03:47 +0000 (UTC) From: Kevin Buettner To: gdb-patches@sourceware.org Cc: Kevin Buettner Subject: [PATCH/commit] Fix regression caused by recently added syscall restart code Date: Mon, 6 May 2019 11:03:23 -0700 Message-Id: <20190506180323.11760-1-kevinb@redhat.com> MIME-Version: 1.0 X-IsSubscribed: yes This line of code... *(int64_t *) ptr = *(int32_t *) ptr; ...in linux-x86-low.c is not needed (and does not work correctly) within a 32-bit executable. I added an __x86_64__ ifdef (which is used extensively elsewhere in the file for like purposes) to prevent this code from being included in 32-bit builds. It fixes the following regressions when running on native i686-pc-linux-gnu: FAIL: gdb.server/abspath.exp: continue to main FAIL: gdb.server/connect-without-multi-process.exp: multiprocess=auto: continue to main FAIL: gdb.server/connect-without-multi-process.exp: multiprocess=off: continue to main FAIL: gdb.server/ext-restart.exp: restart: run to main FAIL: gdb.server/ext-restart.exp: run to main FAIL: gdb.server/ext-run.exp: continue to main FAIL: gdb.server/ext-wrapper.exp: print d FAIL: gdb.server/ext-wrapper.exp: restart: print d FAIL: gdb.server/ext-wrapper.exp: restart: run to marker FAIL: gdb.server/ext-wrapper.exp: run to marker FAIL: gdb.server/no-thread-db.exp: continue to breakpoint: after tls assignment FAIL: gdb.server/reconnect-ctrl-c.exp: first: stop with control-c FAIL: gdb.server/reconnect-ctrl-c.exp: second: stop with control-c FAIL: gdb.server/run-without-local-binary.exp: run test program until the end FAIL: gdb.server/server-kill.exp: continue to breakpoint: after server_pid assignment FAIL: gdb.server/server-kill.exp: tstatus FAIL: gdb.server/server-run.exp: continue to main gdb/gdbserver/ChangeLog: * linux-x86-low.c (x86_fill_gregset): Don't compile 64-bit sign extension code on 32-bit builds. --- gdb/gdbserver/ChangeLog | 5 +++++ gdb/gdbserver/linux-x86-low.c | 2 ++ 2 files changed, 7 insertions(+) diff --git a/gdb/gdbserver/ChangeLog b/gdb/gdbserver/ChangeLog index 82278e7bb2..2e98158aa6 100644 --- a/gdb/gdbserver/ChangeLog +++ b/gdb/gdbserver/ChangeLog @@ -1,3 +1,8 @@ +2019-05-06 Kevin Buettner + + * linux-x86-low.c (x86_fill_gregset): Don't compile 64-bit + sign extension code on 32-bit builds. + 2019-05-03 Eli Zaretskii * remote-utils.c: diff --git a/gdb/gdbserver/linux-x86-low.c b/gdb/gdbserver/linux-x86-low.c index dd7673126e..adddfe7797 100644 --- a/gdb/gdbserver/linux-x86-low.c +++ b/gdb/gdbserver/linux-x86-low.c @@ -339,6 +339,7 @@ x86_fill_gregset (struct regcache *regcache, void *buf) collect_register_by_name (regcache, "orig_eax", ((char *) buf) + ORIG_EAX * REGSIZE); +#ifdef __x86_64__ /* Sign extend EAX value to avoid potential syscall restart problems. @@ -351,6 +352,7 @@ x86_fill_gregset (struct regcache *regcache, void *buf) *(int64_t *) ptr = *(int32_t *) ptr; } +#endif } static void