Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEugene Tarassov2013-04-23 20:38:55 -0400
committerEugene Tarassov2013-04-23 20:38:55 -0400
commitada7bca7372503004d2876b7bcf463de20327954 (patch)
tree256eb8407d6ccb3794b69bc9ca1056b9d40db281
parent70522ccca7a3981717e086c7ce71a5a2895c59de (diff)
downloadorg.eclipse.tcf.agent-ada7bca7372503004d2876b7bcf463de20327954.tar.gz
org.eclipse.tcf.agent-ada7bca7372503004d2876b7bcf463de20327954.tar.xz
org.eclipse.tcf.agent-ada7bca7372503004d2876b7bcf463de20327954.zip
Bug 405902 - Step-Over / Step-Into falls into a stub when debugging code compiled with -fPIC
-rw-r--r--agent/tcf/services/runctrl.c29
1 files changed, 29 insertions, 0 deletions
diff --git a/agent/tcf/services/runctrl.c b/agent/tcf/services/runctrl.c
index 3b33907b..6ad6c55e 100644
--- a/agent/tcf/services/runctrl.c
+++ b/agent/tcf/services/runctrl.c
@@ -1165,6 +1165,31 @@ static int is_function_prologue(Context * ctx, ContextAddress ip, CodeArea * are
return 0;
}
+static int is_hidden_function(Context * ctx, ContextAddress ip,
+ ContextAddress * addr0, ContextAddress * addr1) {
+#if ENABLE_Symbols
+ Symbol * sym = NULL;
+ char * name = NULL;
+ ContextAddress sym_addr = 0;
+ ContextAddress sym_size = 0;
+ if (find_symbol_by_addr(ctx, STACK_NO_FRAME, ip, &sym) < 0) return 0;
+ if (get_symbol_name(sym, &name) < 0 || name == NULL) return 0;
+ if (strcmp(name, "__i686.get_pc_thunk.bx") == 0) {
+ if (get_symbol_address(sym, &sym_addr) < 0) return 0;
+ if (get_symbol_size(sym, &sym_size) < 0 || sym_size == 0) {
+ *addr0 = ip;
+ *addr1 = ip + 1;
+ }
+ else {
+ *addr0 = sym_addr;
+ *addr1 = sym_addr + sym_size;
+ }
+ return 1;
+ }
+#endif
+ return 0;
+}
+
#if ENABLE_Symbols
static void get_machine_code_area(CodeArea * area, void * args) {
*(CodeArea **)args = (CodeArea *)tmp_alloc(sizeof(CodeArea));
@@ -1474,6 +1499,10 @@ static int update_step_machine_state(Context * ctx) {
ext->step_done = REASON_STEP;
return 0;
}
+ if (is_hidden_function(ctx, addr, &ext->step_range_start, &ext->step_range_end)) {
+ /* Don't stop in a function that should be hidden during source level stepping */
+ break;
+ }
ext->step_code_area = NULL;
if (address_to_line(ctx, addr, addr + 1, update_step_machine_code_area, ext) < 0) {
free_code_area(area);

Back to the top