Skip to main content
summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorEugene Tarassov2012-02-02 20:17:10 -0500
committerEugene Tarassov2012-02-02 20:17:10 -0500
commit897fd389a7b87739842551b05793fe614e4f728c (patch)
treef5abd737072bcd72efc5625ba18419af270a0f48 /tests
parentd3ed0d59a3e4b1a405ecf506546bff6b00cd98bc (diff)
downloadorg.eclipse.tcf.agent-897fd389a7b87739842551b05793fe614e4f728c.tar.gz
org.eclipse.tcf.agent-897fd389a7b87739842551b05793fe614e4f728c.tar.xz
org.eclipse.tcf.agent-897fd389a7b87739842551b05793fe614e4f728c.zip
TCF Agent: new command: Symbols.findByName
Diffstat (limited to 'tests')
-rw-r--r--tests/test-dwarf/tcf/backend/backend.c37
1 files changed, 37 insertions, 0 deletions
diff --git a/tests/test-dwarf/tcf/backend/backend.c b/tests/test-dwarf/tcf/backend/backend.c
index 92a9ae47..82463a4b 100644
--- a/tests/test-dwarf/tcf/backend/backend.c
+++ b/tests/test-dwarf/tcf/backend/backend.c
@@ -373,6 +373,43 @@ static void loc_var_func(void * args, Symbol * sym) {
if (get_symbol_name(sym, &name) < 0) {
error_sym("get_symbol_name", sym);
}
+ if (name != NULL) {
+ Symbol * find_sym = NULL;
+ Symbol * find_next = NULL;
+ name = tmp_strdup(name);
+ if (find_symbol_by_name(elf_ctx, STACK_TOP_FRAME, 0, name, &find_sym) < 0) {
+ error("find_symbol_by_name");
+ }
+ if (find_next_symbol(&find_next) < 0) {
+ if (get_error_code(errno) != ERR_SYM_NOT_FOUND) {
+ error("find_next_symbol");
+ }
+ }
+ else {
+ errno = ERR_OTHER;
+ error("Invalid result of find_next_symbol()");
+ }
+ if (symcmp(sym, find_sym) != 0) {
+ /* 'sym' is eclipsed by 'find_sym' */
+ Symbol * container = NULL;
+ if (get_symbol_container(find_sym, &container) < 0) {
+ error("get_symbol_container");
+ }
+ for (;;) {
+ if (get_symbol_container(container, &container) < 0) {
+ error("get_symbol_container");
+ }
+ if (find_symbol_in_scope(elf_ctx, STACK_TOP_FRAME, 0, container, name, &find_sym) < 0) {
+ if (get_error_code(errno) != ERR_SYM_NOT_FOUND) {
+ error("find_symbol_in_scope");
+ }
+ }
+ else {
+ if (symcmp(sym, find_sym) == 0) break;
+ }
+ }
+ }
+ }
if (get_symbol_address(sym, &addr) < 0) {
if ((get_symbol_register(sym, &ctx, &frame, &reg) < 0 || reg == NULL) &&
(get_symbol_value(sym, &value, &value_size, &value_big_endian) < 0 || value == NULL)) {

Back to the top