History log of /external/google-breakpad/src/common/dwarf/dwarf2reader.cc
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
4344eb9b1b5b785b2768e36699ac0e89da9a8504 03-Dec-2014 mseaborn@chromium.org <mseaborn@chromium.org@4c0a9323-5329-0410-9bdc-e9ce6186880e> dump_syms: Fix handling of DW_FORM_ref_addr to work with DWARF 4

Previously, dump_syms did not handle DW_FORM_ref_addr if it appeared
in DWARF 4 debugging info.

Also fix a DW_FORM_ref_addr case so that it doesn't fall through to
the next switch case when assertions are disabled and the DWARF
version isn't recognised.

The following steps will reproduce the problem when using LLVM 3.4:

cat <<END >example1.c
int main() { return 0; }
END
cat <<END >example2.c
void foo(int x) {}
END

clang -emit-llvm -g -c example1.c -o example1.bc
clang -emit-llvm -g -c example2.c -o example2.bc
llvm-link-3.4 example1.bc example2.bc -o combined.bc
clang combined.bc -o executable
./google-breakpad/build/src/tools/linux/dump_syms/dump_syms executable

When using LLVM bitcode linking in this way, LLVM's backend generates
partially-merged DWARF debugging info in which some of the references
to the "int" type go via "DW_FORM_ref_addr". Since PNaCl uses LLVM
bitcode linking, this dump_syms failure occurs with nexes produced by
the PNaCl toolchain.

BUG= https://code.google.com/p/chromium/issues/detail?id=416368
TEST= see above
R=mark@chromium.org, mcgrathr@chromium.org

Review URL: https://breakpad.appspot.com/5744002

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1408 4c0a9323-5329-0410-9bdc-e9ce6186880e
/external/google-breakpad/src/common/dwarf/dwarf2reader.cc
5f22d6a7f471f2352d394c188560fd06830e14f3 11-Sep-2013 gordana.cmiljanovic@imgtec.com <gordana.cmiljanovic@imgtec.com@4c0a9323-5329-0410-9bdc-e9ce6186880e> Adding support for mips.

Support for mips cpu is added to all breakapad targets including unittests.

BUG=none
TEST=unittests

Review URL: https://breakpad.appspot.com/614002



git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1212 4c0a9323-5329-0410-9bdc-e9ce6186880e
/external/google-breakpad/src/common/dwarf/dwarf2reader.cc
7c2350868e7f53728866d304bc6a7ce8ba3b5d05 12-Dec-2012 mark@chromium.org <mark@chromium.org@4c0a9323-5329-0410-9bdc-e9ce6186880e> Remove dead code.

Patch by Rafael Espindola <rafael.espindola@gmail.com>

Review URL: http://breakpad.appspot.com/502003/


git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1091 4c0a9323-5329-0410-9bdc-e9ce6186880e
/external/google-breakpad/src/common/dwarf/dwarf2reader.cc
4e518a4357a2d1c379d4a91df6d4e153ee791101 29-Jun-2012 ivan.penkov@gmail.com <ivan.penkov@gmail.com@4c0a9323-5329-0410-9bdc-e9ce6186880e> This change allows compiling the google-breakpad code using a global ::string class instead of std::string. For more details take a look at common/using_std_string.h



git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@974 4c0a9323-5329-0410-9bdc-e9ce6186880e
/external/google-breakpad/src/common/dwarf/dwarf2reader.cc
272aafd0b00e3b8d1ad1823755e75ba00e7b0152 04-Apr-2012 jimblandy <jimblandy@4c0a9323-5329-0410-9bdc-e9ce6186880e> Accept version 3 .eh_frame unwinding data, as well as version 1.
a=michaelrmmiller
r=jimblandy


git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@947 4c0a9323-5329-0410-9bdc-e9ce6186880e
/external/google-breakpad/src/common/dwarf/dwarf2reader.cc
397ec043da95224cab62f18dc98a840e14cd7cc1 15-Feb-2012 ted.mielczarek <ted.mielczarek@4c0a9323-5329-0410-9bdc-e9ce6186880e> Add some missing #includes
P=Albert Zeyer
R=ted at http://breakpad.appspot.com/289001

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@920 4c0a9323-5329-0410-9bdc-e9ce6186880e
/external/google-breakpad/src/common/dwarf/dwarf2reader.cc
f13ce5e39b268157343fecf176a0f7ee9ef5d787 01-Feb-2012 jimblandy <jimblandy@4c0a9323-5329-0410-9bdc-e9ce6186880e> Breakpad DWARF: Add support for DWARF 4 attribute forms.

