From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 81638 invoked by alias); 29 Jan 2017 22:41:05 -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 81555 invoked by uid 89); 29 Jan 2017 22:40:56 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.4 required=5.0 tests=BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,RCVD_IN_SORBS_SPAM,SPF_PASS autolearn=no version=3.3.2 spammy=Hx-languages-length:1673 X-Spam-User: qpsmtpd, 2 recipients X-HELO: mail-wm0-f66.google.com Received: from mail-wm0-f66.google.com (HELO mail-wm0-f66.google.com) (74.125.82.66) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sun, 29 Jan 2017 22:40:55 +0000 Received: by mail-wm0-f66.google.com with SMTP id u63so4978862wmu.2; Sun, 29 Jan 2017 14:40:55 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=DNbw6tXXMmUlisXrDJai/7ay5GtacnWvIuf/8JQpW20=; b=sXVa5V9WBchzm/y9iiY84UTE6+FWfAT1Ry82O5fSlowbcIMUYODnC4oUdeDIn7cIH+ 6R8+rWEj8VxdHOIDI+fX9TcN1cp7nHOLglr/iL8d4p9KTZ+UnQf4s2UK+AW2eiY8WCVb TGvCcF+376ZWBmUHGitWFvMvcQc0SIY6bQDFb/11aaq6eEZJ8l1LnDRWzbA+FNqNxa34 jNZLMr3szod+7G8PqY/jnI9v4Iw8owjcP1pGb0Dfo+mOMeTlwA6TA+CtKdBYDVs5GJSw J66FSpw0apd7Mxdx6cas/HIC9Ud1k8/eNzkttjlX6pU+th6jognEXTMx3GwY1I9LwZSF a35w== X-Gm-Message-State: AIkVDXKsXwkFBfB9rTyBTRn7CRI9tOC6joJ/QOBskQ19KvM5KAsnI3Ja3i+U0zyLWPiLuA== X-Received: by 10.28.236.93 with SMTP id k90mr10652210wmh.40.1485729653407; Sun, 29 Jan 2017 14:40:53 -0800 (PST) Received: from localhost ([2a02:c7d:8e80:c00:158b:292e:2700:bd80]) by smtp.gmail.com with ESMTPSA id 61sm19671245wrs.29.2017.01.29.14.40.51 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sun, 29 Jan 2017 14:40:52 -0800 (PST) Date: Sun, 29 Jan 2017 22:41:00 -0000 From: Yao Qi To: Steve Ellcey Cc: binutils , gdb-patches , Yury Norov , schwab@suse.de, "Pinski, Andrew" Subject: Re: [PATCH] Patch 2 of 2 for aarch64 ILP32 support in gdb Message-ID: <20170129224045.ekflcodtmfs4hv54@localhost> References: <1485303639.29977.10.camel@caviumnetworks.com> <20170126141414.GY28060@E107787-LIN> <1485555939.2509.5.camel@caviumnetworks.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1485555939.2509.5.camel@caviumnetworks.com> User-Agent: NeoMutt/20161104 (1.7.1) X-IsSubscribed: yes X-SW-Source: 2017-01/txt/msg00640.txt.bz2 On 17-01-27 14:25:39, Steve Ellcey wrote: > That patch seems reasonable and it fixed some test failures I had > in the glibc testsuite but it is breaking gdb.????If I undo this > patch by making this change to bfd/cpu-aarch64.c: > > ??static const bfd_arch_info_type bfd_aarch64_arch_ilp32 = > -????N (bfd_mach_aarch64_ilp32, "aarch64:ilp32", 32, FALSE, NULL); > +????N (bfd_mach_aarch64_ilp32, "aarch64:ilp32", 64, FALSE, NULL); > This changes the word size and address size, which is used to determine the inferior is arm or aarch64 by checking "bits_per_word == 32" in multi-arch debugging. You can find some instances of such check in aarch64-linux-nat.c. If the bits_per_word is 32 in ILP32, GDB thinks the inferior is an ARM one, rather than an AArch64 ILP32 one. which is wrong. We need to tweak the condition above to correctly identify the ARM inferior. > Then gdb starts working again and I can debug 32 bit programs. > > I am not sure how this change to the ILP32 aarch64 bfd description > is affecting gdb and why this change would break things.????Do you > know why this change messes up gdb? > D0 you compare the ILP32 gdb test result with normal aarch64 one? > + > /* Return the pseudo register name corresponding to register regnum. */ > > static const char * > @@ -2851,6 +2867,10 @@ aarch64_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) > const struct tdesc_feature *feature; > int num_regs = 0; > int num_pseudo_regs = 0; > + bool ilp32 = FALSE; > + s/FALSE/false/ > + if (info.bfd_arch_info->mach == bfd_mach_aarch64_ilp32) > + ilp32 = TRUE; s/TRUE/true/ -- Yao