From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 50030 invoked by alias); 25 Jan 2017 08:38:33 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 49923 invoked by uid 89); 25 Jan 2017 08:38:32 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.5 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,RCVD_IN_SORBS_SPAM,SPF_PASS autolearn=no version=3.3.2 spammy=H*MI:sk:1484560, H*RU:209.85.192.193, Hx-spam-relays-external:209.85.192.193, sid X-HELO: mail-pf0-f193.google.com Received: from mail-pf0-f193.google.com (HELO mail-pf0-f193.google.com) (209.85.192.193) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 25 Jan 2017 08:38:25 +0000 Received: by mail-pf0-f193.google.com with SMTP id y143so13931966pfb.1 for ; Wed, 25 Jan 2017 00:38:25 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references; bh=abNc1zw1Pxx9MZs+wc1uPLW3F4NFqnEPD9eEUk/9d1c=; b=jcfv99lWqInlyVxnKxhBGTRgWwSqRRJAX8psgSwEg/trsUMPYffcn8/s6SE1VBIHnj kBx0ps0Xfzds7mrPlqR3+AX47fOmSOHPlF5bXu08Omicjn69HW2D753pMOylWXzqQuj6 rpdEGf6ETCcq7mXvMEfGmVxpQOMhi4kh5hk5E3BaCZ6LMkIud5AQGwEFdFhvDx9rYyyu LTQCRSbW3QcTWT5k4yvV1G59hxAspe98Ww0xDDzK2KLpRMH2dz8b9iudu4beh1id8kfy mtHoelDjULn0zgYs+v3Y2kc3lnQdrtucwuR7K/y5xgQVvsDpt71TYEJRg3GMM8xZE+JA aeQg== X-Gm-Message-State: AIkVDXIFTVXkWYrODHrCQKrOmZDgwWuPsFqDSzwii6AyV0qvKAHA3e7ixvUoJnpNAwbqhQ== X-Received: by 10.99.56.29 with SMTP id f29mr45659604pga.167.1485333504031; Wed, 25 Jan 2017 00:38:24 -0800 (PST) Received: from E107787-LIN.cambridge.arm.com (gcc1-power7.osuosl.org. [140.211.15.137]) by smtp.gmail.com with ESMTPSA id x2sm50271378pfa.71.2017.01.25.00.38.22 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 25 Jan 2017 00:38:23 -0800 (PST) From: Yao Qi X-Google-Original-From: Yao Qi To: gdb-patches@sourceware.org Subject: [PATCH 3/6] Call print_insn_mep in mep_gdb_print_insn Date: Wed, 25 Jan 2017 08:38:00 -0000 Message-Id: <1485333480-20515-4-git-send-email-yao.qi@linaro.org> In-Reply-To: <1485333480-20515-1-git-send-email-yao.qi@linaro.org> References: <1484560977-8693-1-git-send-email-yao.qi@linaro.org> <1485333480-20515-1-git-send-email-yao.qi@linaro.org> X-IsSubscribed: yes X-SW-Source: 2017-01/txt/msg00515.txt.bz2 opcodes/mep-dis.c:mep_print_insn has already had the code to handle the case when info->section is NULL, /* Picking the right ISA bitmask for the current context is tricky. */ if (info->section) { } else /* sid or gdb */ { } so that we can still cal print_insn_mep even section can't be found. On the other hand, user can disassemble an arbitrary address which doesn't map to any section at all. gdb: 2017-01-10 Yao Qi * mep-tdep.c (mep_gdb_print_insn): Set info->arch to bfd_arch_mep. Don't return 0 if section is not found. Call print_insn_mep. --- gdb/mep-tdep.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/gdb/mep-tdep.c b/gdb/mep-tdep.c index 68b0c4b..b1dcc86 100644 --- a/gdb/mep-tdep.c +++ b/gdb/mep-tdep.c @@ -1266,13 +1266,12 @@ mep_pseudo_register_write (struct gdbarch *gdbarch, /* Disassembly. */ -/* The mep disassembler needs to know about the section in order to - work correctly. */ static int mep_gdb_print_insn (bfd_vma pc, disassemble_info * info) { struct obj_section * s = find_pc_section (pc); + info->arch = bfd_arch_mep; if (s) { /* The libopcodes disassembly code uses the section to find the @@ -1280,12 +1279,9 @@ mep_gdb_print_insn (bfd_vma pc, disassemble_info * info) the me_module index, and the me_module index to select the right instructions to print. */ info->section = s->the_bfd_section; - info->arch = bfd_arch_mep; - - return print_insn_mep (pc, info); } - - return 0; + + return print_insn_mep (pc, info); } -- 1.9.1