Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'services/symbols_win32.c')
-rw-r--r--services/symbols_win32.c17
1 files changed, 12 insertions, 5 deletions
diff --git a/services/symbols_win32.c b/services/symbols_win32.c
index ea67c8f8..195ce145 100644
--- a/services/symbols_win32.c
+++ b/services/symbols_win32.c
@@ -90,9 +90,9 @@ struct Symbol {
unsigned frame;
int sym_class;
ULONG64 module;
- ULONG index;
- const TypeInfo * info;
- const Symbol * base;
+ ULONG index; /* The symbol index in debug info section */
+ const TypeInfo * info; /* If not NULL, the symbol is basic type */
+ const Symbol * base; /* If not NULL, the symbol is array or pointer with this base type */
size_t length;
ContextAddress address;
};
@@ -489,8 +489,15 @@ int get_symbol_size(const Symbol * sym, ContextAddress * size) {
*size = sym->info->size;
return 0;
}
- if (get_type_tag(&type, &tag)) return -1;
- if (get_type_info(&type, TI_GET_LENGTH, &res) < 0) return -1;
+ if (sym->sym_class == SYM_CLASS_REFERENCE || sym->sym_class == SYM_CLASS_FUNCTION) {
+ SYMBOL_INFO * info = NULL;
+ if (get_sym_info(sym, sym->index, &info) < 0) return -1;
+ res = info->Size;
+ }
+ else {
+ if (get_type_tag(&type, &tag)) return -1;
+ if (get_type_info(&type, TI_GET_LENGTH, &res) < 0) return -1;
+ }
*size = (ContextAddress)res;
return 0;

Back to the top