This is the mail archive of the gdb-patches@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]

s/current_inferior/current_thread/ in gdbserver


Hey there,

I and Gary just spent a while discussing target vs target descriptions
vs gdbarch vs inferior vs thread in gdb vs gdbserver, and there's a lot
of technical dept related to confusing historical terminology here that
is now haunting us back on and causing us to spend time discussing
things that are central and used all over the place.

E.g., target_gdbarch was a global at some point.  It's nowadays per-inferior.
So it could be renamed to inferior_gdbarch.  And then each inferior has
one "target description", which the gdbarch is derived from.
A rename looked to daunting at the time, my fault, and now I get to
explain these things.  :-/  And then "target description" is a term that
we're more stuck with, because it's exposed at the RSP level, which
doesn't help either.

And then there's the annoying terminology issue with "inferior"
in GDB vs GDBserver, which prompted this email.
"current_inferior" in gdbserver actually meaning "current thread",
and being the moral equivalent of "inferior_thread ()" in gdb.

  struct thread_info *current_inferior;

The "inferior" data structure means a different thing in gdb,
and, gdb even has a "current_inferior ()" function that doesn't
really have a 100% equivalent in gdbserver.  In many contexts it's
(roughly) interchangeable with gdbserver's current_inferior, because
conceptually a thread belongs to a process that is mapped to an
inferior.  The closest in gdbserver is current_process (), but really
the concept of an "struct inferior" like in gdb does not exist
in gdbserver.

So we were talking about one quick mechanical change that
would probably clear things up a lot.  That is,
s/current_inferior/current_thread/g in gdbserver.

Any objections to that?

Thanks,
Pedro Alves


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