From 436801fa2324dfae9e5a0bd2651dd7c753e7e95f Mon Sep 17 00:00:00 2001 From: mmentovai Date: Tue, 8 May 2007 20:56:30 +0000 Subject: [PATCH] Stacks (still) truncated on win32 (#165). Patch by Benjamin Smedberg. r=me Don't require a program string to reset %ebp, as not all program strings set this value. http://groups.google.com/group/google-breakpad-dev/browse_thread/thread/ee4854ae7ffce94e git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@163 4c0a9323-5329-0410-9bdc-e9ce6186880e --- src/processor/stackwalker_x86.cc | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/src/processor/stackwalker_x86.cc b/src/processor/stackwalker_x86.cc index cb8be3ed..59662cdf 100644 --- a/src/processor/stackwalker_x86.cc +++ b/src/processor/stackwalker_x86.cc @@ -223,9 +223,7 @@ StackFrame* StackwalkerX86::GetCallerFrame( "$esp .raSearchStart 4 + ="; } else { // The function corresponding to the last frame doesn't use %ebp at - // all. The callee frame is located relative to %esp. %ebp is reset - // to itself only to cause it to appear to have been set in - // dictionary_validity. + // all. The callee frame is located relative to %esp. // // The called procedure's instruction pointer and stack pointer are // recovered in the same way as the case above, except that no @@ -244,8 +242,7 @@ StackFrame* StackwalkerX86::GetCallerFrame( // %esp_new = %esp_old + callee_params + saved_regs + locals + 4 // %ebp_new = %ebp_old program_string = "$eip .raSearchStart ^ = " - "$esp .raSearchStart 4 + = " - "$ebp $ebp ="; + "$esp .raSearchStart 4 + ="; recover_ebp = false; } } else { @@ -280,15 +277,14 @@ StackFrame* StackwalkerX86::GetCallerFrame( "$ebp $ebp ^ ="; } - // Now crank it out, making sure that the program string set the three - // required variables. + // Now crank it out, making sure that the program string set at least the + // two required variables. PostfixEvaluator evaluator = PostfixEvaluator(&dictionary, memory_); PostfixEvaluator::DictionaryValidityType dictionary_validity; if (!evaluator.Evaluate(program_string, &dictionary_validity) || dictionary_validity.find("$eip") == dictionary_validity.end() || - dictionary_validity.find("$esp") == dictionary_validity.end() || - dictionary_validity.find("$ebp") == dictionary_validity.end()) { + dictionary_validity.find("$esp") == dictionary_validity.end()) { return NULL; }