public inbox for gdb@sourceware.org
 help / color / mirror / Atom feed
* tracking "next" failure?
@ 2003-06-01  1:37 Richard Henderson
  2003-06-01  2:48 ` Andrew Cagney
  0 siblings, 1 reply; 4+ messages in thread
From: Richard Henderson @ 2003-06-01  1:37 UTC (permalink / raw)
  To: gdb

How in the world do you go about finding out why:

   Breakpoint 1, main () at .../testsuite/gdb.base/all-types.c:35
   35          dummy();
   (gdb) next

   Program exited normally.
   (gdb) FAIL: gdb.base/all-bin.exp: continuing after dummy()

loses control of the application?  I'm getting completely lost.

I suspect that this is responsible for the bulk of the gdb test
failures on alpha at the moment.


r~

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: tracking "next" failure?
  2003-06-01  1:37 tracking "next" failure? Richard Henderson
@ 2003-06-01  2:48 ` Andrew Cagney
  2003-06-01  4:29   ` [RFA] fix dwarf2 unwind of pc Richard Henderson
  0 siblings, 1 reply; 4+ messages in thread
From: Andrew Cagney @ 2003-06-01  2:48 UTC (permalink / raw)
  To: Richard Henderson; +Cc: gdb

> How in the world do you go about finding out why:
> 
>    Breakpoint 1, main () at .../testsuite/gdb.base/all-types.c:35
>    35          dummy();
>    (gdb) next
> 
>    Program exited normally.
>    (gdb) FAIL: gdb.base/all-bin.exp: continuing after dummy()
> 
> loses control of the application?  I'm getting completely lost.
> 
> I suspect that this is responsible for the bulk of the gdb test
> failures on alpha at the moment.

Set a breakpoint on *_saved_pc_after_call, and then use nexti.

The loss of control is likely from a dud return address (used for 
setting the return breakpoint) being computed when the the code is first 
stepped into dummy().  The other is (hmm, alpha) something going wrong 
with software single step?

Andrew


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [RFA] fix dwarf2 unwind of pc
  2003-06-01  2:48 ` Andrew Cagney
@ 2003-06-01  4:29   ` Richard Henderson
  2003-06-01  9:44     ` Mark Kettenis
  0 siblings, 1 reply; 4+ messages in thread
From: Richard Henderson @ 2003-06-01  4:29 UTC (permalink / raw)
  To: Andrew Cagney; +Cc: gdb

On Sat, May 31, 2003 at 10:48:01PM -0400, Andrew Cagney wrote:
> The loss of control is likely from a dud return address (used for 
> setting the return breakpoint) being computed when the the code is first 
> stepped into dummy().

Indeed, a problem with the new dwarf2 unwinder.  Neither of the
targets Mark tested have the return address in a register.  Ok?


r~



	* dwarf2-frame.c (dwarf2_frame_cache): Handle retaddr_column
	not overlapping PC_REGNUM.

Index: dwarf2-frame.c
===================================================================
RCS file: /cvs/src/src/gdb/dwarf2-frame.c,v
retrieving revision 1.1
diff -c -p -d -r1.1 dwarf2-frame.c
*** dwarf2-frame.c	31 May 2003 19:18:05 -0000	1.1
--- dwarf2-frame.c	1 Jun 2003 04:26:17 -0000
*************** dwarf2_frame_cache (struct frame_info *n
*** 550,558 ****
  	cache->reg[regnum] = fs->regs.reg[reg];
      }
  
!   /* Stored the location of the return addess.  */
!   if (fs->retaddr_column < fs->regs.num_regs)
      cache->reg[PC_REGNUM] = fs->regs.reg[fs->retaddr_column];
  
    do_cleanups (old_chain);
  
--- 550,570 ----
  	cache->reg[regnum] = fs->regs.reg[reg];
      }
  
!   /* Store the location of the return addess.  If the return address
!      column (adjusted) is not the same as gdb's PC_REGNUM, then this
!      implies a copy from the ra column register.  */
!   if (fs->retaddr_column < fs->regs.num_regs
!       && fs->regs.reg[fs->retaddr_column].how != REG_UNSAVED)
      cache->reg[PC_REGNUM] = fs->regs.reg[fs->retaddr_column];
+   else
+     {
+       reg = DWARF2_REG_TO_REGNUM (fs->retaddr_column);
+       if (reg != PC_REGNUM)
+ 	{
+ 	  cache->reg[PC_REGNUM].loc.reg = reg;
+ 	  cache->reg[PC_REGNUM].how = REG_SAVED_REG;
+ 	}
+     }
  
    do_cleanups (old_chain);
  

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [RFA] fix dwarf2 unwind of pc
  2003-06-01  4:29   ` [RFA] fix dwarf2 unwind of pc Richard Henderson
@ 2003-06-01  9:44     ` Mark Kettenis
  0 siblings, 0 replies; 4+ messages in thread
From: Mark Kettenis @ 2003-06-01  9:44 UTC (permalink / raw)
  To: rth; +Cc: Andrew Cagney, gdb

Richard Henderson <rth@redhat.com> writes:

> On Sat, May 31, 2003 at 10:48:01PM -0400, Andrew Cagney wrote:
> > The loss of control is likely from a dud return address (used for 
> > setting the return breakpoint) being computed when the the code is first 
> > stepped into dummy().
> 
> Indeed, a problem with the new dwarf2 unwinder.  Neither of the
> targets Mark tested have the return address in a register.  Ok?
> 
> r~
> 
> 	* dwarf2-frame.c (dwarf2_frame_cache): Handle retaddr_column
> 	not overlapping PC_REGNUM.

Ah, GCC is trying to be economical here.  From reading the DWARF
standard I would have expected the compiler to have emitted CFA
instructions that actually put something in the return address column.
Anyway, this shouldn't hurt.

Approved.

Mark

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2003-06-01  9:44 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-06-01  1:37 tracking "next" failure? Richard Henderson
2003-06-01  2:48 ` Andrew Cagney
2003-06-01  4:29   ` [RFA] fix dwarf2 unwind of pc Richard Henderson
2003-06-01  9:44     ` Mark Kettenis

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).