aboutsummaryrefslogtreecommitdiff
path: root/src/processor/minidump.h
diff options
context:
space:
mode:
authormmentovai <mmentovai@4c0a9323-5329-0410-9bdc-e9ce6186880e>2006-09-08 16:41:17 +0000
committermmentovai <mmentovai@4c0a9323-5329-0410-9bdc-e9ce6186880e>2006-09-08 16:41:17 +0000
commit6dd21d3baf490a34af0b1b1f5a48f8443dcb1ea6 (patch)
treec17055e78b878f16e9773bcf3fe377bd4c700777 /src/processor/minidump.h
parentaddressing follow-up review comments from mark (#17) (diff)
downloadbreakpad-6dd21d3baf490a34af0b1b1f5a48f8443dcb1ea6.tar.xz
Change interface for providing files to Minidump (#19). r=bryner
- Interface change: Minidump constructor now accepts a const string& path argument instead of int fd. Minidump will open the file on first Read and close it upon destruction. - Adapt callers to new interface, no longer leaking file descriptors. http://groups.google.com/group/airbag-dev/browse_thread/thread/ff24dbcde7db8ae3 git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@20 4c0a9323-5329-0410-9bdc-e9ce6186880e
Diffstat (limited to 'src/processor/minidump.h')
-rw-r--r--src/processor/minidump.h13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/processor/minidump.h b/src/processor/minidump.h
index 8ad7c9f5..cdc6d39e 100644
--- a/src/processor/minidump.h
+++ b/src/processor/minidump.h
@@ -561,10 +561,8 @@ class MinidumpMiscInfo : public MinidumpStream {
// and provides access to the minidump's top-level stream directory.
class Minidump {
public:
- // fd is a randomly seekable file descriptor that is open and is
- // positioned at the beginning of the MDRawHeader structure (byte offset
- // 0).
- Minidump(int fd);
+ // path is the pathname of a file containing the minidump.
+ Minidump(const string& path);
~Minidump();
@@ -652,6 +650,9 @@ class Minidump {
template<typename T> T* GetStream(T** stream);
+ // Opens the minidump file, or if already open, seeks to the beginning.
+ bool Open();
+
MDRawHeader header_;
// The list of streams.
@@ -660,7 +661,11 @@ class Minidump {
// Access to streams using the stream type as the key.
MinidumpStreamMap* stream_map_;
+ // The pathname of the minidump file to process, set in the constructor.
+ const string path_;
+
// The file descriptor for all file I/O. Used by ReadBytes and SeekSet.
+ // Set based on the |path_| member by Open, which is called by Read.
int fd_;
// swap_ is true if the minidump file should be byte-swapped. If the