diff options
author | Enrico Granata <granata.enrico@gmail.com> | 2011-07-19 18:03:25 +0000 |
---|---|---|
committer | Enrico Granata <granata.enrico@gmail.com> | 2011-07-19 18:03:25 +0000 |
commit | 20edcdbe8a267924e19646374cbead05ec9ea027 (patch) | |
tree | 9fa2db828ee6766299dde760d07431b4602c2423 /lldb/source | |
parent | 33824e572253bcb491a7e0d2a09a7f857f259f34 (diff) | |
download | bcm5719-llvm-20edcdbe8a267924e19646374cbead05ec9ea027.tar.gz bcm5719-llvm-20edcdbe8a267924e19646374cbead05ec9ea027.zip |
The implementation of categories is now synchronization safe
Code cleanup:
- The Format Manager implementation is now split between two files: FormatClasses.{h|cpp} where the
actual formatter classes (ValueFormat, SummaryFormat, ...) are implemented and
FormatManager.{h|cpp} where the infrastructure classes (FormatNavigator, FormatManager, ...)
are contained. The wrapper code always remains in Debugger.{h|cpp}
- Several leftover fields, methods and comments from previous design choices have been removed
type category subcommands (enable, disable, delete) now can take a list of category names as input
- for type category enable, saying "enable A B C" is the same as saying
enable C
enable B
enable A
(the ordering is relevant in enabling categories, and it is expected that a user typing
enable A B C wants to look into category A, then into B, then into C and not the other
way round)
- for the other two commands, the order is not really relevant (however, the same inverted ordering
is used for consistency)
llvm-svn: 135494
Diffstat (limited to 'lldb/source')
-rw-r--r-- | lldb/source/Commands/CommandObjectType.cpp | 135 | ||||
-rw-r--r-- | lldb/source/Commands/CommandObjectType.h | 5 | ||||
-rw-r--r-- | lldb/source/Core/DataExtractor.cpp | 2 | ||||
-rw-r--r-- | lldb/source/Core/Debugger.cpp | 14 | ||||
-rw-r--r-- | lldb/source/Core/FormatClasses.cpp | 140 | ||||
-rw-r--r-- | lldb/source/Core/FormatManager.cpp | 75 | ||||
-rw-r--r-- | lldb/source/Expression/ClangExpressionParser.cpp | 6 | ||||
-rw-r--r-- | lldb/source/Expression/ClangUserExpression.cpp | 2 | ||||
-rw-r--r-- | lldb/source/Expression/IRDynamicChecks.cpp | 2 | ||||
-rw-r--r-- | lldb/source/Expression/IRForTarget.cpp | 6 | ||||
-rw-r--r-- | lldb/source/Plugins/Disassembler/llvm/DisassemblerLLVM.cpp | 2 | ||||
-rw-r--r-- | lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntime.cpp | 2 | ||||
-rw-r--r-- | lldb/source/Target/StackFrame.cpp | 6 | ||||
-rw-r--r-- | lldb/source/Target/ThreadPlanCallFunction.cpp | 2 |
14 files changed, 234 insertions, 165 deletions
diff --git a/lldb/source/Commands/CommandObjectType.cpp b/lldb/source/Commands/CommandObjectType.cpp index 8db88e759ed..ab3574133df 100644 --- a/lldb/source/Commands/CommandObjectType.cpp +++ b/lldb/source/Commands/CommandObjectType.cpp @@ -192,7 +192,7 @@ public: // now I have a valid format, let's add it to every type - for(int i = 0; i < argc; i++) { + for (int i = 0; i < argc; i++) { const char* typeA = command.GetArgumentAtIndex(i); ConstString typeCS(typeA); if (typeCS) @@ -537,7 +537,6 @@ public: options->m_no_children, options->m_no_value, options->m_one_liner, - options->m_is_system, std::string(funct_name), options->m_user_source.CopyList(" "))); @@ -659,7 +658,6 @@ CommandObjectTypeSummaryAdd::CommandOptions::OptionParsingStarting () m_python_script = ""; m_python_function = ""; m_is_add_script = false; - m_is_system = false; m_category = NULL; } @@ -730,7 +728,6 @@ CommandObjectTypeSummaryAdd::Execute_ScriptSummary (Args& command, CommandReturn m_options.m_no_children, m_options.m_no_value, m_options.m_one_liner, - m_options.m_is_system, std::string(funct_name), " " + m_options.m_python_function + "(valobj,dict)")); } @@ -773,7 +770,6 @@ CommandObjectTypeSummaryAdd::Execute_ScriptSummary (Args& command, CommandReturn m_options.m_no_children, m_options.m_no_value, m_options.m_one_liner, - m_options.m_is_system, std::string(funct_name), " " + m_options.m_python_script)); } @@ -786,11 +782,10 @@ CommandObjectTypeSummaryAdd::Execute_ScriptSummary (Args& command, CommandReturn m_options.m_no_value, m_options.m_one_liner, m_options.m_regex, - m_options.m_is_system, m_options.m_name, m_options.m_category); - for(int i = 0; i < argc; i++) { + for (int i = 0; i < argc; i++) { const char* typeA = command.GetArgumentAtIndex(i); if (typeA && *typeA) options->m_target_types << typeA; @@ -880,7 +875,6 @@ CommandObjectTypeSummaryAdd::Execute_StringSummary (Args& command, CommandReturn m_options.m_no_children, m_options.m_no_value, m_options.m_one_liner, - m_options.m_is_system, format_cstr)); if (error.Fail()) @@ -892,7 +886,7 @@ CommandObjectTypeSummaryAdd::Execute_StringSummary (Args& command, CommandReturn // now I have a valid format, let's add it to every type - for(int i = 0; i < argc; i++) { + for (int i = 0; i < argc; i++) { const char* typeA = command.GetArgumentAtIndex(i); if (!typeA || typeA[0] == '\0') { @@ -1039,9 +1033,12 @@ bool CommandObjectTypeSummaryAdd::AddSummary(const ConstString& type_name, SummaryFormatSP entry, SummaryFormatType type, - const char* category, + const char* category_name, Error* error) { + lldb::FormatCategorySP category; + Debugger::Formatting::Categories::Get(ConstString(category_name), category); + if (type == eRegexSummary) { RegularExpressionSP typeRX(new RegularExpression()); @@ -1052,8 +1049,8 @@ CommandObjectTypeSummaryAdd::AddSummary(const ConstString& type_name, return false; } - Debugger::Formatting::SummaryFormats(category)->RegexSummary()->Delete(type_name.GetCString()); - Debugger::Formatting::SummaryFormats(category)->RegexSummary()->Add(typeRX, entry); + category->RegexSummary()->Delete(type_name.GetCString()); + category->RegexSummary()->Add(typeRX, entry); return true; } @@ -1065,7 +1062,7 @@ CommandObjectTypeSummaryAdd::AddSummary(const ConstString& type_name, } else { - Debugger::Formatting::SummaryFormats(category)->Summary()->Add(type_name.GetCString(), entry); + category->Summary()->Add(type_name.GetCString(), entry); return true; } } @@ -1226,7 +1223,10 @@ public: return result.Succeeded(); } - bool delete_category = Debugger::Formatting::SummaryFormats(m_options.m_category)->Delete(typeCS.GetCString()); + lldb::FormatCategorySP category; + Debugger::Formatting::Categories::Get(ConstString(m_options.m_category), category); + + bool delete_category = category->Delete(typeCS.GetCString()); bool delete_named = Debugger::Formatting::NamedSummaryFormats::Delete(typeCS); if (delete_category || delete_named) @@ -1347,14 +1347,20 @@ public: if (m_options.m_delete_all) Debugger::Formatting::Categories::LoopThrough(PerCategoryCallback, NULL); - else if (command.GetArgumentCount() > 0) - { - const char* cat_name = command.GetArgumentAtIndex(0); - ConstString cat_nameCS(cat_name); - Debugger::Formatting::SummaryFormats(cat_nameCS.GetCString())->Clear(); - } + else - Debugger::Formatting::SummaryFormats()->Clear(); + { + lldb::FormatCategorySP category; + if (command.GetArgumentCount() > 0) + { + const char* cat_name = command.GetArgumentAtIndex(0); + ConstString cat_nameCS(cat_name); + Debugger::Formatting::Categories::Get(cat_nameCS, category); + } + else + Debugger::Formatting::Categories::Get(ConstString(NULL), category); + category->Clear(); + } Debugger::Formatting::NamedSummaryFormats::Clear(); @@ -1523,7 +1529,7 @@ public: CommandArgumentData type_style_arg; type_style_arg.arg_type = eArgTypeName; - type_style_arg.arg_repetition = eArgRepeatPlain; + type_style_arg.arg_repetition = eArgRepeatPlus; type_arg.push_back (type_style_arg); @@ -1540,24 +1546,27 @@ public: { const size_t argc = command.GetArgumentCount(); - if (argc != 1) + if (argc < 1) { - result.AppendErrorWithFormat ("%s takes 1 arg.\n", m_cmd_name.c_str()); + result.AppendErrorWithFormat ("%s takes 1 or more args.\n", m_cmd_name.c_str()); result.SetStatus(eReturnStatusFailed); return false; } - const char* typeA = command.GetArgumentAtIndex(0); - ConstString typeCS(typeA); - - if (!typeCS) + for (int i = argc - 1; i >= 0; i--) { - result.AppendError("empty category name not allowed"); - result.SetStatus(eReturnStatusFailed); - return false; + const char* typeA = command.GetArgumentAtIndex(i); + ConstString typeCS(typeA); + + if (!typeCS) + { + result.AppendError("empty category name not allowed"); + result.SetStatus(eReturnStatusFailed); + return false; + } + Debugger::Formatting::Categories::Enable(typeCS); } - Debugger::Formatting::Categories::Enable(typeCS); result.SetStatus(eReturnStatusSuccessFinishResult); return result.Succeeded(); } @@ -1581,7 +1590,7 @@ public: CommandArgumentData type_style_arg; type_style_arg.arg_type = eArgTypeName; - type_style_arg.arg_repetition = eArgRepeatPlain; + type_style_arg.arg_repetition = eArgRepeatPlus; type_arg.push_back (type_style_arg); @@ -1598,36 +1607,42 @@ public: { const size_t argc = command.GetArgumentCount(); - if (argc != 1) + if (argc < 1) { - result.AppendErrorWithFormat ("%s takes 1 arg.\n", m_cmd_name.c_str()); + result.AppendErrorWithFormat ("%s takes 1 or more arg.\n", m_cmd_name.c_str()); result.SetStatus(eReturnStatusFailed); return false; } - const char* typeA = command.GetArgumentAtIndex(0); - ConstString typeCS(typeA); + bool success = true; - if (!typeCS) + // the order is not relevant here + for (int i = argc - 1; i >= 0; i--) { - result.AppendError("empty category name not allowed"); - result.SetStatus(eReturnStatusFailed); - return false; + const char* typeA = command.GetArgumentAtIndex(i); + ConstString typeCS(typeA); + + if (!typeCS) + { + result.AppendError("empty category name not allowed"); + result.SetStatus(eReturnStatusFailed); + return false; + } + if (!Debugger::Formatting::Categories::Delete(typeCS)) + success = false; // keep deleting even if we hit an error } - - if (Debugger::Formatting::Categories::Delete(typeCS)) + if (success) { result.SetStatus(eReturnStatusSuccessFinishResult); return result.Succeeded(); } else { - result.AppendErrorWithFormat ("cannot delete category %s.\n", typeA); + result.AppendError("cannot delete one or more categories\n"); result.SetStatus(eReturnStatusFailed); return false; - } + } } - }; //------------------------------------------------------------------------- @@ -1647,7 +1662,7 @@ public: CommandArgumentData type_style_arg; type_style_arg.arg_type = eArgTypeName; - type_style_arg.arg_repetition = eArgRepeatPlain; + type_style_arg.arg_repetition = eArgRepeatPlus; type_arg.push_back (type_style_arg); @@ -1664,24 +1679,28 @@ public: { const size_t argc = command.GetArgumentCount(); - if (argc != 1) + if (argc < 1) { - result.AppendErrorWithFormat ("%s takes 1 arg.\n", m_cmd_name.c_str()); + result.AppendErrorWithFormat ("%s takes 1 or more args.\n", m_cmd_name.c_str()); result.SetStatus(eReturnStatusFailed); return false; } - const char* typeA = command.GetArgumentAtIndex(0); - ConstString typeCS(typeA); - - if (!typeCS) + // the order is not relevant here + for (int i = argc - 1; i >= 0; i--) { - result.AppendError("empty category name not allowed"); - result.SetStatus(eReturnStatusFailed); - return false; + const char* typeA = command.GetArgumentAtIndex(i); + ConstString typeCS(typeA); + + if (!typeCS) + { + result.AppendError("empty category name not allowed"); + result.SetStatus(eReturnStatusFailed); + return false; + } + Debugger::Formatting::Categories::Disable(typeCS); } - - Debugger::Formatting::Categories::Disable(typeCS); + result.SetStatus(eReturnStatusSuccessFinishResult); return result.Succeeded(); } diff --git a/lldb/source/Commands/CommandObjectType.h b/lldb/source/Commands/CommandObjectType.h index d9242879bea..c37bc70a8b3 100644 --- a/lldb/source/Commands/CommandObjectType.h +++ b/lldb/source/Commands/CommandObjectType.h @@ -39,8 +39,6 @@ public: bool m_one_liner; bool m_regex; - bool m_is_system; - ConstString* m_name; const char* m_category; @@ -52,7 +50,6 @@ public: bool novl, bool onel, bool regx, - bool syst, ConstString* name, const char* catg) : m_skip_pointers(sptr), @@ -64,7 +61,6 @@ public: m_no_value(novl), m_one_liner(onel), m_regex(regx), - m_is_system(syst), m_name(name), m_category(catg) { @@ -130,7 +126,6 @@ private: std::string m_python_script; std::string m_python_function; bool m_is_add_script; - bool m_is_system; const char* m_category; }; diff --git a/lldb/source/Core/DataExtractor.cpp b/lldb/source/Core/DataExtractor.cpp index e364dfd6097..f8be9a421e0 100644 --- a/lldb/source/Core/DataExtractor.cpp +++ b/lldb/source/Core/DataExtractor.cpp @@ -754,7 +754,7 @@ DataExtractor::GetMaxU64Bitfield (uint32_t *offset_ptr, uint32_t size, uint32_t if (bitfield_bit_offset > 0) uval64 >>= bitfield_bit_offset; uint64_t bitfield_mask = ((1ul << bitfield_bit_size) - 1); - if(!bitfield_mask && bitfield_bit_offset == 0 && bitfield_bit_size == 64) + if (!bitfield_mask && bitfield_bit_offset == 0 && bitfield_bit_size == 64) return uval64; uval64 &= bitfield_mask; } diff --git a/lldb/source/Core/Debugger.cpp b/lldb/source/Core/Debugger.cpp index 1c62a8cb46f..cce768f8684 100644 --- a/lldb/source/Core/Debugger.cpp +++ b/lldb/source/Core/Debugger.cpp @@ -1755,12 +1755,6 @@ Debugger::Formatting::ValueFormats::GetCount() return GetFormatManager().Value().GetCount(); } -lldb::FormatCategorySP -Debugger::Formatting::SummaryFormats(const char* category_name) -{ - return GetFormatManager().Category(category_name); -} - bool Debugger::Formatting::GetSummaryFormat(ValueObject& vobj, lldb::SummaryFormatSP& entry) @@ -1804,15 +1798,10 @@ void Debugger::Formatting::Categories::Enable(ConstString& category) { if (GetFormatManager().Category(category.GetCString())->IsEnabled() == false) - { - //GetFormatManager().Category(category.GetCString())->Enable(); GetFormatManager().EnableCategory(category.GetCString()); - } else { - //GetFormatManager().Category(category.GetCString())->Disable(); GetFormatManager().DisableCategory(category.GetCString()); - //GetFormatManager().Category(category.GetCString())->Enable(); GetFormatManager().EnableCategory(category.GetCString()); } } @@ -1821,10 +1810,7 @@ void Debugger::Formatting::Categories::Disable(ConstString& category) { if (GetFormatManager().Category(category.GetCString())->IsEnabled() == true) - { - //GetFormatManager().Category(category.GetCString())->Disable(); GetFormatManager().DisableCategory(category.GetCString()); - } } void diff --git a/lldb/source/Core/FormatClasses.cpp b/lldb/source/Core/FormatClasses.cpp new file mode 100644 index 00000000000..8ff237a603a --- /dev/null +++ b/lldb/source/Core/FormatClasses.cpp @@ -0,0 +1,140 @@ +//===-- FormatClasses.cpp ----------------------------------------*- C++ -*-===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +// C Includes + +// C++ Includes +#include <ostream> + +// Other libraries and framework includes + +// Project includes +#include "lldb/lldb-public.h" +#include "lldb/lldb-enumerations.h" + +#include "lldb/Core/Debugger.h" +#include "lldb/Core/FormatClasses.h" +#include "lldb/Core/StreamString.h" +#include "lldb/Symbol/ClangASTType.h" +#include "lldb/Target/StackFrame.h" + +using namespace lldb; +using namespace lldb_private; + +std::string +ValueFormat::FormatObject(lldb::ValueObjectSP object) +{ + if (!object.get()) + return "NULL"; + + StreamString sstr; + + if (ClangASTType::DumpTypeValue (object->GetClangAST(), // The clang AST + object->GetClangType(), // The clang type to display + &sstr, + m_format, // Format to display this type with + object->GetDataExtractor(), // Data to extract from + 0, // Byte offset into "data" + object->GetByteSize(), // Byte size of item in "data" + object->GetBitfieldBitSize(), // Bitfield bit size + object->GetBitfieldBitOffset())) // Bitfield bit offset + return (sstr.GetString()); + else + { + return ("unsufficient data for value"); + } +} + +std::string +StringSummaryFormat::FormatObject(lldb::ValueObjectSP object) +{ + if (!object.get()) + return "NULL"; + + StreamString s; + ExecutionContext exe_ctx; + object->GetExecutionContextScope()->CalculateExecutionContext(exe_ctx); + SymbolContext sc; + if (exe_ctx.frame) + sc = exe_ctx.frame->GetSymbolContext(lldb::eSymbolContextEverything); + + if (m_show_members_oneliner) + { + const uint32_t num_children = object->GetNumChildren(); + if (num_children) + { + s.PutChar('('); + + for (uint32_t idx=0; idx<num_children; ++idx) + { + lldb::ValueObjectSP child_sp(object->GetChildAtIndex(idx, true)); + if (child_sp.get()) + { + if (idx) + s.PutCString(", "); + s.PutCString(child_sp.get()->GetName().AsCString()); + s.PutChar('='); + s.PutCString(child_sp.get()->GetPrintableRepresentation()); + } + } + + s.PutChar(')'); + + return s.GetString(); + } + else + return ""; + + } + else + { + if (Debugger::FormatPrompt(m_format.c_str(), &sc, &exe_ctx, &sc.line_entry.range.GetBaseAddress(), s, NULL, object.get())) + return s.GetString(); + else + return ""; + } +} + +std::string +StringSummaryFormat::GetDescription() +{ + StreamString sstr; + sstr.Printf ("`%s`%s%s%s%s%s%s", m_format.c_str(), + m_cascades ? "" : " (not cascading)", + m_dont_show_children ? "" : " (show children)", + m_dont_show_value ? " (hide value)" : "", + m_show_members_oneliner ? " (one-line printout)" : "", + m_skip_pointers ? " (skip pointers)" : "", + m_skip_references ? " (skip references)" : ""); + return sstr.GetString(); +} + +std::string +ScriptSummaryFormat::FormatObject(lldb::ValueObjectSP object) +{ + return std::string(ScriptInterpreterPython::CallPythonScriptFunction(m_function_name.c_str(), + object).c_str()); +} + +std::string +ScriptSummaryFormat::GetDescription() +{ + StreamString sstr; + sstr.Printf ("%s%s%s%s%s%s\n%s", m_cascades ? "" : " (not cascading)", + m_dont_show_children ? "" : " (show children)", + m_dont_show_value ? " (hide value)" : "", + m_show_members_oneliner ? " (one-line printout)" : "", + m_skip_pointers ? " (skip pointers)" : "", + m_skip_references ? " (skip references)" : "", + m_python_script.c_str()); + return sstr.GetString(); + +} + + diff --git a/lldb/source/Core/FormatManager.cpp b/lldb/source/Core/FormatManager.cpp index 2ce91aed8fd..e064534028f 100644 --- a/lldb/source/Core/FormatManager.cpp +++ b/lldb/source/Core/FormatManager.cpp @@ -184,7 +184,7 @@ FormatNavigator<lldb::RegularExpressionSP, SummaryFormat>::Delete(const char* ty if ( ::strcmp(type,regex->GetText()) == 0) { m_format_map.map().erase(pos); - if(m_format_map.listener) + if (m_format_map.listener) m_format_map.listener->Changed(); return true; } @@ -220,75 +220,4 @@ FormatManager::GetSingleItemFormat(lldb::Format vector_format) default: return lldb::eFormatInvalid; } -} - -std::string -StringSummaryFormat::FormatObject(lldb::ValueObjectSP object) -{ - if (!object.get()) - return "NULL"; - - StreamString s; - ExecutionContext exe_ctx; - object->GetExecutionContextScope()->CalculateExecutionContext(exe_ctx); - SymbolContext sc; - if (exe_ctx.frame) - sc = exe_ctx.frame->GetSymbolContext(lldb::eSymbolContextEverything); - - if (m_show_members_oneliner) - { - const uint32_t num_children = object->GetNumChildren(); - if (num_children) - { - s.PutChar('('); - - for (uint32_t idx=0; idx<num_children; ++idx) - { - lldb::ValueObjectSP child_sp(object->GetChildAtIndex(idx, true)); - if (child_sp.get()) - { - if (idx) - s.PutCString(", "); - s.PutCString(child_sp.get()->GetName().AsCString()); - s.PutChar('='); - s.PutCString(child_sp.get()->GetPrintableRepresentation()); - } - } - - s.PutChar(')'); - - return s.GetString(); - } - else - return ""; - - } - else - { - if (Debugger::FormatPrompt(m_format.c_str(), &sc, &exe_ctx, &sc.line_entry.range.GetBaseAddress(), s, NULL, object.get())) - return s.GetString(); - else - return ""; - } -} - -void -FormatCategory::ChooseAsPreferential(const char* name) -{ - Mutex::Locker(m_mutex); - lldb::SummaryFormatSP format; - - uint32_t revision = Debugger::Formatting::ValueFormats::GetCurrentRevision(); - - if ( Summary()->Get(name, format) ) - format->SetPriority(revision); - - format.reset(); - - if ( RegexSummary()->Get(name, format) ) - format->SetPriority(revision); - - if(m_change_listener) - m_change_listener->Changed(); - -} +}
\ No newline at end of file diff --git a/lldb/source/Expression/ClangExpressionParser.cpp b/lldb/source/Expression/ClangExpressionParser.cpp index 2c411e4a623..c7050f328f4 100644 --- a/lldb/source/Expression/ClangExpressionParser.cpp +++ b/lldb/source/Expression/ClangExpressionParser.cpp @@ -506,7 +506,7 @@ ClangExpressionParser::MakeJIT (lldb::addr_t &func_allocation_addr, } else { - if(log) + if (log) log->Printf("Found function %s for %s", function_name.c_str(), m_expr.FunctionName()); } @@ -733,7 +733,7 @@ ClangExpressionParser::DisassembleFunction (Stream &stream, ExecutionContext &ex return ret; } - if(log) + if (log) log->Printf("Found function, has local address 0x%llx and remote address 0x%llx", (uint64_t)func_local_addr, (uint64_t)func_remote_addr); std::pair <lldb::addr_t, lldb::addr_t> func_range; @@ -747,7 +747,7 @@ ClangExpressionParser::DisassembleFunction (Stream &stream, ExecutionContext &ex return ret; } - if(log) + if (log) log->Printf("Function's code range is [0x%llx-0x%llx]", func_range.first, func_range.second); if (!exe_ctx.target) diff --git a/lldb/source/Expression/ClangUserExpression.cpp b/lldb/source/Expression/ClangUserExpression.cpp index 0df6a5b63b7..359b011c546 100644 --- a/lldb/source/Expression/ClangUserExpression.cpp +++ b/lldb/source/Expression/ClangUserExpression.cpp @@ -179,7 +179,7 @@ ClangUserExpression::Parse (Stream &error_stream, m_needs_object_ptr = true; } - else if(m_objectivec) + else if (m_objectivec) { const char *function_name = FunctionName(); diff --git a/lldb/source/Expression/IRDynamicChecks.cpp b/lldb/source/Expression/IRDynamicChecks.cpp index 09f520c731c..dd09b12e716 100644 --- a/lldb/source/Expression/IRDynamicChecks.cpp +++ b/lldb/source/Expression/IRDynamicChecks.cpp @@ -307,7 +307,7 @@ private: { lldb::LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_EXPRESSIONS)); - if(log) + if (log) log->Printf("Instrumenting load/store instruction: %s\n", PrintValue(inst).c_str()); diff --git a/lldb/source/Expression/IRForTarget.cpp b/lldb/source/Expression/IRForTarget.cpp index 03716ff1eb6..e20af16f61d 100644 --- a/lldb/source/Expression/IRForTarget.cpp +++ b/lldb/source/Expression/IRForTarget.cpp @@ -253,7 +253,7 @@ IRForTarget::MaybeSetCastResult (lldb_private::TypeFromParser type) { next_value = cast_inst->getOperand(0); } - else if(load_inst) + else if (load_inst) { if (isa<LoadInst>(load_inst->getPointerOperand())) { @@ -1064,7 +1064,7 @@ IRForTarget::RewriteObjCSelectors (BasicBlock &basic_block) if (m_error_stream) m_error_stream->Printf("Internal error [IRForTarget]: Couldn't change a static reference to an Objective-C selector to a dynamic reference\n"); - if(log) + if (log) log->PutCString("Couldn't rewrite a reference to an Objective-C selector"); return false; @@ -1198,7 +1198,7 @@ IRForTarget::RewritePersistentAllocs(llvm::BasicBlock &basic_block) if (m_error_stream) m_error_stream->Printf("Internal error [IRForTarget]: Couldn't rewrite the creation of a persistent variable\n"); - if(log) + if (log) log->PutCString("Couldn't rewrite the creation of a persistent variable"); return false; diff --git a/lldb/source/Plugins/Disassembler/llvm/DisassemblerLLVM.cpp b/lldb/source/Plugins/Disassembler/llvm/DisassemblerLLVM.cpp index caed8c51063..972d9a3ad16 100644 --- a/lldb/source/Plugins/Disassembler/llvm/DisassemblerLLVM.cpp +++ b/lldb/source/Plugins/Disassembler/llvm/DisassemblerLLVM.cpp @@ -325,7 +325,7 @@ InstructionLLVM::Dump if (show_token) { - if(EDGetTokenString(&tokenStr, token)) + if (EDGetTokenString(&tokenStr, token)) { printTokenized = false; break; diff --git a/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntime.cpp b/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntime.cpp index cc42306b20c..e62c3bb7749 100644 --- a/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntime.cpp +++ b/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntime.cpp @@ -167,7 +167,7 @@ AppleObjCRuntime::GetPrintForDebuggerAddr() SymbolContextList contexts; SymbolContext context; - if((!modules.FindSymbolsWithNameAndType(ConstString ("_NSPrintForDebugger"), eSymbolTypeCode, contexts)) && + if ((!modules.FindSymbolsWithNameAndType(ConstString ("_NSPrintForDebugger"), eSymbolTypeCode, contexts)) && (!modules.FindSymbolsWithNameAndType(ConstString ("_CFPrintForDebugger"), eSymbolTypeCode, contexts))) return NULL; diff --git a/lldb/source/Target/StackFrame.cpp b/lldb/source/Target/StackFrame.cpp index ac67767b6e5..48055d075e7 100644 --- a/lldb/source/Target/StackFrame.cpp +++ b/lldb/source/Target/StackFrame.cpp @@ -752,15 +752,15 @@ StackFrame::GetValueForVariableExpressionPath (const char *var_expr_cstr, // able to find the child member break; } - else if(end && *end == '-') + else if (end && *end == '-') { // this is most probably a BitField, let's take a look char *real_end = NULL; long final_index = ::strtol (end+1, &real_end, 0); - if(real_end && *real_end == ']') + if (real_end && *real_end == ']') { // if the format given is [high-low], swap range - if(child_index > final_index) + if (child_index > final_index) { long temp = child_index; child_index = final_index; diff --git a/lldb/source/Target/ThreadPlanCallFunction.cpp b/lldb/source/Target/ThreadPlanCallFunction.cpp index 163322a661a..07608726908 100644 --- a/lldb/source/Target/ThreadPlanCallFunction.cpp +++ b/lldb/source/Target/ThreadPlanCallFunction.cpp @@ -339,7 +339,7 @@ ThreadPlanCallFunction::PlanExplainsStop () // If our subplan knows why we stopped, even if it's done (which would forward the question to us) // we answer yes. - if(m_subplan_sp.get() != NULL && m_subplan_sp->PlanExplainsStop()) + if (m_subplan_sp.get() != NULL && m_subplan_sp->PlanExplainsStop()) return true; // Check if the breakpoint is one of ours. |