This is the mail archive of the gdb-prs@sourceware.org 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]
Other format: [Raw text]

[Bug sim/13418] sim: building with --enable-targets=all fails with: undefined reference to sim_spr_register_name


https://sourceware.org/bugzilla/show_bug.cgi?id=13418

--- Comment #4 from Mike Frysinger <vapier at gentoo dot org> ---
the issue is that the sim itself is not multi-target aware (yet), but gdb is. 
so all of the gdb targets are built, including the rs6000-tdep.c file.  that
has this little nugget:
#ifdef WITH_SIM
...
      const char *spr_name = sim_spr_register_name (i);
...
#endif
that function is not part of the official sim API, but is an internal one
specific to the ppc sim.  this should not exist, but it does, so ugh.

looking closer, gdb uses this name to get the sim's naming convention for
specific spr register #'s and then dynamically map them to gdb's register's. 
this way gdb can have register "mmcr1" and support multiple targets, and the
sim itself will dynamically resolv it to spr 956.  if it didn't have this info,
it'd just mean it wouldn't be able to map some of the extended registers.  not
a game changer.

plus, unless the main target was ppc, the ppc sim wouldn't even be available
(since the sim is not multi-target aware).

for now, i'm just going to disable this logic when ppc isn't the main target to
avoid the link failure.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

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