Lines Matching +full:input +full:- +full:depth
1 //===- Signals.cpp - Signal Handling support --------------------*- C++ -*-===//
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 //===----------------------------------------------------------------------===//
12 //===----------------------------------------------------------------------===//
19 #include "llvm/Config/llvm-config.h"
36 //===----------------------------------------------------------------------===//
39 //===----------------------------------------------------------------------===//
50 "disable-symbolication",
58 "crash-diagnostics-dir", cl::value_desc("directory"),
77 // Callbacks to run in signal handler must be lock-free because a signal handler
90 // -Werror=global-constructors in c++20 and above
97 // Signal-safe.
111 // Signal-safe.
127 static bool findModulesAndOffsets(void **StackTrace, int Depth,
140 /// Helper that launches llvm-symbolizer and symbolizes a backtrace.
143 int Depth, llvm::raw_ostream &OS) {
147 // Don't recursively invoke the llvm-symbolizer binary.
148 if (Argv0.contains("llvm-symbolizer"))
153 // Use llvm-symbolizer tool to symbolize the stack traces. First look for it
161 LLVMSymbolizerPathOrErr = sys::findProgramByName("llvm-symbolizer", Parent);
164 LLVMSymbolizerPathOrErr = sys::findProgramByName("llvm-symbolizer");
176 std::vector<const char *> Modules(Depth, nullptr);
177 std::vector<intptr_t> Offsets(Depth, 0);
178 if (!findModulesAndOffsets(StackTrace, Depth, Modules.data(), Offsets.data(),
183 sys::fs::createTemporaryFile("symbolizer-input", "", InputFD, InputFile);
184 sys::fs::createTemporaryFile("symbolizer-output", "", OutputFile);
189 raw_fd_ostream Input(InputFD, true);
190 for (int i = 0; i < Depth; i++) {
192 Input << Modules[i] << " " << (void*)Offsets[i] << "\n";
198 StringRef Args[] = {"llvm-symbolizer", "--functions=linkage", "--inlining",
200 // Pass --relative-address on Windows so that we don't
202 // FIXME: Make this the default for llvm-symbolizer.
203 "--relative-address",
205 "--demangle"};
212 // sanitizer_stacktrace_printer.cc in compiler-rt.
216 StringRef Output = OutputBuf.get()->getBuffer();
221 for (int i = 0; i < Depth; i++) {
224 std::log10(Depth) + 2)
259 static bool printMarkupStackTrace(StringRef Argv0, void **StackTrace, int Depth,
270 for (int I = 0; I < Depth; I++)
275 // Include the platform-specific parts of this class.