003 File Manager
Current Path:
/usr/src/contrib/llvm-project/lldb/include/lldb/Utility
usr
/
src
/
contrib
/
llvm-project
/
lldb
/
include
/
lldb
/
Utility
/
📁
..
📄
AnsiTerminal.h
(4.97 KB)
📄
ArchSpec.h
(17.08 KB)
📄
Args.h
(13.72 KB)
📄
Baton.h
(2.25 KB)
📄
Broadcaster.h
(17.55 KB)
📄
CompletionRequest.h
(9.23 KB)
📄
Connection.h
(6.42 KB)
📄
ConstString.h
(17.92 KB)
📄
DataBuffer.h
(3.39 KB)
📄
DataBufferHeap.h
(3.65 KB)
📄
DataBufferLLVM.h
(1.17 KB)
📄
DataEncoder.h
(8.45 KB)
📄
DataExtractor.h
(39.18 KB)
📄
Endian.h
(865 B)
📄
Environment.h
(2.68 KB)
📄
Event.h
(6.64 KB)
📄
FileSpec.h
(15.41 KB)
📄
Flags.h
(3.39 KB)
📄
GDBRemote.h
(4.15 KB)
📄
IOObject.h
(1.38 KB)
📄
Iterable.h
(5.5 KB)
📄
LLDBAssert.h
(911 B)
📄
Listener.h
(5.2 KB)
📄
Log.h
(10.51 KB)
📄
Logging.h
(2.27 KB)
📄
NameMatches.h
(716 B)
📄
Predicate.h
(8.08 KB)
📄
ProcessInfo.h
(7.92 KB)
📄
RangeMap.h
(23.05 KB)
📄
RegisterValue.h
(7.08 KB)
📄
RegularExpression.h
(3.2 KB)
📄
Reproducer.h
(13.25 KB)
📄
ReproducerInstrumentation.h
(39.38 KB)
📄
Scalar.h
(11.27 KB)
📄
SelectHelper.h
(2.53 KB)
📄
SharedCluster.h
(1.69 KB)
📄
State.h
(2.54 KB)
📄
Status.h
(7.31 KB)
📄
Stream.h
(14.34 KB)
📄
StreamCallback.h
(978 B)
📄
StreamString.h
(1.23 KB)
📄
StreamTee.h
(4.52 KB)
📄
StringExtractor.h
(3.13 KB)
📄
StringExtractorGDBRemote.h
(6.12 KB)
📄
StringLexer.h
(1.31 KB)
📄
StringList.h
(3.47 KB)
📄
StructuredData.h
(15.49 KB)
📄
TildeExpressionResolver.h
(2.42 KB)
📄
Timeout.h
(2.45 KB)
📄
Timer.h
(1.87 KB)
📄
TraceOptions.h
(1.79 KB)
📄
UUID.h
(3.74 KB)
📄
UriParser.h
(1.01 KB)
📄
UserID.h
(2.8 KB)
📄
UserIDResolver.h
(1.8 KB)
📄
VASPrintf.h
(636 B)
📄
VMRange.h
(3.06 KB)
📄
XcodeSDK.h
(2.85 KB)
Editing: GDBRemote.h
//===-- GDBRemote.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 // //===----------------------------------------------------------------------===// #ifndef LLDB_UTILITY_GDBREMOTE_H #define LLDB_UTILITY_GDBREMOTE_H #include "lldb/Utility/FileSpec.h" #include "lldb/Utility/Reproducer.h" #include "lldb/Utility/StreamString.h" #include "lldb/lldb-enumerations.h" #include "lldb/lldb-public.h" #include "llvm/Support/YAMLTraits.h" #include "llvm/Support/raw_ostream.h" #include <stddef.h> #include <stdint.h> #include <string> #include <vector> namespace lldb_private { class StreamGDBRemote : public StreamString { public: StreamGDBRemote(); StreamGDBRemote(uint32_t flags, uint32_t addr_size, lldb::ByteOrder byte_order); ~StreamGDBRemote() override; /// Output a block of data to the stream performing GDB-remote escaping. /// /// \param[in] s /// A block of data. /// /// \param[in] src_len /// The amount of data to write. /// /// \return /// Number of bytes written. // TODO: Convert this function to take ArrayRef<uint8_t> int PutEscapedBytes(const void *s, size_t src_len); }; /// GDB remote packet as used by the reproducer and the GDB remote /// communication history. Packets can be serialized to file. struct GDBRemotePacket { friend llvm::yaml::MappingTraits<GDBRemotePacket>; enum Type { ePacketTypeInvalid = 0, ePacketTypeSend, ePacketTypeRecv }; GDBRemotePacket() : packet(), type(ePacketTypeInvalid), bytes_transmitted(0), packet_idx(0), tid(LLDB_INVALID_THREAD_ID) {} void Clear() { packet.data.clear(); type = ePacketTypeInvalid; bytes_transmitted = 0; packet_idx = 0; tid = LLDB_INVALID_THREAD_ID; } struct BinaryData { std::string data; }; void Dump(Stream &strm) const; BinaryData packet; Type type; uint32_t bytes_transmitted; uint32_t packet_idx; lldb::tid_t tid; private: llvm::StringRef GetTypeStr() const; }; namespace repro { class PacketRecorder : public AbstractRecorder { public: PacketRecorder(const FileSpec &filename, std::error_code &ec) : AbstractRecorder(filename, ec) {} static llvm::Expected<std::unique_ptr<PacketRecorder>> Create(const FileSpec &filename); void Record(const GDBRemotePacket &packet); }; class GDBRemoteProvider : public repro::Provider<GDBRemoteProvider> { public: struct Info { static const char *name; static const char *file; }; GDBRemoteProvider(const FileSpec &directory) : Provider(directory) {} llvm::raw_ostream *GetHistoryStream(); PacketRecorder *GetNewPacketRecorder(); void SetCallback(std::function<void()> callback) { m_callback = std::move(callback); } void Keep() override; void Discard() override; static char ID; private: std::function<void()> m_callback; std::unique_ptr<llvm::raw_fd_ostream> m_stream_up; std::vector<std::unique_ptr<PacketRecorder>> m_packet_recorders; }; } // namespace repro } // namespace lldb_private LLVM_YAML_IS_DOCUMENT_LIST_VECTOR(lldb_private::GDBRemotePacket) LLVM_YAML_IS_DOCUMENT_LIST_VECTOR(std::vector<lldb_private::GDBRemotePacket>) namespace llvm { namespace yaml { template <> struct ScalarEnumerationTraits<lldb_private::GDBRemotePacket::Type> { static void enumeration(IO &io, lldb_private::GDBRemotePacket::Type &value); }; template <> struct ScalarTraits<lldb_private::GDBRemotePacket::BinaryData> { static void output(const lldb_private::GDBRemotePacket::BinaryData &, void *, raw_ostream &); static StringRef input(StringRef, void *, lldb_private::GDBRemotePacket::BinaryData &); static QuotingType mustQuote(StringRef S) { return QuotingType::None; } }; template <> struct MappingTraits<lldb_private::GDBRemotePacket> { static void mapping(IO &io, lldb_private::GDBRemotePacket &Packet); static StringRef validate(IO &io, lldb_private::GDBRemotePacket &); }; } // namespace yaml } // namespace llvm #endif // LLDB_UTILITY_GDBREMOTE_H
Upload File
Create Folder