Re: New gdb 31 & 64 bit patches for S/390

Andrew Cagney
2001-07-04T11:25:00Z

DJB,

The patches included the change:

2001-02-26 D.J. Barrow <djbarrow@de.ibm.com,barrow_dj@yahoo.com>

* core-aout.c added check for CANNOT_FETCH_REGISTER
in fetch_core_registers.

--- src.orig/gdb/core-aout.c Sun Jul 30 03:48:24 2000
+++ src.new/gdb/core-aout.c Tue Feb 27 17:36:35 2001
@@ -81,6 +81,7 @@
int bad_reg = -1;
CORE_ADDR reg_ptr = -reg_addr; /* Original u.u_ar0 is -reg_addr. */
int numregs = ARCH_NUM_REGS;
+ char *buf=alloca(MAX_REGISTER_RAW_SIZE);

/* If u.u_ar0 was an absolute address in the core file, relativize
it now,
so we can use it as an offset into core_reg_sect. When we're done,
@@ -93,12 +94,20 @@

for (regno = 0; regno < numregs; regno++)
{
- addr = CORE_REGISTER_ADDR (regno, reg_ptr);
- if (addr >= core_reg_size
-
&& bad_reg < 0)
-
bad_reg = regno;
+ if (CANNOT_FETCH_REGISTER (regno))
+
{
+
memset (buf, '\0', REGISTER_RAW_SIZE (regno)); /* Supply zeroes */
+
supply_register (regno, buf);
+
}
else
-
supply_register (regno, core_reg_sect + addr);
+
{
+
addr = CORE_REGISTER_ADDR (regno, reg_ptr);
+
if (addr >= core_reg_size
+
&& bad_reg < 0)
+
bad_reg = regno;
+
else
+
supply_register (regno, core_reg_sect + addr);
+
}
}

if (bad_reg >= 0)

Can you please expand on this change. I don't think it is s390 specific.

Andrew