Mark
Mark

Reputation: 7576

Decoding protobuf data from plCrashReporter

I'm integrating plCrashReporter into one of my apps to add crash reporting functionality. Essentially, if I detect a crash I gather the crash report as NSData...

NSData *crashData;
NSError *error;
crashData = [crashReporter loadPendingCrashReportDataAndReturnError: &error];

crashData now contains the entire report. I can push this crashData into a PLCrashReport struct and read out parameters of it, but I'd rather just send the whole blob to my servers and look at it there. When the data reaches me, it looks like a lot of this:

706c6372 61736801 0a110801 1205342e 322e3118 02209184 82e80412
1b0a1263 6f6d2e73 6d756c65 2e545061 696e4465 76120531 2e362e32
1adb0208 00120618 d4a5f59d 03120618 bda5f59d 03120418 b5b96c12
0618df95 b09d0312 0618938b 9f9a0312 0618f9bb f68d0312 0618cdbc
f68d0312

I haven't had any luck getting anything meaningful out of this. I've tried using the plcrashutil, but haven't had any luck...

./plcrashutil convert --format=iphone example.plcrash Could not decode crash log: Could not decode invalid crash log header

I also tried using Google's protobuf but was unable to get it running.

I do have a dSYM file but am not even at the point of trying to symbolicate this yet.

I'm running Mac OS X 10.6.5.

Any advice would be greatly, greatly appreciated. Thanks!

Upvotes: 2

Views: 1085

Answers (1)

Mark
Mark

Reputation: 7576

Got this sorted out! The report gets sent through as hex, but converting it to binary allows you then to nicely run it through plcrashutil. Here is my HexToBinary.cpp implementation.

Upvotes: 2

Related Questions