From patchwork Sun Jun 2 22:44:59 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom Tromey X-Patchwork-Id: 32967 Received: (qmail 89485 invoked by alias); 2 Jun 2019 22:45:25 -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 89398 invoked by uid 89); 2 Jun 2019 22:45:21 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-18.7 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_HELO_PASS autolearn=ham version=3.3.1 spammy=FYI, fyi, 496 X-HELO: gateway34.websitewelcome.com Received: from gateway34.websitewelcome.com (HELO gateway34.websitewelcome.com) (192.185.148.222) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sun, 02 Jun 2019 22:45:04 +0000 Received: from cm11.websitewelcome.com (cm11.websitewelcome.com [100.42.49.5]) by gateway34.websitewelcome.com (Postfix) with ESMTP id 6CFC54D6DD for ; Sun, 2 Jun 2019 17:45:02 -0500 (CDT) Received: from box5379.bluehost.com ([162.241.216.53]) by cmsmtp with SMTP id XZDqhWKWqdnCeXZDqhAJJS; Sun, 02 Jun 2019 17:45:02 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=tromey.com; s=default; h=Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To:MIME-Version :Content-Type:Content-Transfer-Encoding:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: In-Reply-To:References:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=oa5WArylRlP8g5mWy5gWR4i2qakB9snrnQOpoq0m2JI=; b=MnpuejBkqP42sRzMnUIdd/X3b3 sqamwUkkCdkFFd+ScBTdIThJGuB9CIF1yCvreCibECOEpcpwntK1sCY/juCxCGA9nVoiGrhuvZWqG fFb66gOCN+07BxwkNuMOGEFPz; Received: from 174-29-48-168.hlrn.qwest.net ([174.29.48.168]:48544 helo=bapiya.Home) by box5379.bluehost.com with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.91) (envelope-from ) id 1hXZDq-003bbk-71; Sun, 02 Jun 2019 17:45:02 -0500 From: Tom Tromey To: gdb-patches@sourceware.org Cc: Tom Tromey Subject: [FYI] Remove fromhex implementation from gdbreplay Date: Sun, 2 Jun 2019 16:44:59 -0600 Message-Id: <20190602224459.1539-1-tom@tromey.com> gdbreplay had its own implementation of fromhex. This patch changes it to use the one in common/. gdb/gdbserver/ChangeLog 2019-06-02 Tom Tromey * gdbreplay.c (fromhex): Remove. * Makefile.in (GDBREPLAY_OBS): Add rsp-low.o. --- gdb/gdbserver/ChangeLog | 5 +++++ gdb/gdbserver/Makefile.in | 1 + gdb/gdbserver/gdbreplay.c | 21 +-------------------- 3 files changed, 7 insertions(+), 20 deletions(-) diff --git a/gdb/gdbserver/Makefile.in b/gdb/gdbserver/Makefile.in index f5fc55034ee..71865508d7a 100644 --- a/gdb/gdbserver/Makefile.in +++ b/gdb/gdbserver/Makefile.in @@ -291,6 +291,7 @@ GDBREPLAY_OBS = \ common/cleanups.o \ common/common-exceptions.o \ common/common-utils.o \ + common/rsp-low.o \ common/errors.o \ common/netstuff.o \ common/print-utils.o \ diff --git a/gdb/gdbserver/gdbreplay.c b/gdb/gdbserver/gdbreplay.c index 2800e7834df..f4fd5686ef7 100644 --- a/gdb/gdbserver/gdbreplay.c +++ b/gdb/gdbserver/gdbreplay.c @@ -49,6 +49,7 @@ #endif #include "common/netstuff.h" +#include "common/rsp-low.h" #ifndef HAVE_SOCKLEN_T typedef int socklen_t; @@ -288,26 +289,6 @@ remote_open (char *name) fflush (stderr); } -static int -fromhex (int ch) -{ - if (ch >= '0' && ch <= '9') - { - return (ch - '0'); - } - if (ch >= 'A' && ch <= 'F') - { - return (ch - 'A' + 10); - } - if (ch >= 'a' && ch <= 'f') - { - return (ch - 'a' + 10); - } - fprintf (stderr, "\nInvalid hex digit '%c'\n", ch); - fflush (stderr); - exit (1); -} - static int logchar (FILE *fp) {