This patch allows Breakpad's DWARF reader to at least read or skip
attributes using the new forms defined in version 4 of the DWARF
specification, instead of crashing.

Attributes encoded using DW_FORM_flag_present, DW_FORM_sec_offset, and
DW_FORM_exprloc should work fine now. However, compilation units using
DW_FORM_ref_sig8 to refer to types in .debug_types will need further work
to support. (GCC 4.6.2 does not emit .debug_types sections.)

Specifically:

- dwarf2reader::DwarfForm gets new values.
- dwarf2reader::Dwarf2Handler and dwarf2reader::DIEHandler get new handler
methods, named ProcessAttributeSignature, for DW_FORM_ref_sig8 attributes.
- dwarf2reader::CompilationUnit reads DW_FORM_ref_sig8 attributes, and
passes them to ProcessAttributeSignature. It also gets support for
DW_FORM_sec_offset, DW_FORM_exprloc, and DW_FORM_flag_present, using the
existing appropriate ProcessAttribute* methods.
- dwarf2reader::DIEDispatcher passes through ProcessAttributeSignature
attributes to its DIEHandler.
- Unit tests are updated.

a=jimb, r=ted.mielczarek
Review URL: http://breakpad.appspot.com/343003/


git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@912 4c0a9323-5329-0410-9bdc-e9ce6186880e
/external/google-breakpad/src/common/dwarf/dwarf2reader.cc
16695cdfa0b9f9f66a1fb1c19e1eaf6c433bbeca 01-Feb-2012 jimblandy <jimblandy@4c0a9323-5329-0410-9bdc-e9ce6186880e> Breakpad DWARF support: Remove extraneous breaks following returns in dwarf2reader.cc.
a=jimb, r=ted.mielczarek
Review URL: http://breakpad.appspot.com/343002/


git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@911 4c0a9323-5329-0410-9bdc-e9ce6186880e
/external/google-breakpad/src/common/dwarf/dwarf2reader.cc
aa4a7a62c717289ff9eec7e903d66f13943bf524 11-Oct-2011 mark@chromium.org <mark@chromium.org@4c0a9323-5329-0410-9bdc-e9ce6186880e> Remove "using namespace std" from dwarf2reader.h. Using-directives are
forbidden by the style guide, and are bad practice in headers even under
style rules that tolerate this construct.

This fixes warnings such as:

In file included from dwarf2reader.cc:34:
dwarf2reader.h:53:17: warning: using namespace directive in global context in header [-Wheader-hygiene]
Review URL: http://breakpad.appspot.com/312002

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@862 4c0a9323-5329-0410-9bdc-e9ce6186880e
/external/google-breakpad/src/common/dwarf/dwarf2reader.cc
c2c4192c1bc951512073c6108e63e2c6d08da639 25-Aug-2010 jimblandy <jimblandy@4c0a9323-5329-0410-9bdc-e9ce6186880e> Breakpad DWARF Reader: Ignore padding at the end of the compilation unit.

After the final DIE in a compilation unit, there may be any number of
zero bytes present. This is meant to allow producers to align
compilation unit starting points when necessary.

This patch changes the dwarf2reader::CompilationUnit class to skip
those zero bytes, rather than interpreting them as 'end of children'
markers for DIEs that do not exist. Without this change, the padding
bytes will cause the reader to attempt to pop an offset from an empty
stack, and call EndDIE with a garbage offset.

a=jimblandy, r=mmentovai


git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@667 4c0a9323-5329-0410-9bdc-e9ce6186880e
/external/google-breakpad/src/common/dwarf/dwarf2reader.cc
42943c2391b6134b4caf5ff78e35c0c9edc57661 25-Aug-2010 jimblandy <jimblandy@4c0a9323-5329-0410-9bdc-e9ce6186880e> Breakpad DWARF parser: Don't use auto_ptr<stack<uint64> > where stack<uint64> would do.

Perhaps there once was some reason one needed the DIE offset stack to
have an unusual lifetime, but there is none now.

a=jimblandy, r=mmentovai


