Commit 26a531ff authored by Oskar Sundbom's avatar Oskar Sundbom Committed by Commit Bot

Revert "Add support for lldbinit to macOS."

This reverts commit 4fa0fac0.

Reason for revert: Tests hit the DCHECK on Mac Retina Debug (AMD) tester: https://crbug.com/999065

Original change's description:
> Add support for lldbinit to macOS.
> 
> The build-flag `strip_absolute_paths_from_debug_symbols = 1` produces
> deterministic outputs and has better goma caching, but breaks lldb. This CL adds
> machinery to help users get functional symbols in lldb while still using that
> compile flag.
> 
> Bug: 330262
> Change-Id: I42f1e6c9c76296d451730ea481d7e1c3c0a69476
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1775227
> Reviewed-by: Nico Weber <thakis@chromium.org>
> Commit-Queue: Erik Chen <erikchen@chromium.org>
> Auto-Submit: Erik Chen <erikchen@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#691393}

TBR=thakis@chromium.org,erikchen@chromium.org

Change-Id: I801cd3afe2b1b89b050c7806d62295a4a269911b
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: 330262, 999065
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1774627Reviewed-by: default avatarOskar Sundbom <ossu@chromium.org>
Commit-Queue: Oskar Sundbom <ossu@chromium.org>
Cr-Commit-Position: refs/heads/master@{#691542}
parent 0551216f
...@@ -2071,8 +2071,6 @@ buildflag_header("debugging_buildflags") { ...@@ -2071,8 +2071,6 @@ buildflag_header("debugging_buildflags") {
header_dir = "base/debug" header_dir = "base/debug"
enable_gdbinit_warning = enable_gdbinit_warning =
is_debug && (strip_absolute_paths_from_debug_symbols || use_custom_libcxx) is_debug && (strip_absolute_paths_from_debug_symbols || use_custom_libcxx)
enable_lldbinit_warning =
is_debug && strip_absolute_paths_from_debug_symbols && is_mac
flags = [ flags = [
"ENABLE_LOCATION_SOURCE=$enable_location_source", "ENABLE_LOCATION_SOURCE=$enable_location_source",
...@@ -2081,7 +2079,6 @@ buildflag_header("debugging_buildflags") { ...@@ -2081,7 +2079,6 @@ buildflag_header("debugging_buildflags") {
"UNSAFE_DEVELOPER_BUILD=$is_unsafe_developer_build", "UNSAFE_DEVELOPER_BUILD=$is_unsafe_developer_build",
"CAN_UNWIND_WITH_CFI_TABLE=$can_unwind_with_cfi_table", "CAN_UNWIND_WITH_CFI_TABLE=$can_unwind_with_cfi_table",
"ENABLE_GDBINIT_WARNING=$enable_gdbinit_warning", "ENABLE_GDBINIT_WARNING=$enable_gdbinit_warning",
"ENABLE_LLDBINIT_WARNING=$enable_lldbinit_warning",
] ]
} }
......
...@@ -40,8 +40,7 @@ BASE_EXPORT bool IsDebugUISuppressed(); ...@@ -40,8 +40,7 @@ BASE_EXPORT bool IsDebugUISuppressed();
// If a debugger is present, verifies that it is properly set up, and DCHECK()s // If a debugger is present, verifies that it is properly set up, and DCHECK()s
// if misconfigured. Currently only verifies that //tools/gdb/gdbinit has been // if misconfigured. Currently only verifies that //tools/gdb/gdbinit has been
// sourced when using gdb on Linux and //tools/lldb/lldbinit.py has been sourced // sourced when using gdb on Linux.
// when using lldb on macOS.
BASE_EXPORT void VerifyDebugger(); BASE_EXPORT void VerifyDebugger();
} // namespace debug } // namespace debug
......
...@@ -128,21 +128,7 @@ bool BeingDebugged() { ...@@ -128,21 +128,7 @@ bool BeingDebugged() {
return being_debugged; return being_debugged;
} }
void VerifyDebugger() { void VerifyDebugger() {}
#if BUILDFLAG(ENABLE_LLDBINIT_WARNING)
// Quick check before potentially slower GetDebuggerProcess().
if (Environment::Create()->HasVar("CHROMIUM_LLDBINIT_SOURCED"))
return;
DCHECK(false)
<< "Detected lldb without sourcing //tools/lldb/lldbinit.py. lldb may "
"not be able to find debug symbols. Please see debug instructions for "
"using //tools/lldb/lldbinit.py:\n"
"https://chromium.googlesource.com/chromium/src/+/master/docs/"
"lldbinit.md\n"
"To continue anyway, type 'continue' in lldb. To always skip this "
"check, define an environment variable CHROMIUM_LLDBINIT_SOURCED=1";
#endif
}
#elif defined(OS_LINUX) || defined(OS_ANDROID) || defined(OS_AIX) #elif defined(OS_LINUX) || defined(OS_ANDROID) || defined(OS_AIX)
......
# Usage of tools/lldb/lldbinit.py
Usage of Chromium's [lldbinit.py](../tools/lldb/lldbinit.py) is recommended when
debugging with lldb. This is necessary for source-level debugging when
`strip_absolute_paths_from_debug_symbols` is enabled.
To use, add the following to your `~/.lldbinit`
```
# So that lldbinit.py takes precedence.
script sys.path[:0] = ['<.../path/to/chromium/src/tools/lldb>']
script import lldbinit
```
# Copyright 2019 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
# The GN arg `strip_absolute_paths_from_debug_symbols = 1` uses relative paths
# for debug symbols. This confuses lldb. We explicitly set the source-map to
# point at the root directory of the chromium checkout.
import os
import lldb
this_dir = os.path.dirname(os.path.abspath(__file__))
source_dir = os.path.join(os.path.join(this_dir, os.pardir), os.pardir)
lldb.debugger.HandleCommand(
'settings set target.source-map ../.. ' + source_dir)
lldb.debugger.HandleCommand(
'settings set target.env-vars CHROMIUM_LLDBINIT_SOURCED=1')
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment