Imported Upstream version 6.10.0.49

Former-commit-id: 1d6753294b2993e1fbf92de9366bb9544db4189b
This commit is contained in:
Xamarin Public Jenkins (auto-signing)
2020-01-16 16:38:04 +00:00
parent d94e79959b
commit 468663ddbb
48518 changed files with 2789335 additions and 61176 deletions

View File

@@ -0,0 +1,35 @@
if ((CMAKE_SYSTEM_NAME MATCHES "Windows") OR
(CMAKE_SYSTEM_NAME MATCHES "NetBSD" ))
# These targets do not have getopt support, so they rely on the one provided by
# liblldb. However, getopt is not a part of the liblldb interface, so we have
# to link against the constituent libraries manually. Note that this is
# extremely scary as it introduces ODR violations, and it should go away as
# soon as possible.
set(host_lib lldbHost)
endif()
add_lldb_tool(lldb
Driver.cpp
Platform.cpp
LINK_LIBS
liblldb
${host_lib}
LINK_COMPONENTS
Support
)
if ( CMAKE_SYSTEM_NAME MATCHES "Windows" )
add_definitions( -DIMPORT_LIBLLDB )
endif()
# Add lldb dependency on lldb-server if we can use it.
if ( LLDB_CAN_USE_LLDB_SERVER )
add_dependencies(lldb lldb-server)
endif()
# Add lldb dependency on debugserver if we can use it.
if ( LLDB_CAN_USE_DEBUGSERVER )
add_dependencies(lldb debugserver)
endif()

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,125 @@
//===-- Driver.h ------------------------------------------------*- C++ -*-===//
//
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
#ifndef lldb_Driver_h_
#define lldb_Driver_h_
#include "Platform.h"
#include "lldb/Host/PseudoTerminal.h"
#include <bitset>
#include <set>
#include <string>
#include <vector>
#include "lldb/API/SBBroadcaster.h"
#include "lldb/API/SBDebugger.h"
#include "lldb/API/SBDefines.h"
#include "lldb/API/SBError.h"
class IOChannel;
class Driver : public lldb::SBBroadcaster {
public:
typedef enum CommandPlacement {
eCommandPlacementBeforeFile,
eCommandPlacementAfterFile,
eCommandPlacementAfterCrash,
} CommandPlacement;
Driver();
virtual ~Driver();
void MainLoop();
lldb::SBError ParseArgs(int argc, const char *argv[], FILE *out_fh,
bool &do_exit);
const char *GetFilename() const;
const char *GetCrashLogFilename() const;
const char *GetArchName() const;
lldb::ScriptLanguage GetScriptLanguage() const;
void WriteCommandsForSourcing(CommandPlacement placement,
lldb::SBStream &strm);
bool GetDebugMode() const;
class OptionData {
public:
OptionData();
~OptionData();
void Clear();
void AddInitialCommand(const char *command, CommandPlacement placement,
bool is_file, lldb::SBError &error);
// static OptionDefinition m_cmd_option_table[];
struct InitialCmdEntry {
InitialCmdEntry(const char *in_contents, bool in_is_file,
bool is_cwd_lldbinit_file_read, bool in_quiet = false)
: contents(in_contents), is_file(in_is_file),
is_cwd_lldbinit_file_read(is_cwd_lldbinit_file_read),
source_quietly(in_quiet) {}
std::string contents;
bool is_file;
bool is_cwd_lldbinit_file_read; // if this is reading ./.lldbinit - so we
// may skip if not permitted
bool source_quietly;
};
std::vector<std::string> m_args;
lldb::ScriptLanguage m_script_lang;
std::string m_core_file;
std::string m_crash_log;
std::vector<InitialCmdEntry> m_initial_commands;
std::vector<InitialCmdEntry> m_after_file_commands;
std::vector<InitialCmdEntry> m_after_crash_commands;
bool m_debug_mode;
bool m_source_quietly;
bool m_print_version;
bool m_print_python_path;
bool m_print_help;
bool m_wait_for;
bool m_repl;
lldb::LanguageType m_repl_lang;
std::string m_repl_options;
std::string m_process_name;
lldb::pid_t m_process_pid;
bool m_use_external_editor; // FIXME: When we have set/show variables we can
// remove this from here.
bool m_batch;
typedef std::set<char> OptionSet;
OptionSet m_seen_options;
};
static lldb::SBError SetOptionValue(int option_idx, const char *option_arg,
Driver::OptionData &data);
lldb::SBDebugger &GetDebugger() { return m_debugger; }
void ResizeWindow(unsigned short col);
private:
lldb::SBDebugger m_debugger;
OptionData m_option_data;
void ResetOptionValues();
void ReadyForCommand();
};
#endif // lldb_Driver_h_

