This is the mail archive of the gdb@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Multi-arch question


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)

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]