sentry-native update to 0.6.7

This commit is contained in:
Marek Roszko 2023-12-17 21:39:10 -05:00
parent de2f5f6547
commit 421cf3d344
499 changed files with 8714 additions and 4174 deletions

View File

@ -1,5 +1,92 @@
# Changelog
## 0.6.7
**Fixes**:
- Disable sigaltstack on Android ([#901](https://github.com/getsentry/sentry-native/pull/901))
- Prevent stuck crashpad-client on Windows ([#902](https://github.com/getsentry/sentry-native/pull/902), [crashpad#89](https://github.com/getsentry/crashpad/pull/89))
## 0.6.6
**Fixes**:
- Use a more up-to-date version of `mini_chromium` as a `crashpad` dependency, which fixes a build error on some systems. ([#891](https://github.com/getsentry/sentry-native/pull/891), [crashpad#88](https://github.com/getsentry/crashpad/pull/88))
**Internal**:
- Updated `libunwindstack` to 2023-09-13. ([#884](https://github.com/getsentry/sentry-native/pull/884), [libunwindstack-ndk#8](https://github.com/getsentry/libunwindstack-ndk/pull/8))
- Updated `crashpad` to 2023-09-28. ([#891](https://github.com/getsentry/sentry-native/pull/891), [crashpad#88](https://github.com/getsentry/crashpad/pull/88))
- Updated `breakpad` to 2023-10-02. ([#892](https://github.com/getsentry/sentry-native/pull/892), [breakpad#38](https://github.com/getsentry/breakpad/pull/38))
**Thank you**:
Features, fixes and improvements in this release have been contributed by:
- [@sapphonie](https://github.com/sapphonie)
## 0.6.5
**Fixes**:
- Remove deadlock pattern in dynamic sdk-name assignment ([#858](https://github.com/getsentry/sentry-native/pull/858))
## 0.6.4
**Fixes**:
- Crash events are initialized with level `FATAL` ([#852](https://github.com/getsentry/sentry-native/pull/852))
- Fix MSVC compiler error with on non-Unicode systems ([#846](https://github.com/getsentry/sentry-native/pull/846), [crashpad#85](https://github.com/getsentry/crashpad/pull/85))
**Features**:
- crashpad_handler: log `body` if minidump endpoint response is not `OK` ([#851](https://github.com/getsentry/sentry-native/pull/851), [crashpad#87](https://github.com/getsentry/crashpad/pull/87))
**Thank you**:
Features, fixes and improvements in this release have been contributed by:
- [@xyz1001](https://github.com/xyz1001)
## 0.6.3
**Features**:
- Disable PC adjustment in the backend for libunwindstack ([#839](https://github.com/getsentry/sentry-native/pull/839))
- Crashpad backend allows inspection and enrichment of the crash event in the on_crash/before_send hooks ([#843](https://github.com/getsentry/sentry-native/pull/843))
- Add http-proxy support to the `crashpad_handler` ([#847](https://github.com/getsentry/sentry-native/pull/847), [crashpad#86](https://github.com/getsentry/crashpad/pull/86))
**Internal**:
- Updated Breakpad backend to 2023-05-03. ([#836](https://github.com/getsentry/sentry-native/pull/836), [breakpad#35](https://github.com/getsentry/breakpad/pull/35))
- Updated Crashpad backend to 2023-05-03. ([#837](https://github.com/getsentry/sentry-native/pull/837), [crashpad#82](https://github.com/getsentry/crashpad/pull/82))
## 0.6.2
**Features**:
- Extend API with ptr/len-string interfaces. ([#827](https://github.com/getsentry/sentry-native/pull/827))
- Allow setting sdk_name at runtime ([#834](https://github.com/getsentry/sentry-native/pull/834))
## 0.6.1
**Fixes**:
- Remove OpenSSL as direct dependency for the crashpad backend on Linux. ([#812](https://github.com/getsentry/sentry-native/pull/812), [crashpad#81](https://github.com/getsentry/crashpad/pull/81))
- Check `libcurl` for feature `AsynchDNS` at compile- and runtime. ([#813](https://github.com/getsentry/sentry-native/pull/813))
- Allow setting `CRASHPAD_WER_ENABLED` when using system crashpad. ([#816](https://github.com/getsentry/sentry-native/pull/816))
**Docs**:
- Add badges for conan, nix and vcpkg package-repos to README. ([#795](https://github.com/getsentry/sentry-native/pull/795))
**Thank you**:
Features, fixes and improvements in this release have been contributed by:
- [@Cyriuz](https://github.com/Cyriuz)
- [@MartinDelille](https://github.com/MartinDelille)
## 0.6.0
**Breaking changes**:

View File

@ -65,6 +65,9 @@ endif()
if(MSVC)
option(SENTRY_BUILD_RUNTIMESTATIC "Build sentry-native with static runtime" OFF)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /utf-8")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /utf-8")
endif()
if(LINUX)
@ -274,7 +277,7 @@ endif()
if(SENTRY_TRANSPORT_CURL)
if(NOT CURL_FOUND) # Some other lib might bring libcurl already
find_package(CURL REQUIRED)
find_package(CURL REQUIRED COMPONENTS AsynchDNS)
endif()
if(TARGET CURL::libcurl) # Only available in cmake 3.12+
@ -426,8 +429,9 @@ if(SENTRY_BACKEND_CRASHPAD)
set(CRASHPAD_ENABLE_INSTALL ON CACHE BOOL "Enable crashpad installation" FORCE)
endif()
add_subdirectory(external/crashpad crashpad_build)
if(CRASHPAD_WER_ENABLED)
add_compile_definitions(CRASHPAD_WER_ENABLED)
add_dependencies(sentry crashpad::wer)
endif()
# set static runtime if enabled
@ -482,8 +486,9 @@ if(SENTRY_BACKEND_CRASHPAD)
endif()
endif()
add_dependencies(sentry crashpad::handler)
if(WIN32 AND CRASHPAD_WER_ENABLED)
add_dependencies(sentry crashpad::wer)
if(CRASHPAD_WER_ENABLED)
add_compile_definitions(CRASHPAD_WER_ENABLED)
endif()
elseif(SENTRY_BACKEND_BREAKPAD)
option(SENTRY_BREAKPAD_SYSTEM "Use system breakpad" OFF)

View File

@ -144,6 +144,7 @@ The example currently supports the following commands:
- `discarding-before-send`: Installs a `before_send()` callback that discards the event.
- `on-crash`: Installs an `on_crash()` callback that retains the crash event.
- `discarding-on-crash`: Installs an `on_crash()` callback that discards the crash event.
- `override-sdk-name`: Changes the SDK name via the options at runtime.
Only on Windows using crashpad with its WER handler module:

View File

@ -1,3 +1,5 @@
[![Conan Center](https://shields.io/conan/v/sentry-native)](https://conan.io/center/recipes/sentry-native) [![nixpkgs unstable](https://repology.org/badge/version-for-repo/nix_unstable/sentry-native.svg)](https://github.com/NixOS/nixpkgs/blob/nixos-unstable/pkgs/development/libraries/sentry-native/default.nix) [![vcpkg](https://shields.io/vcpkg/v/sentry-native)](https://vcpkg.link/ports/sentry-native)
<p align="center">
<a href="https://sentry.io/?utm_source=github&utm_medium=logo" target="_blank">
<picture>
@ -15,13 +17,10 @@ applications, optimized for C and C++. Sentry allows to add tags, breadcrumbs
and arbitrary custom context to enrich error reports. Supports Sentry _20.6.0_
and later.
**Note**: This SDK is being actively developed and still in Beta. We recommend
to check for updates regularly to benefit from latest features and bug fixes.
Please see [Known Limitations](#known-limitations).
## Resources <!-- omit in toc -->
- [Discord](https://discord.gg/ez5KZN7) server for project discussions.
- [SDK Documentation](https://docs.sentry.io/platforms/native/)
- [Discord](https://discord.gg/ez5KZN7) server for project discussions
- Follow [@getsentry](https://twitter.com/getsentry) on Twitter for updates
## Table of Contents <!-- omit in toc -->

View File

@ -218,6 +218,10 @@ main(int argc, char **argv)
options, discarding_on_crash_callback, NULL);
}
if (has_arg(argc, argv, "override-sdk-name")) {
sentry_options_set_sdk_name(options, "sentry.native.android.flutter");
}
sentry_init(options);
if (!has_arg(argc, argv, "no-setup")) {

View File

@ -40,6 +40,8 @@ set(BREAKPAD_SOURCES_COMMON_WINDOWS
)
set(BREAKPAD_SOURCES_COMMON_APPLE
breakpad/src/common/mac/arch_utilities.cc
breakpad/src/common/mac/arch_utilities.h
breakpad/src/common/mac/file_id.cc
breakpad/src/common/mac/file_id.h
breakpad/src/common/mac/macho_id.cc

View File

@ -52,7 +52,7 @@ deps = {
hooks = [
{
# Keep the manifest up to date.
"action": ["python", "src/src/tools/python/deps-to-manifest.py",
"action": ["src/src/tools/python/deps-to-manifest.py",
"src/DEPS", "src/default.xml"],
},
]

View File

@ -694,9 +694,11 @@ src_tools_linux_dump_syms_dump_syms_SOURCES = \
src/common/linux/safe_readlink.cc \
src/tools/linux/dump_syms/dump_syms.cc
src_tools_linux_dump_syms_dump_syms_CXXFLAGS = \
$(RUSTC_DEMANGLE_CFLAGS)
$(RUSTC_DEMANGLE_CFLAGS) \
$(ZSTD_CFLAGS)
src_tools_linux_dump_syms_dump_syms_LDADD = \
$(RUSTC_DEMANGLE_LIBS) \
$(ZSTD_CFLAGS) \
-lz
src_tools_linux_md2core_minidump_2_core_SOURCES = \
@ -821,11 +823,13 @@ src_common_dumper_unittest_SOURCES = \
src_common_dumper_unittest_CPPFLAGS = \
$(AM_CPPFLAGS) $(TEST_CFLAGS) \
$(RUSTC_DEMANGLE_CFLAGS) \
$(PTHREAD_CFLAGS)
$(PTHREAD_CFLAGS) \
$(ZSTD_CFLAGS)
src_common_dumper_unittest_LDADD = \
$(TEST_LIBS) \
$(RUSTC_DEMANGLE_LIBS) \
$(PTHREAD_CFLAGS) $(PTHREAD_LIBS) \
$(ZSTD_LIBS) \
-lz
src_common_mac_macho_reader_unittest_SOURCES = \
@ -1732,10 +1736,12 @@ EXTRA_DIST = \
src/third_party/curl/typecheck-gcc.h \
src/third_party/curl/types.h \
src/third_party/mac_headers/architecture/byte_order.h \
src/third_party/mac_headers/arm/_types.h \
src/third_party/mac_headers/i386/_types.h \
src/third_party/mac_headers/mach/boolean.h \
src/third_party/mac_headers/mach/arm/boolean.h \
src/third_party/mac_headers/mach/arm/vm_types.h \
src/third_party/mac_headers/mach/i386/boolean.h \
src/third_party/mac_headers/mach/i386/vm_param.h \
src/third_party/mac_headers/mach/i386/vm_types.h \
src/third_party/mac_headers/mach/machine/boolean.h \
src/third_party/mac_headers/mach/machine.h \

View File

@ -2185,12 +2185,10 @@ DEPDIR = @DEPDIR@
ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
EGREP = @EGREP@
ETAGS = @ETAGS@
EXEEXT = @EXEEXT@
GMOCK_CFLAGS = @GMOCK_CFLAGS@
GMOCK_LIBS = @GMOCK_LIBS@
GREP = @GREP@
GTEST_CFLAGS = @GTEST_CFLAGS@
GTEST_LIBS = @GTEST_LIBS@
HAVE_CXX17 = @HAVE_CXX17@
@ -2697,7 +2695,7 @@ src_tools_linux_dump_syms_dump_syms_CXXFLAGS = \
src_tools_linux_dump_syms_dump_syms_LDADD = \
$(RUSTC_DEMANGLE_LIBS) \
-lz
-lz -lzstd
src_tools_linux_md2core_minidump_2_core_SOURCES = \
src/common/linux/memory_mapped_file.cc \
@ -2830,7 +2828,7 @@ src_common_dumper_unittest_LDADD = \
$(TEST_LIBS) \
$(RUSTC_DEMANGLE_LIBS) \
$(PTHREAD_CFLAGS) $(PTHREAD_LIBS) \
-lz
-lz -lzstd
src_common_mac_macho_reader_unittest_SOURCES = \
src/common/dwarf_cfi_to_module.cc \
@ -3734,10 +3732,12 @@ EXTRA_DIST = \
src/third_party/curl/typecheck-gcc.h \
src/third_party/curl/types.h \
src/third_party/mac_headers/architecture/byte_order.h \
src/third_party/mac_headers/arm/_types.h \
src/third_party/mac_headers/i386/_types.h \
src/third_party/mac_headers/mach/boolean.h \
src/third_party/mac_headers/mach/arm/boolean.h \
src/third_party/mac_headers/mach/arm/vm_types.h \
src/third_party/mac_headers/mach/i386/boolean.h \
src/third_party/mac_headers/mach/i386/vm_param.h \
src/third_party/mac_headers/mach/i386/vm_types.h \
src/third_party/mac_headers/mach/machine/boolean.h \
src/third_party/mac_headers/mach/machine.h \

View File

@ -848,35 +848,6 @@ else
fi
])
# -*- Autoconf -*-
# Obsolete and "removed" macros, that must however still report explicit
# error messages when used, to smooth transition.
#
# Copyright (C) 1996-2021 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
AC_DEFUN([AM_CONFIG_HEADER],
[AC_DIAGNOSE([obsolete],
['$0': this macro is obsolete.
You should use the 'AC][_CONFIG_HEADERS' macro instead.])dnl
AC_CONFIG_HEADERS($@)])
AC_DEFUN([AM_PROG_CC_STDC],
[AC_PROG_CC
am_cv_prog_cc_stdc=$ac_cv_prog_cc_stdc
AC_DIAGNOSE([obsolete],
['$0': this macro is obsolete.
You should simply use the 'AC][_PROG_CC' macro instead.
Also, your code should no longer depend upon 'am_cv_prog_cc_stdc',
but upon 'ac_cv_prog_cc_stdc'.])])
AC_DEFUN([AM_C_PROTOTYPES],
[AC_FATAL([automatic de-ANSI-fication support has been removed])])
AU_DEFUN([fp_C_PROTOTYPES], [AM_C_PROTOTYPES])
# Helper functions for option handling. -*- Autoconf -*-
# Copyright (C) 2001-2021 Free Software Foundation, Inc.

View File

@ -182,8 +182,7 @@ test -x / || exit 1"
as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO
as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO
eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" &&
test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1
test \$(( 1 + 1 )) = 2 || exit 1"
test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1"
if (eval "$as_required") 2>/dev/null
then :
as_have_required=yes
@ -685,8 +684,6 @@ PTHREAD_CFLAGS
PTHREAD_LIBS
PTHREAD_CC
ax_pthread_config
EGREP
GREP
RANLIB
am__fastdepCXX_FALSE
am__fastdepCXX_TRUE
@ -813,6 +810,7 @@ enable_system_test_libs
enable_selftest
with_rustc_demangle
enable_system_rustc_demangle
enable_zstd
with_tests_as_root
'
ac_precious_vars='build_alias
@ -1486,6 +1484,7 @@ Optional Features:
is no). This assumes that rustc-demangle is
installed in your sysroot, and all headers from it
are available in your standard include path
--enable-zstd Enable decompression of ELF sections with zstd
Optional Packages:
--with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
@ -1719,39 +1718,6 @@ fi
} # ac_fn_cxx_try_compile
# ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES
# -------------------------------------------------------
# Tests whether HEADER exists and can be compiled using the include files in
# INCLUDES, setting the cache variable VAR accordingly.
ac_fn_c_check_header_compile ()
{
as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
printf %s "checking for $2... " >&6; }
if eval test \${$3+y}
then :
printf %s "(cached) " >&6
else $as_nop
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
$4
#include <$2>
_ACEOF
if ac_fn_c_try_compile "$LINENO"
then :
eval "$3=yes"
else $as_nop
eval "$3=no"
fi
rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
fi
eval ac_res=\$$3
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
printf "%s\n" "$ac_res" >&6; }
eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
} # ac_fn_c_check_header_compile
# ac_fn_c_try_link LINENO
# -----------------------
# Try to link conftest.$ac_ext, and return whether this succeeded.
@ -1799,6 +1765,39 @@ fi
} # ac_fn_c_try_link
# ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES
# -------------------------------------------------------
# Tests whether HEADER exists and can be compiled using the include files in
# INCLUDES, setting the cache variable VAR accordingly.
ac_fn_c_check_header_compile ()
{
as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
printf %s "checking for $2... " >&6; }
if eval test \${$3+y}
then :
printf %s "(cached) " >&6
else $as_nop
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
$4
#include <$2>
_ACEOF
if ac_fn_c_try_compile "$LINENO"
then :
eval "$3=yes"
else $as_nop
eval "$3=no"
fi
rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
fi
eval ac_res=\$$3
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
printf "%s\n" "$ac_res" >&6; }
eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
} # ac_fn_c_check_header_compile
# ac_fn_c_check_func LINENO FUNC VAR
# ----------------------------------
# Tests whether FUNC exists, setting the cache variable VAR accordingly
@ -6597,11 +6596,11 @@ if test x$ac_prog_cxx_stdcxx = xno
then :
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CXX option to enable C++11 features" >&5
printf %s "checking for $CXX option to enable C++11 features... " >&6; }
if test ${ac_cv_prog_cxx_11+y}
if test ${ac_cv_prog_cxx_cxx11+y}
then :
printf %s "(cached) " >&6
else $as_nop
ac_cv_prog_cxx_11=no
ac_cv_prog_cxx_cxx11=no
ac_save_CXX=$CXX
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
@ -6643,11 +6642,11 @@ if test x$ac_prog_cxx_stdcxx = xno
then :
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CXX option to enable C++98 features" >&5
printf %s "checking for $CXX option to enable C++98 features... " >&6; }
if test ${ac_cv_prog_cxx_98+y}
if test ${ac_cv_prog_cxx_cxx98+y}
then :
printf %s "(cached) " >&6
else $as_nop
ac_cv_prog_cxx_98=no
ac_cv_prog_cxx_cxx98=no
ac_save_CXX=$CXX
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
@ -6937,180 +6936,6 @@ if test "x$enable_m32" = xyes; then
CXXFLAGS="${CXXFLAGS} -m32"
fi
# Autoupdate added the next two lines to ensure that your configure
# script's behavior did not change. They are probably safe to remove.
ac_header= ac_cache=
for ac_item in $ac_header_c_list
do
if test $ac_cache; then
ac_fn_c_check_header_compile "$LINENO" $ac_header ac_cv_header_$ac_cache "$ac_includes_default"
if eval test \"x\$ac_cv_header_$ac_cache\" = xyes; then
printf "%s\n" "#define $ac_item 1" >> confdefs.h
fi
ac_header= ac_cache=
elif test $ac_header; then
ac_cache=$ac_item
else
ac_header=$ac_item
fi
done
if test $ac_cv_header_stdlib_h = yes && test $ac_cv_header_string_h = yes
then :
printf "%s\n" "#define STDC_HEADERS 1" >>confdefs.h
fi
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5
printf %s "checking for grep that handles long lines and -e... " >&6; }
if test ${ac_cv_path_GREP+y}
then :
printf %s "(cached) " >&6
else $as_nop
if test -z "$GREP"; then
ac_path_GREP_found=false
# Loop through the user's path and test for each of PROGNAME-LIST
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
do
IFS=$as_save_IFS
case $as_dir in #(((
'') as_dir=./ ;;
*/) ;;
*) as_dir=$as_dir/ ;;
esac
for ac_prog in grep ggrep
do
for ac_exec_ext in '' $ac_executable_extensions; do
ac_path_GREP="$as_dir$ac_prog$ac_exec_ext"
as_fn_executable_p "$ac_path_GREP" || continue
# Check for GNU ac_path_GREP and select it if it is found.
# Check for GNU $ac_path_GREP
case `"$ac_path_GREP" --version 2>&1` in
*GNU*)
ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;;
*)
ac_count=0
printf %s 0123456789 >"conftest.in"
while :
do
cat "conftest.in" "conftest.in" >"conftest.tmp"
mv "conftest.tmp" "conftest.in"
cp "conftest.in" "conftest.nl"
printf "%s\n" 'GREP' >> "conftest.nl"
"$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break
diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
as_fn_arith $ac_count + 1 && ac_count=$as_val
if test $ac_count -gt ${ac_path_GREP_max-0}; then
# Best one so far, save it but keep looking for a better one
ac_cv_path_GREP="$ac_path_GREP"
ac_path_GREP_max=$ac_count
fi
# 10*(2^10) chars as input seems more than enough
test $ac_count -gt 10 && break
done
rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
esac
$ac_path_GREP_found && break 3
done
done
done
IFS=$as_save_IFS
if test -z "$ac_cv_path_GREP"; then
as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
fi
else
ac_cv_path_GREP=$GREP
fi
fi
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5
printf "%s\n" "$ac_cv_path_GREP" >&6; }
GREP="$ac_cv_path_GREP"
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5
printf %s "checking for egrep... " >&6; }
if test ${ac_cv_path_EGREP+y}
then :
printf %s "(cached) " >&6
else $as_nop
if echo a | $GREP -E '(a|b)' >/dev/null 2>&1
then ac_cv_path_EGREP="$GREP -E"
else
if test -z "$EGREP"; then
ac_path_EGREP_found=false
# Loop through the user's path and test for each of PROGNAME-LIST
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
do
IFS=$as_save_IFS
case $as_dir in #(((
'') as_dir=./ ;;
*/) ;;
*) as_dir=$as_dir/ ;;
esac
for ac_prog in egrep
do
for ac_exec_ext in '' $ac_executable_extensions; do
ac_path_EGREP="$as_dir$ac_prog$ac_exec_ext"
as_fn_executable_p "$ac_path_EGREP" || continue
# Check for GNU ac_path_EGREP and select it if it is found.
# Check for GNU $ac_path_EGREP
case `"$ac_path_EGREP" --version 2>&1` in
*GNU*)
ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;;
*)
ac_count=0
printf %s 0123456789 >"conftest.in"
while :
do
cat "conftest.in" "conftest.in" >"conftest.tmp"
mv "conftest.tmp" "conftest.in"
cp "conftest.in" "conftest.nl"
printf "%s\n" 'EGREP' >> "conftest.nl"
"$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break
diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
as_fn_arith $ac_count + 1 && ac_count=$as_val
if test $ac_count -gt ${ac_path_EGREP_max-0}; then
# Best one so far, save it but keep looking for a better one
ac_cv_path_EGREP="$ac_path_EGREP"
ac_path_EGREP_max=$ac_count
fi
# 10*(2^10) chars as input seems more than enough
test $ac_count -gt 10 && break
done
rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
esac
$ac_path_EGREP_found && break 3
done
done
done
IFS=$as_save_IFS
if test -z "$ac_cv_path_EGREP"; then
as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
fi
else
ac_cv_path_EGREP=$EGREP
fi
fi
fi
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5
printf "%s\n" "$ac_cv_path_EGREP" >&6; }
EGREP="$ac_cv_path_EGREP"
# Check whether --enable-largefile was given.
if test ${enable_largefile+y}
then :
@ -7678,6 +7503,35 @@ ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $
ac_compiler_gnu=$ac_cv_c_compiler_gnu
ac_header= ac_cache=
for ac_item in $ac_header_c_list
do
if test $ac_cache; then
ac_fn_c_check_header_compile "$LINENO" $ac_header ac_cv_header_$ac_cache "$ac_includes_default"
if eval test \"x\$ac_cv_header_$ac_cache\" = xyes; then
printf "%s\n" "#define $ac_item 1" >> confdefs.h
fi
ac_header= ac_cache=
elif test $ac_header; then
ac_cache=$ac_item
else
ac_header=$ac_item
fi
done
if test $ac_cv_header_stdlib_h = yes && test $ac_cv_header_string_h = yes
then :
printf "%s\n" "#define STDC_HEADERS 1" >>confdefs.h
fi
ac_fn_c_check_header_compile "$LINENO" "a.out.h" "ac_cv_header_a_out_h" "$ac_includes_default"
if test "x$ac_cv_header_a_out_h" = xyes
then :
@ -10652,6 +10506,70 @@ fi
# Check whether --enable-zstd was given.
if test ${enable_zstd+y}
then :
enableval=$enable_zstd;
else $as_nop
enable_zstd=no
fi
if test "x${enable_zstd}" != xno; then
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for ZSTD_decompress in -lzstd" >&5
printf %s "checking for ZSTD_decompress in -lzstd... " >&6; }
if test ${ac_cv_lib_zstd_ZSTD_decompress+y}
then :
printf %s "(cached) " >&6
else $as_nop
ac_check_lib_save_LIBS=$LIBS
LIBS="-lzstd $LIBS"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
/* Override any GCC internal prototype to avoid an error.
Use char because int might match the return type of a GCC
builtin and then its argument prototype would still apply. */
char ZSTD_decompress ();
int
main (void)
{
return ZSTD_decompress ();
;
return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"
then :
ac_cv_lib_zstd_ZSTD_decompress=yes
else $as_nop
ac_cv_lib_zstd_ZSTD_decompress=no
fi
rm -f core conftest.err conftest.$ac_objext conftest.beam \
conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_zstd_ZSTD_decompress" >&5
printf "%s\n" "$ac_cv_lib_zstd_ZSTD_decompress" >&6; }
if test "x$ac_cv_lib_zstd_ZSTD_decompress" = xyes
then :
printf "%s\n" "#define HAVE_LIBZSTD 1" >>confdefs.h
LIBS="-lzstd $LIBS"
else $as_nop
as_fn_error $? "zstd library not found." "$LINENO" 5
fi
ac_fn_c_check_header_compile "$LINENO" "zstd.h" "ac_cv_header_zstd_h" "$ac_includes_default"
if test "x$ac_cv_header_zstd_h" = xyes
then :
else $as_nop
as_fn_error $? "zstd header not found." "$LINENO" 5
fi
fi
# Check whether --with-tests-as-root was given.
if test ${with_tests_as_root+y}
@ -10767,6 +10685,7 @@ DEFS=-DHAVE_CONFIG_H
ac_libobjs=
ac_ltlibobjs=
U=
for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue
# 1. Remove the extension, and $U if already installed.
ac_script='s/\$U\././;s/\.o$//;s/\.obj$//'

View File

@ -37,7 +37,7 @@ AC_CONFIG_MACRO_DIR([m4])
AC_CANONICAL_HOST
AM_INIT_AUTOMAKE(subdir-objects tar-ustar 1.13)
AM_CONFIG_HEADER(src/config.h)
AC_CONFIG_HEADERS(src/config.h)
AM_MAINTAINER_MODE
AM_PROG_AR
@ -59,15 +59,6 @@ if test "x$enable_m32" = xyes; then
CXXFLAGS="${CXXFLAGS} -m32"
fi
m4_warn([obsolete],
[The preprocessor macro `STDC_HEADERS' is obsolete.
Except in unusual embedded environments, you can safely include all
ISO C90 headers unconditionally.])dnl
# Autoupdate added the next two lines to ensure that your configure
# script's behavior did not change. They are probably safe to remove.
AC_CHECK_INCLUDES_DEFAULT
AC_PROG_EGREP
AC_SYS_LARGEFILE
AX_PTHREAD
AC_CHECK_HEADERS([a.out.h sys/mman.h sys/random.h])
@ -221,6 +212,17 @@ fi
AC_ARG_VAR([RUSTC_DEMANGLE_CFLAGS], [Compiler flags for rustc-demangle])
AC_ARG_VAR([RUSTC_DEMANGLE_LIBS], [Linker flags for rustc-demangle])
AC_ARG_ENABLE(zstd,
AS_HELP_STRING([--enable-zstd],
[Enable decompression of ELF sections with zstd]),,
[enable_zstd=no])
if test "x${enable_zstd}" != xno; then
AC_CHECK_LIB(zstd, ZSTD_decompress, [],
[AC_MSG_ERROR([zstd library not found.])])
AC_CHECK_HEADER(zstd.h, [],
[AC_MSG_ERROR([zstd header not found.])])
fi
AC_ARG_WITH(tests-as-root,
AS_HELP_STRING([--with-tests-as-root],
[Run the tests as root. Use this on platforms]

View File

@ -26,6 +26,10 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#ifdef HAVE_CONFIG_H
#include <config.h> // Must come first
#endif
#include <signal.h>
#include <TargetConditionals.h>

View File

@ -26,6 +26,10 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#ifdef HAVE_CONFIG_H
#include <config.h> // Must come first
#endif
#include "client/linux/crash_generation/crash_generation_client.h"
#include <stdio.h>
@ -45,9 +49,11 @@ namespace {
class CrashGenerationClientImpl : public CrashGenerationClient {
public:
explicit CrashGenerationClientImpl(int server_fd) : server_fd_(server_fd) {}
virtual ~CrashGenerationClientImpl() {}
CrashGenerationClientImpl(const CrashGenerationClientImpl&) = delete;
void operator=(const CrashGenerationClientImpl&) = delete;
~CrashGenerationClientImpl() override = default;
virtual bool RequestDump(const void* blob, size_t blob_size) {
bool RequestDump(const void* blob, size_t blob_size) override {
int fds[2];
if (sys_pipe(fds) < 0)
return false;
@ -88,8 +94,6 @@ class CrashGenerationClientImpl : public CrashGenerationClient {
private:
int server_fd_;
DISALLOW_COPY_AND_ASSIGN(CrashGenerationClientImpl);
};
} // namespace

View File

@ -29,8 +29,6 @@
#ifndef CLIENT_LINUX_CRASH_GENERATION_CRASH_GENERATION_CLIENT_H_
#define CLIENT_LINUX_CRASH_GENERATION_CRASH_GENERATION_CLIENT_H_
#include "common/basictypes.h"
#include <stddef.h>
namespace google_breakpad {
@ -41,8 +39,10 @@ namespace google_breakpad {
// via a remote process.
class CrashGenerationClient {
public:
CrashGenerationClient() {}
virtual ~CrashGenerationClient() {}
CrashGenerationClient() = default;
CrashGenerationClient(const CrashGenerationClient&) = delete;
void operator=(const CrashGenerationClient&) = delete;
virtual ~CrashGenerationClient() = default;
// Request the crash server to generate a dump. |blob| is an opaque
// CrashContext pointer from exception_handler.h.
@ -54,9 +54,6 @@ class CrashGenerationClient {
// The returned CrashGenerationClient* is owned by the caller of
// this function.
static CrashGenerationClient* TryCreate(int server_fd);
private:
DISALLOW_COPY_AND_ASSIGN(CrashGenerationClient);
};
} // namespace google_breakpad

View File

@ -26,6 +26,10 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#ifdef HAVE_CONFIG_H
#include <config.h> // Must come first
#endif
#include <assert.h>
#include <dirent.h>
#include <fcntl.h>

View File

@ -26,6 +26,10 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#ifdef HAVE_CONFIG_H
#include <config.h> // Must come first
#endif
#include "client/linux/dump_writer_common/thread_info.h"
#include <string.h>
@ -318,23 +322,19 @@ void ThreadInfo::FillCPUContext(RawContextCPU* out) const {
out->t5 = mcontext.__gregs[30];
out->t6 = mcontext.__gregs[31];
# if __riscv_flen == 32
for(int i = 0; i < MD_FLOATINGSAVEAREA_RISCV_FPR_COUNT; i++)
out->float_save.regs[i] = mcontext.__fpregs.__f.__f[i];
out->float_save.fpcsr = mcontext.__fpregs.__f.__fcsr;
# elif __riscv_flen == 64
for(int i = 0; i < MD_FLOATINGSAVEAREA_RISCV_FPR_COUNT; i++)
out->float_save.regs[i] = mcontext.__fpregs.__d.__f[i];
out->float_save.fpcsr = mcontext.__fpregs.__d.__fcsr;
# elif __riscv_flen == 128
for(int i = 0; i < MD_FLOATINGSAVEAREA_RISCV_FPR_COUNT; i++) {
out->float_save.regs[i].high = mcontext.__fpregs.__q.__f[2*i];
out->float_save.regs[i].low = mcontext.__fpregs.__q.__f[2*i+1];
}
out->float_save.fpcsr = mcontext.__fpregs.__q.__fcsr;
# else
# error "Unexpected __riscv_flen"
# endif
// Breakpad only supports RISCV32 with 32 bit floating point.
// Breakpad only supports RISCV64 with 64 bit floating point.
#if __riscv_xlen == 32
for (int i = 0; i < MD_CONTEXT_RISCV_FPR_COUNT; i++)
out->fpregs[i] = mcontext.__fpregs.__f.__f[i];
out->fcsr = mcontext.__fpregs.__f.__fcsr;
#elif __riscv_xlen == 64
for (int i = 0; i < MD_CONTEXT_RISCV_FPR_COUNT; i++)
out->fpregs[i] = mcontext.__fpregs.__d.__f[i];
out->fcsr = mcontext.__fpregs.__d.__fcsr;
#else
#error "Unexpected __riscv_xlen"
#endif
}
#endif // __riscv

View File

@ -26,6 +26,10 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#ifdef HAVE_CONFIG_H
#include <config.h> // Must come first
#endif
#include "client/linux/dump_writer_common/ucontext_reader.h"
#include "common/linux/linux_libc_support.h"
@ -306,21 +310,19 @@ void UContextReader::FillCPUContext(RawContextCPU* out, const ucontext_t* uc) {
out->t5 = uc->uc_mcontext.__gregs[30];
out->t6 = uc->uc_mcontext.__gregs[31];
# if __riscv_flen == 32
for(int i = 0; i < MD_FLOATINGSAVEAREA_RISCV_FPR_COUNT; i++)
out->float_save.regs[i] = uc->uc_mcontext.__fpregs.__f.__f[i];
out->float_save.fpcsr = uc->uc_mcontext.__fpregs.__f.__fcsr;
# elif __riscv_flen == 64
for(int i = 0; i < MD_FLOATINGSAVEAREA_RISCV_FPR_COUNT; i++)
out->float_save.regs[i] = uc->uc_mcontext.__fpregs.__d.__f[i];
out->float_save.fpcsr = uc->uc_mcontext.__fpregs.__d.__fcsr;
# elif __riscv_flen == 128
for(int i = 0; i < MD_FLOATINGSAVEAREA_RISCV_FPR_COUNT; i++) {
out->float_save.regs[i].high = uc->uc_mcontext.__fpregs.__q.__f[2*i];
out->float_save.regs[i].low = uc->uc_mcontext.__fpregs.__q.__f[2*i+1];
}
out->float_save.fpcsr = uc->uc_mcontext.__fpregs.__q.__fcsr;
# endif
// Breakpad only supports RISCV32 with 32 bit floating point.
// Breakpad only supports RISCV64 with 64 bit floating point.
#if __riscv_xlen == 32
for (int i = 0; i < MD_CONTEXT_RISCV_FPR_COUNT; i++)
out->fpregs[i] = uc->uc_mcontext.__fpregs.__f.__f[i];
out->fcsr = uc->uc_mcontext.__fpregs.__f.__fcsr;
#elif __riscv_xlen == 64
for (int i = 0; i < MD_CONTEXT_RISCV_FPR_COUNT; i++)
out->fpregs[i] = uc->uc_mcontext.__fpregs.__d.__f[i];
out->fcsr = uc->uc_mcontext.__fpregs.__d.__fcsr;
#else
#error "Unexpected __riscv_xlen"
#endif
}
#endif

View File

@ -62,6 +62,10 @@
// alternative malloc. Each function should have comment above it detailing the
// context which it runs in.
#ifdef HAVE_CONFIG_H
#include <config.h> // Must come first
#endif
#include "client/linux/handler/exception_handler.h"
#include <errno.h>

View File

@ -26,6 +26,10 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#ifdef HAVE_CONFIG_H
#include <config.h> // Must come first
#endif
#include <poll.h>
#include <pthread.h>
#include <stdint.h>

View File

@ -26,6 +26,10 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#ifdef HAVE_CONFIG_H
#include <config.h> // Must come first
#endif
#include <stdio.h>
#include "client/linux/handler/minidump_descriptor.h"

View File

@ -26,6 +26,10 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#ifdef HAVE_CONFIG_H
#include <config.h> // Must come first
#endif
#include "client/linux/log/log.h"
#if defined(__ANDROID__)

View File

@ -29,6 +29,10 @@
// This translation unit generates microdumps into the console (logcat on
// Android). See crbug.com/410294 for more info and design docs.
#ifdef HAVE_CONFIG_H
#include <config.h> // Must come first
#endif
#include "client/linux/microdump_writer/microdump_writer.h"
#include <limits>

View File

@ -26,6 +26,10 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#ifdef HAVE_CONFIG_H
#include <config.h> // Must come first
#endif
#include <ctype.h>
#include <sys/syscall.h>
#include <sys/types.h>

View File

@ -26,6 +26,10 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#ifdef HAVE_CONFIG_H
#include <config.h> // Must come first
#endif
#include <stdlib.h>
#include <unistd.h>
#include <sys/types.h>

View File

@ -26,6 +26,10 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#ifdef HAVE_CONFIG_H
#include <config.h> // Must come first
#endif
#include <set>
#include <string>

View File

@ -26,6 +26,10 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#ifdef HAVE_CONFIG_H
#include <config.h> // Must come first
#endif
#include <stdlib.h>
#include <unistd.h>
#include <sys/types.h>

View File

@ -29,6 +29,10 @@
// linux_core_dumper.cc: Implement google_breakpad::LinuxCoreDumper.
// See linux_core_dumper.h for details.
#ifdef HAVE_CONFIG_H
#include <config.h> // Must come first
#endif
#include "client/linux/minidump_writer/linux_core_dumper.h"
#include <asm/ptrace.h>

View File

@ -29,6 +29,10 @@
// linux_core_dumper_unittest.cc:
// Unit tests for google_breakpad::LinuxCoreDumoer.
#ifdef HAVE_CONFIG_H
#include <config.h> // Must come first
#endif
#include <string>
#include "breakpad_googletest_includes.h"

View File

@ -34,6 +34,10 @@
// rules apply as detailed at the top of minidump_writer.h: no libc calls and
// use the alternative allocator.
#ifdef HAVE_CONFIG_H
#include <config.h> // Must come first
#endif
#include "client/linux/minidump_writer/linux_dumper.h"
#include <assert.h>
@ -342,7 +346,7 @@ LinuxDumper::ElfFileIdentifierForMapping(const MappingInfo& mapping,
return false;
bool filename_modified = HandleDeletedFileInMapping(filename);
MemoryMappedFile mapped_file(filename, mapping.offset);
MemoryMappedFile mapped_file(filename, 0);
if (!mapped_file.data() || mapped_file.size() < SELFMAG)
return false;
@ -455,7 +459,7 @@ bool ElfFileSoName(const LinuxDumper& dumper,
if (!dumper.GetMappingAbsolutePath(mapping, filename))
return false;
MemoryMappedFile mapped_file(filename, mapping.offset);
MemoryMappedFile mapped_file(filename, 0);
if (!mapped_file.data() || mapped_file.size() < SELFMAG) {
// mmap failed
return false;

View File

@ -30,6 +30,10 @@
// threads. The first word of each thread's stack is set to the thread
// id.
#ifdef HAVE_CONFIG_H
#include <config.h> // Must come first
#endif
#include <pthread.h>
#include <stdint.h>
#include <stdio.h>

View File

@ -35,6 +35,10 @@
// rules apply as detailed at the top of minidump_writer.h: no libc calls and
// use the alternative allocator.
#ifdef HAVE_CONFIG_H
#include <config.h> // Must come first
#endif
#include "client/linux/minidump_writer/linux_ptrace_dumper.h"
#include <asm/ptrace.h>
@ -175,6 +179,13 @@ bool LinuxPtraceDumper::ReadRegisters(ThreadInfo* info, pid_t tid) {
return false;
}
// When running on arm processors the binary may be built with softfp or
// hardfp. If built with softfp we have no hardware registers to read from,
// so the following read will always fail. gcc defines __SOFTFP__ macro,
// clang13 does not do so. see: https://reviews.llvm.org/D135680.
// If you are using clang and the macro is NOT defined, please include the
// macro define for applicable targets.
#if !defined(__SOFTFP__)
#if !(defined(__ANDROID__) && defined(__ARM_EABI__))
// When running an arm build on an arm64 device, attempting to get the
// floating point registers fails. On Android, the floating point registers
@ -186,6 +197,7 @@ bool LinuxPtraceDumper::ReadRegisters(ThreadInfo* info, pid_t tid) {
return false;
}
#endif // !(defined(__ANDROID__) && defined(__ARM_EABI__))
#endif // !defined(__SOFTFP__)
return true;
#else // PTRACE_GETREGS
return false;

View File

@ -32,6 +32,10 @@
// This file was renamed from linux_dumper_unittest.cc and modified due
// to LinuxDumper being splitted into two classes.
#ifdef HAVE_CONFIG_H
#include <config.h> // Must come first
#endif
#include <errno.h>
#include <fcntl.h>
#include <limits.h>

View File

@ -42,6 +42,10 @@
// a canonical instance in the LinuxDumper object. We use the placement
// new form to allocate objects and we don't delete them.
#ifdef HAVE_CONFIG_H
#include <config.h> // Must come first
#endif
#include "client/linux/handler/minidump_descriptor.h"
#include "client/linux/minidump_writer/minidump_writer.h"
#include "client/minidump_file_writer-inl.h"

View File

@ -26,6 +26,10 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#ifdef HAVE_CONFIG_H
#include <config.h> // Must come first
#endif
#include <fcntl.h>
#include <poll.h>
#include <sys/stat.h>

View File

@ -29,6 +29,10 @@
// minidump_writer_unittest_utils.cc:
// Shared routines used by unittests under client/linux/minidump_writer.
#ifdef HAVE_CONFIG_H
#include <config.h> // Must come first
#endif
#include <limits.h>
#include <stdlib.h>

View File

@ -26,6 +26,10 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#ifdef HAVE_CONFIG_H
#include <config.h> // Must come first
#endif
#include <string.h>
#include "client/linux/minidump_writer/pe_file.h"

View File

@ -26,6 +26,10 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#ifdef HAVE_CONFIG_H
#include <config.h> // Must come first
#endif
#include <stdlib.h>
#include <unistd.h>
#include <sys/types.h>

View File

@ -26,6 +26,10 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#ifdef HAVE_CONFIG_H
#include <config.h> // Must come first
#endif
#include "common/linux/google_crashdump_uploader.h"
#include <string>
#include <iostream>

View File

@ -26,6 +26,10 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#ifdef HAVE_CONFIG_H
#include <config.h> // Must come first
#endif
#include "client/mac/crash_generation/crash_generation_client.h"
#include "client/mac/crash_generation/crash_generation_server.h"

View File

@ -26,6 +26,10 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#ifdef HAVE_CONFIG_H
#include <config.h> // Must come first
#endif
#include "client/mac/crash_generation/crash_generation_server.h"
#include <pthread.h>

View File

@ -65,6 +65,10 @@
* I've modified it to be compatible with 64-bit images.
*/
#ifdef HAVE_CONFIG_H
#include <config.h> // Must come first
#endif
#include "breakpad_nlist_64.h"
#include <CoreFoundation/CoreFoundation.h>

View File

@ -26,6 +26,10 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#ifdef HAVE_CONFIG_H
#include <config.h> // Must come first
#endif
#include "client/mac/handler/dynamic_images.h"
extern "C" { // needed to compile on Leopard

View File

@ -26,6 +26,10 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#ifdef HAVE_CONFIG_H
#include <config.h> // Must come first
#endif
#include <mach/exc.h>
#include <mach/mig.h>
#include <pthread.h>

View File

@ -26,6 +26,10 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#ifdef HAVE_CONFIG_H
#include <config.h> // Must come first
#endif
#include <algorithm>
#include <cstdio>

View File

@ -30,6 +30,10 @@
//
// See the header file for documentation
#ifdef HAVE_CONFIG_H
#include <config.h> // Must come first
#endif
#include "protected_memory_allocator.h"
#include <assert.h>

View File

@ -33,6 +33,10 @@
// Copyright 2008 Google LLC
//
#ifdef HAVE_CONFIG_H
#include <config.h> // Must come first
#endif
#include "client/mac/handler/testcases/DynamicImagesTests.h"
#include "client/mac/handler/dynamic_images.h"

View File

@ -33,6 +33,10 @@
// Copyright 2008 Google LLC
//
#ifdef HAVE_CONFIG_H
#include <config.h> // Must come first
#endif
#include "client/mac/handler/testcases/breakpad_nlist_test.h"
#include <mach-o/nlist.h>
#include "client/mac/handler/breakpad_nlist_64.h"

View File

@ -29,6 +29,10 @@
// crash_generation_server_test.cc
// Unit tests for CrashGenerationServer
#ifdef HAVE_CONFIG_H
#include <config.h> // Must come first
#endif
#include <dirent.h>
#include <glob.h>
#include <stdint.h>

View File

@ -28,6 +28,10 @@
// exception_handler_test.cc: Unit tests for google_breakpad::ExceptionHandler
#ifdef HAVE_CONFIG_H
#include <config.h> // Must come first
#endif
#include <pthread.h>
#include <sys/mman.h>
#include <sys/stat.h>

View File

@ -28,6 +28,10 @@
// minidump_generator_test.cc: Unit tests for google_breakpad::MinidumpGenerator
#ifdef HAVE_CONFIG_H
#include <config.h> // Must come first
#endif
#include <AvailabilityMacros.h>
#ifndef MAC_OS_X_VERSION_10_6
#define MAC_OS_X_VERSION_10_6 1060

View File

@ -30,6 +30,10 @@
// minidump_generator_test.cc can launch to test certain things
// that require a separate executable.
#ifdef HAVE_CONFIG_H
#include <config.h> // Must come first
#endif
#include <unistd.h>
#include "client/mac/handler/exception_handler.h"

View File

@ -30,6 +30,10 @@
//
// See minidump_file_writer.h for documentation.
#ifdef HAVE_CONFIG_H
#include <config.h> // Must come first
#endif
#include <fcntl.h>
#include <limits.h>
#include <stdio.h>

View File

@ -36,6 +36,10 @@
-o minidump_file_writer_unittest
*/
#ifdef HAVE_CONFIG_H
#include <config.h> // Must come first
#endif
#include <fcntl.h>
#include <unistd.h>

View File

@ -28,6 +28,10 @@
// Author: Alfred Peng
#ifdef HAVE_CONFIG_H
#include <config.h> // Must come first
#endif
#include <signal.h>
#include <sys/stat.h>
#include <sys/types.h>

View File

@ -28,6 +28,10 @@
// Author: Alfred Peng
#ifdef HAVE_CONFIG_H
#include <config.h> // Must come first
#endif
#include <pthread.h>
#include <unistd.h>

View File

@ -28,6 +28,10 @@
// Author: Alfred Peng
#ifdef HAVE_CONFIG_H
#include <config.h> // Must come first
#endif
#include <fcntl.h>
#include <sys/frame.h>
#include <sys/stat.h>

View File

@ -28,6 +28,10 @@
// Author: Alfred Peng
#ifdef HAVE_CONFIG_H
#include <config.h> // Must come first
#endif
#include <pthread.h>
#include <unistd.h>

View File

@ -28,6 +28,10 @@
// Author: Alfred Peng
#ifdef HAVE_CONFIG_H
#include <config.h> // Must come first
#endif
#include <dirent.h>
#include <elf.h>
#include <errno.h>

View File

@ -26,6 +26,10 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#ifdef HAVE_CONFIG_H
#include <config.h> // Must come first
#endif
#include "client/windows/crash_generation/client_info.h"
#include "client/windows/common/ipc_protocol.h"

View File

@ -26,6 +26,10 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#ifdef HAVE_CONFIG_H
#include <config.h> // Must come first
#endif
#include "client/windows/crash_generation/crash_generation_client.h"
#include <cassert>
#include <utility>

View File

@ -26,6 +26,10 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#ifdef HAVE_CONFIG_H
#include <config.h> // Must come first
#endif
#include "client/windows/crash_generation/crash_generation_server.h"
#include <windows.h>
#include <cassert>

View File

@ -26,6 +26,10 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#ifdef HAVE_CONFIG_H
#include <config.h> // Must come first
#endif
#include "client/windows/crash_generation/minidump_generator.h"
#include <assert.h>

View File

@ -26,6 +26,10 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#ifdef HAVE_CONFIG_H
#include <config.h> // Must come first
#endif
#include <objbase.h>
#include <algorithm>

View File

@ -29,6 +29,10 @@
// Disable exception handler warnings.
#pragma warning( disable : 4530 )
#ifdef HAVE_CONFIG_H
#include <config.h> // Must come first
#endif
#include <errno.h>
#include "client/windows/sender/crash_report_sender.h"

View File

@ -26,6 +26,10 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#ifdef HAVE_CONFIG_H
#include <config.h> // Must come first
#endif
#include "client/windows/tests/crash_generation_app/abstract_class.h"
namespace google_breakpad {

View File

@ -29,6 +29,10 @@
// crash_generation_app.cpp : Defines the entry point for the application.
//
#ifdef HAVE_CONFIG_H
#include <config.h> // Must come first
#endif
#include "client/windows/tests/crash_generation_app/crash_generation_app.h"
#include <windows.h>

View File

@ -27,6 +27,10 @@
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#ifdef HAVE_CONFIG_H
#include <config.h> // Must come first
#endif
#include "breakpad_googletest_includes.h"
#include "client/windows/crash_generation/crash_generation_server.h"
#include "client/windows/common/ipc_protocol.h"

View File

@ -26,6 +26,10 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#ifdef HAVE_CONFIG_H
#include <config.h> // Must come first
#endif
#include <windows.h>
#include <objbase.h>
#include <dbghelp.h>

View File

@ -26,6 +26,10 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#ifdef HAVE_CONFIG_H
#include <config.h> // Must come first
#endif
#include <windows.h>
#include <dbghelp.h>
#include <strsafe.h>

View File

@ -26,6 +26,10 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#ifdef HAVE_CONFIG_H
#include <config.h> // Must come first
#endif
#include <windows.h>
#include <string>

View File

@ -26,6 +26,10 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#ifdef HAVE_CONFIG_H
#include <config.h> // Must come first
#endif
#include "client/windows/unittests/exception_handler_test.h"
#include <windows.h>

View File

@ -26,6 +26,10 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#ifdef HAVE_CONFIG_H
#include <config.h> // Must come first
#endif
#include <windows.h>
#include <objbase.h>
#include <dbghelp.h>

View File

@ -29,14 +29,6 @@
#ifndef COMMON_BASICTYPES_H_
#define COMMON_BASICTYPES_H_
// A macro to disallow the copy constructor and operator= functions
// This should be used in the private: declarations for a class
#ifndef DISALLOW_COPY_AND_ASSIGN
#define DISALLOW_COPY_AND_ASSIGN(TypeName) \
TypeName(const TypeName&); \
void operator=(const TypeName&)
#endif // DISALLOW_COPY_AND_ASSIGN
namespace google_breakpad {
// Used to explicitly mark the return value of a function as unused. If you are

View File

@ -31,6 +31,10 @@
// byte_cursor_unittest.cc: Unit tests for google_breakpad::ByteBuffer
// and google_breakpad::ByteCursor.
#ifdef HAVE_CONFIG_H
#include <config.h> // Must come first
#endif
#include <string>
#include <string.h>

View File

@ -55,6 +55,10 @@ See the header file "ConvertUTF.h" for complete documentation.
------------------------------------------------------------------------ */
#ifdef HAVE_CONFIG_H
#include <config.h> // Must come first
#endif
#include "convert_UTF.h"
#ifdef CVTUTF_DEBUG
#include <stdio.h>

View File

@ -26,6 +26,10 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#ifdef HAVE_CONFIG_H
#include <config.h> // Must come first
#endif
#include <assert.h>
#include <stdint.h>
#include <stdlib.h>

View File

@ -30,6 +30,10 @@
// bytereader_unittest.cc: Unit tests for google_breakpad::ByteReader
#ifdef HAVE_CONFIG_H
#include <config.h> // Must come first
#endif
#include <stdint.h>
#include <string>

View File

@ -31,6 +31,10 @@
// cfi_assembler.cc: Implementation of google_breakpad::CFISection class.
// See cfi_assembler.h for details.
#ifdef HAVE_CONFIG_H
#include <config.h> // Must come first
#endif
#include "common/dwarf/cfi_assembler.h"
#include <assert.h>

View File

@ -31,6 +31,10 @@
// dwarf2diehandler.cc: Implement the dwarf2reader::DieDispatcher class.
// See dwarf2diehandler.h for details.
#ifdef HAVE_CONFIG_H
#include <config.h> // Must come first
#endif
#include <assert.h>
#include <stdint.h>

View File

@ -32,6 +32,10 @@
// dwarf2diehander_unittest.cc: Unit tests for google_breakpad::DIEDispatcher.
#ifdef HAVE_CONFIG_H
#include <config.h> // Must come first
#endif
#include <stdint.h>
#include <string>

View File

@ -580,10 +580,10 @@ enum DwarfSectionId {
DW_SECT_TYPES = 2,
DW_SECT_ABBREV = 3,
DW_SECT_LINE = 4,
DW_SECT_LOC = 5,
DW_SECT_LOCLISTS = 5,
DW_SECT_STR_OFFSETS = 6,
DW_SECT_MACINFO = 7,
DW_SECT_MACRO = 8
DW_SECT_MACRO = 7,
DW_SECT_RNGLISTS = 8
};
// Source languages. These are values for DW_AT_language.

View File

@ -31,6 +31,10 @@
// Implementation of LineInfo, CompilationUnit,
// and CallFrameInfo. See dwarf2reader.h for details.
#ifdef HAVE_CONFIG_H
#include <config.h> // Must come first
#endif
#include "common/dwarf/dwarf2reader.h"
#include <stdint.h>
@ -76,9 +80,10 @@ CompilationUnit::CompilationUnit(const string& path,
str_offsets_buffer_(NULL), str_offsets_buffer_length_(0),
addr_buffer_(NULL), addr_buffer_length_(0),
is_split_dwarf_(false), is_type_unit_(false), dwo_id_(0), dwo_name_(),
skeleton_dwo_id_(0), ranges_base_(0), addr_base_(0),
str_offsets_base_(0), have_checked_for_dwp_(false), dwp_path_(),
dwp_byte_reader_(), dwp_reader_() {}
skeleton_dwo_id_(0), addr_base_(0),
str_offsets_base_(0), have_checked_for_dwp_(false),
should_process_split_dwarf_(false), low_pc_(0),
has_source_line_info_(false), source_line_offset_(0) {}
// Initialize a compilation unit from a .dwo or .dwp file.
// In this case, we need the .debug_addr section from the
@ -87,16 +92,10 @@ CompilationUnit::CompilationUnit(const string& path,
// the executable file, and call it as if we were still
// processing the original compilation unit.
void CompilationUnit::SetSplitDwarf(const uint8_t* addr_buffer,
uint64_t addr_buffer_length,
uint64_t addr_base,
uint64_t ranges_base,
void CompilationUnit::SetSplitDwarf(uint64_t addr_base,
uint64_t dwo_id) {
is_split_dwarf_ = true;
addr_buffer_ = addr_buffer;
addr_buffer_length_ = addr_buffer_length;
addr_base_ = addr_base;
ranges_base_ = ranges_base;
skeleton_dwo_id_ = dwo_id;
}
@ -396,7 +395,13 @@ uint64_t CompilationUnit::Start() {
// Set up our buffer
buffer_ = iter->second.first + offset_from_section_start_;
buffer_length_ = iter->second.second - offset_from_section_start_;
if (is_split_dwarf_) {
iter = GetSectionByName(sections_, ".debug_info_offset");
assert(iter != sections_.end());
buffer_length_ = iter->second.second;
} else {
buffer_length_ = iter->second.second - offset_from_section_start_;
}
// Read the header
ReadHeader();
@ -430,6 +435,12 @@ uint64_t CompilationUnit::Start() {
string_buffer_length_ = iter->second.second;
}
iter = GetSectionByName(sections_, ".debug_line");
if (iter != sections_.end()) {
line_buffer_ = iter->second.first;
line_buffer_length_ = iter->second.second;
}
// Set the line string section if we have one.
iter = GetSectionByName(sections_, ".debug_line_str");
if (iter != sections_.end()) {
@ -457,10 +468,8 @@ uint64_t CompilationUnit::Start() {
// If this is a skeleton compilation unit generated with split DWARF,
// and the client needs the full debug info, we need to find the full
// compilation unit in a .dwo or .dwp file.
if (!is_split_dwarf_
&& dwo_name_ != NULL
&& handler_->NeedSplitDebugInfo())
ProcessSplitDwarf();
should_process_split_dwarf_ =
!is_split_dwarf_ && dwo_name_ != NULL && handler_->NeedSplitDebugInfo();
return ourlength;
}
@ -881,7 +890,9 @@ const uint8_t* CompilationUnit::ProcessDIE(uint64_t dieoffset,
// DW_AT_str_offsets_base or DW_AT_addr_base. If it does, that attribute must
// be found and processed before trying to process the other attributes;
// otherwise the string or address values will all come out incorrect.
if (abbrev.tag == DW_TAG_compile_unit && header_.version == 5) {
if ((abbrev.tag == DW_TAG_compile_unit ||
abbrev.tag == DW_TAG_skeleton_unit) &&
header_.version == 5) {
uint64_t dieoffset_copy = dieoffset;
const uint8_t* start_copy = start;
for (AttributeList::const_iterator i = abbrev.attributes.begin();
@ -990,66 +1001,69 @@ inline int GetElfWidth(const ElfReader& elf) {
return 0;
}
void CompilationUnit::ProcessSplitDwarf() {
bool CompilationUnit::ProcessSplitDwarf(std::string& split_file,
SectionMap& sections,
ByteReader& split_byte_reader,
uint64_t& cu_offset) {
if (!should_process_split_dwarf_)
return false;
struct stat statbuf;
bool found_in_dwp = false;
if (!have_checked_for_dwp_) {
// Look for a .dwp file in the same directory as the executable.
have_checked_for_dwp_ = true;
string dwp_suffix(".dwp");
dwp_path_ = path_ + dwp_suffix;
if (stat(dwp_path_.c_str(), &statbuf) != 0) {
std::string dwp_path = path_ + dwp_suffix;
if (stat(dwp_path.c_str(), &statbuf) != 0) {
// Fall back to a split .debug file in the same directory.
string debug_suffix(".debug");
dwp_path_ = path_;
dwp_path = path_;
size_t found = path_.rfind(debug_suffix);
if (found + debug_suffix.length() == path_.length())
dwp_path_ = dwp_path_.replace(found, debug_suffix.length(), dwp_suffix);
if (found != string::npos &&
found + debug_suffix.length() == path_.length())
dwp_path = dwp_path.replace(found, debug_suffix.length(), dwp_suffix);
}
if (stat(dwp_path_.c_str(), &statbuf) == 0) {
ElfReader* elf = new ElfReader(dwp_path_);
int width = GetElfWidth(*elf);
if (stat(dwp_path.c_str(), &statbuf) == 0) {
split_elf_reader_ = std::make_unique<ElfReader>(dwp_path);
int width = GetElfWidth(*split_elf_reader_.get());
if (width != 0) {
dwp_byte_reader_.reset(new ByteReader(reader_->GetEndianness()));
dwp_byte_reader_->SetAddressSize(width);
dwp_reader_.reset(new DwpReader(*dwp_byte_reader_, elf));
split_byte_reader = ByteReader(reader_->GetEndianness());
split_byte_reader.SetAddressSize(width);
dwp_reader_ = std::make_unique<DwpReader>(split_byte_reader,
split_elf_reader_.get());
dwp_reader_->Initialize();
} else {
delete elf;
// If we have a .dwp file, read the debug sections for the requested CU.
dwp_reader_->ReadDebugSectionsForCU(dwo_id_, &sections);
if (!sections.empty()) {
SectionMap::const_iterator cu_iter =
GetSectionByName(sections, ".debug_info_offset");
SectionMap::const_iterator debug_info_iter =
GetSectionByName(sections, ".debug_info");
assert(cu_iter != sections.end());
assert(debug_info_iter != sections.end());
cu_offset = cu_iter->second.first - debug_info_iter->second.first;
found_in_dwp = true;
split_file = dwp_path;
}
}
}
}
bool found_in_dwp = false;
if (dwp_reader_) {
// If we have a .dwp file, read the debug sections for the requested CU.
SectionMap sections;
dwp_reader_->ReadDebugSectionsForCU(dwo_id_, &sections);
if (!sections.empty()) {
found_in_dwp = true;
CompilationUnit dwp_comp_unit(dwp_path_, sections, 0,
dwp_byte_reader_.get(), handler_);
dwp_comp_unit.SetSplitDwarf(addr_buffer_, addr_buffer_length_, addr_base_,
ranges_base_, dwo_id_);
dwp_comp_unit.Start();
}
}
if (!found_in_dwp) {
// If no .dwp file, try to open the .dwo file.
if (stat(dwo_name_, &statbuf) == 0) {
ElfReader elf(dwo_name_);
int width = GetElfWidth(elf);
split_elf_reader_ = std::make_unique<ElfReader>(dwo_name_);
int width = GetElfWidth(*split_elf_reader_.get());
if (width != 0) {
ByteReader reader(ENDIANNESS_LITTLE);
reader.SetAddressSize(width);
SectionMap sections;
ReadDebugSectionsFromDwo(&elf, &sections);
CompilationUnit dwo_comp_unit(dwo_name_, sections, 0, &reader,
handler_);
dwo_comp_unit.SetSplitDwarf(addr_buffer_, addr_buffer_length_,
addr_base_, ranges_base_, dwo_id_);
dwo_comp_unit.Start();
split_byte_reader = ByteReader(ENDIANNESS_LITTLE);
split_byte_reader.SetAddressSize(width);
ReadDebugSectionsFromDwo(split_elf_reader_.get(), &sections);
if (!sections.empty()) {
split_file = dwo_name_;
}
}
}
}
return !split_file.empty();
}
void CompilationUnit::ReadDebugSectionsFromDwo(ElfReader* elf_reader,
@ -1084,10 +1098,6 @@ DwpReader::DwpReader(const ByteReader& byte_reader, ElfReader* elf_reader)
abbrev_size_(0), info_data_(NULL), info_size_(0),
str_offsets_data_(NULL), str_offsets_size_(0) {}
DwpReader::~DwpReader() {
if (elf_reader_) delete elf_reader_;
}
void DwpReader::Initialize() {
cu_index_ = elf_reader_->GetSectionByName(".debug_cu_index",
&cu_index_size_);
@ -1127,6 +1137,8 @@ void DwpReader::Initialize() {
info_data_ = elf_reader_->GetSectionByName(".debug_info.dwo", &info_size_);
str_offsets_data_ = elf_reader_->GetSectionByName(".debug_str_offsets.dwo",
&str_offsets_size_);
rnglist_data_ =
elf_reader_->GetSectionByName(".debug_rnglists.dwo", &rnglist_size_);
if (size_table_ >= cu_index_ + cu_index_size_) {
version_ = 0;
}
@ -1227,13 +1239,24 @@ void DwpReader::ReadDebugSectionsForCU(uint64_t dwo_id,
} else if (section_id == DW_SECT_INFO) {
sections->insert(std::make_pair(
".debug_info",
std::make_pair(reinterpret_cast<const uint8_t*> (info_data_)
+ offset, size)));
std::make_pair(reinterpret_cast<const uint8_t*>(info_data_), 0)));
// .debug_info_offset will points the buffer for the CU with given
// dwo_id.
sections->insert(std::make_pair(
".debug_info_offset",
std::make_pair(
reinterpret_cast<const uint8_t*>(info_data_) + offset, size)));
} else if (section_id == DW_SECT_STR_OFFSETS) {
sections->insert(std::make_pair(
".debug_str_offsets",
std::make_pair(reinterpret_cast<const uint8_t*> (str_offsets_data_)
+ offset, size)));
} else if (section_id == DW_SECT_RNGLISTS) {
sections->insert(std::make_pair(
".debug_rnglists",
std::make_pair(
reinterpret_cast<const uint8_t*>(rnglist_data_) + offset,
size)));
}
}
sections->insert(std::make_pair(
@ -1819,6 +1842,11 @@ bool RangeListReader::ReadRanges(enum DwarfForm form, uint64_t data) {
return ReadDebugRngList(data);
}
} else if (form == DW_FORM_rnglistx) {
if (cu_info_->ranges_base_ == 0) {
// In split dwarf, there's no DW_AT_rnglists_base attribute, range_base
// will just be the first byte after the header.
cu_info_->ranges_base_ = reader_->OffsetSize() == 4? 12: 20;
}
offset_array_ = cu_info_->ranges_base_;
uint64_t index_offset = reader_->OffsetSize() * data;
uint64_t range_list_offset =

View File

@ -469,8 +469,7 @@ class CompilationUnit {
// compilation unit. We also inherit the Dwarf2Handler from
// the executable file, and call it as if we were still
// processing the original compilation unit.
void SetSplitDwarf(const uint8_t* addr_buffer, uint64_t addr_buffer_length,
uint64_t addr_base, uint64_t ranges_base, uint64_t dwo_id);
void SetSplitDwarf(uint64_t addr_base, uint64_t dwo_id);
// Begin reading a Dwarf2 compilation unit, and calling the
// callbacks in the Dwarf2Handler
@ -481,6 +480,36 @@ class CompilationUnit {
// start of the next compilation unit, if there is one.
uint64_t Start();
// Process the actual debug information in a split DWARF file.
bool ProcessSplitDwarf(std::string& split_file,
SectionMap& sections,
ByteReader& split_byte_reader,
uint64_t& cu_offset);
const uint8_t* GetAddrBuffer() { return addr_buffer_; }
uint64_t GetAddrBufferLen() { return addr_buffer_length_; }
uint64_t GetAddrBase() { return addr_base_; }
uint64_t GetLowPC() { return low_pc_; }
uint64_t GetDWOID() { return dwo_id_; }
const uint8_t* GetLineBuffer() { return line_buffer_; }
uint64_t GetLineBufferLen() { return line_buffer_length_; }
const uint8_t* GetLineStrBuffer() { return line_string_buffer_; }
uint64_t GetLineStrBufferLen() { return line_string_buffer_length_; }
bool HasSourceLineInfo() { return has_source_line_info_; }
uint64_t GetSourceLineOffset() { return source_line_offset_; }
bool ShouldProcessSplitDwarf() { return should_process_split_dwarf_; }
private:
// This struct represents a single DWARF2/3 abbreviation
@ -565,14 +594,12 @@ class CompilationUnit {
else if (attr == DW_AT_str_offsets_base) {
str_offsets_base_ = data;
}
else if (attr == DW_AT_GNU_ranges_base || attr == DW_AT_rnglists_base) {
ranges_base_ = data;
else if (attr == DW_AT_low_pc) {
low_pc_ = data;
}
// TODO(yunlian): When we add DW_AT_ranges_base from DWARF-5,
// that base will apply to DW_AT_ranges attributes in the
// skeleton CU as well as in the .dwo/.dwp files.
else if (attr == DW_AT_ranges && is_split_dwarf_) {
data += ranges_base_;
else if (attr == DW_AT_stmt_list) {
has_source_line_info_ = true;
source_line_offset_ = data;
}
handler_->ProcessAttributeUnsigned(offset, attr, form, data);
}
@ -647,9 +674,6 @@ class CompilationUnit {
// new place to position the stream to.
const uint8_t* SkipAttribute(const uint8_t* start, enum DwarfForm form);
// Process the actual debug information in a split DWARF file.
void ProcessSplitDwarf();
// Read the debug sections from a .dwo file.
void ReadDebugSectionsFromDwo(ElfReader* elf_reader,
SectionMap* sections);
@ -658,7 +682,7 @@ class CompilationUnit {
const string path_;
// Offset from section start is the offset of this compilation unit
// from the beginning of the .debug_info section.
// from the beginning of the .debug_info/.debug_info.dwo section.
uint64_t offset_from_section_start_;
// buffer is the buffer for our CU, starting at .debug_info + offset
@ -688,7 +712,7 @@ class CompilationUnit {
const uint8_t* string_buffer_;
uint64_t string_buffer_length_;
// Similarly for .debug_line_string.
// Similarly for .debug_line_str.
const uint8_t* line_string_buffer_;
uint64_t line_string_buffer_length_;
@ -702,6 +726,10 @@ class CompilationUnit {
const uint8_t* addr_buffer_;
uint64_t addr_buffer_length_;
// .debug_line section buffer and length.
const uint8_t* line_buffer_;
uint64_t line_buffer_length_;
// Flag indicating whether this compilation unit is part of a .dwo
// or .dwp file. If true, we are reading this unit because a
// skeleton compilation unit in an executable file had a
@ -730,10 +758,6 @@ class CompilationUnit {
// from the skeleton CU.
uint64_t skeleton_dwo_id_;
// The value of the DW_AT_GNU_ranges_base or DW_AT_rnglists_base attribute,
// if any.
uint64_t ranges_base_;
// The value of the DW_AT_GNU_addr_base attribute, if any.
uint64_t addr_base_;
@ -743,14 +767,20 @@ class CompilationUnit {
// True if we have already looked for a .dwp file.
bool have_checked_for_dwp_;
// Path to the .dwp file.
string dwp_path_;
// ByteReader for the DWP file.
std::unique_ptr<ByteReader> dwp_byte_reader_;
// ElfReader for the dwo/dwo file.
std::unique_ptr<ElfReader> split_elf_reader_;
// DWP reader.
std::unique_ptr<DwpReader> dwp_reader_;
std::unique_ptr<DwpReader> dwp_reader_;
bool should_process_split_dwarf_;
// The value of the DW_AT_low_pc attribute, if any.
uint64_t low_pc_;
// The value of DW_AT_stmt_list attribute if any.
bool has_source_line_info_;
uint64_t source_line_offset_;
};
// A Reader for a .dwp file. Supports the fetching of DWARF debug
@ -770,8 +800,6 @@ class DwpReader {
public:
DwpReader(const ByteReader& byte_reader, ElfReader* elf_reader);
~DwpReader();
// Read the CU index and initialize data members.
void Initialize();
@ -839,6 +867,8 @@ class DwpReader {
size_t info_size_;
const char* str_offsets_data_;
size_t str_offsets_size_;
const char* rnglist_data_;
size_t rnglist_size_;
};
// This class is a reader for DWARF's Call Frame Information. CFI

View File

@ -30,6 +30,10 @@
// dwarf2reader_cfi_unittest.cc: Unit tests for google_breakpad::CallFrameInfo
#ifdef HAVE_CONFIG_H
#include <config.h> // Must come first
#endif
#include <stdint.h>
#include <stdlib.h>

View File

@ -30,6 +30,10 @@
// dwarf2reader_die_unittest.cc: Unit tests for google_breakpad::CompilationUnit
#ifdef HAVE_CONFIG_H
#include <config.h> // Must come first
#endif
#include <stdint.h>
#include <stdlib.h>
@ -329,7 +333,8 @@ struct DwarfFormsFixture: public DIEFixture {
uint64_t offset=0) {
ByteReader byte_reader(params.endianness == kLittleEndian ?
ENDIANNESS_LITTLE : ENDIANNESS_BIG);
CompilationUnit parser("", MakeSectionMap(), offset, &byte_reader, &handler);
CompilationUnit parser("", MakeSectionMap(), offset, &byte_reader,
&handler);
EXPECT_EQ(offset + parser.Start(), info_contents.size());
}

View File

@ -30,6 +30,10 @@
// dwarf2reader_lineinfo_unittest.cc: Unit tests for google_breakpad::LineInfo
#ifdef HAVE_CONFIG_H
#include <config.h> // Must come first
#endif
#include <stdint.h>
#include <stdlib.h>

View File

@ -32,6 +32,10 @@
// information generated when with splitting optimizations such as
// -fsplit-machine-functions (clang) -freorder-blocks-and-partition (gcc).
#ifdef HAVE_CONFIG_H
#include <config.h> // Must come first
#endif
#include <stdint.h>
#include <stdlib.h>

View File

@ -30,6 +30,10 @@
#define _GNU_SOURCE // needed for pread()
#endif
#ifdef HAVE_CONFIG_H
#include <config.h> // Must come first
#endif
#include <fcntl.h>
#include <limits.h>
#include <string.h>

View File

@ -29,6 +29,10 @@
// This is a client for the dwarf2reader to extract function and line
// information from the debug info.
#ifdef HAVE_CONFIG_H
#include <config.h> // Must come first
#endif
#include <assert.h>
#include <limits.h>
#include <stdio.h>

View File

@ -33,6 +33,10 @@
// Implementation of google_breakpad::DwarfCFIToModule.
// See dwarf_cfi_to_module.h for details.
#ifdef HAVE_CONFIG_H
#include <config.h> // Must come first
#endif
#include <memory>
#include <sstream>
#include <utility>
@ -143,6 +147,29 @@ vector<string> DwarfCFIToModule::RegisterNames::MIPS() {
sizeof(kRegisterNames) / sizeof(kRegisterNames[0]));
}
vector<string> DwarfCFIToModule::RegisterNames::RISCV() {
static const char *const names[] = {
"pc", "ra", "sp", "gp", "tp", "t0", "t1", "t2",
"s0", "s1", "a0", "a1", "a2", "a3", "a4", "a5",
"a6", "a7", "s2", "s3", "s4", "s5", "s6", "s7",
"s8", "s9", "s10", "s11", "t3", "t4", "t5", "t6",
"f0", "f1", "f2", "f3", "f4", "f5", "f6", "f7",
"f8", "f9", "f10", "f11", "f12", "f13", "f14", "f15",
"f16", "f17", "f18", "f19", "f20", "f21", "f22", "f23",
"f24", "f25", "f26", "f27", "f28", "f29", "f30", "f31",
"", "", "", "", "", "", "", "",
"", "", "", "", "", "", "", "",
"", "", "", "", "", "", "", "",
"", "", "", "", "", "", "", "",
"v0", "v1", "v2", "v3", "v4", "v5", "v6", "v7",
"v8", "v9", "v10", "v11", "v12", "v13", "v14", "v15",
"v16", "v17", "v18", "v19", "v20", "v21", "v22", "v23",
"v24", "v25", "v26", "v27", "v28", "v29", "v30", "v31"
};
return MakeVector(names, sizeof(names) / sizeof(names[0]));
}
bool DwarfCFIToModule::Entry(size_t offset, uint64_t address, uint64_t length,
uint8_t version, const string& augmentation,
unsigned return_address) {

View File

@ -114,6 +114,9 @@ class DwarfCFIToModule: public CallFrameInfo::Handler {
// MIPS.
static vector<string> MIPS();
// RISC-V.
static vector<string> RISCV();
private:
// Given STRINGS, an array of C strings with SIZE elements, return an
// equivalent vector<string>.

View File

@ -30,6 +30,10 @@
// dwarf_cfi_to_module_unittest.cc: Tests for google_breakpad::DwarfCFIToModule.
#ifdef HAVE_CONFIG_H
#include <config.h> // Must come first
#endif
#include <string>
#include <vector>
@ -303,3 +307,15 @@ TEST(RegisterNames, X86_64) {
EXPECT_EQ("$rsp", names[7]);
EXPECT_EQ("$rip", names[16]);
}
TEST(RegisterNames, RISCV) {
vector<string> names = DwarfCFIToModule::RegisterNames::RISCV();
EXPECT_EQ("pc", names[0]);
EXPECT_EQ("t6", names[31]);
EXPECT_EQ("f0", names[32]);
EXPECT_EQ("f31", names[63]);
EXPECT_EQ("v0", names[96]);
EXPECT_EQ("v31", names[127]);
}

View File

@ -35,6 +35,10 @@
#define __STDC_FORMAT_MACROS
#endif /* __STDC_FORMAT_MACROS */
#ifdef HAVE_CONFIG_H
#include <config.h> // Must come first
#endif
#include "common/dwarf_cu_to_module.h"
#include <assert.h>
@ -165,19 +169,23 @@ bool DwarfCUToModule::FileContext::IsUnhandledInterCUReference(
// parsing. This is for data shared across the CU's entire DIE tree,
// and parameters from the code invoking the CU parser.
struct DwarfCUToModule::CUContext {
CUContext(FileContext* file_context_arg, WarningReporter* reporter_arg,
RangesHandler* ranges_handler_arg)
CUContext(FileContext* file_context_arg,
WarningReporter* reporter_arg,
RangesHandler* ranges_handler_arg,
uint64_t low_pc,
uint64_t addr_base)
: version(0),
file_context(file_context_arg),
reporter(reporter_arg),
ranges_handler(ranges_handler_arg),
language(Language::CPlusPlus),
low_pc(0),
low_pc(low_pc),
high_pc(0),
ranges_form(DW_FORM_sec_offset),
ranges_data(0),
ranges_base(0),
str_offsets_base(0) { }
addr_base(addr_base),
str_offsets_base(0) {}
~CUContext() {
for (vector<Module::Function*>::iterator it = functions.begin();
@ -326,7 +334,10 @@ class DwarfCUToModule::GenericDIEHandler: public DIEHandler {
// Use this from EndAttributes member functions, not ProcessAttribute*
// functions; only the former can be sure that all the DIE's attributes
// have been seen.
StringView ComputeQualifiedName();
//
// On return, if has_qualified_name is non-NULL, *has_qualified_name is set to
// true if the DIE includes a fully-qualified name, false otherwise.
StringView ComputeQualifiedName(bool* has_qualified_name);
CUContext* cu_context_;
DIEContext* parent_context_;
@ -462,7 +473,8 @@ void DwarfCUToModule::GenericDIEHandler::ProcessAttributeString(
}
}
StringView DwarfCUToModule::GenericDIEHandler::ComputeQualifiedName() {
StringView DwarfCUToModule::GenericDIEHandler::ComputeQualifiedName(
bool* has_qualified_name) {
// Use the demangled name, if one is available. Demangled names are
// preferable to those inferred from the DWARF structure because they
// include argument types.
@ -478,6 +490,15 @@ StringView DwarfCUToModule::GenericDIEHandler::ComputeQualifiedName() {
StringView* unqualified_name = nullptr;
StringView* enclosing_name = nullptr;
if (!qualified_name) {
if (has_qualified_name) {
// dSYMs built with -gmlt do not include the DW_AT_linkage_name
// with the unmangled symbol, but rather include it in the
// LC_SYMTAB STABS, which end up in the externs of the module.
//
// Remember this so the Module can copy over the extern name later.
*has_qualified_name = false;
}
// Find the unqualified name. If the DIE has its own DW_AT_name
// attribute, then use that; otherwise, check the specification.
if (!name_attribute_.empty()) {
@ -496,6 +517,10 @@ StringView DwarfCUToModule::GenericDIEHandler::ComputeQualifiedName() {
} else if (parent_context_) {
enclosing_name = &parent_context_->name;
}
} else {
if (has_qualified_name) {
*has_qualified_name = true;
}
}
// Prepare the return value before upcoming mutations possibly invalidate the
@ -554,6 +579,7 @@ class DwarfCUToModule::InlineHandler : public GenericDIEHandler {
ranges_data_(0),
call_site_line_(0),
inline_nest_level_(inline_nest_level),
has_range_data_(false),
inlines_(inlines) {}
void ProcessAttributeUnsigned(enum DwarfAttribute attr,
@ -575,6 +601,7 @@ class DwarfCUToModule::InlineHandler : public GenericDIEHandler {
int call_site_line_; // DW_AT_call_line
int call_site_file_id_; // DW_AT_call_file
int inline_nest_level_;
bool has_range_data_;
// A vector of inlines in the same nest level. It's owned by its parent
// function/inline. At Finish(), add this inline into the vector.
vector<unique_ptr<Module::Inline>>& inlines_;
@ -595,6 +622,7 @@ void DwarfCUToModule::InlineHandler::ProcessAttributeUnsigned(
high_pc_ = data;
break;
case DW_AT_ranges:
has_range_data_ = true;
ranges_data_ = data;
ranges_form_ = form;
break;
@ -638,7 +666,7 @@ bool DwarfCUToModule::InlineHandler::EndAttributes() {
void DwarfCUToModule::InlineHandler::Finish() {
vector<Module::Range> ranges;
if (low_pc_ && high_pc_) {
if (!has_range_data_) {
if (high_pc_form_ != DW_FORM_addr &&
high_pc_form_ != DW_FORM_GNU_addr_index &&
high_pc_form_ != DW_FORM_addrx &&
@ -675,11 +703,12 @@ void DwarfCUToModule::InlineHandler::Finish() {
// Every DW_TAG_inlined_subroutine should have a DW_AT_abstract_origin.
assert(specification_offset_ != 0);
cu_context_->file_context->module_->inline_origin_map.SetReference(
specification_offset_, specification_offset_);
Module::InlineOriginMap& inline_origin_map =
cu_context_->file_context->module_
->inline_origin_maps[cu_context_->file_context->filename_];
inline_origin_map.SetReference(specification_offset_, specification_offset_);
Module::InlineOrigin* origin =
cu_context_->file_context->module_->inline_origin_map
.GetOrCreateInlineOrigin(specification_offset_, name_);
inline_origin_map.GetOrCreateInlineOrigin(specification_offset_, name_);
unique_ptr<Module::Inline> in(
new Module::Inline(origin, ranges, call_site_line_, call_site_file_id_,
inline_nest_level_, std::move(child_inlines_)));
@ -718,7 +747,9 @@ class DwarfCUToModule::FuncHandler: public GenericDIEHandler {
ranges_form_(DW_FORM_sec_offset),
ranges_data_(0),
inline_(false),
handle_inline_(handle_inline) {}
handle_inline_(handle_inline),
has_qualified_name_(false),
has_range_data_(false) {}
void ProcessAttributeUnsigned(enum DwarfAttribute attr,
enum DwarfForm form,
@ -741,6 +772,8 @@ class DwarfCUToModule::FuncHandler: public GenericDIEHandler {
bool inline_;
vector<unique_ptr<Module::Inline>> child_inlines_;
bool handle_inline_;
bool has_qualified_name_;
bool has_range_data_;
DIEContext child_context_; // A context for our children.
};
@ -760,6 +793,7 @@ void DwarfCUToModule::FuncHandler::ProcessAttributeUnsigned(
high_pc_ = data;
break;
case DW_AT_ranges:
has_range_data_ = true;
ranges_data_ = data;
ranges_form_ = form;
break;
@ -804,7 +838,7 @@ DIEHandler* DwarfCUToModule::FuncHandler::FindChildHandler(
bool DwarfCUToModule::FuncHandler::EndAttributes() {
// Compute our name, and record a specification, if appropriate.
name_ = ComputeQualifiedName();
name_ = ComputeQualifiedName(&has_qualified_name_);
if (name_.empty() && abstract_origin_) {
name_ = abstract_origin_->name;
}
@ -830,7 +864,7 @@ void DwarfCUToModule::FuncHandler::Finish() {
iter->second->name = name_;
}
if (!ranges_data_) {
if (!has_range_data_) {
// Make high_pc_ an address, if it isn't already.
if (high_pc_form_ != DW_FORM_addr &&
high_pc_form_ != DW_FORM_GNU_addr_index &&
@ -877,6 +911,9 @@ void DwarfCUToModule::FuncHandler::Finish() {
scoped_ptr<Module::Function> func(new Module::Function(name, low_pc_));
func->ranges = ranges;
func->parameter_size = 0;
// If the name was unqualified, prefer the Extern name if there's a mismatch
// (the Extern name will be fully-qualified in that case).
func->prefer_extern_name = !has_qualified_name_;
if (func->address) {
// If the function address is zero this is a sign that this function
// description is just empty debug data and should just be discarded.
@ -903,15 +940,16 @@ void DwarfCUToModule::FuncHandler::Finish() {
StringView name = name_.empty() ? name_omitted : name_;
uint64_t offset =
specification_offset_ != 0 ? specification_offset_ : offset_;
cu_context_->file_context->module_->inline_origin_map.SetReference(offset_,
offset);
cu_context_->file_context->module_->inline_origin_map
.GetOrCreateInlineOrigin(offset_, name);
Module::InlineOriginMap& inline_origin_map =
cu_context_->file_context->module_
->inline_origin_maps[cu_context_->file_context->filename_];
inline_origin_map.SetReference(offset_, offset);
inline_origin_map.GetOrCreateInlineOrigin(offset_, name);
}
}
bool DwarfCUToModule::NamedScopeHandler::EndAttributes() {
child_context_.name = ComputeQualifiedName();
child_context_.name = ComputeQualifiedName(NULL);
if (child_context_.name.empty() && no_specification) {
cu_context_->reporter->UnknownSpecification(offset_, specification_offset_);
}
@ -1041,12 +1079,21 @@ DwarfCUToModule::DwarfCUToModule(FileContext* file_context,
LineToModuleHandler* line_reader,
RangesHandler* ranges_handler,
WarningReporter* reporter,
bool handle_inline)
bool handle_inline,
uint64_t low_pc,
uint64_t addr_base,
bool has_source_line_info,
uint64_t source_line_offset)
: RootDIEHandler(handle_inline),
line_reader_(line_reader),
cu_context_(new CUContext(file_context, reporter, ranges_handler)),
cu_context_(new CUContext(file_context,
reporter,
ranges_handler,
low_pc,
addr_base)),
child_context_(new DIEContext()),
has_source_line_info_(false) {}
has_source_line_info_(has_source_line_info),
source_line_offset_(source_line_offset) {}
DwarfCUToModule::~DwarfCUToModule() {
}

View File

@ -264,7 +264,11 @@ class DwarfCUToModule: public RootDIEHandler {
LineToModuleHandler* line_reader,
RangesHandler* ranges_handler,
WarningReporter* reporter,
bool handle_inline = false);
bool handle_inline = false,
uint64_t low_pc = 0,
uint64_t addr_base = 0,
bool has_source_line_info = false,
uint64_t source_line_offset = 0);
~DwarfCUToModule();
void ProcessAttributeSigned(enum DwarfAttribute attr,

View File

@ -30,6 +30,10 @@
// dwarf_cu_to_module.cc: Unit tests for google_breakpad::DwarfCUToModule.
#ifdef HAVE_CONFIG_H
#include <config.h> // Must come first
#endif
#include <stdint.h>
#include <string>
@ -263,6 +267,10 @@ class CUFixtureBase {
void TestFunction(int i, const string& name,
Module::Address address, Module::Address size);
// Test that the I'th function (ordered by address) in the module
// this.module_ has the given prefer_extern_name.
void TestFunctionPreferExternName(int i, bool prefer_extern_name);
// Test that the number of source lines owned by the I'th function
// in the module this.module_ is equal to EXPECTED.
void TestLineCount(int i, size_t expected);
@ -611,6 +619,15 @@ void CUFixtureBase::TestFunction(int i, const string& name,
EXPECT_EQ(0U, function->parameter_size);
}
void CUFixtureBase::TestFunctionPreferExternName(int i,
bool prefer_extern_name) {
FillFunctions();
ASSERT_LT((size_t)i, functions_.size());
Module::Function* function = functions_[i];
EXPECT_EQ(prefer_extern_name, function->prefer_extern_name);
}
void CUFixtureBase::TestLineCount(int i, size_t expected) {
FillFunctions();
ASSERT_LT((size_t) i, functions_.size());

View File

@ -31,6 +31,10 @@
// dwarf_line_to_module.cc: Implementation of DwarfLineToModule class.
// See dwarf_line_to_module.h for details.
#ifdef HAVE_CONFIG_H
#include <config.h> // Must come first
#endif
#include <stdio.h>
#include <string>

View File

@ -30,6 +30,10 @@
// dwarf_line_to_module.cc: Unit tests for google_breakpad::DwarfLineToModule.
#ifdef HAVE_CONFIG_H
#include <config.h> // Must come first
#endif
#include <vector>
#include "breakpad_googletest_includes.h"

View File

@ -32,6 +32,10 @@
// dwarf_range_list_handler.cc: Implementation of DwarfRangeListHandler class.
// See dwarf_range_list_handler.h for details.
#ifdef HAVE_CONFIG_H
#include <config.h> // Must come first
#endif
#include <algorithm>
#include "common/dwarf_range_list_handler.h"

View File

@ -31,6 +31,10 @@
// language.cc: Subclasses and singletons for google_breakpad::Language.
// See language.h for details.
#ifdef HAVE_CONFIG_H
#include <config.h> // Must come first
#endif
#include "common/language.h"
#include <stdlib.h>

Some files were not shown because too many files have changed in this diff Show More