This is the mail archive of the
gdb-patches@sourceware.cygnus.com
mailing list for the GDB project.
Re: [RFA] longjmp() breakpoints on Linux/x86
- To: Mark Kettenis <kettenis at wins dot uva dot nl>
- Subject: Re: [RFA] longjmp() breakpoints on Linux/x86
- From: Michael Snyder <msnyder at cygnus dot com>
- Date: Thu, 06 Jul 2000 16:52:16 -0700
- CC: gdb-patches at sourceware dot cygnus dot com, jimb at cygnus dot com
- Organization: Cygnus Solutions
- References: <200007062328.e66NSYA10978@delius.kettenis.local>
- Reply-To: msnyder at cygnus dot com
Mark Kettenis wrote:
>
> I'm having some difficulties with getting longjmp() breakpoints to
> work on Linux/x86. GDB tries to set longjmp() breakpoints at the
> following symbols: longjmp, _longjmp, siglongjmp, _siglongjmp. In
> glibc 2.1.3, the adresses of longjmp, _longjmp and siglongjmp are
> identical, which means that GDB creates multiple longjmp() breakpoints
> at one address. Later when we hit the breakpoint and bpstat_what() is
> called this leads to some problems. bpstat_what() iterates over all
> breakpoints that were hit (i.e. all three of them in the Linux case)
> and determines the appropriate action. On the first breakpoint it
> decides on BPSTAT_WHAT_SET_LONGJMP_RESUME. But on the second it
> decides that hitting multiple longjmp() breakpoints can't happen,
> which is translated into BPSTAT_WHAT_STOP_NOISY. The effect is that
> GDB stops in longjmp() instead of stepping over it.
>
> The simplest, and IMHO right solution is to keep returning
> BPSTAT_WHAT_SET_LONGJMP_RESUME if we hit multiple longjmp()
> breakpoints.
>
> Another option would be to avoid duplicate longjmp() breakpoints, but
> I think that would be more involving and probably less fool-proof.
>
> OK to check the attached patch in?
If it works, OK. Although I would have prefered the second option.
If this breaks some other target, will you undertake to do the other?