From 1849c7029b1d6cf0468e5587c1b2715e00a3b47e Mon Sep 17 00:00:00 2001 From: Dmitry Boulytchev Date: Mon, 16 Nov 2020 20:49:07 +0300 Subject: [PATCH] Fixed call frame info (for gdb's bt command) --- src/X86.ml | 7 ++++--- src/version.ml | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/X86.ml b/src/X86.ml index 705ac0578..ddb00a3c3 100644 --- a/src/X86.ml +++ b/src/X86.ml @@ -436,8 +436,8 @@ let compile cmd env imports code = (List.flatten @@ List.map stabs_scope scopes) ) @ - [Meta "\t.cfi_startproc"; Meta "\t.cfi_adjust_cfa_offset\t4"] @ - (if has_closure then [Push edx; Meta "\t.cfi_adjust_cfa_offset\t4"] else []) @ + [Meta "\t.cfi_startproc"] @ + (if has_closure then [Push edx] else []) @ (if f = cmd#topname then [Mov (M "_init", eax); @@ -450,7 +450,8 @@ let compile cmd env imports code = else [] ) @ [Push ebp; - Meta "\t.cfi_adjust_cfa_offset\t4"; + Meta ("\t.cfi_def_cfa_offset\t" ^ if has_closure then "12" else "8"); + Meta ("\t.cfi_offset 5, -" ^ if has_closure then "12" else "8"); Mov (esp, ebp); Meta "\t.cfi_def_cfa_register\t5"; Binop ("-", M ("$" ^ env#lsize), esp); diff --git a/src/version.ml b/src/version.ml index 434ba2507..d9e2c2f3c 100644 --- a/src/version.ml +++ b/src/version.ml @@ -1 +1 @@ -let version = "Version 1.00, 695ddc7d8, Sat Oct 31 02:59:20 2020 +0300" +let version = "Version 1.00, 682258255, Mon Nov 16 16:20:19 2020 +0300"