Re: RFC: printing pointers to global (data) variable on Windows...

Tom Tromey
2012-08-20T17:50:53Z

Joel> + By default, it is assumed that the symbol size can be determined,
Joel> + which means that the "has_size" flag of the returned minimal symbol
Joel> + is set to 1.

What about defaulting it to zero, applying the appended, and then fixing
up the fallout?

I could do the mechanics of this if you think it is ok; and if you plan
to go forward with this.

Tom

diff --git a/gdb/symtab.h b/gdb/symtab.h
index 5401b22..05bc706 100644
--- a/gdb/symtab.h
+++ b/gdb/symtab.h
@@ -361,7 +361,12 @@ struct minimal_symbol

#define MSYMBOL_TARGET_FLAG_1(msymbol) (msymbol)->target_flag_1
#define MSYMBOL_TARGET_FLAG_2(msymbol) (msymbol)->target_flag_2
-#define MSYMBOL_SIZE(msymbol) (msymbol)->size
+#define MSYMBOL_SIZE(msymbol) ((msymbol)->size + 0)
+#define SET_MSYMBOL_SIZE(msymbol, sz) \
+ do { \
+ (msymbol)->size = sz; \
+ (msymbol)->has_size = 1; \
+ } while (0)
#define MSYMBOL_TYPE(msymbol) (msymbol)->type

#include "minsyms.h"