summaryrefslogtreecommitdiff
path: root/libs/binder/Status.cpp
diff options
context:
space:
mode:
author Fyodor Kupolov <fkupolov@google.com> 2017-11-13 15:51:03 -0800
committer Fyodor Kupolov <fkupolov@google.com> 2017-11-13 15:51:03 -0800
commitd9ac3741922a58b17aec730ba113f44efb8b6600 (patch)
tree20bec2c8a265733e2241ce84c6361954c6ce5b34 /libs/binder/Status.cpp
parent4d55997a193827675ff1eee7ffe5d23f3772c985 (diff)
Provide remote stack trace information
The stack is truncated up to 5 lines at parcel time. When unparceling, a separate RemoteException will be created and set as a cause of the exception being thrown. Performance results(in nanoseconds): timeWriteExceptionWithStackTraceParceling 82175 timeWriteException 6616 timeReadException 22529 timeReadExceptionWithStackTraceParceling 34151 Test: manual + ParcelPerfTest Bug: 36561158 Change-Id: I9c0a54a86cd82cff92d8e1a15ec19dfed58ef856
Diffstat (limited to 'libs/binder/Status.cpp')
-rw-r--r--libs/binder/Status.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/libs/binder/Status.cpp b/libs/binder/Status.cpp
index 006f7f94e9..a9d5055549 100644
--- a/libs/binder/Status.cpp
+++ b/libs/binder/Status.cpp
@@ -102,6 +102,15 @@ status_t Status::readFromParcel(const Parcel& parcel) {
}
mMessage = String8(message);
+ // Skip over the remote stack trace data
+ int32_t remote_stack_trace_header_size;
+ status = parcel.readInt32(&remote_stack_trace_header_size);
+ if (status != OK) {
+ setFromStatusT(status);
+ return status;
+ }
+ parcel.setDataPosition(parcel.dataPosition() + remote_stack_trace_header_size);
+
if (mException == EX_SERVICE_SPECIFIC) {
status = parcel.readInt32(&mErrorCode);
} else if (mException == EX_PARCELABLE) {
@@ -137,6 +146,7 @@ status_t Status::writeToParcel(Parcel* parcel) const {
return status;
}
status = parcel->writeString16(String16(mMessage));
+ status = parcel->writeInt32(0); // Empty remote stack trace header
if (mException == EX_SERVICE_SPECIFIC) {
status = parcel->writeInt32(mErrorCode);
} else if (mException == EX_PARCELABLE) {