From patchwork Thu Oct 10 17:14:37 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom Tromey X-Patchwork-Id: 34910 Received: (qmail 8205 invoked by alias); 10 Oct 2019 17:14:42 -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 8197 invoked by uid 89); 10 Oct 2019 17:14:42 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-22.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_PASS autolearn=ham version=3.3.1 spammy=HContent-Transfer-Encoding:8bit X-HELO: rock.gnat.com Received: from rock.gnat.com (HELO rock.gnat.com) (205.232.38.15) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 10 Oct 2019 17:14:41 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by filtered-rock.gnat.com (Postfix) with ESMTP id AC35E117E6C; Thu, 10 Oct 2019 13:14:39 -0400 (EDT) Received: from rock.gnat.com ([127.0.0.1]) by localhost (rock.gnat.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id uX3kQB6cwC7H; Thu, 10 Oct 2019 13:14:39 -0400 (EDT) Received: from murgatroyd.Home (174-29-53-230.hlrn.qwest.net [174.29.53.230]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by rock.gnat.com (Postfix) with ESMTPSA id 5824E117C41; Thu, 10 Oct 2019 13:14:39 -0400 (EDT) From: Tom Tromey To: gdb-patches@sourceware.org Cc: Tom Tromey Subject: [PATCH] gdbserver does not need xstrdup Date: Thu, 10 Oct 2019 11:14:37 -0600 Message-Id: <20191010171437.11145-1-tromey@adacore.com> MIME-Version: 1.0 gdbserver has its own implementation of xstrdup. However, because gdbserver links against libiberty now, I think this is not needed. This patch removes it. gdb/gdbserver/ChangeLog 2019-09-03 Tom Tromey * utils.c (xstrdup): Remove. --- gdb/gdbserver/ChangeLog | 4 ++++ gdb/gdbserver/utils.c | 12 ------------ 2 files changed, 4 insertions(+), 12 deletions(-) diff --git a/gdb/gdbserver/utils.c b/gdb/gdbserver/utils.c index 79a7e80f625..6a0e7a7a0f9 100644 --- a/gdb/gdbserver/utils.c +++ b/gdb/gdbserver/utils.c @@ -37,18 +37,6 @@ malloc_failure (long size) exit (1); } -/* Copy a string into a memory buffer. - If malloc fails, this will print a message to stderr and exit. */ - -char * -xstrdup (const char *s) -{ - char *ret = strdup (s); - if (ret == NULL) - malloc_failure (strlen (s) + 1); - return ret; -} - /* Print the system error message for errno, and also mention STRING as the file name for which the error was encountered. Then return to command level. */