Skip to content

Commit

Permalink
Merged master:e308a0ca15a into amd-gfx:8b31d4bb755
Browse files Browse the repository at this point in the history
Local branch amd-gfx 8b31d4b Merged master:54c52242034 into amd-gfx:669a5b9da2e
Remote branch master e308a0c [libcxx] Fix a typo in config.py
  • Loading branch information
Sw authored and Sw committed Dec 26, 2019
2 parents 8b31d4b + e308a0c commit 1291a95
Show file tree
Hide file tree
Showing 13 changed files with 73 additions and 76 deletions.
2 changes: 1 addition & 1 deletion libcxx/utils/libcxx/test/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ def configure_executor(self):
# ValgrindExecutor is supposed to go. It is likely
# that the user wants it at the end, but we have no
# way of getting at that easily.
selt.lit_config.fatal("Cannot infer how to create a Valgrind "
self.lit_config.fatal("Cannot infer how to create a Valgrind "
" executor.")
else:
te = LocalExecutor()
Expand Down
4 changes: 3 additions & 1 deletion lldb/include/lldb/Symbol/DebugMacros.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@ typedef std::shared_ptr<DebugMacros> DebugMacrosSP;

class DebugMacroEntry {
public:
enum EntryType { INVALID, DEFINE, UNDEF, START_FILE, END_FILE, INDIRECT };
enum EntryType : uint32_t {
INVALID, DEFINE, UNDEF, START_FILE, END_FILE, INDIRECT
};

public:
static DebugMacroEntry CreateDefineEntry(uint32_t line, const char *str);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,7 @@ class CommandCrasher : public SBCommandPluginInterface {
result = subcommand(dbg, "help");
// Test also whether self-assignment is handled correctly.
result = result;
if (!result.Succeeded())
return false;
return true;
return result.Succeeded();
}
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,8 @@ CXX_SOURCES := main.cpp

DEBUG_INFO_FLAG = -g3 -gdwarf-5

# GCC produces incorrect .debug_macro section when "-include" option is used:
# https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93075.
NO_TEST_COMMON_H := 1

include Makefile.rules
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#define _POSIX_C_SOURCE 200809L

#include <cstdio>
#include <cstdlib>
#include <cstring>
Expand Down
7 changes: 6 additions & 1 deletion lldb/packages/Python/lldbsuite/test/lldbplatformutil.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,12 @@ def getDarwinOSTriples():

def getPlatform():
"""Returns the target platform which the tests are running on."""
platform = lldb.DBG.GetSelectedPlatform().GetTriple().split('-')[2]
triple = lldb.DBG.GetSelectedPlatform().GetTriple()
if triple is None:
# It might be an unconnected remote platform.
return ''

platform = triple.split('-')[2]
if platform.startswith('freebsd'):
platform = 'freebsd'
elif platform.startswith('netbsd'):
Expand Down
1 change: 1 addition & 0 deletions lldb/packages/Python/lldbsuite/test/test_categories.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
'flakey': 'Flakey test cases, i.e. tests that do not reliably pass at each execution',
'darwin-log': 'Darwin log tests',
'watchpoint': 'Watchpoint-related tests',
'lldb-vscode': 'Visual Studio Code debug adaptor tests',
}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,8 @@ class ObjCRuntimeMethodType {
}

clang::ObjCMethodDecl *
BuildMethod(clang::ObjCInterfaceDecl *interface_decl, const char *name,
BuildMethod(ClangASTContext &clang_ast_ctxt,
clang::ObjCInterfaceDecl *interface_decl, const char *name,
bool instance,
ObjCLanguageRuntime::EncodingToTypeSP type_realizer_sp) {
if (!m_is_valid || m_type_vector.size() < 3)
Expand Down Expand Up @@ -360,8 +361,7 @@ class ObjCRuntimeMethodType {

clang::QualType ret_type =
ClangUtil::GetQualType(type_realizer_sp->RealizeType(
interface_decl->getASTContext(), m_type_vector[0].c_str(),
for_expression));
clang_ast_ctxt, m_type_vector[0].c_str(), for_expression));

if (ret_type.isNull())
return nullptr;
Expand All @@ -378,7 +378,7 @@ class ObjCRuntimeMethodType {
const bool for_expression = true;
clang::QualType arg_type =
ClangUtil::GetQualType(type_realizer_sp->RealizeType(
ast_ctx, m_type_vector[ai].c_str(), for_expression));
clang_ast_ctxt, m_type_vector[ai].c_str(), for_expression));

if (arg_type.isNull())
return nullptr; // well, we just wasted a bunch of time. Wish we could
Expand Down Expand Up @@ -455,8 +455,8 @@ bool AppleObjCDeclVendor::FinishDecl(clang::ObjCInterfaceDecl *interface_decl) {

ObjCRuntimeMethodType method_type(types);

clang::ObjCMethodDecl *method_decl =
method_type.BuildMethod(interface_decl, name, true, m_type_realizer_sp);
clang::ObjCMethodDecl *method_decl = method_type.BuildMethod(
m_ast_ctx, interface_decl, name, true, m_type_realizer_sp);

LLDB_LOGF(log, "[ AOTV::FD] Instance method [%s] [%s]", name, types);

Expand All @@ -474,7 +474,7 @@ bool AppleObjCDeclVendor::FinishDecl(clang::ObjCInterfaceDecl *interface_decl) {
ObjCRuntimeMethodType method_type(types);

clang::ObjCMethodDecl *method_decl = method_type.BuildMethod(
interface_decl, name, false, m_type_realizer_sp);
m_ast_ctx, interface_decl, name, false, m_type_realizer_sp);

LLDB_LOGF(log, "[ AOTV::FD] Class method [%s] [%s]", name, types);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ AppleObjCTypeEncodingParser::StructElement::StructElement()
: name(""), type(clang::QualType()), bitfield(0) {}

AppleObjCTypeEncodingParser::StructElement
AppleObjCTypeEncodingParser::ReadStructElement(clang::ASTContext &ast_ctx,
AppleObjCTypeEncodingParser::ReadStructElement(ClangASTContext &ast_ctx,
StringLexer &type,
bool for_expression) {
StructElement retval;
Expand All @@ -78,19 +78,19 @@ AppleObjCTypeEncodingParser::ReadStructElement(clang::ASTContext &ast_ctx,
}

clang::QualType AppleObjCTypeEncodingParser::BuildStruct(
clang::ASTContext &ast_ctx, StringLexer &type, bool for_expression) {
ClangASTContext &ast_ctx, StringLexer &type, bool for_expression) {
return BuildAggregate(ast_ctx, type, for_expression, '{', '}',
clang::TTK_Struct);
}

clang::QualType AppleObjCTypeEncodingParser::BuildUnion(
clang::ASTContext &ast_ctx, StringLexer &type, bool for_expression) {
ClangASTContext &ast_ctx, StringLexer &type, bool for_expression) {
return BuildAggregate(ast_ctx, type, for_expression, '(', ')',
clang::TTK_Union);
}

clang::QualType AppleObjCTypeEncodingParser::BuildAggregate(
clang::ASTContext &ast_ctx, StringLexer &type, bool for_expression,
ClangASTContext &ast_ctx, StringLexer &type, bool for_expression,
char opener, char closer, uint32_t kind) {
if (!type.NextIf(opener))
return clang::QualType();
Expand Down Expand Up @@ -124,10 +124,7 @@ clang::QualType AppleObjCTypeEncodingParser::BuildAggregate(
if (is_templated)
return clang::QualType(); // This is where we bail out. Sorry!

ClangASTContext *lldb_ctx = ClangASTContext::GetASTContext(&ast_ctx);
if (!lldb_ctx)
return clang::QualType();
CompilerType union_type(lldb_ctx->CreateRecordType(
CompilerType union_type(ast_ctx.CreateRecordType(
nullptr, lldb::eAccessPublic, name, kind, lldb::eLanguageTypeC));
if (union_type) {
ClangASTContext::StartTagDeclarationDefinition(union_type);
Expand All @@ -141,8 +138,7 @@ clang::QualType AppleObjCTypeEncodingParser::BuildAggregate(
}
ClangASTContext::AddFieldToRecordType(
union_type, element.name.c_str(),
CompilerType(ClangASTContext::GetASTContext(&ast_ctx),
element.type.getAsOpaquePtr()),
CompilerType(&ast_ctx, element.type.getAsOpaquePtr()),
lldb::eAccessPublic, element.bitfield);
++count;
}
Expand All @@ -152,20 +148,15 @@ clang::QualType AppleObjCTypeEncodingParser::BuildAggregate(
}

clang::QualType AppleObjCTypeEncodingParser::BuildArray(
clang::ASTContext &ast_ctx, StringLexer &type, bool for_expression) {
ClangASTContext &ast_ctx, StringLexer &type, bool for_expression) {
if (!type.NextIf('['))
return clang::QualType();
uint32_t size = ReadNumber(type);
clang::QualType element_type(BuildType(ast_ctx, type, for_expression));
if (!type.NextIf(']'))
return clang::QualType();
ClangASTContext *lldb_ctx = ClangASTContext::GetASTContext(&ast_ctx);
if (!lldb_ctx)
return clang::QualType();
CompilerType array_type(lldb_ctx->CreateArrayType(
CompilerType(ClangASTContext::GetASTContext(&ast_ctx),
element_type.getAsOpaquePtr()),
size, false));
CompilerType array_type(ast_ctx.CreateArrayType(
CompilerType(&ast_ctx, element_type.getAsOpaquePtr()), size, false));
return ClangUtil::GetQualType(array_type);
}

Expand All @@ -175,10 +166,12 @@ clang::QualType AppleObjCTypeEncodingParser::BuildArray(
// consume but ignore the type info and always return an 'id'; if anything,
// dynamic typing will resolve things for us anyway
clang::QualType AppleObjCTypeEncodingParser::BuildObjCObjectPointerType(
clang::ASTContext &ast_ctx, StringLexer &type, bool for_expression) {
ClangASTContext &clang_ast_ctx, StringLexer &type, bool for_expression) {
if (!type.NextIf('@'))
return clang::QualType();

clang::ASTContext &ast_ctx = clang_ast_ctx.getASTContext();

std::string name;

if (type.NextIf('"')) {
Expand Down Expand Up @@ -257,23 +250,25 @@ clang::QualType AppleObjCTypeEncodingParser::BuildObjCObjectPointerType(
}

clang::QualType
AppleObjCTypeEncodingParser::BuildType(clang::ASTContext &ast_ctx,
AppleObjCTypeEncodingParser::BuildType(ClangASTContext &clang_ast_ctx,
StringLexer &type, bool for_expression,
uint32_t *bitfield_bit_size) {
if (!type.HasAtLeast(1))
return clang::QualType();

clang::ASTContext &ast_ctx = clang_ast_ctx.getASTContext();

switch (type.Peek()) {
default:
break;
case '{':
return BuildStruct(ast_ctx, type, for_expression);
return BuildStruct(clang_ast_ctx, type, for_expression);
case '[':
return BuildArray(ast_ctx, type, for_expression);
return BuildArray(clang_ast_ctx, type, for_expression);
case '(':
return BuildUnion(ast_ctx, type, for_expression);
return BuildUnion(clang_ast_ctx, type, for_expression);
case '@':
return BuildObjCObjectPointerType(ast_ctx, type, for_expression);
return BuildObjCObjectPointerType(clang_ast_ctx, type, for_expression);
}

switch (type.Next()) {
Expand All @@ -289,10 +284,7 @@ AppleObjCTypeEncodingParser::BuildType(clang::ASTContext &ast_ctx,
case 'l':
return ast_ctx.getIntTypeForBitwidth(32, true);
// this used to be done like this:
// ClangASTContext *lldb_ctx = ClangASTContext::GetASTContext(&ast_ctx);
// if (!lldb_ctx)
// return clang::QualType();
// return lldb_ctx->GetIntTypeFromBitSize(32, true).GetQualType();
// return clang_ast_ctx->GetIntTypeFromBitSize(32, true).GetQualType();
// which uses one of the constants if one is available, but we don't think
// all this work is necessary.
case 'q':
Expand Down Expand Up @@ -331,7 +323,8 @@ AppleObjCTypeEncodingParser::BuildType(clang::ASTContext &ast_ctx,
return clang::QualType();
}
case 'r': {
clang::QualType target_type = BuildType(ast_ctx, type, for_expression);
clang::QualType target_type =
BuildType(clang_ast_ctx, type, for_expression);
if (target_type.isNull())
return clang::QualType();
else if (target_type == ast_ctx.UnknownAnyTy)
Expand All @@ -348,7 +341,8 @@ AppleObjCTypeEncodingParser::BuildType(clang::ASTContext &ast_ctx,
// practical cases
return ast_ctx.VoidPtrTy;
} else {
clang::QualType target_type = BuildType(ast_ctx, type, for_expression);
clang::QualType target_type =
BuildType(clang_ast_ctx, type, for_expression);
if (target_type.isNull())
return clang::QualType();
else if (target_type == ast_ctx.UnknownAnyTy)
Expand All @@ -362,13 +356,13 @@ AppleObjCTypeEncodingParser::BuildType(clang::ASTContext &ast_ctx,
}
}

CompilerType AppleObjCTypeEncodingParser::RealizeType(
clang::ASTContext &ast_ctx, const char *name, bool for_expression) {
CompilerType AppleObjCTypeEncodingParser::RealizeType(ClangASTContext &ast_ctx,
const char *name,
bool for_expression) {
if (name && name[0]) {
StringLexer lexer(name);
clang::QualType qual_type = BuildType(ast_ctx, lexer, for_expression);
return CompilerType(ClangASTContext::GetASTContext(&ast_ctx),
qual_type.getAsOpaquePtr());
return CompilerType(&ast_ctx, qual_type.getAsOpaquePtr());
}
return CompilerType();
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class AppleObjCTypeEncodingParser : public ObjCLanguageRuntime::EncodingToType {
AppleObjCTypeEncodingParser(ObjCLanguageRuntime &runtime);
~AppleObjCTypeEncodingParser() override = default;

CompilerType RealizeType(clang::ASTContext &ast_ctx, const char *name,
CompilerType RealizeType(ClangASTContext &ast_ctx, const char *name,
bool for_expression) override;

private:
Expand All @@ -35,29 +35,29 @@ class AppleObjCTypeEncodingParser : public ObjCLanguageRuntime::EncodingToType {
~StructElement() = default;
};

clang::QualType BuildType(clang::ASTContext &ast_ctx, StringLexer &type,
clang::QualType BuildType(ClangASTContext &clang_ast_ctx, StringLexer &type,
bool for_expression,
uint32_t *bitfield_bit_size = nullptr);

clang::QualType BuildStruct(clang::ASTContext &ast_ctx, StringLexer &type,
clang::QualType BuildStruct(ClangASTContext &ast_ctx, StringLexer &type,
bool for_expression);

clang::QualType BuildAggregate(clang::ASTContext &ast_ctx, StringLexer &type,
bool for_expression, char opener, char closer,
uint32_t kind);
clang::QualType BuildAggregate(ClangASTContext &clang_ast_ctx,
StringLexer &type, bool for_expression,
char opener, char closer, uint32_t kind);

clang::QualType BuildUnion(clang::ASTContext &ast_ctx, StringLexer &type,
clang::QualType BuildUnion(ClangASTContext &ast_ctx, StringLexer &type,
bool for_expression);

clang::QualType BuildArray(clang::ASTContext &ast_ctx, StringLexer &type,
clang::QualType BuildArray(ClangASTContext &ast_ctx, StringLexer &type,
bool for_expression);

std::string ReadStructName(StringLexer &type);

StructElement ReadStructElement(clang::ASTContext &ast_ctx, StringLexer &type,
StructElement ReadStructElement(ClangASTContext &ast_ctx, StringLexer &type,
bool for_expression);

clang::QualType BuildObjCObjectPointerType(clang::ASTContext &ast_ctx,
clang::QualType BuildObjCObjectPointerType(ClangASTContext &clang_ast_ctx,
StringLexer &type,
bool for_expression);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -313,12 +313,6 @@ ObjCLanguageRuntime::EncodingToType::RealizeType(const char *name,
return CompilerType();
}

CompilerType ObjCLanguageRuntime::EncodingToType::RealizeType(
ClangASTContext &ast_ctx, const char *name, bool for_expression) {
clang::ASTContext &clang_ast = ast_ctx.getASTContext();
return RealizeType(clang_ast, name, for_expression);
}

ObjCLanguageRuntime::EncodingToType::~EncodingToType() {}

ObjCLanguageRuntime::EncodingToTypeSP ObjCLanguageRuntime::GetEncodingToType() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -145,12 +145,9 @@ class ObjCLanguageRuntime : public LanguageRuntime {
virtual ~EncodingToType();

virtual CompilerType RealizeType(ClangASTContext &ast_ctx, const char *name,
bool for_expression);
bool for_expression) = 0;
virtual CompilerType RealizeType(const char *name, bool for_expression);

virtual CompilerType RealizeType(clang::ASTContext &ast_ctx,
const char *name, bool for_expression) = 0;

protected:
std::unique_ptr<ClangASTContext> m_scratch_ast_ctx_up;
};
Expand Down
19 changes: 10 additions & 9 deletions lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2349,21 +2349,22 @@ void ProcessGDBRemote::RefreshStateAfterStop() {

m_thread_ids.clear();
m_thread_pcs.clear();

// Set the thread stop info. It might have a "threads" key whose value is a
// list of all thread IDs in the current process, so m_thread_ids might get
// set.
// Check to see if SetThreadStopInfo() filled in m_thread_ids?
if (m_thread_ids.empty()) {
// No, we need to fetch the thread list manually
UpdateThreadIDList();
}

// We might set some stop info's so make sure the thread list is up to
// date before we do that or we might overwrite what was computed here.
UpdateThreadListIfNeeded();

// Scope for the lock
{
// Check to see if SetThreadStopInfo() filled in m_thread_ids?
if (m_thread_ids.empty()) {
// No, we need to fetch the thread list manually
UpdateThreadIDList();
}
// We might set some stop info's so make sure the thread list is up to
// date before we do that or we might overwrite what was computed here.
UpdateThreadListIfNeeded();

// Lock the thread stack while we access it
std::lock_guard<std::recursive_mutex> guard(m_last_stop_packet_mutex);
// Get the number of stop packets on the stack
Expand Down

0 comments on commit 1291a95

Please sign in to comment.