This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH] [gdbserver] Disable conditional breakpoints on no-hardware-single-step targets
- From: Antoine Tremblay <antoine dot tremblay at ericsson dot com>
- To: Yao Qi <qiyaoltc at gmail dot com>, <gdb-patches at sourceware dot org>
- Date: Thu, 30 Apr 2015 13:10:29 -0400
- Subject: Re: [PATCH] [gdbserver] Disable conditional breakpoints on no-hardware-single-step targets
- Authentication-results: sourceware.org; auth=none
- References: <1430411029-12097-1-git-send-email-qiyaoltc at gmail dot com>
On 04/30/2015 12:23 PM, Yao Qi wrote:
From: Yao Qi <yao.qi@linaro.org>
/* 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 ?
Regards,
Antoine Tremblay