Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* ia64 patch to handle predicated insns in prologue
@ 2003-08-26 19:50 J. Johnston
  2003-08-26 20:10 ` Kevin Buettner
  0 siblings, 1 reply; 5+ messages in thread
From: J. Johnston @ 2003-08-26 19:50 UTC (permalink / raw)
  To: gdb-patches

[-- Attachment #1: Type: text/plain, Size: 708 bytes --]

The accompanying patch handles a bug in backtracing through glibc's sleep.
The compiler generates some predicated insns prior to saving the return register
b0 into a register stack register.  The current code stops when it sees a
predicated insn.  The change makes the prologue examination stop only if the
function is frameless or we have already seen the return register.

This removes a number of failures in gdb.threads caused when we catch another
thread in sleep and we try and backtrace.

Ok to commit?

-- Jeff J.

2003-08-26  Jeff Johnston  <jjohnstn@redhat.com>

	* ia64-tdep.c (examine_prologue): Only stop at predicated insns if
	we are frameless or the return address register is already known.

[-- Attachment #2: ia64-tdep-predicated.patch --]
[-- Type: text/plain, Size: 996 bytes --]

Index: ia64-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/ia64-tdep.c,v
retrieving revision 1.94
diff -u -r1.94 ia64-tdep.c
--- ia64-tdep.c	26 Aug 2003 17:33:22 -0000	1.94
+++ ia64-tdep.c	26 Aug 2003 17:46:44 -0000
@@ -1143,11 +1143,18 @@
       if (next_pc == 0)
 	break;
 
-      if ((it == B && ((instr & 0x1e1f800003f) != 0x04000000000))
-          || ((instr & 0x3fLL) != 0LL))
+      if (it == B && ((instr & 0x1e1f800003f) != 0x04000000000))
 	{
-	  /* Exit loop upon hitting a non-nop branch instruction 
-	     or a predicated instruction. */
+	  /* Exit loop upon hitting a non-nop branch instruction. */ 
+	  if (trust_limit)
+	    lim_pc = pc;
+	  break;
+	}
+      else if (((instr & 0x3fLL) != 0LL) && 
+	       (frameless || ret_reg != 0))
+	{
+	  /* Exit loop upon hitting a predicated instruction if
+	     we already have the return register or if we are frameless.  */ 
 	  if (trust_limit)
 	    lim_pc = pc;
 	  break;

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

* Re: ia64 patch to handle predicated insns in prologue
  2003-08-26 19:50 ia64 patch to handle predicated insns in prologue J. Johnston
@ 2003-08-26 20:10 ` Kevin Buettner
  2003-08-26 22:26   ` J. Johnston
  0 siblings, 1 reply; 5+ messages in thread
From: Kevin Buettner @ 2003-08-26 20:10 UTC (permalink / raw)
  To: J. Johnston, gdb-patches

On Aug 26,  2:30pm, J. Johnston wrote:

> The accompanying patch handles a bug in backtracing through glibc's sleep.
> The compiler generates some predicated insns prior to saving the return register
> b0 into a register stack register.  The current code stops when it sees a
> predicated insn.  The change makes the prologue examination stop only if the
> function is frameless or we have already seen the return register.
> 
> This removes a number of failures in gdb.threads caused when we catch another
> thread in sleep and we try and backtrace.
> 
> Ok to commit?

Okay.

Thanks again,

Kevin


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

* Re: ia64 patch to handle predicated insns in prologue
  2003-08-26 20:10 ` Kevin Buettner
@ 2003-08-26 22:26   ` J. Johnston
  2003-08-26 22:36     ` Kevin Buettner
  0 siblings, 1 reply; 5+ messages in thread
From: J. Johnston @ 2003-08-26 22:26 UTC (permalink / raw)
  To: Kevin Buettner; +Cc: gdb-patches

Patch checked in, thanks.  I forgot to ask: should all the ia64-tdep.c changes be
put into gdb-6.0?

-- Jeff J.

Kevin Buettner wrote:
> On Aug 26,  2:30pm, J. Johnston wrote:
> 
> 
>>The accompanying patch handles a bug in backtracing through glibc's sleep.
>>The compiler generates some predicated insns prior to saving the return register
>>b0 into a register stack register.  The current code stops when it sees a
>>predicated insn.  The change makes the prologue examination stop only if the
>>function is frameless or we have already seen the return register.
>>
>>This removes a number of failures in gdb.threads caused when we catch another
>>thread in sleep and we try and backtrace.
>>
>>Ok to commit?
> 
> 
> Okay.
> 
> Thanks again,
> 
> Kevin
> 


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

* Re: ia64 patch to handle predicated insns in prologue
  2003-08-26 22:26   ` J. Johnston
@ 2003-08-26 22:36     ` Kevin Buettner
  2003-08-27 18:26       ` J. Johnston
  0 siblings, 1 reply; 5+ messages in thread
From: Kevin Buettner @ 2003-08-26 22:36 UTC (permalink / raw)
  To: J. Johnston, Kevin Buettner; +Cc: gdb-patches

On Aug 26,  6:26pm, J. Johnston wrote:

> Patch checked in, thanks.  I forgot to ask:  should all the
> ia64-tdep.c changes be put into gdb-6.0?

Sure.

Kevin


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

* Re: ia64 patch to handle predicated insns in prologue
  2003-08-26 22:36     ` Kevin Buettner
@ 2003-08-27 18:26       ` J. Johnston
  0 siblings, 0 replies; 5+ messages in thread
From: J. Johnston @ 2003-08-27 18:26 UTC (permalink / raw)
  To: Kevin Buettner; +Cc: gdb-patches

Kevin Buettner wrote:
> On Aug 26,  6:26pm, J. Johnston wrote:
> 
> 
>>Patch checked in, thanks.  I forgot to ask:  should all the
>>ia64-tdep.c changes be put into gdb-6.0?
> 
> 
> Sure.
> 
> Kevin
>

Thanks.  ia64-tdep.c has been updated in gdb-6.0.

-- Jeff J.



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

end of thread, other threads:[~2003-08-27 18:26 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-08-26 19:50 ia64 patch to handle predicated insns in prologue J. Johnston
2003-08-26 20:10 ` Kevin Buettner
2003-08-26 22:26   ` J. Johnston
2003-08-26 22:36     ` Kevin Buettner
2003-08-27 18:26       ` J. Johnston

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox