From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 93501 invoked by alias); 11 Jun 2015 08:54:46 -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 93483 invoked by uid 89); 11 Jun 2015 08:54:46 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.4 required=5.0 tests=AWL,BAYES_00,KAM_LAZY_DOMAIN_SECURITY,SPF_HELO_PASS,T_RP_MATCHES_RCVD autolearn=no version=3.3.2 X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Thu, 11 Jun 2015 08:54:44 +0000 Received: from int-mx14.intmail.prod.int.phx2.redhat.com (int-mx14.intmail.prod.int.phx2.redhat.com [10.5.11.27]) by mx1.redhat.com (Postfix) with ESMTPS id C6FD42CAB9B; Thu, 11 Jun 2015 08:54:42 +0000 (UTC) Received: from [127.0.0.1] (ovpn01.gateway.prod.ext.ams2.redhat.com [10.39.146.11]) by int-mx14.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id t5B8seHe010622; Thu, 11 Jun 2015 04:54:41 -0400 Message-ID: <55794CD0.3090406@redhat.com> Date: Thu, 11 Jun 2015 08:54:00 -0000 From: Pedro Alves User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.5.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> <55780EB4.1070003@redhat.com> <5578285D.2030808@gmail.com> <55784D18.2000003@redhat.com> <5579472A.6020200@gmail.com> In-Reply-To: <5579472A.6020200@gmail.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-SW-Source: 2015-06/txt/msg00203.txt.bz2 On 06/11/2015 09:30 AM, Yao Qi wrote: >> > >> > IIUC, this triggers on use of add-symbol-file with relocatable >> > objects, when there's real code at address 0. I think that's the angle >> > we should look at things. >> > > Yes, that is the problem. GDB thinks the function is GC'ed by linker > but in fact it isn't. The key point here is _relocatable_ objects. These are special in that they aren't fully linked, so they have relocations in the debug info, and their sections on file start at address zero. See default_symfile_offsets. I still don't understand how lowpc doesn't end up as 0 in the case at hand, meaning there's really code at 0. Or does lowpc really end up as 0, but the real issue is that "lowpc==0" is ambiguous, and we need to track a separate "have pc range" flag? Taimoor, I'd expect you're passing a "0" to add-symbol-file, like: (gdb) add-symbol-file ... -s .some_section 0 ... I think it'd help to see an example invocation of the command. I'd think it possible to expand gdb.base/relocate.exp (or create a new test based on it) to cover this scenario everywhere. Thanks, Pedro Alves