Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoreutarass2011-09-02 19:37:16 +0000
committereutarass2011-09-02 19:37:16 +0000
commitd1aab555aba8055a0ac0e50026297234712a191e (patch)
treef01eed438795ce0f104adfb7945e9ea97e0524ca
parent1244b27c721a8fd14daf02ed0b01b1be4718aba1 (diff)
downloadorg.eclipse.tcf.agent-d1aab555aba8055a0ac0e50026297234712a191e.tar.gz
org.eclipse.tcf.agent-d1aab555aba8055a0ac0e50026297234712a191e.tar.xz
org.eclipse.tcf.agent-d1aab555aba8055a0ac0e50026297234712a191e.zip
TCF Agent: Symbols service: added new symbol flag: SYM_FLAG_VARARG.
-rw-r--r--services/symbols.h33
-rw-r--r--services/symbols_elf.c18
2 files changed, 31 insertions, 20 deletions
diff --git a/services/symbols.h b/services/symbols.h
index f870048d..1a8b7c2c 100644
--- a/services/symbols.h
+++ b/services/symbols.h
@@ -49,22 +49,23 @@ typedef struct Symbol Symbol;
typedef uint32_t SYM_FLAGS;
-#define SYM_FLAG_PARAMETER 0x0001
-#define SYM_FLAG_TYPEDEF 0x0002
-#define SYM_FLAG_CONST_TYPE 0x0004
-#define SYM_FLAG_PACKET_TYPE 0x0008
-#define SYM_FLAG_SUBRANGE_TYPE 0x0010
-#define SYM_FLAG_VOLATILE_TYPE 0x0020
-#define SYM_FLAG_RESTRICT_TYPE 0x0040
-#define SYM_FLAG_UNION_TYPE 0x0080
-#define SYM_FLAG_CLASS_TYPE 0x0100
-#define SYM_FLAG_INTERFACE_TYPE 0x0200
-#define SYM_FLAG_SHARED_TYPE 0x0400
-#define SYM_FLAG_REFERENCE 0x0800
-#define SYM_FLAG_BIG_ENDIAN 0x1000
-#define SYM_FLAG_LITTLE_ENDIAN 0x2000
-#define SYM_FLAG_OPTIONAL 0x4000
-#define SYM_FLAG_EXTERNAL 0x8000
+#define SYM_FLAG_PARAMETER 0x00001
+#define SYM_FLAG_TYPEDEF 0x00002
+#define SYM_FLAG_CONST_TYPE 0x00004
+#define SYM_FLAG_PACKET_TYPE 0x00008
+#define SYM_FLAG_SUBRANGE_TYPE 0x00010
+#define SYM_FLAG_VOLATILE_TYPE 0x00020
+#define SYM_FLAG_RESTRICT_TYPE 0x00040
+#define SYM_FLAG_UNION_TYPE 0x00080
+#define SYM_FLAG_CLASS_TYPE 0x00100
+#define SYM_FLAG_INTERFACE_TYPE 0x00200
+#define SYM_FLAG_SHARED_TYPE 0x00400
+#define SYM_FLAG_REFERENCE 0x00800
+#define SYM_FLAG_BIG_ENDIAN 0x01000
+#define SYM_FLAG_LITTLE_ENDIAN 0x02000
+#define SYM_FLAG_OPTIONAL 0x04000
+#define SYM_FLAG_EXTERNAL 0x08000
+#define SYM_FLAG_VARARG 0x10000
/* Symbol properties update policies */
#define UPDATE_ON_MEMORY_MAP_CHANGES 0
diff --git a/services/symbols_elf.c b/services/symbols_elf.c
index b142a71a..c0e88936 100644
--- a/services/symbols_elf.c
+++ b/services/symbols_elf.c
@@ -211,6 +211,7 @@ static void object2symbol(ObjectInfo * obj, Symbol ** res) {
case TAG_inheritance:
case TAG_member:
case TAG_formal_parameter:
+ case TAG_unspecified_parameters:
case TAG_local_variable:
case TAG_variable:
sym->sym_class = SYM_CLASS_REFERENCE;
@@ -238,6 +239,7 @@ static ObjectInfo * get_object_type(ObjectInfo * obj) {
case TAG_entry_point:
case TAG_enumerator:
case TAG_formal_parameter:
+ case TAG_unspecified_parameters:
case TAG_global_variable:
case TAG_local_variable:
case TAG_variable:
@@ -723,6 +725,7 @@ static int find_by_addr_in_unit(ObjectInfo * obj, int level, ContextAddress rt_o
}
break;
case TAG_formal_parameter:
+ case TAG_unspecified_parameters:
case TAG_local_variable:
if (sym_frame == STACK_NO_FRAME) break;
case TAG_variable:
@@ -826,9 +829,10 @@ static void enumerate_local_vars(ObjectInfo * obj, int level, ContextAddress rt_
}
break;
case TAG_formal_parameter:
+ case TAG_unspecified_parameters:
case TAG_local_variable:
case TAG_variable:
- if (level > 0 && obj->mName != NULL) {
+ if (level > 0) {
Context * org_ctx = sym_ctx;
int org_frame = sym_frame;
ContextAddress org_ip = sym_ip;
@@ -1322,6 +1326,7 @@ int get_symbol_type_class(const Symbol * sym, int * type_class) {
case TAG_const_type:
case TAG_typedef:
case TAG_formal_parameter:
+ case TAG_unspecified_parameters:
case TAG_global_variable:
case TAG_local_variable:
case TAG_variable:
@@ -1670,7 +1675,7 @@ int get_symbol_children(const Symbol * sym, Symbol *** children, int * count) {
ObjectInfo * i = sym->base->obj->mChildren;
if (unpack(sym->base) < 0) return -1;
while (i != NULL) {
- if (i->mTag == TAG_formal_parameter) n++;
+ if (i->mTag == TAG_formal_parameter || i->mTag == TAG_unspecified_parameters) n++;
i = i->mSibling;
}
if (buf_len < n) {
@@ -1680,11 +1685,11 @@ int get_symbol_children(const Symbol * sym, Symbol *** children, int * count) {
n = 0;
i = obj->mChildren;
while (i != NULL) {
- if (i->mTag == TAG_formal_parameter) {
+ if (i->mTag == TAG_formal_parameter || i->mTag == TAG_unspecified_parameters) {
Symbol * x = NULL;
Symbol * y = NULL;
object2symbol(i, &x);
- if (get_symbol_type(x, &y) <0) return -1;
+ if (get_symbol_type(x, &y) < 0) return -1;
buf[n++] = y;
}
i = i->mSibling;
@@ -2062,6 +2067,11 @@ int get_symbol_flags(const Symbol * sym, SYM_FLAGS * flags) {
*flags |= SYM_FLAG_INTERFACE_TYPE;
i = NULL;
break;
+ case TAG_unspecified_parameters:
+ *flags |= SYM_FLAG_PARAMETER;
+ *flags |= SYM_FLAG_VARARG;
+ i = NULL;
+ break;
case TAG_formal_parameter:
case TAG_variable:
case TAG_constant:

Back to the top