diff options
author | Dimitry Andric <dim@FreeBSD.org> | 2017-04-16 16:04:10 +0000 |
---|---|---|
committer | Dimitry Andric <dim@FreeBSD.org> | 2017-04-16 16:04:10 +0000 |
commit | 74a628f776edb588bff8f8f5cc16eac947c9d631 (patch) | |
tree | dc32e010ac4902621e5a279bfeb48628f7f0e166 /source/Core/FormatEntity.cpp | |
parent | afed7be32164a598f8172282c249af7266c48b46 (diff) |
Notes
Diffstat (limited to 'source/Core/FormatEntity.cpp')
-rw-r--r-- | source/Core/FormatEntity.cpp | 65 |
1 files changed, 47 insertions, 18 deletions
diff --git a/source/Core/FormatEntity.cpp b/source/Core/FormatEntity.cpp index 08166d208aeea..835a1c54a0e05 100644 --- a/source/Core/FormatEntity.cpp +++ b/source/Core/FormatEntity.cpp @@ -9,33 +9,31 @@ #include "lldb/Core/FormatEntity.h" -// C Includes -// C++ Includes -// Other libraries and framework includes -#include "llvm/ADT/STLExtras.h" -#include "llvm/ADT/StringRef.h" - -// Project includes #include "lldb/Core/Address.h" +#include "lldb/Core/AddressRange.h" // for AddressRange +#include "lldb/Core/ArchSpec.h" // for ArchSpec #include "lldb/Core/Debugger.h" #include "lldb/Core/Module.h" -#include "lldb/Core/Stream.h" -#include "lldb/Core/StreamString.h" +#include "lldb/Core/RegisterValue.h" // for RegisterValue +#include "lldb/Core/StructuredData.h" // for StructuredData::O... #include "lldb/Core/ValueObject.h" #include "lldb/Core/ValueObjectVariable.h" #include "lldb/DataFormatters/DataVisualization.h" +#include "lldb/DataFormatters/FormatClasses.h" // for TypeNameSpecifier... #include "lldb/DataFormatters/FormatManager.h" -#include "lldb/DataFormatters/ValueObjectPrinter.h" +#include "lldb/DataFormatters/TypeSummary.h" // for TypeSummaryImpl::... #include "lldb/Expression/ExpressionVariable.h" -#include "lldb/Host/FileSpec.h" #include "lldb/Interpreter/CommandInterpreter.h" #include "lldb/Symbol/Block.h" #include "lldb/Symbol/CompileUnit.h" +#include "lldb/Symbol/CompilerType.h" // for CompilerType #include "lldb/Symbol/Function.h" #include "lldb/Symbol/LineEntry.h" #include "lldb/Symbol/Symbol.h" +#include "lldb/Symbol/SymbolContext.h" // for SymbolContext #include "lldb/Symbol/VariableList.h" #include "lldb/Target/ExecutionContext.h" +#include "lldb/Target/ExecutionContextScope.h" // for ExecutionContextS... #include "lldb/Target/Language.h" #include "lldb/Target/Process.h" #include "lldb/Target/RegisterContext.h" @@ -45,6 +43,36 @@ #include "lldb/Target/Target.h" #include "lldb/Target/Thread.h" #include "lldb/Utility/AnsiTerminal.h" +#include "lldb/Utility/ConstString.h" // for ConstString, oper... +#include "lldb/Utility/FileSpec.h" +#include "lldb/Utility/Log.h" // for Log +#include "lldb/Utility/Logging.h" // for GetLogIfAllCatego... +#include "lldb/Utility/SharingPtr.h" // for SharingPtr +#include "lldb/Utility/Stream.h" +#include "lldb/Utility/StreamString.h" +#include "lldb/Utility/StringList.h" // for StringList +#include "lldb/lldb-defines.h" // for LLDB_INVALID_ADDRESS +#include "lldb/lldb-forward.h" // for ValueObjectSP +#include "llvm/ADT/STLExtras.h" +#include "llvm/ADT/StringRef.h" +#include "llvm/ADT/Triple.h" // for Triple, Triple::O... +#include "llvm/Support/Compiler.h" // for LLVM_FALLTHROUGH + +#include <ctype.h> // for isxdigit +#include <inttypes.h> // for PRIu64, PRIx64 +#include <memory> // for shared_ptr, opera... +#include <stdio.h> // for sprintf +#include <stdlib.h> // for strtoul +#include <string.h> // for size_t, strchr +#include <type_traits> // for move +#include <utility> // for pair + +namespace lldb_private { +class ScriptInterpreter; +} +namespace lldb_private { +struct RegisterInfo; +} using namespace lldb; using namespace lldb_private; @@ -64,14 +92,14 @@ enum FileKind { FileError = 0, Basename, Dirname, Fullpath }; #define ENTRY_CHILDREN(n, t, f, c) \ { \ n, nullptr, FormatEntity::Entry::Type::t, \ - FormatEntity::Entry::FormatType::f, 0, llvm::array_lengthof(c), c, \ - false \ + FormatEntity::Entry::FormatType::f, 0, \ + static_cast<uint32_t>(llvm::array_lengthof(c)), c, false \ } #define ENTRY_CHILDREN_KEEP_SEP(n, t, f, c) \ { \ n, nullptr, FormatEntity::Entry::Type::t, \ - FormatEntity::Entry::FormatType::f, 0, llvm::array_lengthof(c), c, \ - true \ + FormatEntity::Entry::FormatType::f, 0, \ + static_cast<uint32_t>(llvm::array_lengthof(c)), c, true \ } #define ENTRY_STRING(n, s) \ { \ @@ -822,8 +850,8 @@ static bool DumpValue(Stream &s, const SymbolContext *sc, StreamString bitfield_name; bitfield_name.Printf("%s:%d", target->GetTypeName().AsCString(), target->GetBitfieldBitSize()); - lldb::TypeNameSpecifierImplSP type_sp( - new TypeNameSpecifierImpl(bitfield_name.GetString(), false)); + auto type_sp = std::make_shared<TypeNameSpecifierImpl>( + bitfield_name.GetString(), false); if (val_obj_display == ValueObject::eValueObjectRepresentationStyleSummary && !DataVisualization::GetSummaryForType(type_sp)) @@ -1187,7 +1215,8 @@ bool FormatEntity::Format(const Entry &entry, Stream &s, ? arch.GetTriple().getOS() : llvm::Triple::UnknownOS; if ((ostype == llvm::Triple::FreeBSD) || - (ostype == llvm::Triple::Linux)) { + (ostype == llvm::Triple::Linux) || + (ostype == llvm::Triple::NetBSD)) { format = "%" PRIu64; } } else { |