diff --git a/src/dwarf/Gparser.c b/src/dwarf/Gparser.c index 3a47255c..5336a2a6 100644 --- a/src/dwarf/Gparser.c +++ b/src/dwarf/Gparser.c @@ -925,7 +925,19 @@ dwarf_make_proc_info (struct dwarf_cursor *c) if (c->as->caching_policy == UNW_CACHE_NONE || get_cached_proc_info (c) < 0) #endif - /* Lookup it up the slow way... */ - return fetch_proc_info (c, c->ip, 0); + dwarf_state_record_t sr; + int ret; + + /* Lookup it up the slow way... */ + if ((ret = fetch_proc_info (c, c->ip, 1)) < 0) + return ret; + /* Also need to check if current frame contains + args_size, and set cursor appropriatly. Only + needed for unw_resume */ + if ((ret = dwarf_create_state_record (c, &sr)) < 0) + return ret; + put_unwind_info (c, &c->pi); + c->args_size = sr.args_size; + return 0; } diff --git a/src/x86/Gresume.c b/src/x86/Gresume.c index cb3fb31e..7d1d934f 100644 --- a/src/x86/Gresume.c +++ b/src/x86/Gresume.c @@ -63,6 +63,15 @@ establish_machine_state (struct cursor *c) (*access_reg) (as, reg, &val, 1, arg); } } + + if (c->dwarf.args_size) + { + if (tdep_access_reg (c, ESP, &val, 0) >= 0) + { + val += c->dwarf.args_size; + (*access_reg) (as, ESP, &val, 1, arg); + } + } return 0; } diff --git a/src/x86_64/Gresume.c b/src/x86_64/Gresume.c index 6880d94a..b880b01c 100644 --- a/src/x86_64/Gresume.c +++ b/src/x86_64/Gresume.c @@ -95,6 +95,15 @@ establish_machine_state (struct cursor *c) (*access_reg) (as, reg, &val, 1, arg); } } + + if (c->dwarf.args_size) + { + if (tdep_access_reg (c, RSP, &val, 0) >= 0) + { + val += c->dwarf.args_size; + (*access_reg) (as, RSP, &val, 1, arg); + } + } return 0; }