From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8440 invoked by alias); 22 Sep 2014 13:52:20 -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 8427 invoked by uid 89); 22 Sep 2014 13:52:20 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.7 required=5.0 tests=AWL,BAYES_00 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; Mon, 22 Sep 2014 13:52:18 +0000 Received: from svr-orw-fem-03.mgc.mentorg.com ([147.34.97.39]) by relay1.mentorg.com with esmtp id 1XW42J-0006Cw-B5 from Yao_Qi@mentor.com for gdb-patches@sourceware.org; Mon, 22 Sep 2014 06:52:15 -0700 Received: from qiyao.dyndns.org (147.34.91.1) by svr-orw-fem-03.mgc.mentorg.com (147.34.97.39) with Microsoft SMTP Server id 14.3.181.6; Mon, 22 Sep 2014 06:52:14 -0700 Message-ID: <54202887.2090401@codesourcery.com> Date: Mon, 22 Sep 2014 13:52:00 -0000 From: Yao Qi User-Agent: Mozilla/5.0 (X11; Linux i686; rv:24.0) Gecko/20100101 Thunderbird/24.7.0 MIME-Version: 1.0 To: Subject: Re: [PATCH] Fix gdb.dwarf2/dwz.exp for thumb mode References: <1409706936-11220-1-git-send-email-yao@codesourcery.com> <87k356lfa8.fsf@codesourcery.com> <87r3zd2hr3.fsf@codesourcery.com> In-Reply-To: <87r3zd2hr3.fsf@codesourcery.com> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8bit X-IsSubscribed: yes X-SW-Source: 2014-09/txt/msg00662.txt.bz2 On 09/15/2014 08:25 PM, Yao Qi wrote: > Subject: [PATCH] Fix gdb.dwarf2/dwz.exp for thumb mode > > We see the fail in gdb.dwarf2/dwz.exp in thumb mode, > > p the_int^M > $2 = 99^M > (gdb) FAIL: gdb.dwarf2/dwz.exp: p the_int > > In thumb mode, the lsb of references to 'main' in the assembly > (produced by dwarf assember) is set, so the generated debug > information is incorrect. > > in this patch, we add a label main_label inside function main. Linker > doesn't set its lsb in thumb mode, and we can get function main's > address by 'main_label - $main_label_offset'. This label isn't moved > out of function main in both gcc and clang. > > gdb/testsuite: > > 2014-09-15 Yao Qi > > * gdb.dwarf2/main.c (main): New lable main_label. > * gdb.dwarf2/dwz.exp: Get the offset of main_label to main. > Return early if $main_label_offset is unknown. Get address > of main by "main_label - $main_label_offset". Ping. https://sourceware.org/ml/gdb-patches/2014-09/msg00497.html -- Yao (齐尧)