mirror of
https://github.com/yuzu-emu/breakpad.git
synced 2024-12-23 14:45:46 +00:00
Breakpad x86 Stack Walker: Pass "out" parameters by address, not reference.
The Google C++ Style Guide requires all parameters passed by reference to be labeled 'const', and says that pointers should be used for output arguments. This patch brings google_breakpad::StackwalkerX86 into line. a=jimblandy, r=mmentovai git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@510 4c0a9323-5329-0410-9bdc-e9ce6186880e
This commit is contained in:
parent
2214cb9bc1
commit
6a9ffff696
|
@ -317,7 +317,7 @@ StackFrame* StackwalkerX86::GetCallerFrame(const CallStack *stack) {
|
|||
// frame pointer.
|
||||
u_int32_t location_start = last_frame->context.esp;
|
||||
u_int32_t location, eip;
|
||||
if (!ScanForReturnAddress(location_start, location, eip)) {
|
||||
if (!ScanForReturnAddress(location_start, &location, &eip)) {
|
||||
// if we can't find an instruction pointer even with stack scanning,
|
||||
// give up.
|
||||
return NULL;
|
||||
|
@ -360,7 +360,7 @@ StackFrame* StackwalkerX86::GetCallerFrame(const CallStack *stack) {
|
|||
// looking one 32-bit word above that location.
|
||||
u_int32_t location_start = dictionary[".raSearchStart"] + 4;
|
||||
u_int32_t location;
|
||||
if (ScanForReturnAddress(location_start, location, eip)) {
|
||||
if (ScanForReturnAddress(location_start, &location, &eip)) {
|
||||
// This is a better return address that what program string
|
||||
// evaluation found. Use it, and set %esp to the location above the
|
||||
// one where the return address was found.
|
||||
|
@ -450,8 +450,8 @@ StackFrame* StackwalkerX86::GetCallerFrame(const CallStack *stack) {
|
|||
}
|
||||
|
||||
bool StackwalkerX86::ScanForReturnAddress(u_int32_t location_start,
|
||||
u_int32_t &location_found,
|
||||
u_int32_t &eip_found) {
|
||||
u_int32_t *location_found,
|
||||
u_int32_t *eip_found) {
|
||||
const int kRASearchWords = 15;
|
||||
for (u_int32_t location = location_start;
|
||||
location <= location_start + kRASearchWords * 4;
|
||||
|
@ -463,8 +463,8 @@ bool StackwalkerX86::ScanForReturnAddress(u_int32_t location_start,
|
|||
if (modules_ && modules_->GetModuleForAddress(eip) &&
|
||||
InstructionAddressSeemsValid(eip)) {
|
||||
|
||||
eip_found = eip;
|
||||
location_found = location;
|
||||
*eip_found = eip;
|
||||
*location_found = location;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -79,8 +79,8 @@ class StackwalkerX86 : public Stackwalker {
|
|||
// the value was found, and eip_found to the value contained at that
|
||||
// location in memory.
|
||||
bool ScanForReturnAddress(u_int32_t location_start,
|
||||
u_int32_t &location_found,
|
||||
u_int32_t &eip_found);
|
||||
u_int32_t *location_found,
|
||||
u_int32_t *eip_found);
|
||||
|
||||
// Stores the CPU context corresponding to the innermost stack frame to
|
||||
// be returned by GetContextFrame.
|
||||
|
|
Loading…
Reference in a new issue