From mboxrd@z Thu Jan 1 00:00:00 1970 From: Fernando Nasser To: Eric Marsden Cc: gdb@sources.redhat.com Subject: Re: conditional traps on powerpc Date: Mon, 19 Feb 2001 14:33:00 -0000 Message-id: <3A919E78.A2BE2D83@redhat.com> References: X-SW-Source: 2001-02/msg00260.html Eric Marsden wrote: > > I have a problem debugging a program which uses conditional traps on > powerpc (TWxxx instructions). Upon encountering these the linuxppc > kernel raises a SIGTRAP, which is grabbed by gdb. When running such a > program under gdb I can't distinguish between normal breakpoints and > these conditional trap instructions; debugging becomes impossible. > > Is there some way to handle this situation, or is it necessary to > modify gdb so that it looks at the faulting instruction to determine > whether it was a conditional trap? > Gdb considers that the SIGTRAP is a breakpoint if it has inserted a breakpoint at that address; otherwise it is a signal like any other. So, your breakpoints should work. W.r.t the signal processing, gdb has commands that let you decide what to do with signals received by the program being debugged. You may choose to "pass" them. If I am not mistaken, this would only apply to the SIGTRAPs that have been already determined not to be caused by a breakpoint. -- Fernando Nasser Red Hat Canada Ltd. E-Mail: fnasser@redhat.com 2323 Yonge Street, Suite #300 Toronto, Ontario M4P 2C9