From patchwork Mon Oct 29 08:18:33 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Denis Dmitriev X-Patchwork-Id: 29937 Received: (qmail 62521 invoked by alias); 29 Oct 2018 08:18:48 -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 62499 invoked by uid 89); 29 Oct 2018 08:18:47 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-25.0 required=5.0 tests=AWL, BAYES_00, FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, HTML_MESSAGE, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.2 spammy=arches, H*r:sk:i15-v6s, H*c:alternative, sincerely X-HELO: mail-qt1-f179.google.com Received: from mail-qt1-f179.google.com (HELO mail-qt1-f179.google.com) (209.85.160.179) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 29 Oct 2018 08:18:46 +0000 Received: by mail-qt1-f179.google.com with SMTP id i15-v6so8229317qtr.0 for ; Mon, 29 Oct 2018 01:18:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=+fdlnLhzJUer2gk2/ue08RlmBchWiYYH7WR4n2AMA5Q=; b=DrNXVVFbqDw1AcPRMMAebGjGVTG/sbC46l0yvwa6TIk4WnssGbP0AKKdMygs2JBkK7 Ju0rxctOBbo5QQ3sxNfyo29o2K1+NmcU9ZJ572RvqBqok2RNYD1y2x2db0D6MrbT5Fx9 yrfC9GgNR9HpxbiSmDOMkydlNeErnPGjSDCwO1dOc88UaG7vJ2CzmvzEqFAmSw3xIon7 5aPSOrRbZiOFI2j7XsC8Vqvzs3oJmjoJZWPOBltOpjOXblG5Iyz37j1lZsxvDR48PD2Q M0x8JCL+xwLnSsPnRahzLFP2DGGKE8UOEMzhUt6iQHjRNWUw+2CzMv7e6hAmPaX+pwLf FTng== MIME-Version: 1.0 From: Denis Dmitriev Date: Mon, 29 Oct 2018 11:18:33 +0300 Message-ID: Subject: [PATCH] Abi selection based on set arch command in case of remote debugging for MIPS To: gdb-patches@sourceware.org Abi selection based on the execution of the "set arch" command in the case of remote debugging. Mips. No need to manually configure abi. if (gdbarch_debug) diff --git a/gdb/mips-tdep.c b/gdb/mips-tdep.c index 5e0a606..dc6b6181 100644 --- a/gdb/mips-tdep.c +++ b/gdb/mips-tdep.c @@ -8085,7 +8085,20 @@ mips_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) if (info.abfd && bfd_get_flavour (info.abfd) == bfd_target_elf_flavour) elf_flags = elf_elfheader (info.abfd)->e_flags; else if (arches != NULL) + { elf_flags = gdbarch_tdep (arches->gdbarch)->elf_flags; + if (elf_flags == 0) + { + if (info.bfd_arch_info && info.bfd_arch_info->bits_per_address == 64) + { + elf_flags = E_MIPS_ABI_EABI64; + } + else if (info.bfd_arch_info->bits_per_address == 32) + { + elf_flags = MIPS_ABI_EABI32; + } + } + } else elf_flags = 0;