From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 97914 invoked by alias); 16 Oct 2018 21:13:18 -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 97894 invoked by uid 89); 16 Oct 2018 21:13:18 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00,SPF_HELO_PASS,SPF_PASS autolearn=ham version=3.3.2 spammy= X-HELO: smtp.polymtl.ca Received: from smtp.polymtl.ca (HELO smtp.polymtl.ca) (132.207.4.11) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 16 Oct 2018 21:13:16 +0000 Received: from simark.ca (simark.ca [158.69.221.121]) (authenticated bits=0) by smtp.polymtl.ca (8.14.7/8.14.7) with ESMTP id w9GLD9mV001111 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Tue, 16 Oct 2018 17:13:14 -0400 Received: by simark.ca (Postfix, from userid 112) id D12551EA6F; Tue, 16 Oct 2018 17:13:07 -0400 (EDT) Received: from simark.ca (localhost [127.0.0.1]) by simark.ca (Postfix) with ESMTP id C61ED1E519; Tue, 16 Oct 2018 17:13:06 -0400 (EDT) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Tue, 16 Oct 2018 21:13:00 -0000 From: Simon Marchi To: Denis Dmitriev Cc: gdb-patches@sourceware.org Subject: Re: [PATCH] Fix target architecture address size inside gdbarch structure In-Reply-To: References: Message-ID: <63523264fb0856e46a4846517945b6e4@polymtl.ca> X-Sender: simon.marchi@polymtl.ca User-Agent: Roundcube Webmail/1.3.6 X-IsSubscribed: yes X-SW-Source: 2018-10/txt/msg00352.txt.bz2 On 2018-10-16 08:03, Denis Dmitriev wrote: > Hi all, > GDB can't get information about instructions when debugging > mips:octeon2 > architecture. > The problem is that the gdbarch structure contains the wrong address > size > for target architecture (gdbarch->addr_bit, 32). > However, in the same structure there is data settings for the target > architecture (mips:octeon2) which indicate the correct address size > (gdbarch->bfd_arch_info->bits_per_address, 64). > This patch fixes creation gdbarch structure. Now the address size is > taken > directly from the settings (gdbarch->bfd_arch_info). Hi Denis, This file (gdbarch.c) is generated from gdbarch.sh, so it can't be modified directly. What you see here: gdbarch->addr_bit = gdbarch_ptr_bit (gdbarch); is the result from the default value of the addr_bit property in gdbarch.sh: 402 v;int;addr_bit;;;8 * sizeof (void*);0;gdbarch_ptr_bit (gdbarch); So if any modification needs to be done here, it needs to be in gdbarch.sh. However, I tried generating an executable with: $ mips64el-linux-gnuabi64-gcc --versio mips64el-linux-gnuabi64-gcc (Ubuntu 5.4.0-6ubuntu1~16.04.9) 5.4.0 20160609 Copyright (C) 2015 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. $ mips64el-linux-gnuabi64-gcc test.c -o test And the resulting addr_bit and ptr_bit in gdb are both 64. From you explanations, I get that the value you get for ptr_bit is 32. Is this value the right one, or it should be 64? Could you share how you generate you executable, with what toolchain, etc? Simon