Changeset View
Changeset View
Standalone View
Standalone View
compiler-rt/lib/sanitizer_common/sanitizer_symbolizer_internal.h
Show First 20 Lines • Show All 70 Lines • ▼ Show 20 Lines | public: | ||||
} | } | ||||
}; | }; | ||||
// SymbolizerProcess encapsulates communication between the tool and | // SymbolizerProcess encapsulates communication between the tool and | ||||
// external symbolizer program, running in a different subprocess. | // external symbolizer program, running in a different subprocess. | ||||
// SymbolizerProcess may not be used from two threads simultaneously. | // SymbolizerProcess may not be used from two threads simultaneously. | ||||
class SymbolizerProcess { | class SymbolizerProcess { | ||||
public: | public: | ||||
explicit SymbolizerProcess(const char *path, bool use_forkpty = false); | explicit SymbolizerProcess(const char *path, bool use_posix_spawn = false); | ||||
const char *SendCommand(const char *command); | const char *SendCommand(const char *command); | ||||
protected: | protected: | ||||
virtual bool ReachedEndOfOutput(const char *buffer, uptr length) const { | virtual bool ReachedEndOfOutput(const char *buffer, uptr length) const { | ||||
UNIMPLEMENTED(); | UNIMPLEMENTED(); | ||||
} | } | ||||
/// The maximum number of arguments required to invoke a tool process. | /// The maximum number of arguments required to invoke a tool process. | ||||
Show All 20 Lines | private: | ||||
static const uptr kBufferSize = 16 * 1024; | static const uptr kBufferSize = 16 * 1024; | ||||
char buffer_[kBufferSize]; | char buffer_[kBufferSize]; | ||||
static const uptr kMaxTimesRestarted = 5; | static const uptr kMaxTimesRestarted = 5; | ||||
static const int kSymbolizerStartupTimeMillis = 10; | static const int kSymbolizerStartupTimeMillis = 10; | ||||
uptr times_restarted_; | uptr times_restarted_; | ||||
bool failed_to_start_; | bool failed_to_start_; | ||||
bool reported_invalid_path_; | bool reported_invalid_path_; | ||||
bool use_forkpty_; | bool use_posix_spawn_; | ||||
}; | }; | ||||
class LLVMSymbolizerProcess; | class LLVMSymbolizerProcess; | ||||
// This tool invokes llvm-symbolizer in a subprocess. It should be as portable | // This tool invokes llvm-symbolizer in a subprocess. It should be as portable | ||||
// as the llvm-symbolizer tool is. | // as the llvm-symbolizer tool is. | ||||
class LLVMSymbolizer : public SymbolizerTool { | class LLVMSymbolizer : public SymbolizerTool { | ||||
public: | public: | ||||
Show All 33 Lines |