aboutsummaryrefslogtreecommitdiff
path: root/src/google_breakpad/processor
diff options
context:
space:
mode:
authorMike Frysinger <vapier@chromium.org>2016-10-25 20:12:09 -0400
committerMike Frysinger <vapier@chromium.org>2017-03-24 16:22:21 +0000
commite1b3620ec763cf3cd116570556cc3d7ca1771ad2 (patch)
tree1236c1cb0f5cd2abb637bde41b85122f03b68525 /src/google_breakpad/processor
parentminidump_dump: add proper cli processing (diff)
downloadbreakpad-e1b3620ec763cf3cd116570556cc3d7ca1771ad2.tar.xz
minidump_dump: dump stack memory like hexdump
The current stack output is one line byte string which is not easy for humans to parse. Extend the print mode to support a hexdump-like view and switch to that by default. Now we get something like: Stack 00000000 20 67 7b 53 94 7f 00 00 01 00 00 00 00 00 00 00 | g{S...........| 00000010 00 70 c4 44 9a 25 00 00 08 65 7a 53 94 7f 00 00 |.p.D.%...ezS...| BUG=chromium:598947 Change-Id: I868e1cf4faa435a14c5f1c35f94a5db4a49b6a6d Reviewed-on: https://chromium-review.googlesource.com/404008 Reviewed-by: Mark Mentovai <mark@chromium.org>
Diffstat (limited to 'src/google_breakpad/processor')
-rw-r--r--src/google_breakpad/processor/minidump.h16
1 files changed, 15 insertions, 1 deletions
diff --git a/src/google_breakpad/processor/minidump.h b/src/google_breakpad/processor/minidump.h
index a5d32c8b..2651a323 100644
--- a/src/google_breakpad/processor/minidump.h
+++ b/src/google_breakpad/processor/minidump.h
@@ -236,6 +236,7 @@ class MinidumpMemoryRegion : public MinidumpObject,
// Print a human-readable representation of the object to stdout.
void Print() const;
+ void SetPrintMode(bool hexdump, unsigned int width);
protected:
explicit MinidumpMemoryRegion(Minidump* minidump);
@@ -252,6 +253,10 @@ class MinidumpMemoryRegion : public MinidumpObject,
template<typename T> bool GetMemoryAtAddressInternal(uint64_t address,
T* value) const;
+ // Knobs for controlling display of memory printing.
+ bool hexdump_;
+ unsigned int hexdump_width_;
+
// The largest memory region that will be read from a minidump. The
// default is 1MB.
static uint32_t max_bytes_;
@@ -1104,7 +1109,9 @@ class MinidumpLinuxMapsList : public MinidumpStream {
class Minidump {
public:
// path is the pathname of a file containing the minidump.
- explicit Minidump(const string& path);
+ explicit Minidump(const string& path,
+ bool hexdump=false,
+ unsigned int hexdump_width=16);
// input is an istream wrapping minidump data. Minidump holds a
// weak pointer to input, and the caller must ensure that the stream
// is valid as long as the Minidump object is.
@@ -1214,6 +1221,9 @@ class Minidump {
// Is the OS Android.
bool IsAndroid();
+ // Get current hexdump display settings.
+ unsigned int HexdumpMode() const { return hexdump_ ? hexdump_width_ : 0; }
+
private:
// MinidumpStreamInfo is used in the MinidumpStreamMap. It lets
// the Minidump object locate interesting streams quickly, and
@@ -1275,6 +1285,10 @@ class Minidump {
// Read().
bool valid_;
+ // Knobs for controlling display of memory printing.
+ bool hexdump_;
+ unsigned int hexdump_width_;
+
DISALLOW_COPY_AND_ASSIGN(Minidump);
};