Vendor import of lldb trunk r291274:
https://llvm.org/svn/llvm-project/lldb/trunk@291274
This commit is contained in:
parent
cce7c2b0d2
commit
a4092fcbfb
@ -52,8 +52,7 @@ class MappedHash {
|
||||
default:
|
||||
break;
|
||||
}
|
||||
assert(!"Invalid hash function index");
|
||||
return 0;
|
||||
llvm_unreachable("Invalid hash function index");
|
||||
}
|
||||
|
||||
static const uint32_t HASH_MAGIC = 0x48415348u;
|
||||
|
@ -322,6 +322,8 @@ class Editline {
|
||||
/// single or multi-line editing.
|
||||
void ConfigureEditor(bool multiline);
|
||||
|
||||
bool CompleteCharacter(char ch, EditLineCharType &out);
|
||||
|
||||
private:
|
||||
#if LLDB_EDITLINE_USE_WCHAR
|
||||
std::wstring_convert<std::codecvt_utf8<wchar_t>> m_utf8conv;
|
||||
|
@ -0,0 +1,37 @@
|
||||
"""
|
||||
Test lldb-mi -environment-cd command.
|
||||
"""
|
||||
|
||||
from __future__ import print_function
|
||||
|
||||
|
||||
import lldbmi_testcase
|
||||
from lldbsuite.test.decorators import *
|
||||
from lldbsuite.test.lldbtest import *
|
||||
from lldbsuite.test import lldbutil
|
||||
|
||||
|
||||
class MiEnvironmentCdTestCase(lldbmi_testcase.MiTestCaseBase):
|
||||
|
||||
mydir = TestBase.compute_mydir(__file__)
|
||||
|
||||
@skipIfWindows # llvm.org/pr24452: Get lldb-mi tests working on Windows
|
||||
@skipIfFreeBSD # llvm.org/pr22411: Failure presumably due to known thread races
|
||||
@skipIfDarwin # Disabled while I investigate the failure on buildbot.
|
||||
def test_lldbmi_environment_cd(self):
|
||||
"""Test that 'lldb-mi --interpreter' changes working directory for inferior."""
|
||||
|
||||
self.spawnLldbMi(args=None)
|
||||
|
||||
# Load executable
|
||||
self.runCmd("-file-exec-and-symbols %s" % self.myexe)
|
||||
self.expect("\^done")
|
||||
|
||||
# cd to a different directory
|
||||
self.runCmd("-environment-cd /tmp")
|
||||
self.expect("\^done")
|
||||
|
||||
# Run to the end
|
||||
self.runCmd("-exec-run")
|
||||
self.expect("\^running")
|
||||
self.expect("@\"cwd: /tmp\\r\\n\"", exactly=True)
|
@ -208,3 +208,44 @@ def test_lldbmi_gdb_set_ouptut_radix(self):
|
||||
self.expect("\^done")
|
||||
self.runCmd("-var-evaluate-expression var_a")
|
||||
self.expect("\^done,value=\"10\"")
|
||||
|
||||
@skipIfWindows # llvm.org/pr24452: Get lldb-mi tests working on Windows
|
||||
@skipIfFreeBSD # llvm.org/pr22411: Failure presumably due to known thread races
|
||||
@expectedFailureAll(
|
||||
bugnumber="llvm.org/pr31485: data-disassemble doesn't follow flavor settings")
|
||||
def test_lldbmi_gdb_set_disassembly_flavor(self):
|
||||
"""Test that 'lldb-mi --interpreter' works for -gdb-set disassembly-flavor."""
|
||||
|
||||
self.spawnLldbMi(args=None)
|
||||
|
||||
# Load executable
|
||||
self.runCmd("-file-exec-and-symbols %s" % self.myexe)
|
||||
self.expect("\^done")
|
||||
|
||||
# Run to BP_printf
|
||||
line = line_number('main.cpp', '// BP_printf')
|
||||
self.runCmd("-break-insert main.cpp:%d" % line)
|
||||
self.expect("\^done,bkpt={number=\"1\"")
|
||||
self.runCmd("-exec-run")
|
||||
self.expect("\^running")
|
||||
self.expect("\*stopped,reason=\"breakpoint-hit\".+addr=\"(0x[0-9a-f]+)\"")
|
||||
|
||||
# Get starting and ending address from $pc
|
||||
pc = int(self.child.match.group(1), base=16)
|
||||
s_addr, e_addr = pc, pc + 1
|
||||
|
||||
# Test default output (att)
|
||||
self.runCmd("-data-disassemble -s %d -e %d -- 0" % (s_addr, e_addr))
|
||||
self.expect("movl ")
|
||||
|
||||
# Test intel style
|
||||
self.runCmd("-gdb-set disassembly-flavor intel")
|
||||
self.expect("\^done")
|
||||
self.runCmd("-data-disassemble -s %d -e %d -- 0" % (s_addr, e_addr))
|
||||
self.expect("mov ")
|
||||
|
||||
# Test AT&T style
|
||||
self.runCmd("-gdb-set disassembly-flavor intel")
|
||||
self.expect("\^done")
|
||||
self.runCmd("-data-disassemble -s %d -e %d -- 0" % (s_addr, e_addr))
|
||||
self.expect("movl ")
|
||||
|
@ -111,24 +111,25 @@ def test_lldbmi_exec_arguments_set(self):
|
||||
self.expect("\*stopped,reason=\"breakpoint-hit\"")
|
||||
|
||||
# Check argc and argv to see if arg passed
|
||||
# Note that exactly=True is needed to avoid extra escaping for re
|
||||
self.runCmd("-data-evaluate-expression argc")
|
||||
self.expect("\^done,value=\"5\"")
|
||||
#self.runCmd("-data-evaluate-expression argv[1]")
|
||||
# self.expect("\^done,value=\"--arg1\"")
|
||||
self.runCmd("-interpreter-exec command \"print argv[1]\"")
|
||||
self.expect("\"--arg1\"")
|
||||
self.expect("\\\"--arg1\\\"", exactly=True)
|
||||
#self.runCmd("-data-evaluate-expression argv[2]")
|
||||
#self.expect("\^done,value=\"2nd arg\"")
|
||||
self.runCmd("-interpreter-exec command \"print argv[2]\"")
|
||||
self.expect("\"2nd arg\"")
|
||||
self.expect("\\\"2nd arg\\\"", exactly=True)
|
||||
#self.runCmd("-data-evaluate-expression argv[3]")
|
||||
# self.expect("\^done,value=\"third_arg\"")
|
||||
self.runCmd("-interpreter-exec command \"print argv[3]\"")
|
||||
self.expect("\"third_arg\"")
|
||||
self.expect("\\\"third_arg\\\"", exactly=True)
|
||||
#self.runCmd("-data-evaluate-expression argv[4]")
|
||||
#self.expect("\^done,value=\"fourth=\\\\\\\"4th arg\\\\\\\"\"")
|
||||
self.runCmd("-interpreter-exec command \"print argv[4]\"")
|
||||
self.expect("\"fourth=\\\\\\\"4th arg\\\\\\\"\"")
|
||||
self.expect("\\\"fourth=\\\\\\\"4th arg\\\\\\\"\\\"", exactly=True)
|
||||
|
||||
@skipIfWindows # llvm.org/pr24452: Get lldb-mi tests working on Windows
|
||||
@skipIfFreeBSD # llvm.org/pr22411: Failure presumably due to known thread races
|
||||
|
@ -9,11 +9,25 @@
|
||||
|
||||
#include <cstdio>
|
||||
|
||||
#ifdef _WIN32
|
||||
#include <direct.h>
|
||||
#define getcwd _getcwd // suppress "deprecation" warning
|
||||
#else
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
|
||||
int
|
||||
main(int argc, char const *argv[])
|
||||
{
|
||||
int a = 10;
|
||||
int a = 10;
|
||||
|
||||
char buf[512];
|
||||
char *ans = getcwd(buf, sizeof(buf));
|
||||
if (ans) {
|
||||
printf("cwd: %s\n", ans);
|
||||
}
|
||||
|
||||
printf("argc=%d\n", argc); // BP_printf
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
@ -97,6 +97,7 @@ def test_lldbmi_output_grammar(self):
|
||||
|
||||
# Run all commands simultaneously
|
||||
self.runCmd("-unknown-command")
|
||||
self.runCmd("-interpreter-exec command help")
|
||||
self.runCmd("-file-exec-and-symbols %s" % self.myexe)
|
||||
self.runCmd("-break-insert -f main")
|
||||
self.runCmd("-gdb-set target-async off")
|
||||
|
@ -258,8 +258,7 @@ uint32_t DataEncoder::PutMaxU64(uint32_t offset, uint32_t byte_size,
|
||||
case 8:
|
||||
return PutU64(offset, value);
|
||||
default:
|
||||
assert(!"GetMax64 unhandled case!");
|
||||
break;
|
||||
llvm_unreachable("GetMax64 unhandled case!");
|
||||
}
|
||||
return UINT32_MAX;
|
||||
}
|
||||
|
@ -165,8 +165,7 @@ bool ValueObjectMemory::UpdateValue() {
|
||||
|
||||
switch (value_type) {
|
||||
default:
|
||||
assert(!"Unhandled expression result value kind...");
|
||||
break;
|
||||
llvm_unreachable("Unhandled expression result value kind...");
|
||||
|
||||
case Value::eValueTypeScalar:
|
||||
// The variable value is in the Scalar value inside the m_value.
|
||||
|
@ -1602,25 +1602,23 @@ bool IRInterpreter::Interpret(llvm::Module &module, llvm::Function &function,
|
||||
lldb::addr_t addr = tmp_op.ULongLong();
|
||||
size_t dataSize = 0;
|
||||
|
||||
if (execution_unit.GetAllocSize(addr, dataSize)) {
|
||||
// Create the required buffer
|
||||
rawArgs[i].size = dataSize;
|
||||
rawArgs[i].data_ap.reset(new uint8_t[dataSize + 1]);
|
||||
bool Success = execution_unit.GetAllocSize(addr, dataSize);
|
||||
(void)Success;
|
||||
assert(Success &&
|
||||
"unable to locate host data for transfer to device");
|
||||
// Create the required buffer
|
||||
rawArgs[i].size = dataSize;
|
||||
rawArgs[i].data_ap.reset(new uint8_t[dataSize + 1]);
|
||||
|
||||
// Read string from host memory
|
||||
execution_unit.ReadMemory(rawArgs[i].data_ap.get(), addr, dataSize,
|
||||
error);
|
||||
if (error.Fail()) {
|
||||
assert(!"we have failed to read the string from memory");
|
||||
return false;
|
||||
}
|
||||
// Add null terminator
|
||||
rawArgs[i].data_ap[dataSize] = '\0';
|
||||
rawArgs[i].type = lldb_private::ABI::CallArgument::HostPointer;
|
||||
} else {
|
||||
assert(!"unable to locate host data for transfer to device");
|
||||
return false;
|
||||
}
|
||||
// Read string from host memory
|
||||
execution_unit.ReadMemory(rawArgs[i].data_ap.get(), addr, dataSize,
|
||||
error);
|
||||
assert(!error.Fail() &&
|
||||
"we have failed to read the string from memory");
|
||||
|
||||
// Add null terminator
|
||||
rawArgs[i].data_ap[dataSize] = '\0';
|
||||
rawArgs[i].type = lldb_private::ABI::CallArgument::HostPointer;
|
||||
} else /* if ( arg_ty->isPointerTy() ) */
|
||||
{
|
||||
rawArgs[i].type = lldb_private::ABI::CallArgument::TargetValue;
|
||||
|
@ -126,7 +126,7 @@ lldb::addr_t IRMemoryMap::FindSpace(size_t size) {
|
||||
err = process_sp->GetMemoryRegionInfo(
|
||||
region_info.GetRange().GetRangeEnd(), region_info);
|
||||
if (err.Fail()) {
|
||||
lldbassert(!"GetMemoryRegionInfo() succeeded, then failed");
|
||||
lldbassert(0 && "GetMemoryRegionInfo() succeeded, then failed");
|
||||
ret = LLDB_INVALID_ADDRESS;
|
||||
break;
|
||||
}
|
||||
|
@ -526,17 +526,8 @@ int Editline::GetCharacter(EditLineCharType *c) {
|
||||
}
|
||||
|
||||
if (read_count) {
|
||||
#if LLDB_EDITLINE_USE_WCHAR
|
||||
// After the initial interruptible read, this is guaranteed not to block
|
||||
ungetc(ch, m_input_file);
|
||||
*c = fgetwc(m_input_file);
|
||||
if (*c != WEOF)
|
||||
if (CompleteCharacter(ch, *c))
|
||||
return 1;
|
||||
#else
|
||||
*c = ch;
|
||||
if (ch != (char)EOF)
|
||||
return 1;
|
||||
#endif
|
||||
} else {
|
||||
switch (status) {
|
||||
case lldb::eConnectionStatusSuccess: // Success
|
||||
@ -1367,3 +1358,39 @@ void Editline::PrintAsync(Stream *stream, const char *s, size_t len) {
|
||||
MoveCursor(CursorLocation::BlockEnd, CursorLocation::EditingCursor);
|
||||
}
|
||||
}
|
||||
|
||||
bool Editline::CompleteCharacter(char ch, EditLineCharType &out) {
|
||||
#if !LLDB_EDITLINE_USE_WCHAR
|
||||
if (ch == (char)EOF)
|
||||
return false;
|
||||
|
||||
out = ch;
|
||||
return true;
|
||||
#else
|
||||
std::codecvt_utf8<wchar_t> cvt;
|
||||
llvm::SmallString<4> input;
|
||||
for (;;) {
|
||||
const char *from_next;
|
||||
wchar_t *to_next;
|
||||
std::mbstate_t state = std::mbstate_t();
|
||||
input.push_back(ch);
|
||||
switch (cvt.in(state, input.begin(), input.end(), from_next, &out, &out + 1,
|
||||
to_next)) {
|
||||
case std::codecvt_base::ok:
|
||||
return out != WEOF;
|
||||
|
||||
case std::codecvt_base::error:
|
||||
case std::codecvt_base::noconv:
|
||||
return false;
|
||||
|
||||
case std::codecvt_base::partial:
|
||||
lldb::ConnectionStatus status;
|
||||
size_t read_count = m_input_connection.Read(
|
||||
&ch, 1, std::chrono::seconds(0), status, nullptr);
|
||||
if (read_count == 0)
|
||||
return false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
@ -13,6 +13,7 @@
|
||||
#include "lldb/Host/windows/windows.h"
|
||||
|
||||
#include "lldb/Host/windows/editlinewin.h"
|
||||
#include "llvm/Support/ErrorHandling.h"
|
||||
#include <assert.h>
|
||||
#include <vector>
|
||||
|
||||
@ -285,11 +286,10 @@ void el_end(EditLine *el) {
|
||||
// assert( !"Not implemented!" );
|
||||
}
|
||||
|
||||
void el_reset(EditLine *) { assert(!"Not implemented!"); }
|
||||
void el_reset(EditLine *) { llvm_unreachable("Not implemented!"); }
|
||||
|
||||
int el_getc(EditLine *, char *) {
|
||||
assert(!"Not implemented!");
|
||||
return 0;
|
||||
llvm_unreachable("Not implemented!");
|
||||
}
|
||||
|
||||
void el_push(EditLine *, const char *) {}
|
||||
@ -297,8 +297,7 @@ void el_push(EditLine *, const char *) {}
|
||||
void el_beep(EditLine *) { Beep(1000, 500); }
|
||||
|
||||
int el_parse(EditLine *, int, const char **) {
|
||||
assert(!"Not implemented!");
|
||||
return 0;
|
||||
llvm_unreachable("Not implemented!");
|
||||
}
|
||||
|
||||
int el_get(EditLine *el, int code, ...) {
|
||||
@ -311,7 +310,7 @@ int el_get(EditLine *el, int code, ...) {
|
||||
*dout = clientData;
|
||||
} break;
|
||||
default:
|
||||
assert(!"Not implemented!");
|
||||
llvm_unreachable("Not implemented!");
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
@ -322,7 +321,7 @@ int el_source(EditLine *el, const char *file) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
void el_resize(EditLine *) { assert(!"Not implemented!"); }
|
||||
void el_resize(EditLine *) { llvm_unreachable("Not implemented!"); }
|
||||
|
||||
const LineInfo *el_line(EditLine *el) { return 0; }
|
||||
|
||||
@ -331,7 +330,7 @@ int el_insertstr(EditLine *, const char *) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
void el_deletestr(EditLine *, int) { assert(!"Not implemented!"); }
|
||||
void el_deletestr(EditLine *, int) { llvm_unreachable("Not implemented!"); }
|
||||
|
||||
History *history_init(void) {
|
||||
// return dummy handle
|
||||
|
@ -584,8 +584,7 @@ Error OptionValueProperties::DumpPropertyValue(const ExecutionContext *exe_ctx,
|
||||
}
|
||||
|
||||
lldb::OptionValueSP OptionValueProperties::DeepCopy() const {
|
||||
assert(!"this shouldn't happen");
|
||||
return lldb::OptionValueSP();
|
||||
llvm_unreachable("this shouldn't happen");
|
||||
}
|
||||
|
||||
const Property *OptionValueProperties::GetPropertyAtPath(
|
||||
|
@ -64,10 +64,10 @@ class StoringDiagnosticConsumer : public clang::DiagnosticConsumer {
|
||||
class ClangModulesDeclVendorImpl : public ClangModulesDeclVendor {
|
||||
public:
|
||||
ClangModulesDeclVendorImpl(
|
||||
llvm::IntrusiveRefCntPtr<clang::DiagnosticsEngine> &diagnostics_engine,
|
||||
llvm::IntrusiveRefCntPtr<clang::CompilerInvocation> &compiler_invocation,
|
||||
std::unique_ptr<clang::CompilerInstance> &&compiler_instance,
|
||||
std::unique_ptr<clang::Parser> &&parser);
|
||||
llvm::IntrusiveRefCntPtr<clang::DiagnosticsEngine> diagnostics_engine,
|
||||
std::shared_ptr<clang::CompilerInvocation> compiler_invocation,
|
||||
std::unique_ptr<clang::CompilerInstance> compiler_instance,
|
||||
std::unique_ptr<clang::Parser> parser);
|
||||
|
||||
~ClangModulesDeclVendorImpl() override = default;
|
||||
|
||||
@ -96,7 +96,7 @@ class ClangModulesDeclVendorImpl : public ClangModulesDeclVendor {
|
||||
bool m_enabled = false;
|
||||
|
||||
llvm::IntrusiveRefCntPtr<clang::DiagnosticsEngine> m_diagnostics_engine;
|
||||
llvm::IntrusiveRefCntPtr<clang::CompilerInvocation> m_compiler_invocation;
|
||||
std::shared_ptr<clang::CompilerInvocation> m_compiler_invocation;
|
||||
std::unique_ptr<clang::CompilerInstance> m_compiler_instance;
|
||||
std::unique_ptr<clang::Parser> m_parser;
|
||||
size_t m_source_location_index =
|
||||
@ -157,14 +157,14 @@ ClangModulesDeclVendor::ClangModulesDeclVendor() {}
|
||||
ClangModulesDeclVendor::~ClangModulesDeclVendor() {}
|
||||
|
||||
ClangModulesDeclVendorImpl::ClangModulesDeclVendorImpl(
|
||||
llvm::IntrusiveRefCntPtr<clang::DiagnosticsEngine> &diagnostics_engine,
|
||||
llvm::IntrusiveRefCntPtr<clang::CompilerInvocation> &compiler_invocation,
|
||||
std::unique_ptr<clang::CompilerInstance> &&compiler_instance,
|
||||
std::unique_ptr<clang::Parser> &&parser)
|
||||
: ClangModulesDeclVendor(), m_diagnostics_engine(diagnostics_engine),
|
||||
m_compiler_invocation(compiler_invocation),
|
||||
llvm::IntrusiveRefCntPtr<clang::DiagnosticsEngine> diagnostics_engine,
|
||||
std::shared_ptr<clang::CompilerInvocation> compiler_invocation,
|
||||
std::unique_ptr<clang::CompilerInstance> compiler_instance,
|
||||
std::unique_ptr<clang::Parser> parser)
|
||||
: m_diagnostics_engine(std::move(diagnostics_engine)),
|
||||
m_compiler_invocation(std::move(compiler_invocation)),
|
||||
m_compiler_instance(std::move(compiler_instance)),
|
||||
m_parser(std::move(parser)), m_imported_modules() {}
|
||||
m_parser(std::move(parser)) {}
|
||||
|
||||
void ClangModulesDeclVendorImpl::ReportModuleExportsHelper(
|
||||
std::set<ClangModulesDeclVendor::ModuleID> &exports,
|
||||
@ -498,7 +498,7 @@ void ClangModulesDeclVendorImpl::ForEachMacro(
|
||||
ti->getLocation(), &invalid);
|
||||
|
||||
if (invalid) {
|
||||
lldbassert(!"Unhandled token kind");
|
||||
lldbassert(0 && "Unhandled token kind");
|
||||
macro_expansion.append("<unknown literal value>");
|
||||
} else {
|
||||
macro_expansion.append(
|
||||
@ -621,9 +621,9 @@ ClangModulesDeclVendor::Create(Target &target) {
|
||||
compiler_invocation_argument_cstrs.push_back(arg.c_str());
|
||||
}
|
||||
|
||||
llvm::IntrusiveRefCntPtr<clang::CompilerInvocation> invocation(
|
||||
std::shared_ptr<clang::CompilerInvocation> invocation =
|
||||
clang::createInvocationFromCommandLine(compiler_invocation_argument_cstrs,
|
||||
diagnostics_engine));
|
||||
diagnostics_engine);
|
||||
|
||||
if (!invocation)
|
||||
return nullptr;
|
||||
@ -640,7 +640,7 @@ ClangModulesDeclVendor::Create(Target &target) {
|
||||
new clang::CompilerInstance);
|
||||
|
||||
instance->setDiagnostics(diagnostics_engine.get());
|
||||
instance->setInvocation(invocation.get());
|
||||
instance->setInvocation(invocation);
|
||||
|
||||
std::unique_ptr<clang::FrontendAction> action(new clang::SyntaxOnlyAction);
|
||||
|
||||
@ -674,6 +674,7 @@ ClangModulesDeclVendor::Create(Target &target) {
|
||||
while (!parser->ParseTopLevelDecl(parsed))
|
||||
;
|
||||
|
||||
return new ClangModulesDeclVendorImpl(diagnostics_engine, invocation,
|
||||
return new ClangModulesDeclVendorImpl(std::move(diagnostics_engine),
|
||||
std::move(invocation),
|
||||
std::move(instance), std::move(parser));
|
||||
}
|
||||
|
@ -196,8 +196,8 @@ bool fixupX86StructRetCalls(llvm::Module &module) {
|
||||
llvm::AllocaInst *new_func_ptr =
|
||||
new llvm::AllocaInst(new_func_ptr_type, "new_func_ptr", call_inst);
|
||||
// store the new_func_cast to the newly allocated space
|
||||
(void)new llvm::StoreInst(new_func_cast, new_func_ptr,
|
||||
"new_func_ptr_load_cast", call_inst);
|
||||
(new llvm::StoreInst(new_func_cast, new_func_ptr, call_inst))
|
||||
->setName("new_func_ptr_load_cast");
|
||||
// load the new function address ready for a jump
|
||||
llvm::LoadInst *new_func_addr_load =
|
||||
new llvm::LoadInst(new_func_ptr, "load_func_pointer", call_inst);
|
||||
|
@ -480,8 +480,7 @@ Error ProcessKDP::DoResume() {
|
||||
|
||||
default:
|
||||
// The only valid thread resume states are listed above
|
||||
assert(!"invalid thread resume state");
|
||||
break;
|
||||
llvm_unreachable("invalid thread resume state");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -116,8 +116,7 @@ ThreadKDP::CreateRegisterContextForFrame(StackFrame *frame) {
|
||||
new RegisterContextKDP_x86_64(*this, concrete_frame_idx));
|
||||
break;
|
||||
default:
|
||||
assert(!"Add CPU type support in KDP");
|
||||
break;
|
||||
llvm_unreachable("Add CPU type support in KDP");
|
||||
}
|
||||
}
|
||||
} else {
|
||||
|
@ -21,6 +21,7 @@ void AppendFaultAddr(std::string &str, lldb::addr_t addr) {
|
||||
str += ss.str();
|
||||
}
|
||||
|
||||
#if defined(si_lower) && defined(si_upper)
|
||||
void AppendBounds(std::string &str, lldb::addr_t lower_bound,
|
||||
lldb::addr_t upper_bound, lldb::addr_t addr) {
|
||||
llvm::raw_string_ostream stream(str);
|
||||
@ -37,6 +38,7 @@ void AppendBounds(std::string &str, lldb::addr_t lower_bound,
|
||||
stream << ")";
|
||||
stream.flush();
|
||||
}
|
||||
#endif
|
||||
|
||||
CrashReason GetCrashReasonForSIGSEGV(const siginfo_t &info) {
|
||||
assert(info.si_signo == SIGSEGV);
|
||||
|
@ -167,7 +167,7 @@ DynamicRegisterInfo::SetRegisterInfo(const StructuredData::Dictionary &dict,
|
||||
reg_info.byte_offset =
|
||||
containing_reg_info->byte_offset + msbyte;
|
||||
} else {
|
||||
assert(!"Invalid byte order");
|
||||
llvm_unreachable("Invalid byte order");
|
||||
}
|
||||
} else {
|
||||
if (msbit > max_bit)
|
||||
|
@ -1053,8 +1053,7 @@ bool RegisterContextLLDB::ReadRegisterValueFromRegisterLocation(
|
||||
case UnwindLLDB::RegisterLocation::eRegisterNotSaved:
|
||||
break;
|
||||
case UnwindLLDB::RegisterLocation::eRegisterSavedAtHostMemoryLocation:
|
||||
assert("FIXME debugger inferior function call unwind");
|
||||
break;
|
||||
llvm_unreachable("FIXME debugger inferior function call unwind");
|
||||
case UnwindLLDB::RegisterLocation::eRegisterSavedAtMemoryLocation: {
|
||||
Error error(ReadRegisterValueFromMemory(
|
||||
reg_info, regloc.location.target_memory_location, reg_info->byte_size,
|
||||
@ -1062,8 +1061,7 @@ bool RegisterContextLLDB::ReadRegisterValueFromRegisterLocation(
|
||||
success = error.Success();
|
||||
} break;
|
||||
default:
|
||||
assert("Unknown RegisterLocation type.");
|
||||
break;
|
||||
llvm_unreachable("Unknown RegisterLocation type.");
|
||||
}
|
||||
return success;
|
||||
}
|
||||
@ -1097,8 +1095,7 @@ bool RegisterContextLLDB::WriteRegisterValueToRegisterLocation(
|
||||
case UnwindLLDB::RegisterLocation::eRegisterNotSaved:
|
||||
break;
|
||||
case UnwindLLDB::RegisterLocation::eRegisterSavedAtHostMemoryLocation:
|
||||
assert("FIXME debugger inferior function call unwind");
|
||||
break;
|
||||
llvm_unreachable("FIXME debugger inferior function call unwind");
|
||||
case UnwindLLDB::RegisterLocation::eRegisterSavedAtMemoryLocation: {
|
||||
Error error(WriteRegisterValueToMemory(
|
||||
reg_info, regloc.location.target_memory_location, reg_info->byte_size,
|
||||
@ -1106,8 +1103,7 @@ bool RegisterContextLLDB::WriteRegisterValueToRegisterLocation(
|
||||
success = error.Success();
|
||||
} break;
|
||||
default:
|
||||
assert("Unknown RegisterLocation type.");
|
||||
break;
|
||||
llvm_unreachable("Unknown RegisterLocation type.");
|
||||
}
|
||||
return success;
|
||||
}
|
||||
|
@ -2599,10 +2599,7 @@ size_t GDBRemoteCommunicationClient::GetCurrentThreadIDs(
|
||||
thread_ids.push_back(1);
|
||||
}
|
||||
} else {
|
||||
#if defined(LLDB_CONFIGURATION_DEBUG)
|
||||
// assert(!"ProcessGDBRemote::UpdateThreadList() failed due to not getting the
|
||||
// sequence mutex");
|
||||
#else
|
||||
#if !defined(LLDB_CONFIGURATION_DEBUG)
|
||||
Log *log(ProcessGDBRemoteLog::GetLogIfAnyCategoryIsSet(GDBR_LOG_PROCESS |
|
||||
GDBR_LOG_PACKETS));
|
||||
if (log)
|
||||
@ -3246,7 +3243,7 @@ GDBRemoteCommunicationClient::GetModulesInfo(
|
||||
JSONObject::SP module_sp = std::make_shared<JSONObject>();
|
||||
module_array_sp->AppendObject(module_sp);
|
||||
module_sp->SetObject(
|
||||
"file", std::make_shared<JSONString>(module_file_spec.GetPath()));
|
||||
"file", std::make_shared<JSONString>(module_file_spec.GetPath(false)));
|
||||
module_sp->SetObject("triple",
|
||||
std::make_shared<JSONString>(triple.getTriple()));
|
||||
}
|
||||
|
@ -1599,12 +1599,7 @@ StructuredData::ArraySP ScriptInterpreterPython::OSPlugin_ThreadsInfo(
|
||||
// as the underlying typedef for uint* types, size_t, off_t and other values
|
||||
// change.
|
||||
|
||||
template <typename T> const char *GetPythonValueFormatString(T t) {
|
||||
assert(!"Unhandled type passed to GetPythonValueFormatString(T), make a "
|
||||
"specialization of GetPythonValueFormatString() to support this "
|
||||
"type.");
|
||||
return nullptr;
|
||||
}
|
||||
template <typename T> const char *GetPythonValueFormatString(T t);
|
||||
template <> const char *GetPythonValueFormatString(char *) { return "s"; }
|
||||
template <> const char *GetPythonValueFormatString(char) { return "b"; }
|
||||
template <> const char *GetPythonValueFormatString(unsigned char) {
|
||||
|
@ -65,8 +65,7 @@ bool DWARFDebugRanges::Extract(SymbolFileDWARF *dwarf2Data,
|
||||
break;
|
||||
|
||||
default:
|
||||
assert(!"DWARFRangeList::Extract() unsupported address size.");
|
||||
break;
|
||||
llvm_unreachable("DWARFRangeList::Extract() unsupported address size.");
|
||||
}
|
||||
|
||||
// Filter out empty ranges
|
||||
|
@ -734,12 +734,11 @@ int DWARFFormValue::Compare(const DWARFFormValue &a_value,
|
||||
}
|
||||
|
||||
case DW_FORM_indirect:
|
||||
assert(!"This shouldn't happen after the form has been extracted...");
|
||||
break;
|
||||
llvm_unreachable(
|
||||
"This shouldn't happen after the form has been extracted...");
|
||||
|
||||
default:
|
||||
assert(!"Unhandled DW_FORM");
|
||||
break;
|
||||
llvm_unreachable("Unhandled DW_FORM");
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
@ -167,8 +167,7 @@ void DWARFMappedHash::Prologue::AppendAtom(AtomType type, dw_form_t form) {
|
||||
case DW_FORM_exprloc:
|
||||
case DW_FORM_flag_present:
|
||||
case DW_FORM_ref_sig8:
|
||||
assert(!"Unhandled atom form");
|
||||
break;
|
||||
llvm_unreachable("Unhandled atom form");
|
||||
|
||||
case DW_FORM_string:
|
||||
case DW_FORM_block:
|
||||
|
@ -1253,8 +1253,7 @@ SymbolFileDWARFDebugMap::GetCompileUnit(SymbolFileDWARF *oso_dwarf) {
|
||||
}
|
||||
}
|
||||
}
|
||||
assert(!"this shouldn't happen");
|
||||
return lldb::CompUnitSP();
|
||||
llvm_unreachable("this shouldn't happen");
|
||||
}
|
||||
|
||||
SymbolFileDWARFDebugMap::CompileUnitInfo *
|
||||
|
@ -442,15 +442,14 @@ size_t UnwindAssemblyInstEmulation::WriteMemory(
|
||||
case EmulateInstruction::eContextPushRegisterOnStack: {
|
||||
uint32_t reg_num = LLDB_INVALID_REGNUM;
|
||||
uint32_t generic_regnum = LLDB_INVALID_REGNUM;
|
||||
if (context.info_type ==
|
||||
EmulateInstruction::eInfoTypeRegisterToRegisterPlusOffset) {
|
||||
const uint32_t unwind_reg_kind = m_unwind_plan_ptr->GetRegisterKind();
|
||||
reg_num = context.info.RegisterToRegisterPlusOffset.data_reg
|
||||
.kinds[unwind_reg_kind];
|
||||
generic_regnum = context.info.RegisterToRegisterPlusOffset.data_reg
|
||||
.kinds[eRegisterKindGeneric];
|
||||
} else
|
||||
assert(!"unhandled case, add code to handle this!");
|
||||
assert(context.info_type ==
|
||||
EmulateInstruction::eInfoTypeRegisterToRegisterPlusOffset &&
|
||||
"unhandled case, add code to handle this!");
|
||||
const uint32_t unwind_reg_kind = m_unwind_plan_ptr->GetRegisterKind();
|
||||
reg_num = context.info.RegisterToRegisterPlusOffset.data_reg
|
||||
.kinds[unwind_reg_kind];
|
||||
generic_regnum = context.info.RegisterToRegisterPlusOffset.data_reg
|
||||
.kinds[eRegisterKindGeneric];
|
||||
|
||||
if (reg_num != LLDB_INVALID_REGNUM &&
|
||||
generic_regnum != LLDB_REGNUM_GENERIC_SP) {
|
||||
|
@ -390,7 +390,7 @@ static void ParseLangArgs(LangOptions &Opts, InputKind IK, const char *triple) {
|
||||
case IK_AST:
|
||||
case IK_LLVM_IR:
|
||||
case IK_RenderScript:
|
||||
assert(!"Invalid input kind!");
|
||||
llvm_unreachable("Invalid input kind!");
|
||||
case IK_OpenCL:
|
||||
LangStd = LangStandard::lang_opencl;
|
||||
break;
|
||||
@ -2119,7 +2119,7 @@ CompilerType ClangASTContext::CreateStructForIdentifier(
|
||||
if (!type_name.IsEmpty() &&
|
||||
(type = GetTypeForIdentifier<clang::CXXRecordDecl>(type_name))
|
||||
.IsValid()) {
|
||||
lldbassert("Trying to create a type for an existing name");
|
||||
lldbassert(0 && "Trying to create a type for an existing name");
|
||||
return type;
|
||||
}
|
||||
|
||||
@ -7568,8 +7568,7 @@ ClangASTContext::GetTemplateArgument(lldb::opaque_compiler_type_t type,
|
||||
return CompilerType();
|
||||
|
||||
default:
|
||||
assert(!"Unhandled clang::TemplateArgument::ArgKind");
|
||||
break;
|
||||
llvm_unreachable("Unhandled clang::TemplateArgument::ArgKind");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -484,8 +484,7 @@ bool Type::ResolveClangType(ResolveState compiler_type_resolve_state) {
|
||||
break;
|
||||
|
||||
default:
|
||||
assert(!"Unhandled encoding_data_type.");
|
||||
break;
|
||||
llvm_unreachable("Unhandled encoding_data_type.");
|
||||
}
|
||||
} else {
|
||||
// We have no encoding type, return void?
|
||||
@ -529,8 +528,7 @@ bool Type::ResolveClangType(ResolveState compiler_type_resolve_state) {
|
||||
break;
|
||||
|
||||
default:
|
||||
assert(!"Unhandled encoding_data_type.");
|
||||
break;
|
||||
llvm_unreachable("Unhandled encoding_data_type.");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -189,8 +189,7 @@ bool ABI::PrepareTrivialCall(Thread &thread, lldb::addr_t sp,
|
||||
lldb::addr_t returnAddress, llvm::Type &returntype,
|
||||
llvm::ArrayRef<ABI::CallArgument> args) const {
|
||||
// dummy prepare trivial call
|
||||
assert(!"Should never get here!");
|
||||
return false;
|
||||
llvm_unreachable("Should never get here!");
|
||||
}
|
||||
|
||||
bool ABI::GetFallbackRegisterLocation(
|
||||
|
@ -1876,9 +1876,8 @@ size_t Platform::GetSoftwareBreakpointTrapOpcode(Target &target,
|
||||
} break;
|
||||
|
||||
default:
|
||||
assert(
|
||||
!"Unhandled architecture in Platform::GetSoftwareBreakpointTrapOpcode");
|
||||
break;
|
||||
llvm_unreachable(
|
||||
"Unhandled architecture in Platform::GetSoftwareBreakpointTrapOpcode");
|
||||
}
|
||||
|
||||
assert(bp_site);
|
||||
|
@ -541,8 +541,7 @@ StackFrameSP StackFrameList::GetFrameAtIndex(uint32_t idx) {
|
||||
if (m_frames.empty()) {
|
||||
// Why do we have a thread with zero frames, that should not ever
|
||||
// happen...
|
||||
if (m_thread.IsValid())
|
||||
assert("A valid thread has no frames.");
|
||||
assert(!m_thread.IsValid() && "A valid thread has no frames.");
|
||||
} else {
|
||||
ResetCurrentInlinedDepth();
|
||||
frame_sp = m_frames[original_idx];
|
||||
|
@ -15,6 +15,7 @@
|
||||
#include <stdlib.h>
|
||||
|
||||
#include "Platform.h"
|
||||
#include "llvm/Support/ErrorHandling.h"
|
||||
|
||||
int ioctl(int d, int request, ...) {
|
||||
switch (request) {
|
||||
@ -34,9 +35,8 @@ int ioctl(int d, int request, ...) {
|
||||
return 0;
|
||||
} break;
|
||||
default:
|
||||
assert(!"Not implemented!");
|
||||
llvm_unreachable("Not implemented!");
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
int kill(pid_t pid, int sig) {
|
||||
@ -44,13 +44,11 @@ int kill(pid_t pid, int sig) {
|
||||
if (pid == getpid())
|
||||
exit(sig);
|
||||
//
|
||||
assert(!"Not implemented!");
|
||||
return -1;
|
||||
llvm_unreachable("Not implemented!");
|
||||
}
|
||||
|
||||
int tcsetattr(int fd, int optional_actions, const struct termios *termios_p) {
|
||||
assert(!"Not implemented!");
|
||||
return -1;
|
||||
llvm_unreachable("Not implemented!");
|
||||
}
|
||||
|
||||
int tcgetattr(int fildes, struct termios *termios_p) {
|
||||
|
@ -94,6 +94,13 @@ bool CMICmdCmdEnvironmentCd::Execute() {
|
||||
m_cmdData.strMiCmd.c_str(),
|
||||
"SetCurrentPlatformSDKRoot()"));
|
||||
|
||||
lldb::SBTarget sbTarget = m_rLLDBDebugSessionInfo.GetTarget();
|
||||
if (sbTarget.IsValid()) {
|
||||
lldb::SBLaunchInfo sbLaunchInfo = sbTarget.GetLaunchInfo();
|
||||
sbLaunchInfo.SetWorkingDirectory(strWkDir.c_str());
|
||||
sbTarget.SetLaunchInfo(sbLaunchInfo);
|
||||
}
|
||||
|
||||
return bOk;
|
||||
}
|
||||
|
||||
|
@ -27,6 +27,7 @@ const CMICmdCmdGdbSet::MapGdbOptionNameToFnGdbOptionPtr_t
|
||||
// Example code if need to implement GDB set other options
|
||||
{"output-radix", &CMICmdCmdGdbSet::OptionFnOutputRadix},
|
||||
{"solib-search-path", &CMICmdCmdGdbSet::OptionFnSolibSearchPath},
|
||||
{"disassembly-flavor", &CMICmdCmdGdbSet::OptionFnDisassemblyFlavor},
|
||||
{"fallback", &CMICmdCmdGdbSet::OptionFnFallback}};
|
||||
|
||||
//++
|
||||
@ -397,6 +398,39 @@ bool CMICmdCmdGdbSet::OptionFnOutputRadix(
|
||||
return MIstatus::success;
|
||||
}
|
||||
|
||||
//++
|
||||
//------------------------------------------------------------------------------------
|
||||
// Details: Carry out work to complete the GDB set option 'disassembly-flavor'
|
||||
// to prepare
|
||||
// and send back information asked for.
|
||||
// Type: Method.
|
||||
// Args: vrWords - (R) List of additional parameters used by this option.
|
||||
// Return: MIstatus::success - Functional succeeded.
|
||||
// MIstatus::failure - Functional failed.
|
||||
// Throws: None.
|
||||
//--
|
||||
bool CMICmdCmdGdbSet::OptionFnDisassemblyFlavor(
|
||||
const CMIUtilString::VecString_t &vrWords) {
|
||||
// Check we have at least one argument
|
||||
if (vrWords.size() < 1) {
|
||||
m_bGbbOptionFnHasError = true;
|
||||
// m_strGdbOptionFnError = MIRSRC(IDS_CMD_ERR_GDBSET_OPT_SOLIBSEARCHPATH);
|
||||
return MIstatus::failure;
|
||||
}
|
||||
const CMIUtilString &rStrValDisasmFlavor(vrWords[0]);
|
||||
|
||||
lldb::SBDebugger &rDbgr = m_rLLDBDebugSessionInfo.GetDebugger();
|
||||
lldb::SBError error = lldb::SBDebugger::SetInternalVariable(
|
||||
"target.x86-disassembly-flavor", rStrValDisasmFlavor.c_str(),
|
||||
rDbgr.GetInstanceName());
|
||||
if (error.Fail()) {
|
||||
m_strGdbOptionFnError = error.GetCString();
|
||||
return MIstatus::failure;
|
||||
}
|
||||
|
||||
return MIstatus::success;
|
||||
}
|
||||
|
||||
//++
|
||||
//------------------------------------------------------------------------------------
|
||||
// Details: Carry out work to complete the GDB set option to prepare and send
|
||||
|
@ -79,6 +79,7 @@ class CMICmdCmdGdbSet : public CMICmdBase {
|
||||
bool OptionFnPrint(const CMIUtilString::VecString_t &vrWords);
|
||||
bool OptionFnSolibSearchPath(const CMIUtilString::VecString_t &vrWords);
|
||||
bool OptionFnOutputRadix(const CMIUtilString::VecString_t &vrWords);
|
||||
bool OptionFnDisassemblyFlavor(const CMIUtilString::VecString_t &vrWords);
|
||||
bool OptionFnFallback(const CMIUtilString::VecString_t &vrWords);
|
||||
|
||||
// Attributes:
|
||||
|
@ -13,6 +13,7 @@
|
||||
#include "lldb/API/SBCompileUnit.h"
|
||||
#include "lldb/API/SBFrame.h"
|
||||
#include "lldb/API/SBLanguageRuntime.h"
|
||||
#include "lldb/API/SBStringList.h"
|
||||
#include "lldb/API/SBThread.h"
|
||||
|
||||
// In-house headers:
|
||||
@ -30,6 +31,7 @@ const CMICmdCmdGdbShow::MapGdbOptionNameToFnGdbOptionPtr_t
|
||||
{"target-async", &CMICmdCmdGdbShow::OptionFnTargetAsync},
|
||||
{"print", &CMICmdCmdGdbShow::OptionFnPrint},
|
||||
{"language", &CMICmdCmdGdbShow::OptionFnLanguage},
|
||||
{"disassembly-flavor", &CMICmdCmdGdbShow::OptionFnDisassemblyFlavor},
|
||||
{"fallback", &CMICmdCmdGdbShow::OptionFnFallback}};
|
||||
|
||||
//++
|
||||
@ -325,6 +327,26 @@ bool CMICmdCmdGdbShow::OptionFnLanguage(
|
||||
return MIstatus::success;
|
||||
}
|
||||
|
||||
//++
|
||||
//------------------------------------------------------------------------------------
|
||||
// Details: Carry out work to complete the GDB show option 'disassembly-flavor' to prepare
|
||||
// and send back the requested information.
|
||||
// Type: Method.
|
||||
// Args: vrWords - (R) List of additional parameters used by this option.
|
||||
// Return: MIstatus::success - Function succeeded.
|
||||
// MIstatus::failure - Function failed.
|
||||
// Throws: None.
|
||||
//--
|
||||
bool CMICmdCmdGdbShow::OptionFnDisassemblyFlavor(const CMIUtilString::VecString_t &vrWords) {
|
||||
MIunused(vrWords);
|
||||
|
||||
// Get current disassembly flavor
|
||||
lldb::SBDebugger &rDbgr = m_rLLDBDebugSessionInfo.GetDebugger();
|
||||
m_strValue = lldb::SBDebugger::GetInternalVariableValue("target.x86-disassembly-flavor",
|
||||
rDbgr.GetInstanceName()).GetStringAtIndex(0);
|
||||
return MIstatus::success;
|
||||
}
|
||||
|
||||
//++
|
||||
//------------------------------------------------------------------------------------
|
||||
// Details: Carry out work to complete the GDB show option to prepare and send
|
||||
|
@ -78,6 +78,7 @@ class CMICmdCmdGdbShow : public CMICmdBase {
|
||||
bool OptionFnTargetAsync(const CMIUtilString::VecString_t &vrWords);
|
||||
bool OptionFnPrint(const CMIUtilString::VecString_t &vrWords);
|
||||
bool OptionFnLanguage(const CMIUtilString::VecString_t &vrWords);
|
||||
bool OptionFnDisassemblyFlavor(const CMIUtilString::VecString_t &vrWords);
|
||||
bool OptionFnFallback(const CMIUtilString::VecString_t &vrWords);
|
||||
|
||||
// Attributes:
|
||||
|
@ -496,14 +496,22 @@ bool CMICmdCmdInterpreterExec::Execute() {
|
||||
//--
|
||||
bool CMICmdCmdInterpreterExec::Acknowledge() {
|
||||
if (m_lldbResult.GetOutputSize() > 0) {
|
||||
CMIUtilString strMsg(m_lldbResult.GetOutput());
|
||||
strMsg = strMsg.StripCREndOfLine();
|
||||
CMICmnStreamStdout::TextToStdout(strMsg);
|
||||
const CMIUtilString line(m_lldbResult.GetOutput());
|
||||
const bool bEscapeQuotes(true);
|
||||
CMICmnMIValueConst miValueConst(line.Escape(bEscapeQuotes));
|
||||
CMICmnMIOutOfBandRecord miOutOfBandRecord(CMICmnMIOutOfBandRecord::eOutOfBand_ConsoleStreamOutput, miValueConst);
|
||||
const bool bOk = CMICmnStreamStdout::TextToStdout(miOutOfBandRecord.GetString());
|
||||
if (!bOk)
|
||||
return MIstatus::failure;
|
||||
}
|
||||
if (m_lldbResult.GetErrorSize() > 0) {
|
||||
CMIUtilString strMsg(m_lldbResult.GetError());
|
||||
strMsg = strMsg.StripCREndOfLine();
|
||||
CMICmnStreamStderr::LLDBMsgToConsole(strMsg);
|
||||
const CMIUtilString line(m_lldbResult.GetError());
|
||||
const bool bEscapeQuotes(true);
|
||||
CMICmnMIValueConst miValueConst(line.Escape(bEscapeQuotes));
|
||||
CMICmnMIOutOfBandRecord miOutOfBandRecord(CMICmnMIOutOfBandRecord::eOutOfBand_LogStreamOutput, miValueConst);
|
||||
const bool bOk = CMICmnStreamStdout::TextToStdout(miOutOfBandRecord.GetString());
|
||||
if (!bOk)
|
||||
return MIstatus::failure;
|
||||
}
|
||||
|
||||
const CMICmnMIResultRecord miRecordResult(
|
||||
|
@ -123,6 +123,7 @@ bool CMICmdCmdTargetSelect::Execute() {
|
||||
|
||||
// Verify that we have managed to connect successfully
|
||||
lldb::SBStream errMsg;
|
||||
error.GetDescription(errMsg);
|
||||
if (!process.IsValid()) {
|
||||
SetError(CMIUtilString::Format(MIRSRC(IDS_CMD_ERR_INVALID_TARGET_PLUGIN),
|
||||
m_cmdData.strMiCmd.c_str(),
|
||||
|
@ -48,6 +48,10 @@ MapOutOfBandToText(CMICmnMIOutOfBandRecord::OutOfBand_e veType) {
|
||||
return "library-unloaded";
|
||||
case CMICmnMIOutOfBandRecord::eOutOfBand_TargetStreamOutput:
|
||||
return "";
|
||||
case CMICmnMIOutOfBandRecord::eOutOfBand_ConsoleStreamOutput:
|
||||
return "";
|
||||
case CMICmnMIOutOfBandRecord::eOutOfBand_LogStreamOutput:
|
||||
return "";
|
||||
}
|
||||
assert(false && "unknown CMICmnMIOutofBandRecord::OutOfBand_e");
|
||||
return NULL;
|
||||
@ -86,6 +90,10 @@ MapOutOfBandToToken(CMICmnMIOutOfBandRecord::OutOfBand_e veType) {
|
||||
return "=";
|
||||
case CMICmnMIOutOfBandRecord::eOutOfBand_TargetStreamOutput:
|
||||
return "@";
|
||||
case CMICmnMIOutOfBandRecord::eOutOfBand_ConsoleStreamOutput:
|
||||
return "~";
|
||||
case CMICmnMIOutOfBandRecord::eOutOfBand_LogStreamOutput:
|
||||
return "&";
|
||||
}
|
||||
assert(false && "unknown CMICmnMIOutofBandRecord::OutOfBand_e");
|
||||
return NULL;
|
||||
|
@ -65,7 +65,9 @@ class CMICmnMIOutOfBandRecord : public CMICmnBase {
|
||||
eOutOfBand_ThreadSelected,
|
||||
eOutOfBand_TargetModuleLoaded,
|
||||
eOutOfBand_TargetModuleUnloaded,
|
||||
eOutOfBand_TargetStreamOutput
|
||||
eOutOfBand_TargetStreamOutput,
|
||||
eOutOfBand_ConsoleStreamOutput,
|
||||
eOutOfBand_LogStreamOutput
|
||||
};
|
||||
|
||||
// Methods:
|
||||
|
@ -76,8 +76,7 @@ static void AddResultToArray(CFCMutableArray &parent_array,
|
||||
} break;
|
||||
|
||||
default:
|
||||
assert(!"unhandled result");
|
||||
break;
|
||||
llvm_unreachable("unhandled result");
|
||||
}
|
||||
}
|
||||
|
||||
@ -125,8 +124,7 @@ static void AddResultToDictionary(CFCMutableDictionary &parent_dict,
|
||||
result->GetAsUnsigned()->GetValue(), true);
|
||||
} break;
|
||||
default:
|
||||
assert(!"unhandled result");
|
||||
break;
|
||||
llvm_unreachable("unhandled result");
|
||||
}
|
||||
}
|
||||
void Results::Write(const char *out_path) {
|
||||
|
@ -199,14 +199,22 @@ TEST_F(GDBRemoteCommunicationClientTest, GetModulesInfo) {
|
||||
|
||||
FileSpec file_specs[] = {
|
||||
FileSpec("/foo/bar.so", false, FileSpec::ePathSyntaxPosix),
|
||||
FileSpec("/foo/baz.so", false, FileSpec::ePathSyntaxPosix)};
|
||||
FileSpec("/foo/baz.so", false, FileSpec::ePathSyntaxPosix),
|
||||
|
||||
// This is a bit dodgy but we currently depend on GetModulesInfo not
|
||||
// performing denormalization. It can go away once the users
|
||||
// (DynamicLoaderPOSIXDYLD, at least) correctly set the path syntax for
|
||||
// the FileSpecs they create.
|
||||
FileSpec("/foo/baw.so", false, FileSpec::ePathSyntaxWindows),
|
||||
};
|
||||
std::future<llvm::Optional<std::vector<ModuleSpec>>> async_result =
|
||||
std::async(std::launch::async,
|
||||
[&] { return client.GetModulesInfo(file_specs, triple); });
|
||||
HandlePacket(
|
||||
server, "jModulesInfo:["
|
||||
R"({"file":"/foo/bar.so","triple":"i386-pc-linux"},)"
|
||||
R"({"file":"/foo/baz.so","triple":"i386-pc-linux"}])",
|
||||
R"({"file":"/foo/baz.so","triple":"i386-pc-linux"},)"
|
||||
R"({"file":"/foo/baw.so","triple":"i386-pc-linux"}])",
|
||||
R"([{"uuid":"404142434445464748494a4b4c4d4e4f","triple":"i386-pc-linux",)"
|
||||
R"("file_path":"/foo/bar.so","file_offset":0,"file_size":1234}]])");
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user