From patchwork Tue Jul 10 11:58:42 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Burgess X-Patchwork-Id: 28290 Received: (qmail 52721 invoked by alias); 10 Jul 2018 11:58:54 -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 52625 invoked by uid 89); 10 Jul 2018 11:58:54 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-25.3 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.2 spammy= X-HELO: mail-wm0-f46.google.com Received: from mail-wm0-f46.google.com (HELO mail-wm0-f46.google.com) (74.125.82.46) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 10 Jul 2018 11:58:52 +0000 Received: by mail-wm0-f46.google.com with SMTP id z13-v6so24034504wma.5 for ; Tue, 10 Jul 2018 04:58:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=embecosm.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :in-reply-to:references; bh=LeEM7Q7YXdy60fiRSwsaZF7heHylrOqskbZGJwwudWc=; b=Vwvq1x85Vw4/O3bcxbcL+FA7lZPV1Py8OrLm4DsV9badO6romgokCtUu8k2yD9IlNS XgamAdNV3m3ABpiWRuoh0eajQsTpcA73L4wEd019YRkm7uKoPqmE9BvnWRBDnn+2h7g9 MFli+GpSymCoDtR4wfVxuw2jO3iKfPre4sKvDDxWIPVH36gmGrhw+6I2Rq+7+22jnsMT v4KbfPvYRve0IrGeKzRL3MNMBzz8ddj8yI7dp0ztaWFbbl4rIc+U3vF+gTLgLhvdjKWR pFfPsWMfCdpv/r3n8GGK7Y+Te3vrqHakY64V+yChhhoBjI57Hu2mPE3GIdORjXGtL+cv rD9A== Return-Path: Received: from localhost (host86-164-199-62.range86-164.btcentralplus.com. [86.164.199.62]) by smtp.gmail.com with ESMTPSA id d15-v6sm12869436wmb.0.2018.07.10.04.58.49 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 10 Jul 2018 04:58:49 -0700 (PDT) From: Andrew Burgess To: gdb-patches@sourceware.org Cc: Andrew Burgess Subject: [PATCH 1/2] gdb/riscv: Use TYPE_SAFE_NAME Date: Tue, 10 Jul 2018 12:58:42 +0100 Message-Id: <42ecac1732194293568ab6093c742ca74c1dbdf6.1531223299.git.andrew.burgess@embecosm.com> In-Reply-To: References: In-Reply-To: References: X-IsSubscribed: yes In debug printing, use TYPE_SAFE_NAME instead of replicating the functionality using TYPE_NAME and a null check. gdb/ChangeLog: * riscv-tdep.c (riscv_print_arg_location): Use TYPE_SAFE_NAME. --- gdb/ChangeLog | 4 ++++ gdb/riscv-tdep.c | 6 +----- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/gdb/riscv-tdep.c b/gdb/riscv-tdep.c index 4c68ef73fc5..e2be993eaf0 100644 --- a/gdb/riscv-tdep.c +++ b/gdb/riscv-tdep.c @@ -1939,12 +1939,8 @@ riscv_print_arg_location (ui_file *stream, struct gdbarch *gdbarch, struct riscv_arg_info *info, CORE_ADDR sp_refs, CORE_ADDR sp_args) { - const char* type_name = TYPE_NAME (info->type); - if (type_name == nullptr) - type_name = "???"; - fprintf_unfiltered (stream, "type: '%s', length: 0x%x, alignment: 0x%x", - type_name, info->length, info->align); + TYPE_SAFE_NAME (info->type), info->length, info->align); switch (info->argloc[0].loc_type) { case riscv_arg_info::location::in_reg: