llvm/compiler-rt/lib/sanitizer_common/sanitizer_symbolizer_libcdep.cpp

//===-- sanitizer_symbolizer_libcdep.cpp ----------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
//
// This file is shared between AddressSanitizer and ThreadSanitizer
// run-time libraries.
//===----------------------------------------------------------------------===//

#include "sanitizer_allocator_internal.h"
#include "sanitizer_internal_defs.h"
#include "sanitizer_platform.h"
#include "sanitizer_symbolizer_internal.h"

namespace __sanitizer {

Symbolizer *Symbolizer::GetOrInit() {}

// See sanitizer_symbolizer_markup.cpp.
#if !SANITIZER_SYMBOLIZER_MARKUP

const char *ExtractToken(const char *str, const char *delims, char **result) {}

const char *ExtractInt(const char *str, const char *delims, int *result) {}

const char *ExtractUptr(const char *str, const char *delims, uptr *result) {}

const char *ExtractSptr(const char *str, const char *delims, sptr *result) {}

const char *ExtractTokenUpToDelimiter(const char *str, const char *delimiter,
                                      char **result) {}

SymbolizedStack *Symbolizer::SymbolizePC(uptr addr) {}

bool Symbolizer::SymbolizeData(uptr addr, DataInfo *info) {}

bool Symbolizer::SymbolizeFrame(uptr addr, FrameInfo *info) {}

bool Symbolizer::GetModuleNameAndOffsetForPC(uptr pc, const char **module_name,
                                             uptr *module_address) {}

void Symbolizer::Flush() {}

const char *Symbolizer::Demangle(const char *name) {}

bool Symbolizer::FindModuleNameAndOffsetForAddress(uptr address,
                                                   const char **module_name,
                                                   uptr *module_offset,
                                                   ModuleArch *module_arch) {}

void Symbolizer::RefreshModules() {}

const ListOfModules &Symbolizer::GetRefreshedListOfModules() {}

static const LoadedModule *SearchForModule(const ListOfModules &modules,
                                           uptr address) {}

const LoadedModule *Symbolizer::FindModuleForAddress(uptr address) {}

// For now we assume the following protocol:
// For each request of the form
//   <module_name> <module_offset>
// passed to STDIN, external symbolizer prints to STDOUT response:
//   <function_name>
//   <file_name>:<line_number>:<column_number>
//   <function_name>
//   <file_name>:<line_number>:<column_number>
//   ...
//   <empty line>
class LLVMSymbolizerProcess final : public SymbolizerProcess {};

LLVMSymbolizer::LLVMSymbolizer(const char *path, LowLevelAllocator *allocator)
    :{}

// Parse a <file>:<line>[:<column>] buffer. The file path may contain colons on
// Windows, so extract tokens from the right hand side first. The column info is
// also optional.
static const char *ParseFileLineInfo(AddressInfo *info, const char *str) {}

// Parses one or more two-line strings in the following format:
//   <function_name>
//   <file_name>:<line_number>[:<column_number>]
// Used by LLVMSymbolizer, Addr2LinePool and InternalSymbolizer, since all of
// them use the same output format.
void ParseSymbolizePCOutput(const char *str, SymbolizedStack *res) {}

// Parses a two- or three-line string in the following format:
//   <symbol_name>
//   <start_address> <size>
//   <filename>:<column>
// Used by LLVMSymbolizer and InternalSymbolizer. LLVMSymbolizer added support
// for symbolizing the third line in D123538, but we support the older two-line
// information as well.
void ParseSymbolizeDataOutput(const char *str, DataInfo *info) {}

void ParseSymbolizeFrameOutput(const char *str,
                               InternalMmapVector<LocalInfo> *locals) {}

bool LLVMSymbolizer::SymbolizePC(uptr addr, SymbolizedStack *stack) {}

bool LLVMSymbolizer::SymbolizeData(uptr addr, DataInfo *info) {}

bool LLVMSymbolizer::SymbolizeFrame(uptr addr, FrameInfo *info) {}

const char *LLVMSymbolizer::FormatAndSendCommand(const char *command_prefix,
                                                 const char *module_name,
                                                 uptr module_offset,
                                                 ModuleArch arch) {}

SymbolizerProcess::SymbolizerProcess(const char *path, bool use_posix_spawn)
    :{}

static bool IsSameModule(const char* path) {}

const char *SymbolizerProcess::SendCommand(const char *command) {}

const char *SymbolizerProcess::SendCommandImpl(const char *command) {}

bool SymbolizerProcess::Restart() {}

bool SymbolizerProcess::ReadFromSymbolizer() {}

bool SymbolizerProcess::WriteToSymbolizer(const char *buffer, uptr length) {}

#endif  // !SANITIZER_SYMBOLIZER_MARKUP

}  // namespace __sanitizer