core-aout.c (19371) | core-aout.c (21738) |
---|---|
1/* Extract registers from a "standard" core file, for GDB. 2 Copyright (C) 1988-1995 Free Software Foundation, Inc. 3 4This file is part of GDB. 5 6This program is free software; you can redistribute it and/or modify 7it under the terms of the GNU General Public License as published by 8the Free Software Foundation; either version 2 of the License, or --- 53 unchanged lines hidden (view full) --- 62 REG_ADDR is the offset from u.u_ar0 to the register values relative to 63 core_reg_sect. This is used with old-fashioned core files to 64 locate the registers in a large upage-plus-stack ".reg" section. 65 Original upage address X is at location core_reg_sect+x+reg_addr. 66 */ 67 68static void 69fetch_core_registers (core_reg_sect, core_reg_size, which, reg_addr) | 1/* Extract registers from a "standard" core file, for GDB. 2 Copyright (C) 1988-1995 Free Software Foundation, Inc. 3 4This file is part of GDB. 5 6This program is free software; you can redistribute it and/or modify 7it under the terms of the GNU General Public License as published by 8the Free Software Foundation; either version 2 of the License, or --- 53 unchanged lines hidden (view full) --- 62 REG_ADDR is the offset from u.u_ar0 to the register values relative to 63 core_reg_sect. This is used with old-fashioned core files to 64 locate the registers in a large upage-plus-stack ".reg" section. 65 Original upage address X is at location core_reg_sect+x+reg_addr. 66 */ 67 68static void 69fetch_core_registers (core_reg_sect, core_reg_size, which, reg_addr) |
70 char *core_reg_sect; 71 unsigned core_reg_size; 72 int which; 73 unsigned reg_addr; | 70 char *core_reg_sect; 71 unsigned core_reg_size; 72 int which; 73 CORE_ADDR reg_addr; |
74{ 75 register int regno; | 74{ 75 register int regno; |
76 register unsigned int addr; | 76 register CORE_ADDR addr; |
77 int bad_reg = -1; | 77 int bad_reg = -1; |
78 register reg_ptr = -reg_addr; /* Original u.u_ar0 is -reg_addr. */ | 78 register CORE_ADDR reg_ptr = -reg_addr; /* Original u.u_ar0 is -reg_addr. */ |
79 int numregs = ARCH_NUM_REGS; 80 81 /* If u.u_ar0 was an absolute address in the core file, relativize it now, 82 so we can use it as an offset into core_reg_sect. When we're done, 83 "register 0" will be at core_reg_sect+reg_ptr, and we can use 84 CORE_REGISTER_ADDR to offset to the other registers. If this is a modern 85 core file without a upage, reg_ptr will be zero and this is all a big 86 NOP. */ | 79 int numregs = ARCH_NUM_REGS; 80 81 /* If u.u_ar0 was an absolute address in the core file, relativize it now, 82 so we can use it as an offset into core_reg_sect. When we're done, 83 "register 0" will be at core_reg_sect+reg_ptr, and we can use 84 CORE_REGISTER_ADDR to offset to the other registers. If this is a modern 85 core file without a upage, reg_ptr will be zero and this is all a big 86 NOP. */ |
87 if (reg_ptr > (int) core_reg_size) | 87 if (reg_ptr > core_reg_size) |
88 reg_ptr -= KERNEL_U_ADDR; 89 90 for (regno = 0; regno < numregs; regno++) 91 { 92 addr = CORE_REGISTER_ADDR (regno, reg_ptr); 93 if (addr >= core_reg_size) { 94 if (bad_reg < 0) 95 bad_reg = regno; --- 13 unchanged lines hidden (view full) --- 109/* Return the address in the core dump or inferior of register REGNO. 110 BLOCKEND is the address of the end of the user structure. */ 111 112unsigned int 113register_addr (regno, blockend) 114 int regno; 115 int blockend; 116{ | 88 reg_ptr -= KERNEL_U_ADDR; 89 90 for (regno = 0; regno < numregs; regno++) 91 { 92 addr = CORE_REGISTER_ADDR (regno, reg_ptr); 93 if (addr >= core_reg_size) { 94 if (bad_reg < 0) 95 bad_reg = regno; --- 13 unchanged lines hidden (view full) --- 109/* Return the address in the core dump or inferior of register REGNO. 110 BLOCKEND is the address of the end of the user structure. */ 111 112unsigned int 113register_addr (regno, blockend) 114 int regno; 115 int blockend; 116{ |
117 int addr; | 117 CORE_ADDR addr; |
118 119 if (regno < 0 || regno >= ARCH_NUM_REGS) 120 error ("Invalid register number %d.", regno); 121 122 REGISTER_U_ADDR (addr, blockend, regno); 123 124 return addr; 125} --- 18 unchanged lines hidden --- | 118 119 if (regno < 0 || regno >= ARCH_NUM_REGS) 120 error ("Invalid register number %d.", regno); 121 122 REGISTER_U_ADDR (addr, blockend, regno); 123 124 return addr; 125} --- 18 unchanged lines hidden --- |