mirror of
https://github.com/chromium/crashpad.git
synced 2025-03-09 14:06:33 +00:00
linux: Log register sizes on mismatch
Bug:1051354 Change-Id: Ia7731a87420e61756b61d109f9c69970ec27c6cb Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/2062776 Reviewed-by: Mark Mentovai <mark@chromium.org>
This commit is contained in:
parent
07812f5bd6
commit
faed21a286
@ -44,7 +44,8 @@ bool GetRegisterSet(pid_t tid, int set, Destination* dest, bool can_log) {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (iov.iov_len != sizeof(*dest)) {
|
if (iov.iov_len != sizeof(*dest)) {
|
||||||
LOG_IF(ERROR, can_log) << "Unexpected registers size";
|
LOG_IF(ERROR, can_log) << "Unexpected registers size " << iov.iov_len
|
||||||
|
<< " != " << sizeof(*dest);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
@ -176,7 +177,8 @@ bool GetFloatingPointRegisters32(pid_t tid,
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (iov.iov_len != sizeof(context->f32.fpregs)) {
|
if (iov.iov_len != sizeof(context->f32.fpregs)) {
|
||||||
LOG_IF(ERROR, can_log) << "Unexpected registers size";
|
LOG_IF(ERROR, can_log) << "Unexpected registers size " << iov.iov_len
|
||||||
|
<< " != " << sizeof(context->f32.fpregs);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
context->f32.have_fpregs = true;
|
context->f32.have_fpregs = true;
|
||||||
@ -197,7 +199,8 @@ bool GetFloatingPointRegisters32(pid_t tid,
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (iov.iov_len != kArmVfpSize && iov.iov_len != sizeof(context->f32.vfp)) {
|
if (iov.iov_len != kArmVfpSize && iov.iov_len != sizeof(context->f32.vfp)) {
|
||||||
LOG_IF(ERROR, can_log) << "Unexpected registers size";
|
LOG_IF(ERROR, can_log) << "Unexpected registers size " << iov.iov_len
|
||||||
|
<< " != " << sizeof(context->f32.vfp);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
context->f32.have_vfp = true;
|
context->f32.have_vfp = true;
|
||||||
@ -223,7 +226,8 @@ bool GetFloatingPointRegisters64(pid_t tid,
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (iov.iov_len != sizeof(context->f64)) {
|
if (iov.iov_len != sizeof(context->f64)) {
|
||||||
LOG_IF(ERROR, can_log) << "Unexpected registers size";
|
LOG_IF(ERROR, can_log) << "Unexpected registers size " << iov.iov_len
|
||||||
|
<< " != " << sizeof(context->f64);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
@ -425,9 +429,10 @@ size_t GetGeneralPurposeRegistersAndLength(pid_t tid,
|
|||||||
bool GetGeneralPurposeRegisters32(pid_t tid,
|
bool GetGeneralPurposeRegisters32(pid_t tid,
|
||||||
ThreadContext* context,
|
ThreadContext* context,
|
||||||
bool can_log) {
|
bool can_log) {
|
||||||
if (GetGeneralPurposeRegistersAndLength(tid, context, can_log) !=
|
size_t length = GetGeneralPurposeRegistersAndLength(tid, context, can_log);
|
||||||
sizeof(context->t32)) {
|
if (length != sizeof(context->t32)) {
|
||||||
LOG_IF(ERROR, can_log) << "Unexpected registers size";
|
LOG_IF(ERROR, can_log) << "Unexpected registers size " << length
|
||||||
|
<< " != " << sizeof(context->t32);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
@ -436,9 +441,10 @@ bool GetGeneralPurposeRegisters32(pid_t tid,
|
|||||||
bool GetGeneralPurposeRegisters64(pid_t tid,
|
bool GetGeneralPurposeRegisters64(pid_t tid,
|
||||||
ThreadContext* context,
|
ThreadContext* context,
|
||||||
bool can_log) {
|
bool can_log) {
|
||||||
if (GetGeneralPurposeRegistersAndLength(tid, context, can_log) !=
|
size_t length = GetGeneralPurposeRegistersAndLength(tid, context, can_log);
|
||||||
sizeof(context->t64)) {
|
if (length != sizeof(context->t64)) {
|
||||||
LOG_IF(ERROR, can_log) << "Unexpected registers size";
|
LOG_IF(ERROR, can_log) << "Unexpected registers size " << length
|
||||||
|
<< " != " << sizeof(context->t64);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
@ -467,7 +473,9 @@ bool Ptracer::Initialize(pid_t pid) {
|
|||||||
} else if (length == sizeof(context.t32)) {
|
} else if (length == sizeof(context.t32)) {
|
||||||
is_64_bit_ = false;
|
is_64_bit_ = false;
|
||||||
} else {
|
} else {
|
||||||
LOG_IF(ERROR, can_log_) << "Unexpected registers size";
|
LOG_IF(ERROR, can_log_)
|
||||||
|
<< "Unexpected registers size " << length
|
||||||
|
<< " != " << sizeof(context.t64) << ", " << sizeof(context.t32);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user