This is the mail archive of the
gdb@sources.redhat.com
mailing list for the GDB project.
Multi-arch question
- To: gdb at sources dot redhat dot com
- Subject: Multi-arch question
- From: David Smith <dsmith at redhat dot com>
- Date: Wed, 07 Feb 2001 10:25:55 -0600
- Organization: Red Hat, Inc.
I need a philosophical question answered. Let's say I'm writing new
support for processor "foo" for GDB. I'm going to use the architecture
vector exclusively, so that the only thing that config/foo/tm-foo.h has
in it is:
#define GDB_MULTI_ARCH 1
(or should that be 2?)
So, my function foo_gdbarch_init() (in foo-tdep.c) calls all the
set_gdbarch_* functions to fill in the architecture vector.
In one of the functions in foo-tdep.c, I need to know the current value
of the PC. So, which of the following to I do?
1) Call the TARGET_READ_PC macro, which really calls gdbarch_read_pc(),
which ends up calling my foo_read_pc(). (The normal thing to do.)
2) Call foo_read_pc() directly. (Since I'm inside foo-tdep.c, I could
cut to the chase and call foo_read_pc() directly.)
Is there a standard here? Does it matter?
Thanks.
--
David Smith
dsmith@redhat.com
Red Hat, Inc.
http://www.redhat.com
256.704.9222 (direct)
256.837.3839 (fax)