git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@666 4c0a9323-5329-0410-9bdc-e9ce6186880e
/external/google-breakpad/src/common/dwarf/dwarf2reader.cc
31b4957eead3971c2517e686ecf91bd10c4e8120 16-Aug-2010 ted.mielczarek <ted.mielczarek@4c0a9323-5329-0410-9bdc-e9ce6186880e> Add missing stdint.h include to fix compilation on newer GCC.

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@652 4c0a9323-5329-0410-9bdc-e9ce6186880e
/external/google-breakpad/src/common/dwarf/dwarf2reader.cc
4ac61acb3a7dad6ce722fe07564be8ec92713228 19-Jul-2010 dmaclach <dmaclach@4c0a9323-5329-0410-9bdc-e9ce6186880e> Clean up build for 64 bit.
Fix up some broken mac projects.
Consolidate project settings in xcconfig files.

http://breakpad.appspot.com/130001



git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@627 4c0a9323-5329-0410-9bdc-e9ce6186880e
/external/google-breakpad/src/common/dwarf/dwarf2reader.cc
e1930985430ce289f4fe8525f51050e5d78cc44e 25-Jun-2010 ted.mielczarek <ted.mielczarek@4c0a9323-5329-0410-9bdc-e9ce6186880e> Breakpad: Avoid using the C++ <cfoo> headers.

This patch avoids unnecessary use of the <cfoo> headers in files that don't
actually use the identifiers they declare in the std:: namespace.

It also changes some files to better conform with the "Names and Order of
Includes" rules in the Google C++ Style Guide.

A=jimb R=mark

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@619 4c0a9323-5329-0410-9bdc-e9ce6186880e
/external/google-breakpad/src/common/dwarf/dwarf2reader.cc
6869f2e1b3d658c7048347c2bc87fb231f567e25 25-Jun-2010 ted.mielczarek <ted.mielczarek@4c0a9323-5329-0410-9bdc-e9ce6186880e> Breakpad DWARF CFI parser: Use the proper type for offsets in CallFrameInfo::Rule subclasses.

The subclasses of CallFrameInfo::Rule store the rule currently in
force for recovering a register or computing the canonical frame
address. Their sole responsibility is to accurately convey rules from
the parser, which creates them, to a CallFrameInfo::Handler member
function, which consumes them. So, the types of their data members
should match those of the corresponding arguments of the corresponding
Handler member function.

CallFrameInfo::OffsetRule and CallFrameInfo::ValOffsetRule use an
'int' to store the rule's offset value, but
CallFrameInfo::Handler::OffsetRule and ...::ValOffsetRule expect a
'long'. On ABIs where 'long' is larger than 'int', this can cause
values to be truncated or sign-extended unexpectedly.

This patch changes those members to 'long'.

Fortunately, offsets appearing in real DWARF call frame information
never even come close to the limits of a 32-bit int, so this bug is
unlikely to cause any practical problems.
A=jimb R=thestig

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@615 4c0a9323-5329-0410-9bdc-e9ce6186880e
/external/google-breakpad/src/common/dwarf/dwarf2reader.cc
608d142aaa1da8e68e4635db77fd9f36d337276c 30-Mar-2010 jimblandy <jimblandy@4c0a9323-5329-0410-9bdc-e9ce6186880e> Breakpad DWARF parser: correct comments regarding dynamic_cast.

The comments don't accurately describe what the style guide says.

Regardless of what the style guide says, RTTI seems to make trouble in
practice, because so many people build with it disabled. Since only the
symbol dumper uses RTTI, not the client library, it may be practical for
people to simply enable RTTI for the dumper. Failing that, it may be best
in the long run to violate the style guide and make the code work sans
RTTI.

a=jimblandy, r=mmentovai


git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@561 4c0a9323-5329-0410-9bdc-e9ce6186880e
/external/google-breakpad/src/common/dwarf/dwarf2reader.cc
00dbb737525e0dd7411af3679695573ca37ee785 29-Mar-2010 jimblandy <jimblandy@4c0a9323-5329-0410-9bdc-e9ce6186880e> Breakpad Linux dumper: Make changes requested by Neal Sidhwaney in issue 59002.

- Use manifest constants for 'z' augmentation letters.
- Fix typos and rearrange some code for legibility.

a=jimblandy, r=nealsid


git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@560 4c0a9323-5329-0410-9bdc-e9ce6186880e
/external/google-breakpad/src/common/dwarf/dwarf2reader.cc
a76aaa1442d765410da36d743ef92748ea1b815e 16-Mar-2010 jimblandy <jimblandy@4c0a9323-5329-0410-9bdc-e9ce6186880e> Breakpad Linux dumper: Parse the .eh_frame section.

Extend google_breakpad::CFISection with the ability to produce
.eh_frame data. Entry headers have a different format, and pointers
can be encoded in new and fascinating ways.

