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]

[RFA] Add comment describing the target_gdbarch global


Hello,

I remember a few months ago when I stumbled across a piece of code
using target_gdbarch, and I couldn't remember what this global was,
and what the different was with gdbarch.  I eventually found the
original discussion again

(http://sourceware.org/ml/gdb-patches/2008-08/msg00358.html)

but I think a comment would be nice.  I'm finally writing one today.
Does this look accurate?

2009-05-06  Joel Brobecker  <brobecker@adacore.com>

        * gdbarch.h (target_gdbarch): Add comment documenting this global.

-- 
Joel
diff --git a/gdb/gdbarch.h b/gdb/gdbarch.h
index 5e508d7..31c935f 100644
--- a/gdb/gdbarch.h
+++ b/gdb/gdbarch.h
@@ -54,6 +54,17 @@ struct displaced_step_closure;
 struct core_regset_section;
 
 extern struct gdbarch *current_gdbarch;
+
+/* The architecture associated with the connection to the target.
+ 
+   The architecture vector provides some information that is really
+   a property of the target: The layout of certain packets, for instance;
+   or the solib_ops vector.  Etc.  To differentiate architecture accesses
+   to per-target properties to per-thread/pre-frame/per-objfile properties,
+   accesses to per-target properties should be made through target_gdbarch.
+
+   Eventually, when support for multiple targets is implemented in
+   GDB, this global should be made target-specific.  */
 extern struct gdbarch *target_gdbarch;
 
 

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