Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEugene Tarassov2016-03-28 01:57:19 +0000
committerEugene Tarassov2016-03-28 01:57:19 +0000
commit363dcd9ef98a44eb45155f08158827412cbae6bf (patch)
tree35e4685283968d62e8c67652a08c8d5dedadf213 /server/tcf/services
parentc23a602c4b4e8350c5f6621aeb00df398734618e (diff)
downloadorg.eclipse.tcf.agent-363dcd9ef98a44eb45155f08158827412cbae6bf.tar.gz
org.eclipse.tcf.agent-363dcd9ef98a44eb45155f08158827412cbae6bf.tar.xz
org.eclipse.tcf.agent-363dcd9ef98a44eb45155f08158827412cbae6bf.zip
TCF Server: fixed: invalid stack trace info when debugging 32-bit code on X86_64 machine
Diffstat (limited to 'server/tcf/services')
-rw-r--r--server/tcf/services/context-proxy.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/server/tcf/services/context-proxy.c b/server/tcf/services/context-proxy.c
index ce4fe492..930cac20 100644
--- a/server/tcf/services/context-proxy.c
+++ b/server/tcf/services/context-proxy.c
@@ -1223,6 +1223,24 @@ int context_write_mem(Context * ctx, ContextAddress address, void * buf, size_t
RegisterDefinition * get_reg_by_id(Context * ctx, unsigned id, RegisterIdScope * scope) {
RegisterDefinition * defs = get_reg_definitions(ctx);
+ if (scope->machine == 3 && defs && defs->name && strcmp(defs->name, "rax") == 0) {
+ /* TODO: better way to handle 32-bit ELF on X86_64 */
+ switch (id) {
+ case 0: /* eax */ id = 0; break;
+ case 1: /* ecx */ id = 2; break;
+ case 2: /* edx */ id = 1; break;
+ case 3: /* ebx */ id = 3; break;
+ case 4: /* esp */ id = 7; break;
+ case 5: /* ebp */ id = 6; break;
+ case 6: /* esi */ id = 4; break;
+ case 7: /* edi */ id = 5; break;
+ case 8: /* eip */ id = 16; break;
+ case 9: /* eflags */ id = 49; break;
+ default:
+ set_errno(ERR_OTHER, "Invalid register ID");
+ return NULL;
+ }
+ }
while (defs != NULL && defs->name != NULL) {
switch (scope->id_type) {
case REGNUM_DWARF:

Back to the top