From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9414 invoked by alias); 8 May 2015 12:18:09 -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 9405 invoked by uid 89); 8 May 2015 12:18:08 -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; Fri, 08 May 2015 12:18:06 +0000 Received: from svr-orw-fem-05.mgc.mentorg.com ([147.34.97.43]) by relay1.mentorg.com with esmtp id 1YqhEA-0004HS-Mk from Luis_Gustavo@mentor.com ; Fri, 08 May 2015 05:18:02 -0700 Received: from [172.30.2.216] (147.34.91.1) by svr-orw-fem-05.mgc.mentorg.com (147.34.97.43) with Microsoft SMTP Server id 14.3.224.2; Fri, 8 May 2015 05:18:02 -0700 Message-ID: <554CA972.8050700@codesourcery.com> Date: Fri, 08 May 2015 12: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.6.0 MIME-Version: 1.0 To: Antoine Tremblay , Yao Qi , Subject: Re: [PATCH] [gdbserver] Disable conditional breakpoints on no-hardware-single-step targets References: <1430411029-12097-1-git-send-email-qiyaoltc@gmail.com> <55426205.3070901@ericsson.com> In-Reply-To: <55426205.3070901@ericsson.com> Content-Type: text/plain; charset="windows-1252"; format=flowed Content-Transfer-Encoding: 7bit X-IsSubscribed: yes X-SW-Source: 2015-05/txt/msg00188.txt.bz2 On 04/30/2015 02:10 PM, Antoine Tremblay wrote: > > > On 04/30/2015 12:23 PM, Yao Qi wrote: >> From: Yao Qi >> /* Define an ARM-mode breakpoint; we only set breakpoints in the C >> library, which is most likely to be ARM. If the kernel supports >> clone events, we will never insert a breakpoint, so even a Thumb >> C library will work; so will mixing EABI/non-EABI gdbserver and >> application. */ >> #ifndef __ARM_EABI__ >> (const unsigned char *) &arm_breakpoint, >> #else >> (const unsigned char *) &arm_eabi_breakpoint, >> #endif >> >> note that the comments are no longer valid as C library can be compiled >> in thumb mode. > > Could we update the comments at the same time ?... >> >> When GDBserver steps over a breakpoint in arm mode function, which >> returns to thumb mode, GDBserver will insert arm mode breakpoint by >> mistake and the program will crash. GDBserver alone is unable to >> determine the arm/thumb mode given a PC address. See how GDB does >> it in arm-tdep.c:arm_pc_is_thumb. >> >> After thinking about how to teach GDBserver inserting right breakpoint >> (arm or thumb) for a while, I reconsider it from a different direction >> that it may be unreasonable to run target-side conditional breakpoint for >> targets without hardware single step. Pedro also pointed this out here >> https://sourceware.org/ml/gdb-patches/2015-04/msg00337.html >> > > I'm looking into teaching gdbserver about inserting the right > breakpoint and possibly software single-step like this post : > https://sourceware.org/ml/gdb/2012-10/msg00077.html wanted to do... > > It would also fix the problem where we would step-over other breakpoints... > > But it does seems very complex to say the least, I'm still early in my > investigation but if you could share your thoughts on how you came to > think of it as unreasonable to fix arm-mode and possibly the > single-stepping it would be appreciated ? I like the idea of having gdbserver learn how to properly software-single-step, allowing us to share the knowledge GDB already has. Disabling a feature, on the other hand, sound like a backward movement. People with knowledge on each architecture can probably help fine tune those to their needs.