Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoreutarass2011-05-06 16:26:24 -0400
committereutarass2011-05-06 16:26:24 -0400
commit37fcd6cb789bf7e9d3da54456e3bffc51332dfd7 (patch)
tree6c887cda37b0db40569e5e664ecda135ca8cd91c
parent791c7dccf581d1fd61406f325a8301f1dd0f3872 (diff)
downloadorg.eclipse.tcf-37fcd6cb789bf7e9d3da54456e3bffc51332dfd7.tar.gz
org.eclipse.tcf-37fcd6cb789bf7e9d3da54456e3bffc51332dfd7.tar.xz
org.eclipse.tcf-37fcd6cb789bf7e9d3da54456e3bffc51332dfd7.zip
TCF Tests: changed DWARF symbols test to include search for undefined symbol.
-rw-r--r--tests/test-dwarf/backend/backend.c34
1 files changed, 16 insertions, 18 deletions
diff --git a/tests/test-dwarf/backend/backend.c b/tests/test-dwarf/backend/backend.c
index c46ebfe13..5dac7709a 100644
--- a/tests/test-dwarf/backend/backend.c
+++ b/tests/test-dwarf/backend/backend.c
@@ -215,14 +215,7 @@ static void next_pc(void) {
set_regs_PC(elf_ctx, pc);
send_context_changed_event(elf_ctx);
-#if 0
- switch (pc % 4) {
- case 0: name = "???"; break;
- case 1: name = "run_undetached"; break;
- case 2: name = "set_m_bAbort"; break;
- case 3: name = "deallocate_buffers"; break;
- }
-#endif
+
if (find_symbol_by_addr(elf_ctx, STACK_NO_FRAME, pc, &sym) < 0) {
if (get_error_code(errno) != ERR_SYM_NOT_FOUND) {
error("find_symbol_by_addr");
@@ -236,21 +229,26 @@ static void next_pc(void) {
}
if (name != NULL) {
strcpy(name_buf, name);
- if (find_symbol_by_addr(elf_ctx, STACK_TOP_FRAME, pc, &sym) < 0) {
- error("find_symbol_by_addr");
- }
- if (get_symbol_name(sym, &name) < 0) {
- error("get_symbol_name");
- }
- if (strcmp(name_buf, name) != 0) {
- errno = ERR_OTHER;
- error("strcmp(name_buf, name)");
- }
if (find_symbol_by_name(elf_ctx, STACK_TOP_FRAME, 0, name_buf, &sym) < 0) {
if (get_error_code(errno) != ERR_SYM_NOT_FOUND) {
error("find_symbol_by_name");
}
}
+ else {
+ if (get_symbol_name(sym, &name) < 0) {
+ error("get_symbol_name");
+ }
+ if (strcmp(name_buf, name) != 0) {
+ errno = ERR_OTHER;
+ error("strcmp(name_buf, name)");
+ }
+ }
+ }
+ }
+
+ if (find_symbol_by_name(elf_ctx, STACK_TOP_FRAME, 0, "@ non existing name @", &sym) < 0) {
+ if (get_error_code(errno) != ERR_SYM_NOT_FOUND) {
+ error("find_symbol_by_name");
}
}

Back to the top