View File

@@ -0,0 +1,60 @@
//===-- Platform.cpp --------------------------------------------*- C++ -*-===//
//
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
// this file is only relevant for Visual C++
#if defined(_WIN32)
#include <assert.h>
#include <process.h>
#include <stdlib.h>
#include "Platform.h"
#include "llvm/Support/ErrorHandling.h"
int ioctl(int d, int request, ...) {
switch (request) {
// request the console windows size
case (TIOCGWINSZ): {
va_list vl;
va_start(vl, request);
// locate the window size structure on stack
winsize *ws = va_arg(vl, winsize *);
// get screen buffer information
CONSOLE_SCREEN_BUFFER_INFO info;
if (GetConsoleScreenBufferInfo(GetStdHandle(STD_OUTPUT_HANDLE), &info) ==
TRUE)
// fill in the columns
ws->ws_col = info.dwMaximumWindowSize.X;
va_end(vl);
return 0;
} break;
default:
llvm_unreachable("Not implemented!");
}
}
int kill(pid_t pid, int sig) {
// is the app trying to kill itself
if (pid == getpid())
exit(sig);
//
llvm_unreachable("Not implemented!");
}
int tcsetattr(int fd, int optional_actions, const struct termios *termios_p) {
llvm_unreachable("Not implemented!");
}
int tcgetattr(int fildes, struct termios *termios_p) {
// assert( !"Not implemented!" );
// error return value (0=success)
return -1;
}
#endif

View File

@@ -0,0 +1,89 @@
//===-- Platform.h ----------------------------------------------*- C++ -*-===//
//
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
#ifndef lldb_Platform_h_
#define lldb_Platform_h_
#if defined(_WIN32)
#include "lldb/Host/HostGetOpt.h"
#include <io.h>
#if defined(_MSC_VER)
#include <signal.h>
#endif
#include "lldb/Host/windows/windows.h"
#include <inttypes.h>
struct winsize {
long ws_col;
};
typedef unsigned char cc_t;
typedef unsigned int speed_t;
typedef unsigned int tcflag_t;
// fcntl.h
#define O_NOCTTY 0400
// ioctls.h
#define TIOCGWINSZ 0x5413
// signal.h
#define SIGPIPE 13
#define SIGCONT 18
#define SIGTSTP 20
#define SIGWINCH 28
// tcsetattr arguments
#define TCSANOW 0
#define NCCS 32
struct termios {
tcflag_t c_iflag; // input mode flags
tcflag_t c_oflag; // output mode flags
tcflag_t c_cflag; // control mode flags
tcflag_t c_lflag; // local mode flags
cc_t c_line; // line discipline
cc_t c_cc[NCCS]; // control characters
speed_t c_ispeed; // input speed
speed_t c_ospeed; // output speed
};
#ifdef _MSC_VER
struct timeval {
long tv_sec;
long tv_usec;
};
typedef long pid_t;
#define snprintf _snprintf
#define PATH_MAX MAX_PATH
#endif
#define STDIN_FILENO 0
extern int ioctl(int d, int request, ...);
extern int kill(pid_t pid, int sig);
extern int tcsetattr(int fd, int optional_actions,
const struct termios *termios_p);
extern int tcgetattr(int fildes, struct termios *termios_p);
#else
#include "lldb/Host/HostGetOpt.h"
#include <inttypes.h>
#include <libgen.h>
#include <sys/ioctl.h>
#include <termios.h>
#include <unistd.h>
#include <pthread.h>
#include <sys/time.h>
#endif
#endif // lldb_Platform_h_

View File

@@ -0,0 +1,21 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>English</string>
<key>CFBundleIdentifier</key>
<string>com.apple.lldb</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>lldb</string>
<key>CFBundleVersion</key>
<string>360.99.0</string>
<key>SecTaskAccess</key>
<array>
<string>allowed</string>
<string>debug</string>
</array>
</dict>
</plist>