Files
clang-p2996/lldb/tools/lldb-fuzzer/utils/TempFile.h
Jonas Devlieghere 61efe14e21 [lldb] Add a fuzzer for target creation
This patch adds a generic fuzzer that interprets inputs as object files
and uses them to create a target in lldb. It is very similar to the
llvm-dwarfdump fuzzer which found a bunch of issues in libObject.

Differential revision: https://reviews.llvm.org/D122461
2022-03-25 09:34:00 -07:00

28 lines
757 B
C++

//===-- TempFile.h ----------------------------------------------*- C++ -*-===//
//
// 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
//
//===----------------------------------------------------------------------===//
#include "llvm/ADT/SmallString.h"
#include "llvm/ADT/StringRef.h"
#include "llvm/Support/Error.h"
namespace lldb_fuzzer {
class TempFile {
public:
TempFile() = default;
~TempFile();
static std::unique_ptr<TempFile> Create(uint8_t *data, size_t size);
llvm::StringRef GetPath() { return m_path.str(); }
private:
llvm::SmallString<128> m_path;
};
} // namespace lldb_fuzzer