--- gdb-5.2.1/gdb/s390-tdep.c.orig	Wed Feb 19 11:21:16 2003
+++ gdb-5.2.1/gdb/s390-tdep.c	Wed Feb 19 13:03:32 2003
@@ -221,6 +221,7 @@
   bfd_byte instr[S390_MAX_INSTR_SIZE];
   CORE_ADDR test_pc = pc, test_pc2;
   CORE_ADDR orig_sp = 0, save_reg_addr = 0, *saved_regs = NULL;
+  CORE_ADDR constant_pool_addr = 0;
   int valid_prologue, good_prologue = 0;
   int gprs_saved[S390_NUM_GPRS];
   int fprs_saved[S390_NUM_FPRS];
@@ -484,11 +485,13 @@
 	  else
 	    {
 	      /* Check for BASR gpr13,gpr0 used to load constant pool pointer to r13 in old compiler */
+	      /* Also used by Dignus compilers */
 	      if (instr[0] == 0xd && (instr[1] & 0xf) == 0
 		  && ((instr[1] >> 4) == CONST_POOL_REGIDX))
 		{
 		  const_pool_state = 1;
 		  valid_prologue = 1;
+		  constant_pool_addr = test_pc + instrlen;
 		  continue;
 		}
 	    }
@@ -587,6 +590,28 @@
 	  valid_prologue = 1;
 	  continue;
 	}
+      /* Alternatively check for a S or SG R15,offs(CONST_POOL_REGIDX)
+	 emitted by Dignus compilers.
+	 constant_pool_addr must be set upon encountering a
+	 BASR to set CONST_POOL_REGIDX. */
+      if ((save_link_state == 1) && (const_pool_state == 1)
+	  && (constant_pool_addr != 0)
+	  && ((GDB_TARGET_IS_ESAME
+	       && (instr[0] == 0xe3) && (instr[1] == 0xf0)
+	       && ((instr[2]>>4) == CONST_POOL_REGIDX)
+	       && (instr[5] == 0x09))
+	      || ((instr[0] == 0x5b) && (instr[1] == 0xf0)
+	          && ((instr[2]>>4) == CONST_POOL_REGIDX))))
+	{
+	  unsigned int offs = ((instr[2] & 0x0f) << 8) + instr[3];
+	  if (fextra_info)
+	    target_read_memory (constant_pool_addr + offs,
+				(char *) &fextra_info->stack_bought,
+				sizeof (fextra_info->stack_bought));
+	  save_link_state = 3;
+	  valid_prologue = 1;
+	  continue;
+	}
       /* check for LA gprx,offset(15) used for varargs */
       if ((instr[0] == 0x41) && ((instr[2] >> 4) == 0xf) &&
 	  ((instr[1] & 0xf) == 0))
@@ -658,8 +683,7 @@
           instrlen = got_load_len;
         }
         
-      good_prologue = (((const_pool_state == 0) || (const_pool_state == 2)) &&
-		       ((save_link_state == 0) || (save_link_state == 4)) &&
+      good_prologue = (((save_link_state == 0) || (save_link_state == 4)) &&
 		       ((varargs_state == 0) || (varargs_state == 2)));
     }
   if (fextra_info)
