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

[binutils-gdb/c++] Add static field address


https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=9675f1a505b7adf3d21f58ee423cb5cabfa48bf7

commit 9675f1a505b7adf3d21f58ee423cb5cabfa48bf7
Author: Phil Muldoon <pmuldoon@redhat.com>
Date:   Thu Aug 20 12:35:18 2015 +0100

    Add static field address

Diff:
---
 gdb/compile/compile-cplus-types.c         | 7 ++-----
 gdb/testsuite/gdb.compile/compile-cplus.c | 3 ++-
 2 files changed, 4 insertions(+), 6 deletions(-)

diff --git a/gdb/compile/compile-cplus-types.c b/gdb/compile/compile-cplus-types.c
index 8bb8f49..9e3ba29 100644
--- a/gdb/compile/compile-cplus-types.c
+++ b/gdb/compile/compile-cplus-types.c
@@ -265,11 +265,8 @@ convert_struct_or_union (struct compile_cplus_instance *context, struct type *ty
 	CP_CTX (context)->cp_ops->new_decl (CP_CTX (context),
 					    TYPE_FIELD_NAME (type, i),
 					    GCC_CP_SYMBOL_VARIABLE,
-					    field_type, NULL,
-					    // FIXME: compute the
-					    // static var address.
-					    // -lxo
-					    0,
+					    field_type, 0,
+					    TYPE_FIELD_STATIC_PHYSADDR (type, i),
 					    // FIXME: do we have
 					    // location info for
 					    // static data members?
diff --git a/gdb/testsuite/gdb.compile/compile-cplus.c b/gdb/testsuite/gdb.compile/compile-cplus.c
index f7d175c..b8e14c3 100644
--- a/gdb/testsuite/gdb.compile/compile-cplus.c
+++ b/gdb/testsuite/gdb.compile/compile-cplus.c
@@ -148,7 +148,8 @@ class VirtualBase : public virtual Base3
 class Foo
 {
   int var;
-
+  static const int public_static_var = 12;
+  
  private:
   int private_var = 0;
   int private_method (void);


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