This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
i386 debugging code fixes
- To: patches at x86-64 dot org, binutils at sourceware dot cygnus dot com
- Subject: i386 debugging code fixes
- From: Jan Hubicka <jh at suse dot cz>
- Date: Mon, 18 Dec 2000 14:04:39 +0100
Hi
The debugging code in tc-i386 fails to compile. It is quite handy in some
cases, so here is patch to bring it back into functional state.
Honza
Mon Dec 18 14:03:13 MET 2000 Jan Hubicka <jh@suse.cz>
* tc-i387.c (pi, pte, pt): Update.
(type_names): Add new types.
*** src/gas/config/tc-i386.c Mon Dec 18 13:56:52 2000
--- x86-64/binutils/gas/config/tc-i386.c Fri Dec 15 14:32:16 2000
*************** pi (line, x)
*** 915,929 ****
char *line;
i386_insn *x;
{
! register template *p;
! int i;
fprintf (stdout, "%s: template ", line);
pte (&x->tm);
! fprintf (stdout, " modrm: mode %x reg %x reg/mem %x",
x->rm.mode, x->rm.reg, x->rm.regmem);
! fprintf (stdout, " base %x index %x scale %x\n",
! x->bi.base, x->bi.index, x->bi.scale);
for (i = 0; i < x->operands; i++)
{
fprintf (stdout, " #%d: ", i + 1);
--- 914,933 ----
char *line;
i386_insn *x;
{
! unsigned int i;
fprintf (stdout, "%s: template ", line);
pte (&x->tm);
! fprintf (stdout, " address: base %s index %s scale %x\n",
! x->base_reg ? x->base_reg->reg_name : "none",
! x->index_reg ? x->index_reg->reg_name : "none",
! x->log2_scale_factor);
! fprintf (stdout, " modrm: mode %x reg %x reg/mem %x\n",
x->rm.mode, x->rm.reg, x->rm.regmem);
! fprintf (stdout, " sib: base %x index %x scale %x\n",
! x->sib.base, x->sib.index, x->sib.scale);
! fprintf (stdout, " rex: 64bit %x extX %x extY %x extZ %x\n",
! x->rex.mode64, x->rex.extX, x->rex.extY, x->rex.extZ);
for (i = 0; i < x->operands; i++)
{
fprintf (stdout, " #%d: ", i + 1);
*************** static void
*** 943,949 ****
pte (t)
template *t;
{
! int i;
fprintf (stdout, " %d operands ", t->operands);
fprintf (stdout, "opcode %x ", t->base_opcode);
if (t->extension_opcode != None)
--- 947,953 ----
pte (t)
template *t;
{
! unsigned int i;
fprintf (stdout, " %d operands ", t->operands);
fprintf (stdout, "opcode %x ", t->base_opcode);
if (t->extension_opcode != None)
*************** type_names[] =
*** 1003,1017 ****
--- 1007,1026 ----
{ Reg8, "r8" },
{ Reg16, "r16" },
{ Reg32, "r32" },
+ { Reg64, "r64" },
{ Imm8, "i8" },
{ Imm8S, "i8s" },
{ Imm16, "i16" },
{ Imm32, "i32" },
+ { Imm32S, "i32s" },
+ { Imm64, "i64" },
{ Imm1, "i1" },
{ BaseIndex, "BaseIndex" },
{ Disp8, "d8" },
{ Disp16, "d16" },
{ Disp32, "d32" },
+ { Disp32S, "d32s" },
+ { Disp64, "d64" },
{ InOutPortReg, "InOutPortReg" },
{ ShiftCount, "ShiftCount" },
{ Control, "control reg" },
*************** pt (t)
*** 1035,1050 ****
{
register struct type_name *ty;
! if (t == Unknown)
! {
! fprintf (stdout, _("Unknown"));
! }
! else
! {
! for (ty = type_names; ty->mask; ty++)
! if (t & ty->mask)
! fprintf (stdout, "%s, ", ty->tname);
! }
fflush (stdout);
}
--- 1044,1052 ----
{
register struct type_name *ty;
! for (ty = type_names; ty->mask; ty++)
! if (t & ty->mask)
! fprintf (stdout, "%s, ", ty->tname);
fflush (stdout);
}