Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEugene Tarassov2015-03-25 14:19:39 -0400
committerEugene Tarassov2015-03-25 14:19:39 -0400
commit8e7c592ee89c838ed4b51b14dd224b47a981350c (patch)
tree5bace73f6fc44f316fe9636cfda408d15a0ce0e2
parent234f51c0886fd77fac4290fbc63e147e240074d0 (diff)
downloadorg.eclipse.tcf.agent-8e7c592ee89c838ed4b51b14dd224b47a981350c.tar.gz
org.eclipse.tcf.agent-8e7c592ee89c838ed4b51b14dd224b47a981350c.tar.xz
org.eclipse.tcf.agent-8e7c592ee89c838ed4b51b14dd224b47a981350c.zip
TCF Agent: better logic to decide when find_symbol_by_name() should stop the search
-rw-r--r--agent/tcf/services/symbols_elf.c21
1 files changed, 7 insertions, 14 deletions
diff --git a/agent/tcf/services/symbols_elf.c b/agent/tcf/services/symbols_elf.c
index 154c1044..d6e510da 100644
--- a/agent/tcf/services/symbols_elf.c
+++ b/agent/tcf/services/symbols_elf.c
@@ -1017,13 +1017,14 @@ static int symbol_has_location(Symbol * sym) {
}
/* Return 1 if find list has no location info: either common or undef */
-static int has_symbol_list_no_location_info(void) {
+static int should_continue_pub_names_search(void) {
Symbol * s = find_symbol_list;
while (s != NULL) {
if (s->has_location) return 0;
+ if (s->sym_class == SYM_CLASS_TYPE) return 0;
s = s->next;
}
- /* If we are here, no symbols has location info */
+ /* Symbols have no location info, continue search */
return 1;
}
@@ -1435,7 +1436,7 @@ int find_symbol_by_name(Context * ctx, int frame, ContextAddress ip, const char
assert(sym_ctx == ctx);
- if (error == 0 && has_symbol_list_no_location_info()) {
+ if (error == 0 && should_continue_pub_names_search()) {
/* Search in pub names of the current file */
ELF_File * file = elf_list_first(sym_ctx, sym_ip, sym_ip);
if (file == NULL) error = errno;
@@ -1529,14 +1530,11 @@ int find_symbol_by_name(Context * ctx, int frame, ContextAddress ip, const char
}
}
- if (error == 0 && has_symbol_list_no_location_info()) {
+ if (error == 0 && should_continue_pub_names_search()) {
/* Search in pub names of all other files */
ELF_File * file = elf_list_first(sym_ctx, 0, ~(ContextAddress)0);
if (file == NULL) error = errno;
-
while (error == 0 && file != NULL) {
- int no_loc_infos_in_list = 0;
-
if (file != curr_file) {
Trap trap;
if (set_trap(&trap)) {
@@ -1549,11 +1547,6 @@ int find_symbol_by_name(Context * ctx, int frame, ContextAddress ip, const char
error = trap.error;
break;
}
-
- no_loc_infos_in_list = has_symbol_list_no_location_info();
-
- /* If we have no address, continue */
- if (sym_ip != 0 && find_symbol_list != NULL && no_loc_infos_in_list == 0) break;
}
file = elf_list_next(sym_ctx);
if (file == NULL) error = errno;
@@ -1561,7 +1554,7 @@ int find_symbol_by_name(Context * ctx, int frame, ContextAddress ip, const char
elf_list_done(sym_ctx);
}
- if (error == 0 && has_symbol_list_no_location_info()) {
+ if (error == 0 && find_symbol_list == NULL) {
unsigned i = 0;
while (type_pseudo_symbols[i].name) {
if (strcmp(name, type_pseudo_symbols[i].name) == 0) {
@@ -1578,7 +1571,7 @@ int find_symbol_by_name(Context * ctx, int frame, ContextAddress ip, const char
}
#if defined(_WRS_KERNEL)
- if (error == 0 && has_symbol_list_no_location_info()) {
+ if (error == 0 && find_symbol_list == NULL) {
char * ptr;
SYM_TYPE type;

Back to the top