1. Visit DW_TAG_class_type when it's inside DW_TAG_subprogram.
2. Only warn when we can't get the name for the DIE and it has DW_AT_specification that is not in the specification map.
Bug: 1078932
Change-Id: Id3126aec305658f8f65c01675a8e9e3ea03f3651
Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/3579855
Reviewed-by: Joshua Peraza <jperaza@chromium.org>
Since the introduction of inlined frames, it is not sufficient to check
the stack trace length (== 1) in order to identify context frames.
Updating all location that were depending on this assumption to check
for frame trust level instead.
Change-Id: I98f966889367c2270c268b8e78b67418c89c50f1
Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/3499020
Reviewed-by: Mark Mentovai <mark@chromium.org>
for Windows x64 stacks.
According to https://reviews.llvm.org/D2474, LLVM does't generate unwind info for leaf function which doesn't touch any callee-saved
registers. According to MSDN, leaf functions can be unwound simply by
simulating a return.
Change-Id: Ic0503e2aca90b0ba5799133ea8439f1b5f2eefda
Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/3489332
Reviewed-by: Mark Mentovai <mark@chromium.org>
Reviewed-by: Joshua Peraza <jperaza@chromium.org>
This is needed in order to properly detect and highlight frames that
correspond to multiple functions, for example as the result of identical
code folding by the linker.
Bug: google-breakpad:751
Change-Id: I2ee7c147fcff6493c2454383ad5422b38269759a
Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/3471034
Reviewed-by: Joshua Peraza <jperaza@chromium.org>
Inline frames are always of the base-class type (StackFrame). Treating them as derived-class and accessing members was causing heap buffer overflows.
Change-Id: Id4122ab6a31f016933038a1cb63d45d5c38481f5
Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/3425445
Reviewed-by: Joshua Peraza <jperaza@chromium.org>
- don't do iter decrement when the map empty.
- add dummy file with id equals to 0 to represent unknown file.
Change-Id: I3fe55a459c9fa835bbe0c4272e4ac12b1150c034
Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/3425732
Reviewed-by: Joshua Peraza <jperaza@chromium.org>
In trying to create a backend service that can process both ELF and
Mach-O binaries, I found that symbol collisions occur when trying to
link different implementations of FileID. This change puts the
different implementations into separate namespaces to avoid the
collision.
Change-Id: I15aabb222803f2ffbda15ed13e66793bae32ddce
Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/3421417
Reviewed-by: Mark Mentovai <mark@chromium.org>
dump_syms assumes it is operating on a file and can access a compliant
file system. This change allows dump_syms to operate on the contents of
a file that has already been read into memory. This is useful in a
server context where the file does not exist on the local file system.
Change-Id: Id63f115c2df287083d548dadd5ac487f97bde057
Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/3327644
Reviewed-by: Mark Mentovai <mark@chromium.org>
- Make handle_inline default to false in PDBSourceLineWriter constructor.
- Add --i flag for symupload to generate inline information.
Change-Id: I3149173ee635a503b9508a12ef572f8b6e5c5dfe
Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/3364804
Reviewed-by: Joshua Peraza <jperaza@chromium.org>
This adds INLINE and INLINE_ORIGIN records on Window dump_syms. It also
adds more LINE records that represents the inner most callsite line info
inside a function.
Bug: chromium:1190878
Change-Id: I15c2044709f8ca831b03a453910d036f749452c6
Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/3133606
Reviewed-by: Lei Zhang <thestig@chromium.org>
Reviewed-by: Joshua Peraza <jperaza@chromium.org>
Reviewed-by: Ivan Penkov <ivanpe@chromium.org>
This was created by running “go mod init upload_system_symbols”. This is
necessary for “go build” to work in recent versions of golang.
Previously, errors such as this were produced:
go: cannot find main module, but found .git/config in …/breakpad/src
to create a module there, run:
cd ../../../.. && go mod init
Change-Id: Ia88834aec2eb8ee01db452889c525a5f6ebefa25
Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/3345400
Reviewed-by: Robert Sesek <rsesek@chromium.org>
- FastSourceLineResolver::Module::LoadMapFromMemory now rejects an older version of the serialization format.
- Cleaned up several unneeded usages of scoped_ptr::get.
- Fixed the serialization of bool. The serialization code was using 255 for 'true' while the deserialization code was expecting to see 1.
- Serialization for PublicSymbol.is_multiple was missing. Deserialization was expecting it
- Added some logging to processor/source_line_resolver_base.cc
Change-Id: Iadc7d8ee23bf3a07e4ea280d5d4c3f25f6278b69
Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/3324395
Reviewed-by: Joshua Peraza <jperaza@chromium.org>
- Ignore DW_TAG_inlined_subroutine with empty range.
- Don't stop parsing after parsing malformed INLINE/INLINE_ORIGIN
records, because reports can still be generated without them but won't
have inlined frames.
Bug: 1190878
Change-Id: I445105ad06b9146268f7d064e85b0d162c3f2a39
Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/3321166
Reviewed-by: Joshua Peraza <jperaza@chromium.org>
This adds a new mode in ContainedRangeMap which allows existance of
equal ranges. Among those equal ranges, the most recently added range is
the innermost range.
This also adds a function to ContainedRangeMap and
StaticContainedRangeMap to allow users get a vector of entries that
contains given address from innermost to outermost ranges.
Change-Id: I84c1f2e49ffcaf8238df60e41498730103d1ead6
Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/3291137
Reviewed-by: Joshua Peraza <jperaza@chromium.org>
This is a more practical reserved capacity than
std::numeric_limits<int>::max() for the vector.
Change-Id: Ic8d4e812c3804e4f15cc51650f7a91bae7313415
Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/3301419
Reviewed-by: Joshua Peraza <jperaza@chromium.org>
Reviewed-by: Lei Zhang <thestig@chromium.org>
Since GH is mirroring the code directly from our GoB systems, they
aren't triggering push events. Set them up with a daily/weekly cron
so we get some level of coverage.
Change-Id: I9ececc74a4904e0e3060a10ee1acb952e2021240
Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/3289899
Reviewed-by: Mark Mentovai <mark@chromium.org>
The rust-demangle-capi crate hasn't been updated since 2016 and
out-of-date. Instead, Breakpad needs to use C API offered by the
rustc-demangle to demangle Rust symbols.
*** TESTING ***
1) Set up rustc-demangle
> git clone https://github.com/rust-lang/rustc-demangle.git
> cd rustc-demangle
> cargo build -p rustc-demangle-capi --release
2) Breakpad
> ./configure --with-rustc-demangle=<path to rustc-demangle>
> make check src/common/dward_cu_to_module
Change-Id: Ib68b62ef329f1397bc379a1d04c632781e4b2069
Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/3273324
Reviewed-by: Joshua Peraza <jperaza@chromium.org>
Minidumps can contain extended, and compacted extended, contexts to
include xstate data such as the state of the cet registers cetumsr
and cetussp. Previously breakpad would reject dumps with contexts
larger than expected. With this chage, breakpad now accepts and reads
these minidumps. This change does not yet add processing for this
extra data, but will allow any minidumps to be passed on to other
processing tools, or be available for manual inspection.
See chromium-review.googlesource.com/c/crashpad/crashpad/+/2575920
for motivation.
Bug: 1250098
Change-Id: Id67649738ef1c7fb6308e05e6cd8fde790771cb2
Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/3256483
Reviewed-by: Robert Sesek <rsesek@chromium.org>
This is similar to the processor part of
https://chromium-review.googlesource.com/c/breakpad/breakpad/+/3232838/,
but added compatibility to process both old and new format of
INLINE/INLINE_ORIGIN records in symbol file.
Old INLINE format:
INLINE <inline_nest_level> <call_site_line> <origin_id>
[<address> <size>]+
New INLINE format:
INLINE <inline_nest_level> <call_site_line> <call_site_file_id>
<origin_id> [<address> <size>]+
Old INLINE_ORIGIN format:
INLINE_ORIGIN <origin_id> <file_id> <name>
New INLINE_ORIGIN format:
INLINE_ORIGIN <origin_id> <name>
Change-Id: I555d9747bfd44a1a95113b9946dcd509b7710876
Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/3248433
Reviewed-by: Joshua Peraza <jperaza@chromium.org>
This reverts commit 54d878abcb.
54d878abcb changed the dump_syms format incompatibly. This must be
redone in a multi-step process: the processor must be made to understand
the old and new formats simultaneously and the processor service must be
rebuilt and run with that update before dump_syms output can change to
use the new format.
Bug: chromium:1263390
Change-Id: I5b6f8aff8ea2916b2c07ac6a74b569fa27db51b9
Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/3244775
Reviewed-by: Joshua Peraza <jperaza@chromium.org>
Processor shows incorrect source file name if a frame have an inlined
frame and their source files are different.
Consider this example:
FILE 0 /tmp/a.h
FILE 1 /tmp/a.cpp
INLINE_ORIGIN 0 0 foo()
FUNC 1110 a 0 main
INLINE 0 22 0 1110 7
1110 7 3 0
1117 3 23 1
When querying the address 0x1110, we know this line 0x1110 corresponds
to /tmp/a.h line 3 and it's inside a inlined function foo() which is
defined at /tmp/a.h and called at line 22. But we don't know at which
file it's being called at line 22. So, we will get stacks like this:
void foo() /tmp/a.h:3
int main() /tmp/a.h:22
The correct stacks should be this:
void foo() /tmp/a.h:3
int main() /tmp/a.cpp:22
In this change:
1. Remove file_id field for INLINE_ORIGIN record.
2. Add call_site_file_id for INLINE record to represents the file where
this call being inlined.
After adding call_site_file_id to it (as third field), it looks like
this:
FILE 0 /tmp/a.h
FILE 1 /tmp/a.cpp
INLINE_ORIGIN 0 foo()
FUNC 1110 a 0 main
INLINE 0 22 1 0 1110 7
1110 7 3 0
1117 3 23 1
Bug: 1190878
Change-Id: Ibbb697d2f7e1b6ac3208cac6fae4353c8743198d
Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/3232838
Reviewed-by: Joshua Peraza <jperaza@chromium.org>