From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 77597 invoked by alias); 10 Jun 2015 11:18:34 -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 77587 invoked by uid 89); 10 Jun 2015 11:18:33 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 X-HELO: relay1.mentorg.com Received: from relay1.mentorg.com (HELO relay1.mentorg.com) (192.94.38.131) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 10 Jun 2015 11:18:32 +0000 Received: from svr-orw-fem-03.mgc.mentorg.com ([147.34.97.39]) by relay1.mentorg.com with esmtp id 1Z2e1c-0005TE-Ty from Luis_Gustavo@mentor.com ; Wed, 10 Jun 2015 04:18:28 -0700 Received: from [172.30.6.78] (147.34.91.1) by svr-orw-fem-03.mgc.mentorg.com (147.34.97.39) with Microsoft SMTP Server id 14.3.224.2; Wed, 10 Jun 2015 04:18:28 -0700 Message-ID: <55781D03.5070003@codesourcery.com> Date: Wed, 10 Jun 2015 11:18:00 -0000 From: Luis Machado Reply-To: Luis Machado User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.7.0 MIME-Version: 1.0 To: Yao Qi , Taimoor CC: "gdb-patches@sourceware.org" Subject: Re: Improving GDB's mechanism to check if function is GC'ed References: <556DB1BB.50601@codesourcery.com> <86eglkeyfw.fsf@gmail.com> In-Reply-To: <86eglkeyfw.fsf@gmail.com> Content-Type: text/plain; charset="utf-8"; format=flowed Content-Transfer-Encoding: 7bit X-IsSubscribed: yes X-SW-Source: 2015-06/txt/msg00171.txt.bz2 On 06/10/2015 05:53 AM, Yao Qi wrote: > Taimoor writes: > > Hi Taimoor, > I happen to have to some time today to read your patch, here are my > comments below, > >> >> Current Problem >> =============== >> >> We are currently using GDB to debug Nucleus based bare-metal system >> that also allows to dynamically load and unload Nucleus process >> modules during system execution. >> We currently load symbols of a modules using add-symbol-file whenever >> a module is loaded at runtime. It is very common to have functions at >> address 0x0 in debug information and then lowpc in symbol table to be >> non-zero as it depends on section addresses given in add-symbol-file >> command. > > GDB just uses some heuristics to determine whether the function is GC'ed > by linker, so they may not be perfect. However, GDB doesn't support > Nucleus, so it isn't a valid case to me. Do we have other cases that we > add-symbol-file in which function address is at 0x0 on platforms GDB > supports? > > If the problem only exists on Nucleus, I am afraid I don't agree with > accepting this change, because GDB doesn't support Nucleus. Sorry. add-symbol-file can cause things to get weird with addresses given the user can specify the base address as it pleases. I don't think this is Nucleus-specific at all, but more generally bare-metal-specific. I take it DWARF says 0x0 and GDB relocates the symbol file/addresses based on the provided base address? Taimoor?