mirror of
https://github.com/capstone-engine/llvm-capstone.git
synced 2025-04-16 05:10:32 +00:00

*** to conform to clang-format’s LLVM style. This kind of mass change has *** two obvious implications: Firstly, merging this particular commit into a downstream fork may be a huge effort. Alternatively, it may be worth merging all changes up to this commit, performing the same reformatting operation locally, and then discarding the merge for this particular commit. The commands used to accomplish this reformatting were as follows (with current working directory as the root of the repository): find . \( -iname "*.c" -or -iname "*.cpp" -or -iname "*.h" -or -iname "*.mm" \) -exec clang-format -i {} + find . -iname "*.py" -exec autopep8 --in-place --aggressive --aggressive {} + ; The version of clang-format used was 3.9.0, and autopep8 was 1.2.4. Secondly, “blame” style tools will generally point to this commit instead of a meaningful prior commit. There are alternatives available that will attempt to look through this change and find the appropriate prior commit. YMMV. llvm-svn: 280751
158 lines
5.4 KiB
C++
158 lines
5.4 KiB
C++
//===-- GDBRemoteCommunicationServerCommon.h --------------------*- C++ -*-===//
|
|
//
|
|
// The LLVM Compiler Infrastructure
|
|
//
|
|
// This file is distributed under the University of Illinois Open Source
|
|
// License. See LICENSE.TXT for details.
|
|
//
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
#ifndef liblldb_GDBRemoteCommunicationServerCommon_h_
|
|
#define liblldb_GDBRemoteCommunicationServerCommon_h_
|
|
|
|
// C Includes
|
|
// C++ Includes
|
|
#include <string>
|
|
|
|
// Other libraries and framework includes
|
|
// Project includes
|
|
#include "lldb/Target/Process.h"
|
|
#include "lldb/lldb-private-forward.h"
|
|
|
|
#include "GDBRemoteCommunicationServer.h"
|
|
#include "GDBRemoteCommunicationServerCommon.h"
|
|
|
|
class StringExtractorGDBRemote;
|
|
|
|
namespace lldb_private {
|
|
namespace process_gdb_remote {
|
|
|
|
class ProcessGDBRemote;
|
|
|
|
class GDBRemoteCommunicationServerCommon : public GDBRemoteCommunicationServer {
|
|
public:
|
|
GDBRemoteCommunicationServerCommon(const char *comm_name,
|
|
const char *listener_name);
|
|
|
|
~GDBRemoteCommunicationServerCommon() override;
|
|
|
|
protected:
|
|
ProcessLaunchInfo m_process_launch_info;
|
|
Error m_process_launch_error;
|
|
ProcessInstanceInfoList m_proc_infos;
|
|
uint32_t m_proc_infos_index;
|
|
bool m_thread_suffix_supported;
|
|
bool m_list_threads_in_stop_reply;
|
|
|
|
PacketResult Handle_A(StringExtractorGDBRemote &packet);
|
|
|
|
PacketResult Handle_qHostInfo(StringExtractorGDBRemote &packet);
|
|
|
|
PacketResult Handle_qProcessInfoPID(StringExtractorGDBRemote &packet);
|
|
|
|
PacketResult Handle_qfProcessInfo(StringExtractorGDBRemote &packet);
|
|
|
|
PacketResult Handle_qsProcessInfo(StringExtractorGDBRemote &packet);
|
|
|
|
PacketResult Handle_qUserName(StringExtractorGDBRemote &packet);
|
|
|
|
PacketResult Handle_qGroupName(StringExtractorGDBRemote &packet);
|
|
|
|
PacketResult Handle_qSpeedTest(StringExtractorGDBRemote &packet);
|
|
|
|
PacketResult Handle_vFile_Open(StringExtractorGDBRemote &packet);
|
|
|
|
PacketResult Handle_vFile_Close(StringExtractorGDBRemote &packet);
|
|
|
|
PacketResult Handle_vFile_pRead(StringExtractorGDBRemote &packet);
|
|
|
|
PacketResult Handle_vFile_pWrite(StringExtractorGDBRemote &packet);
|
|
|
|
PacketResult Handle_vFile_Size(StringExtractorGDBRemote &packet);
|
|
|
|
PacketResult Handle_vFile_Mode(StringExtractorGDBRemote &packet);
|
|
|
|
PacketResult Handle_vFile_Exists(StringExtractorGDBRemote &packet);
|
|
|
|
PacketResult Handle_vFile_symlink(StringExtractorGDBRemote &packet);
|
|
|
|
PacketResult Handle_vFile_unlink(StringExtractorGDBRemote &packet);
|
|
|
|
PacketResult Handle_vFile_Stat(StringExtractorGDBRemote &packet);
|
|
|
|
PacketResult Handle_vFile_MD5(StringExtractorGDBRemote &packet);
|
|
|
|
PacketResult Handle_qEcho(StringExtractorGDBRemote &packet);
|
|
|
|
PacketResult Handle_qModuleInfo(StringExtractorGDBRemote &packet);
|
|
|
|
PacketResult Handle_qPlatform_shell(StringExtractorGDBRemote &packet);
|
|
|
|
PacketResult Handle_qPlatform_mkdir(StringExtractorGDBRemote &packet);
|
|
|
|
PacketResult Handle_qPlatform_chmod(StringExtractorGDBRemote &packet);
|
|
|
|
PacketResult Handle_qSupported(StringExtractorGDBRemote &packet);
|
|
|
|
PacketResult Handle_QThreadSuffixSupported(StringExtractorGDBRemote &packet);
|
|
|
|
PacketResult Handle_QListThreadsInStopReply(StringExtractorGDBRemote &packet);
|
|
|
|
PacketResult Handle_QSetDetachOnError(StringExtractorGDBRemote &packet);
|
|
|
|
PacketResult Handle_QStartNoAckMode(StringExtractorGDBRemote &packet);
|
|
|
|
PacketResult Handle_QSetSTDIN(StringExtractorGDBRemote &packet);
|
|
|
|
PacketResult Handle_QSetSTDOUT(StringExtractorGDBRemote &packet);
|
|
|
|
PacketResult Handle_QSetSTDERR(StringExtractorGDBRemote &packet);
|
|
|
|
PacketResult Handle_qLaunchSuccess(StringExtractorGDBRemote &packet);
|
|
|
|
PacketResult Handle_QEnvironment(StringExtractorGDBRemote &packet);
|
|
|
|
PacketResult Handle_QEnvironmentHexEncoded(StringExtractorGDBRemote &packet);
|
|
|
|
PacketResult Handle_QLaunchArch(StringExtractorGDBRemote &packet);
|
|
|
|
static void CreateProcessInfoResponse(const ProcessInstanceInfo &proc_info,
|
|
StreamString &response);
|
|
|
|
static void CreateProcessInfoResponse_DebugServerStyle(
|
|
const ProcessInstanceInfo &proc_info, StreamString &response);
|
|
|
|
template <typename T>
|
|
void RegisterMemberFunctionHandler(
|
|
StringExtractorGDBRemote::ServerPacketType packet_type,
|
|
PacketResult (T::*handler)(StringExtractorGDBRemote &packet)) {
|
|
RegisterPacketHandler(packet_type,
|
|
[this, handler](StringExtractorGDBRemote packet,
|
|
Error &error, bool &interrupt,
|
|
bool &quit) {
|
|
return (static_cast<T *>(this)->*handler)(packet);
|
|
});
|
|
}
|
|
|
|
//------------------------------------------------------------------
|
|
/// Launch a process with the current launch settings.
|
|
///
|
|
/// This method supports running an lldb-gdbserver or similar
|
|
/// server in a situation where the startup code has been provided
|
|
/// with all the information for a child process to be launched.
|
|
///
|
|
/// @return
|
|
/// An Error object indicating the success or failure of the
|
|
/// launch.
|
|
//------------------------------------------------------------------
|
|
virtual Error LaunchProcess() = 0;
|
|
|
|
virtual FileSpec FindModuleFile(const std::string &module_path,
|
|
const ArchSpec &arch);
|
|
};
|
|
|
|
} // namespace process_gdb_remote
|
|
} // namespace lldb_private
|
|
|
|
#endif // liblldb_GDBRemoteCommunicationServerCommon_h_
|