Extend dwarf2reader::CallFrameInfo to be able to parse either DWARF
CFI or .eh_frame data, as determined by an argument to the
constructor. Cope with variations in header formats, encoded pointers,
and additional data in 'z' augmentation data blocks. Extend the unit
tests appropriately.

Extend dump_syms to look for a .eh_frame section, and if it is
present, find the necessary base addresess and parse its contents.

There's no need for DwarfCFIToModule to check the version numbers; if
CallFrameInfo can parse it, DwarfCFIToModule should be able to handle
it. Adjust tests accordingly.

a=jimblandy, r=nealsid


git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@552 4c0a9323-5329-0410-9bdc-e9ce6186880e
/external/google-breakpad/src/common/dwarf/dwarf2reader.cc
3e768ed9c01a244cdb1bc0d6aec34fb25821fbcc 16-Mar-2010 jimblandy <jimblandy@4c0a9323-5329-0410-9bdc-e9ce6186880e> Breakpad Linux dumper: Add support for dumping DWARF CFI as STACK CFI records.

Define a new DWARF parser class, dwarf2reader::CallFrameInfo.

Extend google_breakpad::Module to store and write out 'STACK CFI' records.

Define a new google_breakpad::DwarfCFIToModule class, to accept DWARF
CFI data from the parser and populate a Module with the equivalent
STACK CFI records.

Extend the Linux symbol dumping tool, dump_syms, to use
dwarf2reader::CallFrameInfo, google_breakpad::DwarfCFIToModule, and
google_breakpad::Module to extract DWARF CFI from the executable or
shared library files and write it to the Breakpad symbol file.

Define CFISection, a new class derived from TestAssembler::Section,
for use in creating DWARF CFI data for test cases.

a=jimblandy, r=nealsid


git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@550 4c0a9323-5329-0410-9bdc-e9ce6186880e
/external/google-breakpad/src/common/dwarf/dwarf2reader.cc
c50e7c604cd1b12bba9421b0a95357fc942ecd7c 09-Feb-2010 jimblandy <jimblandy@4c0a9323-5329-0410-9bdc-e9ce6186880e> Breakpad Linux dumper: Add file comments as required by the style guide.

This also includes some comments I promised Cary Coutant I'd write
about the appropriateness of processing attributes in EndAttributes
calls.

The Google C++ Style Guide requires each file to have an author notice
and a comment explaining the file's general purpose. For the record, I
don't think putting an author notice on the files is a good idea; it's
odd to have the original author retain prominence even if the file has
been heavily edited by others; the version control system answers this
question more accurately. This is only for Style Guide compliance. The
Apache group decided to discourage author annotations, partially for
these reasons:

http://mail-archives.apache.org/mod_mbox/jakarta-jmeter-dev/200402.mbox/%3C4039F65E.7020406@atg.com%3E

a=jimblandy, r=nealsid


git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@518 4c0a9323-5329-0410-9bdc-e9ce6186880e
/external/google-breakpad/src/common/dwarf/dwarf2reader.cc
83e085b7a331c96237cf8e814f97b3ef4c36a70f 09-Feb-2010 jimblandy <jimblandy@4c0a9323-5329-0410-9bdc-e9ce6186880e> Breakpad: Update copyright notice years on all files changed in 2010.

We've gotten mixed advice from the lawyery types about whether this
matters. But it's easy enough to do.

a=jimblandy, r=nealsid


git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@517 4c0a9323-5329-0410-9bdc-e9ce6186880e
/external/google-breakpad/src/common/dwarf/dwarf2reader.cc
1ac84da26d72cc3fb85af124d91b17cdecb17499 28-Jan-2010 jimblandy <jimblandy@4c0a9323-5329-0410-9bdc-e9ce6186880e> Breakpad DWARF parser: Add method to read DWARF "Initial length".

This patch moves the ReadInitialFunction from dwarf2reader.cc, where
it was a static function, to being a member function of
google_breakpad::ByteReader.

a=jimblandy, r=nealsid


git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@504 4c0a9323-5329-0410-9bdc-e9ce6186880e
/external/google-breakpad/src/common/dwarf/dwarf2reader.cc
8bfcc2683f6cb4345b56c898eabe45efeb77dc3e 23-Jan-2010 jimblandy <jimblandy@4c0a9323-5329-0410-9bdc-e9ce6186880e> Breakpad DWARF Reader: Change LineInfoHandler::AddLine to provide the line's length.

