From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 29022 invoked by alias); 15 Sep 2011 16:13:42 -0000 Received: (qmail 29007 invoked by uid 22791); 15 Sep 2011 16:13:40 -0000 X-SWARE-Spam-Status: No, hits=-1.6 required=5.0 tests=AWL,BAYES_00,TW_BL X-Spam-Check-By: sourceware.org Received: from relay1.mentorg.com (HELO relay1.mentorg.com) (192.94.38.131) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 15 Sep 2011 16:13:26 +0000 Received: from nat-jpt.mentorg.com ([192.94.33.2] helo=PR1-MAIL.mgc.mentorg.com) by relay1.mentorg.com with esmtp id 1R4EZ3-0002bt-Br from Yao_Qi@mentor.com for gdb@sourceware.org; Thu, 15 Sep 2011 09:13:25 -0700 Received: from [172.30.8.86] ([172.30.8.86]) by PR1-MAIL.mgc.mentorg.com with Microsoft SMTPSVC(6.0.3790.1830); Fri, 16 Sep 2011 01:13:24 +0900 Message-ID: <4E72241F.5060402@codesourcery.com> Date: Thu, 15 Sep 2011 16:13:00 -0000 From: Yao Qi User-Agent: Mozilla/5.0 (X11; Linux i686; rv:6.0.2) Gecko/20110906 Thunderbird/6.0.2 MIME-Version: 1.0 To: gdb@sourceware.org Subject: Re: GDB 7.2 gets SIGSEGV when step into a function in a shared library References: In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-IsSubscribed: yes Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org X-SW-Source: 2011-09/txt/msg00054.txt.bz2 On 09/15/2011 12:21 AM, Liang Cheng wrote: > Hi, > > The application and library under debug were built for ARM. The > target is running Android OS, > and the host is Linux X86 64. As long as we try to step into the > function xa_fun_in_lib, it would > cause segmentation fault in gdb. Same thing happened if step the instructions. > > Here are the experiments I did for this issue, and some notes. > If you are reporting a problem of gdb, please describe the problem as clear as possible. A clean and simple debug session is helpful for other people here to understand what is your problem. Please don't mix the experiments or your work in the problem description. > > So far I am stuck because of no idea why PC gets messed up. Anyone > else the similar issue > when trying to debug function in library? And any input to how to > investigate gdb/gdbserver side > also is appreciated. (below some other information is dumped). > Due to lack of clear steps you did in gdb, and its output, I have no idea what the problem is and how do you get to the problem, except for some wild guess, > (gdb) disassemble /m 0x8d14 > Dump of assembler code for function main: > .... > 286 z = xa_fun_in_lib(10); > => 0x00008d18<+84>: mov.w r0, #10 > 0x00008d1c<+88>: blx 0x8628 > 0x00008d20<+92>: mov r3, r0 > 0x00008d22<+94>: str r3, [r7, #44] ; 0x2c How do you get SIGSEGV from here? I guess you typed `step' try to step into xa_fun_in_lib, but get a SIGSEGV afterwards. Last but not least, as Hui suggested, please try GDB 7.3 release or GDB CVS trunk. -- Yao (齐尧)