2014-07-31 13:45:51 -04:00
|
|
|
# Copyright 2014 The Crashpad Authors. All rights reserved.
|
|
|
|
#
|
|
|
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
# you may not use this file except in compliance with the License.
|
|
|
|
# You may obtain a copy of the License at
|
|
|
|
#
|
|
|
|
# http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
#
|
|
|
|
# Unless required by applicable law or agreed to in writing, software
|
|
|
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
# See the License for the specific language governing permissions and
|
|
|
|
# limitations under the License.
|
|
|
|
|
|
|
|
{
|
2015-03-08 15:17:22 -04:00
|
|
|
'includes': [
|
|
|
|
'../build/crashpad.gypi',
|
|
|
|
],
|
2014-07-31 13:45:51 -04:00
|
|
|
'targets': [
|
|
|
|
{
|
2015-03-08 16:25:34 -04:00
|
|
|
'target_name': 'crashpad_compat',
|
2014-09-12 12:13:27 -04:00
|
|
|
'type': 'static_library',
|
2014-07-31 13:45:51 -04:00
|
|
|
'sources': [
|
2017-10-06 12:47:28 -04:00
|
|
|
'android/elf.h',
|
|
|
|
'android/linux/elf.h',
|
|
|
|
'android/linux/prctl.h',
|
|
|
|
'android/linux/ptrace.h',
|
|
|
|
'android/sched.h',
|
|
|
|
'android/sys/syscall.h',
|
|
|
|
'android/sys/user.h',
|
|
|
|
'linux/signal.h',
|
|
|
|
'linux/sys/ptrace.h',
|
2014-07-31 13:45:51 -04:00
|
|
|
'mac/AvailabilityMacros.h',
|
2015-12-02 15:31:44 -08:00
|
|
|
'mac/kern/exc_resource.h',
|
2017-06-20 09:50:37 -04:00
|
|
|
'mac/mach/i386/thread_state.h',
|
2014-07-31 13:45:51 -04:00
|
|
|
'mac/mach/mach.h',
|
2014-09-12 12:13:27 -04:00
|
|
|
'mac/mach-o/getsect.cc',
|
|
|
|
'mac/mach-o/getsect.h',
|
2014-07-31 13:45:51 -04:00
|
|
|
'mac/mach-o/loader.h',
|
2015-04-08 17:46:09 -04:00
|
|
|
'mac/sys/resource.h',
|
2015-12-09 17:36:32 -05:00
|
|
|
'non_cxx11_lib/type_traits',
|
|
|
|
'non_cxx11_lib/utility',
|
2014-08-01 14:37:20 -04:00
|
|
|
'non_mac/mach/mach.h',
|
2014-07-31 13:45:51 -04:00
|
|
|
'non_win/dbghelp.h',
|
|
|
|
'non_win/minwinbase.h',
|
|
|
|
'non_win/timezoneapi.h',
|
|
|
|
'non_win/verrsrc.h',
|
2015-02-04 17:30:03 -08:00
|
|
|
'non_win/windows.h',
|
2014-07-31 13:45:51 -04:00
|
|
|
'non_win/winnt.h',
|
2015-05-06 10:28:07 -07:00
|
|
|
'win/getopt.h',
|
2015-08-05 16:34:50 -04:00
|
|
|
'win/strings.cc',
|
|
|
|
'win/strings.h',
|
2017-10-06 12:47:28 -04:00
|
|
|
'win/sys/time.h',
|
2014-12-10 11:39:50 -08:00
|
|
|
'win/sys/types.h',
|
2015-05-06 10:28:07 -07:00
|
|
|
'win/time.cc',
|
|
|
|
'win/time.h',
|
2015-03-02 13:06:34 -08:00
|
|
|
'win/winnt.h',
|
2014-07-31 13:45:51 -04:00
|
|
|
],
|
2014-09-12 12:13:27 -04:00
|
|
|
'conditions': [
|
|
|
|
['OS=="mac"', {
|
|
|
|
'dependencies': [
|
|
|
|
'../third_party/apple_cctools/apple_cctools.gyp:apple_cctools',
|
|
|
|
],
|
|
|
|
'include_dirs': [
|
|
|
|
'mac',
|
2015-12-09 17:36:32 -05:00
|
|
|
'non_cxx11_lib',
|
2014-09-12 12:13:27 -04:00
|
|
|
],
|
|
|
|
'direct_dependent_settings': {
|
|
|
|
'include_dirs': [
|
|
|
|
'mac',
|
2015-12-09 17:36:32 -05:00
|
|
|
'non_cxx11_lib',
|
2014-09-12 12:13:27 -04:00
|
|
|
],
|
|
|
|
},
|
|
|
|
}],
|
2014-12-10 11:39:50 -08:00
|
|
|
['OS=="win"', {
|
|
|
|
'include_dirs': [
|
|
|
|
'win',
|
|
|
|
],
|
|
|
|
'direct_dependent_settings': {
|
|
|
|
'include_dirs': [
|
|
|
|
'win',
|
|
|
|
],
|
|
|
|
},
|
2015-05-06 10:28:07 -07:00
|
|
|
'dependencies': [
|
|
|
|
'../third_party/getopt/getopt.gyp:getopt',
|
|
|
|
],
|
2014-12-10 11:39:50 -08:00
|
|
|
}, {
|
2014-09-12 12:13:27 -04:00
|
|
|
'include_dirs': [
|
|
|
|
'non_win',
|
|
|
|
],
|
|
|
|
'direct_dependent_settings': {
|
|
|
|
'include_dirs': [
|
|
|
|
'non_win',
|
|
|
|
],
|
|
|
|
},
|
|
|
|
}],
|
2017-03-15 13:47:31 -04:00
|
|
|
['OS=="android"', {
|
|
|
|
'include_dirs': [
|
|
|
|
'android',
|
2017-08-01 19:05:06 -07:00
|
|
|
'linux',
|
2017-03-15 13:47:31 -04:00
|
|
|
],
|
|
|
|
'direct_dependent_settings': {
|
|
|
|
'include_dirs': [
|
|
|
|
'android',
|
2017-08-01 19:05:06 -07:00
|
|
|
'linux',
|
2017-03-15 13:47:31 -04:00
|
|
|
],
|
|
|
|
},
|
|
|
|
}],
|
linux: Use PTRACE_GET_THREAD_AREA for x86 ThreadInfo.GetThreadArea
Linux supports TLS on x86 by allocating slots in the GDT, accessible
via the system calls get/set_thread_area. This allows segment
registers (%gs on x86) to be used to quickly access the TLS.
Previously, we used PTRACE_GETREGSET with the NT_386_TLS regset. This
"register set" provides access to the subarray of the GDT used for TLS.
However, there are multiple slots provided and we don't know which one
is being used by the threading library for the current thread's TLS.
Previously, we were just using the first one, which worked for x86 on
64-bit kernels, but not 32-bit kernels. On 32-bit kernels, the first
slot ended up pointing to the TLS of the main thread.
The authoritative index of the current thread's TLS in the GDT is
given by bits 3-15 of %gs. However, this index cannot be used with
PTRACE_GETREGSET+NT386_TLS because we don't know the location of the
TLS slots in the GDT. PTRACE_GET_THREAD_AREA, however, accepts an
index from the start of the GDT similarly to get/set_thread_area.
Bug: crashpad:30
Change-Id: Ie6dfbdd088c6816fad409812a1a97037d4b38fd7
Reviewed-on: https://chromium-review.googlesource.com/575318
Reviewed-by: Mark Mentovai <mark@chromium.org>
2017-07-18 16:42:58 -07:00
|
|
|
['OS=="linux"', {
|
|
|
|
'include_dirs': [
|
|
|
|
'linux',
|
|
|
|
],
|
|
|
|
'direct_dependent_settings': {
|
|
|
|
'include_dirs': [
|
|
|
|
'linux',
|
|
|
|
],
|
|
|
|
},
|
|
|
|
}],
|
2014-09-12 12:13:27 -04:00
|
|
|
],
|
2014-07-31 13:45:51 -04:00
|
|
|
},
|
|
|
|
],
|
|
|
|
}
|