Breakpad's DWARF line number info parser provides a code address,
file, and line number for each code/source pairing, but doesn't
provide the length of the machine code. This makes that change, as
discussed in the following thread:

http://groups.google.com/group/google-breakpad-dev/browse_thread/thread/ed8d2fde79319368p

This patch also makes the corresponding changes to the functioninfo.cc
module, used by the Mac dumper. This patch has no effect on the Mac
dumper's output.

a=jimblandy, r=ccoutant


git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@494 4c0a9323-5329-0410-9bdc-e9ce6186880e
/external/google-breakpad/src/common/dwarf/dwarf2reader.cc
e15bffe46696996d13ce308a8dbd52a919150ba6 23-Jan-2010 jimblandy <jimblandy@4c0a9323-5329-0410-9bdc-e9ce6186880e> Breakpad DWARF Reader: Also look for DWARF in sections with the proper names.

The DWARF specification specifices which names the sections containing
DWARF information should have. OSX uses slightly different names. This
patch changes the DWARF reader to look for the sections under both
sets of names.

a=jimblandy, r=ccoutant


git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@493 4c0a9323-5329-0410-9bdc-e9ce6186880e
/external/google-breakpad/src/common/dwarf/dwarf2reader.cc
330ca2f7c71d84a01626b1198ef600540eb320b8 12-Jan-2010 jimblandy <jimblandy@4c0a9323-5329-0410-9bdc-e9ce6186880e> Google Breakpad DWARF reader: Add a handler function for DIE references.

Add a new member function to dwarf2reader::Dwarf2Handler,
ProcessAttributeReference, for reporting attribute values that are
references to other DIEs. This handler member function always receives
an absolute offset (that is, relative to the start of the .debug_info
section, not to the start of the compilation unit), regardless of the
form the attribute uses. (Some forms are CU-relative, some are
absolute.)

a=jimblandy, r=nealsid


git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@482 4c0a9323-5329-0410-9bdc-e9ce6186880e
/external/google-breakpad/src/common/dwarf/dwarf2reader.cc
5fb436d5bb74496e7f2b0dddb3649911d1c49df4 15-Dec-2009 jimblandy@gmail.com <jimblandy@gmail.com@4c0a9323-5329-0410-9bdc-e9ce6186880e> Issue 41004: Breakpad DWARF parser: fixes to compile without warnings under GNU C++ 4.3.3.

a=jimblandy, r=nealsid


git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@450 4c0a9323-5329-0410-9bdc-e9ce6186880e
/external/google-breakpad/src/common/dwarf/dwarf2reader.cc
315c4f6b2038a917eaa85267fe251e1be7ee7fb9 15-Dec-2009 jimblandy@gmail.com <jimblandy@gmail.com@4c0a9323-5329-0410-9bdc-e9ce6186880e> Issue 41003: Breakpad DWARF parser: Include <cstdio>, since we use it

src/common/dwarf/dwarf2reader.cc uses the old-fashioned <stdio.h>
facilities to report errors. Ideally, we would add a 'Warning' message
to the handler and make the client responsible for dealing with the
errors, but this at least allows us to compile.

Ubuntu 9.10 uses GCC 4.4.1; under older versions of GCC, this wasn't a
problem, probably because stdio.h was being brought in inadvertently
somewhere else.

a=jimblandy, r=nealsid


git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@449 4c0a9323-5329-0410-9bdc-e9ce6186880e
/external/google-breakpad/src/common/dwarf/dwarf2reader.cc
bdd7ca54cd8313389e85e6b7f3bbf52c5dc52427 15-Dec-2009 jimblandy@gmail.com <jimblandy@gmail.com@4c0a9323-5329-0410-9bdc-e9ce6186880e> 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
/external/google-breakpad/src/common/dwarf/dwarf2reader.cc
4969cfc6477c56afb2d4f2f6c1733c3120690b6d 15-Dec-2009 jimblandy@gmail.com <jimblandy@gmail.com@4c0a9323-5329-0410-9bdc-e9ce6186880e> Issue 39002: Breakpad DWARF parser: Move DWARF parser to platform-independent directory.

Move the DWARF parser, and the functioninfo.cc DWARF consumer, from
src/common/mac/dwarf to src/commmon/dwarf, so that it can be shared
between the Mac and Linux dumpers.

Fix up #include directives, multiple inclusion protection macros, and
Xcode build files.

a=jimblandy, r=nealsid


git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@446 4c0a9323-5329-0410-9bdc-e9ce6186880e
/external/google-breakpad/src/common/dwarf/dwarf2reader.cc