aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjimblandy@gmail.com <jimblandy@gmail.com@4c0a9323-5329-0410-9bdc-e9ce6186880e>2009-12-15 17:21:14 +0000
committerjimblandy@gmail.com <jimblandy@gmail.com@4c0a9323-5329-0410-9bdc-e9ce6186880e>2009-12-15 17:21:14 +0000
commitbdd7ca54cd8313389e85e6b7f3bbf52c5dc52427 (patch)
tree3fea45bbfab43912cdfede201c0b76ce4f2d0f76
parentIssue 42001: Breakpad Linux Dumper: remove compilation warnings in guid_creat... (diff)
downloadbreakpad-bdd7ca54cd8313389e85e6b7f3bbf52c5dc52427.tar.xz
Issue 42002: Breakpad DWARF parser: avoid using <stdint.h> type
It seems that a use of the <stdint.h> type uintptr_t has crept into the DWARF parser. This defines a workaround for the GNU compilers (tested on both Mac and Linux) which will raise an error if it doesn't work. My personal preference would be just to assume that the <stdint.h> header is available and use the standard types everywhere, but 1) that would be a large change, likely to make merges with the other branches of the DWARF parser more difficult, and 2) it would make it quite difficult to build under Microsoft Visual Studio, which doesn't have the <stdint.h> header; Microsoft has said they have no plans to provide it, as they would rather "focus their efforts" on C++ and .NET. a=jimblandy, r=nealsid git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@448 4c0a9323-5329-0410-9bdc-e9ce6186880e
-rw-r--r--src/common/dwarf/dwarf2reader.cc5
-rw-r--r--src/common/dwarf/dwarf2reader.h2
-rw-r--r--src/common/dwarf/types.h7
3 files changed, 11 insertions, 3 deletions
diff --git a/src/common/dwarf/dwarf2reader.cc b/src/common/dwarf/dwarf2reader.cc
index 99acbe1f..bfe890de 100644
--- a/src/common/dwarf/dwarf2reader.cc
+++ b/src/common/dwarf/dwarf2reader.cc
@@ -605,7 +605,7 @@ bool LineInfo::ProcessOneOpcode(ByteReader* reader,
const char* start,
struct LineStateMachine* lsm,
size_t* len,
- uintptr_t pc,
+ uintptr pc,
bool *lsm_passes_pc) {
size_t oplen = 0;
size_t templen;
@@ -806,7 +806,8 @@ void LineInfo::ReadLines() {
while (!lsm.end_sequence) {
size_t oplength;
bool add_line = ProcessOneOpcode(reader_, handler_, header_,
- lineptr, &lsm, &oplength, (uintptr_t)-1, NULL);
+ lineptr, &lsm, &oplength, (uintptr)-1,
+ NULL);
if (add_line)
handler_->AddLine(lsm.address, lsm.file_num, lsm.line_num,
lsm.column_num);
diff --git a/src/common/dwarf/dwarf2reader.h b/src/common/dwarf/dwarf2reader.h
index eb9dc319..5d1c465b 100644
--- a/src/common/dwarf/dwarf2reader.h
+++ b/src/common/dwarf/dwarf2reader.h
@@ -110,7 +110,7 @@ class LineInfo {
const char* start,
struct LineStateMachine* lsm,
size_t* len,
- uintptr_t pc,
+ uintptr pc,
bool *lsm_passes_pc);
private:
diff --git a/src/common/dwarf/types.h b/src/common/dwarf/types.h
index 5f49ff9d..08a325aa 100644
--- a/src/common/dwarf/types.h
+++ b/src/common/dwarf/types.h
@@ -43,4 +43,11 @@ typedef unsigned short uint16;
typedef unsigned int uint32;
typedef unsigned long long uint64;
+#ifdef __PTRDIFF_TYPE__
+typedef __PTRDIFF_TYPE__ intptr;
+typedef unsigned __PTRDIFF_TYPE__ uintptr;
+#else
+#error "Can't find pointer-sized integral types."
+#endif
+
#endif // _COMMON_DWARF_TYPES_H__