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
This commit is contained in:
mmentovai 2007-05-08 20:56:30 +00:00
parent 0e668e0783
commit 436801fa23

View file

@ -223,9 +223,7 @@ StackFrame* StackwalkerX86::GetCallerFrame(
"$esp .raSearchStart 4 + ="; "$esp .raSearchStart 4 + =";
} else { } else {
// The function corresponding to the last frame doesn't use %ebp at // The function corresponding to the last frame doesn't use %ebp at
// all. The callee frame is located relative to %esp. %ebp is reset // all. The callee frame is located relative to %esp.
// to itself only to cause it to appear to have been set in
// dictionary_validity.
// //
// The called procedure's instruction pointer and stack pointer are // The called procedure's instruction pointer and stack pointer are
// recovered in the same way as the case above, except that no // 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 // %esp_new = %esp_old + callee_params + saved_regs + locals + 4
// %ebp_new = %ebp_old // %ebp_new = %ebp_old
program_string = "$eip .raSearchStart ^ = " program_string = "$eip .raSearchStart ^ = "
"$esp .raSearchStart 4 + = " "$esp .raSearchStart 4 + =";
"$ebp $ebp =";
recover_ebp = false; recover_ebp = false;
} }
} else { } else {
@ -280,15 +277,14 @@ StackFrame* StackwalkerX86::GetCallerFrame(
"$ebp $ebp ^ ="; "$ebp $ebp ^ =";
} }
// Now crank it out, making sure that the program string set the three // Now crank it out, making sure that the program string set at least the
// required variables. // two required variables.
PostfixEvaluator<u_int32_t> evaluator = PostfixEvaluator<u_int32_t> evaluator =
PostfixEvaluator<u_int32_t>(&dictionary, memory_); PostfixEvaluator<u_int32_t>(&dictionary, memory_);
PostfixEvaluator<u_int32_t>::DictionaryValidityType dictionary_validity; PostfixEvaluator<u_int32_t>::DictionaryValidityType dictionary_validity;
if (!evaluator.Evaluate(program_string, &dictionary_validity) || if (!evaluator.Evaluate(program_string, &dictionary_validity) ||
dictionary_validity.find("$eip") == dictionary_validity.end() || dictionary_validity.find("$eip") == dictionary_validity.end() ||
dictionary_validity.find("$esp") == dictionary_validity.end() || dictionary_validity.find("$esp") == dictionary_validity.end()) {
dictionary_validity.find("$ebp") == dictionary_validity.end()) {
return NULL; return NULL;
} }