This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
i386 flavors [Was: Re: Misc; Was: [RFA]: x86_64 target files]
Here's a proposal for an implementation - it's similar to the arm way
of doing it.
I would additionally export print_insn_i386 and then gdb would use
that call. i386-tdep.c and x86-64-tdep.c would need to use the new
interface, I can send patches if we like to go this way.
Mark, as i386 maintainer, what do you think?
Andreas
typedef struct
{
const char *name;
const char *description;
}
i386_flavor;
static i386_flavor i386_flavors [] =
{
{ "att", "Select ATT syntax."},
{ "intel", "Select Intel syntax."}
};
enum {ATT_FLAVOR, INTEL_FLAVOR};
static int current_i386_flavor;
int
get_i386_num_flavors (void)
{
return sizeof (i386_flavors) / sizeof (i386_flavor);
}
int
set_i386_flavor (int flavor);
{
int old = current_i386_flavor;
current_i386_flavor = flavor;
switch (flavor)
{
case ATT_FLAVOR:
intel_syntax = 0;
open_char = '(';
close_char = ')';
separator_char = ',';
scale_char = ',';
break;
case INTEL_FLAVOR:
intel_syntax = 1;
open_char = '[';
close_char = ']';
separator_char = '+';
scale_char = '*';
break;
default:
abort ();
}
return old;
}
void
get_i386_flavor (int flavor, const char **name, const char **description)
{
*name = i386_flavors [flavor].name;
*description = i386_flavors [flavor].description;
}
--
Andreas Jaeger
SuSE Labs aj@suse.de
private aj@arthur.inka.de
http://www.suse.de/~aj