This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
Misc; Was: [RFA]: x86_64 target files
- To: Jiri Smid <smid at suse dot cz>
- Subject: Misc; Was: [RFA]: x86_64 target files
- From: Andrew Cagney <ac131313 at cygnus dot com>
- Date: Fri, 10 Aug 2001 02:56:09 -0400
- Cc: gdb-patches at sources dot redhat dot com
- References: <s8vg0baa6hb.fsf@naga.suse.cz>
Jiri, some quick comments on things that caught my eye. Once the
*-tdep.c file is multi-arched (as much as possible) I'll go review the
*-nat file properly.
enjoy,
Andrew
> + /* This table must line up with REGISTER_NAMES in tm-x86_64.h
> + symbols like 'RAX' come from <sys/reg.h>. */
> + static int regmap[] = {
> + RAX, RDX, RCX, RBX,
> + RSI, RDI, RBP, RSP,
> + R8, R9, R10, R11,
> + R12, R13, R14, R15,
> + RIP, EFLAGS
> + };
You are encouraged to create a file like:
x86_64-tdep.h
so that this sort of thing can be shared amonst the various x86_64
specific files. Both *-nat and *-nat-linux contained that exact table.
Just be careful to namespace proof things a little (x86_64 prefixes
and the like).
--
> + /* This is the variable that is set with "set disassembly-flavor", and
> + its legitimate values. */
> + static const char att_flavor[] = "att";
> + static const char intel_flavor[] = "intel";
> + static const char *valid_flavors[] = {
> + att_flavor,
> + intel_flavor,
> + NULL
> + };
> + static const char *disassembly_flavor = att_flavor;
>
Have a look at the ARM which queries opcodes for a list of disassembly
variants instead of duplicating those variants here.
--
> + static unsigned char
> + codestream_fill (int peek_flag)
FYI, I don't think that the code stream stuff belongs in a *-tdep.c.
Hmm, I suspect you accidently picked it up when clonning i386-tdep.c.
Could I recommend going through your new *-tdep.c file and cleaning out
anything that isn't being used.
Andrew