You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
-Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
+Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include "defs.h"
#include "inferior.h"
+#include "floatformat.h"
#include <stdio.h>
extern void print_387_control_word (); /* i387-tdep.h */
extern void print_387_status_word ();
-extern struct ext_format ext_format_i387;
-
#define private static
\f
* Caller knows that the regs handled in one transaction are of same size.
*/
#define FETCH_REGS(state, regnum, count) \
- bcopy (REG_ADDRESS (state, regnum), \
- ®isters[REGISTER_BYTE (regnum)], \
- count*sizeof (REGISTER_TYPE))
+ memcpy (®isters[REGISTER_BYTE (regnum)], \
+ REG_ADDRESS (state, regnum), \
+ count*REGISTER_SIZE)
/* Store COUNT contiguous registers to thread STATE starting from REGNUM */
#define STORE_REGS(state, regnum, count) \
- bcopy (®isters[REGISTER_BYTE (regnum)], \
- REG_ADDRESS (state, regnum), \
- count*sizeof (REGISTER_TYPE))
+ memcpy (REG_ADDRESS (state, regnum), \
+ ®isters[REGISTER_BYTE (regnum)], \
+ count*REGISTER_SIZE)
\f
/*
* Fetch inferiors registers for gdb.
&stateCnt);
if (ret != KERN_SUCCESS)
- message ("fetch_inferior_registers: %s ",
+ warning ("fetch_inferior_registers: %s ",
mach_error_string (ret));
#if 0
/* It may be more effective to store validate all of them,
if (ret != KERN_SUCCESS)
{
- message ("store_inferior_registers (get): %s",
+ warning ("store_inferior_registers (get): %s",
mach_error_string (ret));
if (must_suspend_thread)
setup_thread (current_thread, 0);
i386_THREAD_STATE_COUNT);
if (ret != KERN_SUCCESS)
- message ("store_inferior_registers (set): %s",
+ warning ("store_inferior_registers (set): %s",
mach_error_string (ret));
if (must_suspend_thread)
* core file. If your UX does something else, adapt the routine
* below to return the offset to the given register.
*
- * Called by coredep.c(fetch_core_registers)
+ * Called by core-aout.c(fetch_core_registers)
*/
-unsigned int
+CORE_ADDR
register_addr (regno, blockend)
int regno;
- int blockend;
+ CORE_ADDR blockend;
{
- unsigned int addr;
+ CORE_ADDR addr;
if (regno < 0 || regno >= NUM_REGS)
error ("Invalid register number %d.", regno);
if (status != 0)
{
if (bothstatus)
- printf ("u: ");
+ printf_unfiltered ("u: ");
print_387_status_word (status);
}
if (ep->status != 0)
{
if (bothstatus)
- printf ("e: ");
+ printf_unfiltered ("e: ");
print_387_status_word (ep->status);
}
print_387_control_word (ep->control);
- printf ("last exception: ");
- printf ("opcode %s; ", local_hex_string(ep->opcode));
- printf ("pc %s:", local_hex_string(ep->code_seg));
- printf ("%s; ", local_hex_string(ep->eip));
- printf ("operand %s", local_hex_string(ep->operand_seg));
- printf (":%s\n", local_hex_string(ep->operand));
+ printf_unfiltered ("last exception: ");
+ printf_unfiltered ("opcode %s; ", local_hex_string(ep->opcode));
+ printf_unfiltered ("pc %s:", local_hex_string(ep->code_seg));
+ printf_unfiltered ("%s; ", local_hex_string(ep->eip));
+ printf_unfiltered ("operand %s", local_hex_string(ep->operand_seg));
+ printf_unfiltered (":%s\n", local_hex_string(ep->operand));
top = (ep->status >> 11) & 7;
- printf ("regno tag msb lsb value\n");
+ printf_unfiltered ("regno tag msb lsb value\n");
for (fpreg = 7; fpreg >= 0; fpreg--)
{
double val;
- printf ("%s %d: ", fpreg == top ? "=>" : " ", fpreg);
+ printf_unfiltered ("%s %d: ", fpreg == top ? "=>" : " ", fpreg);
switch ((ep->tag >> (fpreg * 2)) & 3)
{
- case 0: printf ("valid "); break;
- case 1: printf ("zero "); break;
- case 2: printf ("trap "); break;
- case 3: printf ("empty "); break;
+ case 0: printf_unfiltered ("valid "); break;
+ case 1: printf_unfiltered ("zero "); break;
+ case 2: printf_unfiltered ("trap "); break;
+ case 3: printf_unfiltered ("empty "); break;
}
for (i = 9; i >= 0; i--)
- printf ("%02x", ep->regs[fpreg][i]);
+ printf_unfiltered ("%02x", ep->regs[fpreg][i]);
- ieee_extended_to_double (&ext_format_i387, (char *)ep->regs[fpreg],
+ floatformat_to_double (&floatformat_i387_ext, (char *)ep->regs[fpreg],
&val);
- printf (" %g\n", val);
+ printf_unfiltered (" %g\n", val);
}
if (ep->r0)
- printf ("warning: reserved0 is %s\n", local_hex_string(ep->r0));
+ printf_unfiltered ("warning: reserved0 is %s\n", local_hex_string(ep->r0));
if (ep->r1)
- printf ("warning: reserved1 is %s\n", local_hex_string(ep->r1));
+ printf_unfiltered ("warning: reserved1 is %s\n", local_hex_string(ep->r1));
if (ep->r2)
- printf ("warning: reserved2 is %s\n", local_hex_string(ep->r2));
+ printf_unfiltered ("warning: reserved2 is %s\n", local_hex_string(ep->r2));
if (ep->r3)
- printf ("warning: reserved3 is %s\n", local_hex_string(ep->r3));
+ printf_unfiltered ("warning: reserved3 is %s\n", local_hex_string(ep->r3));
}
/*
if (ret != KERN_SUCCESS)
{
- message ("Can not get live floating point state: %s",
+ warning ("Can not get live floating point state: %s",
mach_error_string (ret));
return FALSE;
}
/* Clear the target then copy thread's float state there.
Make a copy of the status word, for some reason?
*/
- bzero (fstate, sizeof(struct fpstate));
+ memset (fstate, 0, sizeof (struct fpstate));
fstate->status = fsp->exc_status;
- bcopy ((char *)&fsp->hw_state, fstate->state, FP_STATE_BYTES);
+ memcpy (fstate->state, (char *)&fsp->hw_state, FP_STATE_BYTES);
return TRUE;
}
if (!valid)
{
- message("no floating point status saved");
+ warning ("no floating point status saved");
return;
}