[Lldb-commits] [PATCH] D116896: [lldb] [gdb-remote] Support client fallback for servers without reg defs (WIP)

2022-01-09 Thread Michał Górny via Phabricator via lldb-commits
mgorny created this revision.
mgorny added reviewers: labath, krytarowski, emaste.
Herald added subscribers: pengfei, arichardson.
mgorny requested review of this revision.

Provide minimal register definition defaults for working with servers
that implement neither target.xml nor qRegisterInfo packets.  This is
useful e.g. when interacting with FreeBSD's kernel minimal gdbserver
that does not send target.xml but uses the same layout for its supported
register subset as GDB.

The prerequisite for this is the ability to determine the correct
architecture, e.g. from the target executable.

For now, this is a proof-of-concept that only supports x86_64.
I'm working on tests.


https://reviews.llvm.org/D116896

Files:
  lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp


Index: lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
===
--- lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
+++ lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
@@ -375,6 +375,46 @@
   return regnums.size();
 }
 
+static std::vector GetRegisters_x86_64() {
+  ConstString empty_alt_name;
+  ConstString reg_set{"general purpose registers"};
+
+#define R64(name)  
\
+  DynamicRegisterInfo::Register {  
\
+ConstString(#name), empty_alt_name, reg_set, 8, LLDB_INVALID_INDEX32,  
\
+lldb::eEncodingUint, lldb::eFormatHex, LLDB_INVALID_REGNUM,
\
+LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, {}, {}, 
\
+  }
+#define R32(name)  
\
+  DynamicRegisterInfo::Register{   
\
+  ConstString(#name),  
\
+  empty_alt_name,  
\
+  reg_set, 
\
+  4,   
\
+  LLDB_INVALID_INDEX32,
\
+  lldb::eEncodingUint, 
\
+  lldb::eFormatHex,
\
+  LLDB_INVALID_REGNUM, 
\
+  LLDB_INVALID_REGNUM, 
\
+  LLDB_INVALID_REGNUM, 
\
+  LLDB_INVALID_REGNUM, 
\
+  {},  
\
+  {},  
\
+  }
+
+  std::vector registers{
+  R64(rax), R64(rbx), R64(rcx), R64(rdx), R64(rsi), R64(rdi),
+  R64(rbp), R64(rsp), R64(r8),  R64(r9),  R64(r10), R64(r11),
+  R64(r12), R64(r13), R64(r14), R64(r15), R64(rip), R32(eflags),
+  R32(cs),  R32(ss),  R32(ds),  R32(es),  R32(fs),  R32(gs),
+  };
+
+#undef R32
+#undef R64
+
+  return registers;
+}
+
 void ProcessGDBRemote::BuildDynamicRegisterInfo(bool force) {
   if (!force && m_register_info_sp)
 return;
@@ -394,6 +434,7 @@
   // 2 - If the target definition doesn't have any of the info from the
   // target.xml (registers) then proceed to read the target.xml.
   // 3 - Fall back on the qRegisterInfo packets.
+  // 4 - Use hardcoded defaults if available.
 
   FileSpec target_definition_fspec =
   GetGlobalPluginProperties().GetTargetDefinitionFile();
@@ -507,6 +548,18 @@
 }
   }
 
+  if (registers.empty()) {
+switch (arch_to_use.GetMachine()) {
+case llvm::Triple::x86:
+  break;
+case llvm::Triple::x86_64:
+  registers = GetRegisters_x86_64();
+  break;
+default:
+  break;
+}
+  }
+
   AddRemoteRegisters(registers, arch_to_use);
 }
 


Index: lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
===
--- lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
+++ lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
@@ -375,6 +375,46 @@
   return regnums.size();
 }
 
+static std::vector GetRegisters_x86_64() {
+  ConstString empty_alt_name;
+  ConstString reg_set{"general purpose registers"};
+
+#define R64(name)  \
+  DynamicRegisterInfo::Register {  \
+ConstString(#name), empty_alt_name, reg_set, 8, LLDB_INVALID_INDEX32,  \
+lldb::eEncodingUint, lldb::eFormatHex, LLDB_INVALID_REGNUM,\
+LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, {}, {}, \
+  }
+#define R32(name)   

[Lldb-commits] [PATCH] D116896: [lldb] [gdb-remote] Support client fallback for servers without reg defs (WIP)

2022-01-09 Thread Michał Górny via Phabricator via lldb-commits
mgorny updated this revision to Diff 398447.
mgorny added a comment.

Improve macro formatting while it's still hot.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D116896/new/

https://reviews.llvm.org/D116896

Files:
  lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp


Index: lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
===
--- lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
+++ lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
@@ -375,6 +375,36 @@
   return regnums.size();
 }
 
+static std::vector GetRegisters_x86_64() {
+  ConstString empty_alt_name;
+  ConstString reg_set{"general purpose registers"};
+
+#define R64(name)  
\
+  DynamicRegisterInfo::Register {  
\
+ConstString(#name), empty_alt_name, reg_set, 8, LLDB_INVALID_INDEX32,  
\
+lldb::eEncodingUint, lldb::eFormatHex, LLDB_INVALID_REGNUM,
\
+LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, {}, {}  
\
+  }
+#define R32(name)  
\
+  DynamicRegisterInfo::Register {  
\
+ConstString(#name), empty_alt_name, reg_set, 4, LLDB_INVALID_INDEX32,  
\
+lldb::eEncodingUint, lldb::eFormatHex, LLDB_INVALID_REGNUM,
\
+LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, {}, {}  
\
+  }
+
+  std::vector registers{
+  R64(rax), R64(rbx), R64(rcx), R64(rdx), R64(rsi), R64(rdi),
+  R64(rbp), R64(rsp), R64(r8),  R64(r9),  R64(r10), R64(r11),
+  R64(r12), R64(r13), R64(r14), R64(r15), R64(rip), R32(eflags),
+  R32(cs),  R32(ss),  R32(ds),  R32(es),  R32(fs),  R32(gs),
+  };
+
+#undef R32
+#undef R64
+
+  return registers;
+}
+
 void ProcessGDBRemote::BuildDynamicRegisterInfo(bool force) {
   if (!force && m_register_info_sp)
 return;
@@ -394,6 +424,7 @@
   // 2 - If the target definition doesn't have any of the info from the
   // target.xml (registers) then proceed to read the target.xml.
   // 3 - Fall back on the qRegisterInfo packets.
+  // 4 - Use hardcoded defaults if available.
 
   FileSpec target_definition_fspec =
   GetGlobalPluginProperties().GetTargetDefinitionFile();
@@ -507,6 +538,18 @@
 }
   }
 
+  if (registers.empty()) {
+switch (arch_to_use.GetMachine()) {
+case llvm::Triple::x86:
+  break;
+case llvm::Triple::x86_64:
+  registers = GetRegisters_x86_64();
+  break;
+default:
+  break;
+}
+  }
+
   AddRemoteRegisters(registers, arch_to_use);
 }
 


Index: lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
===
--- lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
+++ lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
@@ -375,6 +375,36 @@
   return regnums.size();
 }
 
+static std::vector GetRegisters_x86_64() {
+  ConstString empty_alt_name;
+  ConstString reg_set{"general purpose registers"};
+
+#define R64(name)  \
+  DynamicRegisterInfo::Register {  \
+ConstString(#name), empty_alt_name, reg_set, 8, LLDB_INVALID_INDEX32,  \
+lldb::eEncodingUint, lldb::eFormatHex, LLDB_INVALID_REGNUM,\
+LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, {}, {}  \
+  }
+#define R32(name)  \
+  DynamicRegisterInfo::Register {  \
+ConstString(#name), empty_alt_name, reg_set, 4, LLDB_INVALID_INDEX32,  \
+lldb::eEncodingUint, lldb::eFormatHex, LLDB_INVALID_REGNUM,\
+LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, {}, {}  \
+  }
+
+  std::vector registers{
+  R64(rax), R64(rbx), R64(rcx), R64(rdx), R64(rsi), R64(rdi),
+  R64(rbp), R64(rsp), R64(r8),  R64(r9),  R64(r10), R64(r11),
+  R64(r12), R64(r13), R64(r14), R64(r15), R64(rip), R32(eflags),
+  R32(cs),  R32(ss),  R32(ds),  R32(es),  R32(fs),  R32(gs),
+  };
+
+#undef R32
+#undef R64
+
+  return registers;
+}
+
 void ProcessGDBRemote::BuildDynamicRegisterInfo(bool force) {
   if (!force && m_register_info_sp)
 return;
@@ -394,6 +424,7 @@
   // 2 - If the target definition doesn't have any of the info from the
   // target.xml (registers) then proceed to read the target.xml.
   // 3 - Fall back on the qRegisterInfo packets.
+  // 4 - Use hardcoded defaults if available.
 
   FileSpec target_definition_fspec =
   GetGlobalPluginProperties().GetTargetDefinitionFile();
@@ -507,6 +538,18 @@
 }
   }
 
+  if (registers.empty()) {
+switch (arch_to_use.GetMachine()) {
+case llvm::Triple:

[Lldb-commits] [lldb] 9d9f3e0 - [lldb] Remove ProcessStructReader from NSStringSummaryProvider (NFC)

2022-01-09 Thread Dave Lee via lldb-commits

Author: Dave Lee
Date: 2022-01-09T12:09:02-08:00
New Revision: 9d9f3e0ec773c6a2c570c8bc7484367bff73190c

URL: 
https://github.com/llvm/llvm-project/commit/9d9f3e0ec773c6a2c570c8bc7484367bff73190c
DIFF: 
https://github.com/llvm/llvm-project/commit/9d9f3e0ec773c6a2c570c8bc7484367bff73190c.diff

LOG: [lldb] Remove ProcessStructReader from NSStringSummaryProvider (NFC)

Simplify getting the length of `NSPathStore2` strings.

`NSStringSummaryProvider` uses a single field from `NSPathStore2` instances,
its first ivar: `_lengthAndRefCount`. This change uses
`GetSyntheticChildAtOffset` to replace the use of `ProcessStructReader`, and
removes the hard coded `CompilerType` definition of `NSPathStore2`.

Differential Revision: https://reviews.llvm.org/D116461

Added: 


Modified: 
lldb/source/Plugins/Language/ObjC/NSString.cpp

Removed: 




diff  --git a/lldb/source/Plugins/Language/ObjC/NSString.cpp 
b/lldb/source/Plugins/Language/ObjC/NSString.cpp
index 2b5161e781f23..61705c866778c 100644
--- a/lldb/source/Plugins/Language/ObjC/NSString.cpp
+++ b/lldb/source/Plugins/Language/ObjC/NSString.cpp
@@ -8,14 +8,13 @@
 
 #include "NSString.h"
 
-#include "Plugins/TypeSystem/Clang/TypeSystemClang.h"
 #include "lldb/Core/ValueObject.h"
 #include "lldb/Core/ValueObjectConstResult.h"
 #include "lldb/DataFormatters/FormattersHelpers.h"
 #include "lldb/DataFormatters/StringPrinter.h"
 #include "lldb/Target/Language.h"
-#include "lldb/Target/ProcessStructReader.h"
 #include "lldb/Target/Target.h"
+#include "lldb/Utility/ConstString.h"
 #include "lldb/Utility/DataBufferHeap.h"
 #include "lldb/Utility/Endian.h"
 #include "lldb/Utility/Status.h"
@@ -31,24 +30,6 @@ NSString_Additionals::GetAdditionalSummaries() {
   return g_map;
 }
 
-static CompilerType GetNSPathStore2Type(Target &target) {
-  static ConstString g_type_name("__lldb_autogen_nspathstore2");
-
-  TypeSystemClang *ast_ctx = ScratchTypeSystemClang::GetForTarget(target);
-
-  if (!ast_ctx)
-return CompilerType();
-
-  CompilerType voidstar =
-  ast_ctx->GetBasicType(lldb::eBasicTypeVoid).GetPointerType();
-  CompilerType uint32 =
-  ast_ctx->GetBuiltinTypeForEncodingAndBitSize(eEncodingUint, 32);
-
-  return ast_ctx->GetOrCreateStructForIdentifier(
-  g_type_name,
-  {{"isa", voidstar}, {"lengthAndRef", uint32}, {"buffer", voidstar}});
-}
-
 bool lldb_private::formatters::NSStringSummaryProvider(
 ValueObject &valobj, Stream &stream,
 const TypeSummaryOptions &summary_options) {
@@ -229,11 +210,17 @@ bool lldb_private::formatters::NSStringSummaryProvider(
 return StringPrinter::ReadStringAndDumpToStream<
 StringPrinter::StringElementType::UTF16>(options);
   } else if (is_path_store) {
-ProcessStructReader reader(valobj.GetProcessSP().get(),
-   valobj.GetValueAsUnsigned(0),
-   GetNSPathStore2Type(*valobj.GetTargetSP()));
-explicit_length =
-reader.GetField(ConstString("lengthAndRef")) >> 20;
+// _lengthAndRefCount is the first ivar of NSPathStore2 (after the isa).
+uint64_t length_ivar_offset = 1 * ptr_size;
+CompilerType length_type = valobj.GetCompilerType().GetBasicTypeFromAST(
+lldb::eBasicTypeUnsignedInt);
+ValueObjectSP length_valobj_sp =
+valobj.GetSyntheticChildAtOffset(length_ivar_offset, length_type, true,
+ ConstString("_lengthAndRefCount"));
+if (!length_valobj_sp)
+  return false;
+// Get the length out of _lengthAndRefCount.
+explicit_length = length_valobj_sp->GetValueAsUnsigned(0) >> 20;
 lldb::addr_t location = valobj.GetValueAsUnsigned(0) + ptr_size + 4;
 
 options.SetLocation(location);



___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D116461: [lldb] Remove ProcessStructReader from NSStringSummaryProvider (NFC)

2022-01-09 Thread Dave Lee via Phabricator via lldb-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rG9d9f3e0ec773: [lldb] Remove ProcessStructReader from 
NSStringSummaryProvider (NFC) (authored by kastiglione).

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D116461/new/

https://reviews.llvm.org/D116461

Files:
  lldb/source/Plugins/Language/ObjC/NSString.cpp


Index: lldb/source/Plugins/Language/ObjC/NSString.cpp
===
--- lldb/source/Plugins/Language/ObjC/NSString.cpp
+++ lldb/source/Plugins/Language/ObjC/NSString.cpp
@@ -8,14 +8,13 @@
 
 #include "NSString.h"
 
-#include "Plugins/TypeSystem/Clang/TypeSystemClang.h"
 #include "lldb/Core/ValueObject.h"
 #include "lldb/Core/ValueObjectConstResult.h"
 #include "lldb/DataFormatters/FormattersHelpers.h"
 #include "lldb/DataFormatters/StringPrinter.h"
 #include "lldb/Target/Language.h"
-#include "lldb/Target/ProcessStructReader.h"
 #include "lldb/Target/Target.h"
+#include "lldb/Utility/ConstString.h"
 #include "lldb/Utility/DataBufferHeap.h"
 #include "lldb/Utility/Endian.h"
 #include "lldb/Utility/Status.h"
@@ -31,24 +30,6 @@
   return g_map;
 }
 
-static CompilerType GetNSPathStore2Type(Target &target) {
-  static ConstString g_type_name("__lldb_autogen_nspathstore2");
-
-  TypeSystemClang *ast_ctx = ScratchTypeSystemClang::GetForTarget(target);
-
-  if (!ast_ctx)
-return CompilerType();
-
-  CompilerType voidstar =
-  ast_ctx->GetBasicType(lldb::eBasicTypeVoid).GetPointerType();
-  CompilerType uint32 =
-  ast_ctx->GetBuiltinTypeForEncodingAndBitSize(eEncodingUint, 32);
-
-  return ast_ctx->GetOrCreateStructForIdentifier(
-  g_type_name,
-  {{"isa", voidstar}, {"lengthAndRef", uint32}, {"buffer", voidstar}});
-}
-
 bool lldb_private::formatters::NSStringSummaryProvider(
 ValueObject &valobj, Stream &stream,
 const TypeSummaryOptions &summary_options) {
@@ -229,11 +210,17 @@
 return StringPrinter::ReadStringAndDumpToStream<
 StringPrinter::StringElementType::UTF16>(options);
   } else if (is_path_store) {
-ProcessStructReader reader(valobj.GetProcessSP().get(),
-   valobj.GetValueAsUnsigned(0),
-   GetNSPathStore2Type(*valobj.GetTargetSP()));
-explicit_length =
-reader.GetField(ConstString("lengthAndRef")) >> 20;
+// _lengthAndRefCount is the first ivar of NSPathStore2 (after the isa).
+uint64_t length_ivar_offset = 1 * ptr_size;
+CompilerType length_type = valobj.GetCompilerType().GetBasicTypeFromAST(
+lldb::eBasicTypeUnsignedInt);
+ValueObjectSP length_valobj_sp =
+valobj.GetSyntheticChildAtOffset(length_ivar_offset, length_type, true,
+ ConstString("_lengthAndRefCount"));
+if (!length_valobj_sp)
+  return false;
+// Get the length out of _lengthAndRefCount.
+explicit_length = length_valobj_sp->GetValueAsUnsigned(0) >> 20;
 lldb::addr_t location = valobj.GetValueAsUnsigned(0) + ptr_size + 4;
 
 options.SetLocation(location);


Index: lldb/source/Plugins/Language/ObjC/NSString.cpp
===
--- lldb/source/Plugins/Language/ObjC/NSString.cpp
+++ lldb/source/Plugins/Language/ObjC/NSString.cpp
@@ -8,14 +8,13 @@
 
 #include "NSString.h"
 
-#include "Plugins/TypeSystem/Clang/TypeSystemClang.h"
 #include "lldb/Core/ValueObject.h"
 #include "lldb/Core/ValueObjectConstResult.h"
 #include "lldb/DataFormatters/FormattersHelpers.h"
 #include "lldb/DataFormatters/StringPrinter.h"
 #include "lldb/Target/Language.h"
-#include "lldb/Target/ProcessStructReader.h"
 #include "lldb/Target/Target.h"
+#include "lldb/Utility/ConstString.h"
 #include "lldb/Utility/DataBufferHeap.h"
 #include "lldb/Utility/Endian.h"
 #include "lldb/Utility/Status.h"
@@ -31,24 +30,6 @@
   return g_map;
 }
 
-static CompilerType GetNSPathStore2Type(Target &target) {
-  static ConstString g_type_name("__lldb_autogen_nspathstore2");
-
-  TypeSystemClang *ast_ctx = ScratchTypeSystemClang::GetForTarget(target);
-
-  if (!ast_ctx)
-return CompilerType();
-
-  CompilerType voidstar =
-  ast_ctx->GetBasicType(lldb::eBasicTypeVoid).GetPointerType();
-  CompilerType uint32 =
-  ast_ctx->GetBuiltinTypeForEncodingAndBitSize(eEncodingUint, 32);
-
-  return ast_ctx->GetOrCreateStructForIdentifier(
-  g_type_name,
-  {{"isa", voidstar}, {"lengthAndRef", uint32}, {"buffer", voidstar}});
-}
-
 bool lldb_private::formatters::NSStringSummaryProvider(
 ValueObject &valobj, Stream &stream,
 const TypeSummaryOptions &summary_options) {
@@ -229,11 +210,17 @@
 return StringPrinter::ReadStringAndDumpToStream<
 StringPrinter::StringElementType::UTF16>(options);
   } else if (is_path_store) {
-ProcessStructReader reader(valobj.GetProcessSP().get(),
-   valobj.GetValueAsUnsigned(0),
-  

[Lldb-commits] [lldb] 39ea676 - [lldb] Compute fully qualified command names in FindCommandsForApropos

2022-01-09 Thread Dave Lee via lldb-commits

Author: Dave Lee
Date: 2022-01-09T12:11:32-08:00
New Revision: 39ea676d9d0ea467b7e5fe2d5c25d22a2d906041

URL: 
https://github.com/llvm/llvm-project/commit/39ea676d9d0ea467b7e5fe2d5c25d22a2d906041
DIFF: 
https://github.com/llvm/llvm-project/commit/39ea676d9d0ea467b7e5fe2d5c25d22a2d906041.diff

LOG: [lldb] Compute fully qualified command names in FindCommandsForApropos

Fixes incomplete command names in `apropos` results.

The full command names given by `apropos` have come from command name string
literals given to `CommandObject` constructors. For most commands, this has
been accurate, but some commands have incorrect strings. This results in
`apropos` output that doesn't tell the user the full command name they might
want learn more about. These strings can be fixed.

There's a seperate issue that can't be fixed as easily: plugin commands. With
the way they're implemented, plugin commands have to exclude the root command
from their command name string. To illustrate, the `language objc` subcommand
has to set its command name string to "objc", which results in apropos printing
results as `objc ...` instead of `language objc ...`.

To fix both of these issues, this commit changes `FindCommandsForApropos` to
derive the fully qualified command name using the keys of subcommand maps.

Differential Revision: https://reviews.llvm.org/D116491

(cherry picked from commit b3bfd595a548cd85b12e4e83729436cb73b26f29)

Added: 


Modified: 
lldb/include/lldb/Interpreter/CommandInterpreter.h
lldb/source/Interpreter/CommandInterpreter.cpp
lldb/test/API/commands/command/container/TestContainerCommands.py
lldb/test/API/commands/command/container/welcome.py

Removed: 




diff  --git a/lldb/include/lldb/Interpreter/CommandInterpreter.h 
b/lldb/include/lldb/Interpreter/CommandInterpreter.h
index e6f0d5f9c4d43..3efb59fc05647 100644
--- a/lldb/include/lldb/Interpreter/CommandInterpreter.h
+++ b/lldb/include/lldb/Interpreter/CommandInterpreter.h
@@ -649,7 +649,7 @@ class CommandInterpreter : public Broadcaster,
 
   void FindCommandsForApropos(llvm::StringRef word, StringList &commands_found,
   StringList &commands_help,
-  CommandObject::CommandMap &command_map);
+  const CommandObject::CommandMap &command_map);
 
   // An interruptible wrapper around the stream output
   void PrintCommandOutput(Stream &stream, llvm::StringRef str);

diff  --git a/lldb/source/Interpreter/CommandInterpreter.cpp 
b/lldb/source/Interpreter/CommandInterpreter.cpp
index 085b06bce0eae..59c23716bf89c 100644
--- a/lldb/source/Interpreter/CommandInterpreter.cpp
+++ b/lldb/source/Interpreter/CommandInterpreter.cpp
@@ -2841,12 +2841,10 @@ void CommandInterpreter::OutputHelpText(Stream &strm, 
llvm::StringRef word_text,
 
 void CommandInterpreter::FindCommandsForApropos(
 llvm::StringRef search_word, StringList &commands_found,
-StringList &commands_help, CommandObject::CommandMap &command_map) {
-  CommandObject::CommandMap::const_iterator pos;
-
-  for (pos = command_map.begin(); pos != command_map.end(); ++pos) {
-llvm::StringRef command_name = pos->first;
-CommandObject *cmd_obj = pos->second.get();
+StringList &commands_help, const CommandObject::CommandMap &command_map) {
+  for (const auto &pair : command_map) {
+llvm::StringRef command_name = pair.first;
+CommandObject *cmd_obj = pair.second.get();
 
 const bool search_short_help = true;
 const bool search_long_help = false;
@@ -2856,14 +2854,19 @@ void CommandInterpreter::FindCommandsForApropos(
 cmd_obj->HelpTextContainsWord(search_word, search_short_help,
   search_long_help, search_syntax,
   search_options)) {
-  commands_found.AppendString(cmd_obj->GetCommandName());
+  commands_found.AppendString(command_name);
   commands_help.AppendString(cmd_obj->GetHelp());
 }
 
-if (cmd_obj->IsMultiwordObject()) {
-  CommandObjectMultiword *cmd_multiword = cmd_obj->GetAsMultiwordCommand();
-  FindCommandsForApropos(search_word, commands_found, commands_help,
- cmd_multiword->GetSubcommandDictionary());
+if (auto *multiword_cmd = cmd_obj->GetAsMultiwordCommand()) {
+  StringList subcommands_found;
+  FindCommandsForApropos(search_word, subcommands_found, commands_help,
+ multiword_cmd->GetSubcommandDictionary());
+  for (const auto &subcommand_name : subcommands_found) {
+std::string qualified_name =
+(command_name + " " + subcommand_name).str();
+commands_found.AppendString(qualified_name);
+  }
 }
   }
 }

diff  --git a/lldb/test/API/commands/command/container/TestContainerCommands.py 
b/lldb/test/API/commands/command/container/TestContainerCommands.py
index 408303dd43a

[Lldb-commits] [lldb] b12fd13 - Fix bugprone argument comments.

2022-01-09 Thread Kazu Hirata via lldb-commits

Author: Kazu Hirata
Date: 2022-01-09T12:21:02-08:00
New Revision: b12fd138127e368a5d78109bef77713c0bcd536e

URL: 
https://github.com/llvm/llvm-project/commit/b12fd138127e368a5d78109bef77713c0bcd536e
DIFF: 
https://github.com/llvm/llvm-project/commit/b12fd138127e368a5d78109bef77713c0bcd536e.diff

LOG: Fix bugprone argument comments.

Identified by bugprone-argument-comment.

Added: 


Modified: 

clang-tools-extra/clang-tidy/cppcoreguidelines/VirtualClassDestructorCheck.cpp
clang-tools-extra/clang-tidy/misc/DefinitionsInHeadersCheck.cpp
clang-tools-extra/clangd/CodeComplete.cpp
clang-tools-extra/clangd/SourceCode.cpp
clang/lib/Sema/SemaTemplateDeduction.cpp
lld/MachO/SyntheticSections.cpp
lldb/source/Breakpoint/BreakpointResolverFileRegex.cpp
lldb/source/Expression/DWARFExpression.cpp
lldb/source/Plugins/DynamicLoader/POSIX-DYLD/DynamicLoaderPOSIXDYLD.cpp
lldb/source/Symbol/Function.cpp
lldb/source/Target/TraceInstructionDumper.cpp
lldb/source/Utility/Reproducer.cpp
polly/include/polly/ScopPass.h

Removed: 




diff  --git 
a/clang-tools-extra/clang-tidy/cppcoreguidelines/VirtualClassDestructorCheck.cpp
 
b/clang-tools-extra/clang-tidy/cppcoreguidelines/VirtualClassDestructorCheck.cpp
index fa5e06c8e7b26..d6af020326eb0 100644
--- 
a/clang-tools-extra/clang-tidy/cppcoreguidelines/VirtualClassDestructorCheck.cpp
+++ 
b/clang-tools-extra/clang-tidy/cppcoreguidelines/VirtualClassDestructorCheck.cpp
@@ -173,11 +173,11 @@ void VirtualClassDestructorCheck::check(
  "destructor of %0 is private and prevents using the type")
 << MatchedClassOrStruct;
 diag(MatchedClassOrStruct->getLocation(),
- /*FixDescription=*/"make it public and virtual", DiagnosticIDs::Note)
+ /*Description=*/"make it public and virtual", DiagnosticIDs::Note)
 << changePrivateDestructorVisibilityTo(
"public", *Destructor, *Result.SourceManager, getLangOpts());
 diag(MatchedClassOrStruct->getLocation(),
- /*FixDescription=*/"make it protected", DiagnosticIDs::Note)
+ /*Description=*/"make it protected", DiagnosticIDs::Note)
 << changePrivateDestructorVisibilityTo(
"protected", *Destructor, *Result.SourceManager, getLangOpts());
 

diff  --git a/clang-tools-extra/clang-tidy/misc/DefinitionsInHeadersCheck.cpp 
b/clang-tools-extra/clang-tidy/misc/DefinitionsInHeadersCheck.cpp
index 882d254c6d9ea..411d6db582436 100644
--- a/clang-tools-extra/clang-tidy/misc/DefinitionsInHeadersCheck.cpp
+++ b/clang-tools-extra/clang-tidy/misc/DefinitionsInHeadersCheck.cpp
@@ -130,7 +130,7 @@ void DefinitionsInHeadersCheck::check(const 
MatchFinder::MatchResult &Result) {
 // inline is not allowed for main function.
 if (FD->isMain())
   return;
-diag(FD->getLocation(), /*FixDescription=*/"make as 'inline'",
+diag(FD->getLocation(), /*Description=*/"make as 'inline'",
  DiagnosticIDs::Note)
 << FixItHint::CreateInsertion(FD->getInnerLocStart(), "inline ");
   } else if (const auto *VD = dyn_cast(ND)) {

diff  --git a/clang-tools-extra/clangd/CodeComplete.cpp 
b/clang-tools-extra/clangd/CodeComplete.cpp
index 50388e08c30aa..d9165599fb9ab 100644
--- a/clang-tools-extra/clangd/CodeComplete.cpp
+++ b/clang-tools-extra/clangd/CodeComplete.cpp
@@ -420,7 +420,7 @@ struct CodeCompletionBuilder {
 SetDoc(C.IndexResult->Documentation);
   } else if (C.SemaResult) {
 const auto DocComment = getDocComment(*ASTCtx, *C.SemaResult,
-  /*CommentsFromHeader=*/false);
+  /*CommentsFromHeaders=*/false);
 SetDoc(formatDocumentation(*SemaCCS, DocComment));
   }
 }
@@ -959,9 +959,9 @@ class SignatureHelpCollector final : public 
CodeCompleteConsumer {
 paramIndexForArg(Candidate, SigHelp.activeParameter);
   }
 
-  const auto *CCS =
-  Candidate.CreateSignatureString(CurrentArg, S, *Allocator, CCTUInfo,
-  /*IncludeBriefComment=*/true, 
Braced);
+  const auto *CCS = Candidate.CreateSignatureString(
+  CurrentArg, S, *Allocator, CCTUInfo,
+  /*IncludeBriefComments=*/true, Braced);
   assert(CCS && "Expected the CodeCompletionString to be non-null");
   ScoredSignatures.push_back(processOverloadCandidate(
   Candidate, *CCS,

diff  --git a/clang-tools-extra/clangd/SourceCode.cpp 
b/clang-tools-extra/clangd/SourceCode.cpp
index f3a60d6419513..6f6d936ac3a7e 100644
--- a/clang-tools-extra/clangd/SourceCode.cpp
+++ b/clang-tools-extra/clangd/SourceCode.cpp
@@ -457,7 +457,7 @@ llvm::Expected 
sourceLocationInMainFile(const SourceManager &SM,
 Position P) {
   llvm::StringRef Code = SM.getBufferOrFake(SM.getMainFileID()).getBuffer();
   auto 

[Lldb-commits] [lldb] 47b9aad - [lldb] Remove redundant member initialization (NFC)

2022-01-09 Thread Kazu Hirata via lldb-commits

Author: Kazu Hirata
Date: 2022-01-09T12:21:04-08:00
New Revision: 47b9aadb3215e914119d0c45827ea58cb7499204

URL: 
https://github.com/llvm/llvm-project/commit/47b9aadb3215e914119d0c45827ea58cb7499204
DIFF: 
https://github.com/llvm/llvm-project/commit/47b9aadb3215e914119d0c45827ea58cb7499204.diff

LOG: [lldb] Remove redundant member initialization (NFC)

Added: 


Modified: 
lldb/include/lldb/Breakpoint/BreakpointOptions.h
lldb/include/lldb/Breakpoint/WatchpointOptions.h
lldb/include/lldb/Core/Address.h
lldb/include/lldb/Core/Declaration.h
lldb/include/lldb/Core/Disassembler.h
lldb/include/lldb/Core/FormatEntity.h
lldb/include/lldb/Core/LoadedModuleInfoList.h
lldb/include/lldb/Core/Module.h
lldb/include/lldb/Core/ModuleSpec.h
lldb/include/lldb/Core/StructuredDataImpl.h
lldb/include/lldb/Core/ThreadSafeValue.h
lldb/include/lldb/Core/Value.h
lldb/include/lldb/Core/ValueObject.h
lldb/include/lldb/DataFormatters/FormatClasses.h
lldb/include/lldb/DataFormatters/TypeSynthetic.h
lldb/include/lldb/Expression/IRExecutionUnit.h
lldb/include/lldb/Host/Debug.h
lldb/include/lldb/Host/FileSystem.h
lldb/include/lldb/Interpreter/OptionValueArray.h
lldb/include/lldb/Symbol/CompactUnwindInfo.h
lldb/include/lldb/Symbol/DWARFCallFrameInfo.h
lldb/include/lldb/Symbol/ObjectContainer.h
lldb/include/lldb/Symbol/Type.h
lldb/include/lldb/Symbol/UnwindPlan.h
lldb/include/lldb/Target/InstrumentationRuntime.h
lldb/include/lldb/Target/Language.h
lldb/include/lldb/Target/Platform.h
lldb/include/lldb/Target/Process.h
lldb/include/lldb/Target/RegisterCheckpoint.h
lldb/include/lldb/Target/SectionLoadHistory.h
lldb/include/lldb/Target/SectionLoadList.h
lldb/include/lldb/Target/Unwind.h
lldb/include/lldb/Target/UnwindLLDB.h
lldb/include/lldb/Utility/Environment.h
lldb/include/lldb/Utility/Event.h
lldb/include/lldb/Utility/GDBRemote.h
lldb/include/lldb/Utility/Predicate.h
lldb/include/lldb/Utility/ProcessInfo.h
lldb/include/lldb/Utility/ReproducerProvider.h
lldb/include/lldb/Utility/SharedCluster.h
lldb/include/lldb/Utility/StreamTee.h
lldb/include/lldb/Utility/StringExtractorGDBRemote.h
lldb/include/lldb/Utility/StructuredData.h

Removed: 




diff  --git a/lldb/include/lldb/Breakpoint/BreakpointOptions.h 
b/lldb/include/lldb/Breakpoint/BreakpointOptions.h
index 7b78265920a2e..ec39c976f7ac0 100644
--- a/lldb/include/lldb/Breakpoint/BreakpointOptions.h
+++ b/lldb/include/lldb/Breakpoint/BreakpointOptions.h
@@ -43,11 +43,10 @@ friend class Breakpoint;
  | eCondition | eAutoContinue)
   };
   struct CommandData {
-CommandData() : user_source(), script_source() {}
+CommandData() {}
 
 CommandData(const StringList &user_source, lldb::ScriptLanguage interp)
-: user_source(user_source), script_source(), interpreter(interp),
-  stop_on_error(true) {}
+: user_source(user_source), interpreter(interp), stop_on_error(true) {}
 
 virtual ~CommandData() = default;
 

diff  --git a/lldb/include/lldb/Breakpoint/WatchpointOptions.h 
b/lldb/include/lldb/Breakpoint/WatchpointOptions.h
index fbfcb91c4249e..c5ad90c334c48 100644
--- a/lldb/include/lldb/Breakpoint/WatchpointOptions.h
+++ b/lldb/include/lldb/Breakpoint/WatchpointOptions.h
@@ -166,7 +166,7 @@ class WatchpointOptions {
lldb::user_id_t watch_id);
 
   struct CommandData {
-CommandData() : user_source(), script_source() {}
+CommandData() {}
 
 ~CommandData() = default;
 

diff  --git a/lldb/include/lldb/Core/Address.h 
b/lldb/include/lldb/Core/Address.h
index dc50e27ca277a..f77ffc2fd25e6 100644
--- a/lldb/include/lldb/Core/Address.h
+++ b/lldb/include/lldb/Core/Address.h
@@ -116,7 +116,7 @@ class Address {
   ///
   /// Initialize with a invalid section (NULL) and an invalid offset
   /// (LLDB_INVALID_ADDRESS).
-  Address() : m_section_wp() {}
+  Address() {}
 
   /// Copy constructor
   ///

diff  --git a/lldb/include/lldb/Core/Declaration.h 
b/lldb/include/lldb/Core/Declaration.h
index f81de21bc8f8b..67ab09f21c8d5 100644
--- a/lldb/include/lldb/Core/Declaration.h
+++ b/lldb/include/lldb/Core/Declaration.h
@@ -24,7 +24,7 @@ namespace lldb_private {
 class Declaration {
 public:
   /// Default constructor.
-  Declaration() : m_file() {}
+  Declaration() {}
 
   /// Construct with file specification, and optional line and column.
   ///
@@ -45,7 +45,7 @@ class Declaration {
 
   /// Construct with a pointer to another Declaration object.
   Declaration(const Declaration *decl_ptr)
-  : m_file(), m_line(0), m_column(LLDB_INVALID_COLUMN_NUMBER) {
+  : m_line(0), m_column(LLDB_INVALID_COLUMN_NUMBER) {
 if (decl_ptr)
   *this = *decl_ptr;
   }

diff  --git a/lldb/include/lldb/Core/Disassembler.h 
b/lldb/include/lldb/Core/Disassembler.h
in

[Lldb-commits] [lldb] 8afcfbf - Use true/false instead of 1/0 (NFC)

2022-01-09 Thread Kazu Hirata via lldb-commits

Author: Kazu Hirata
Date: 2022-01-09T12:21:06-08:00
New Revision: 8afcfbfb8fc1e53023ffac9d9bdc424248d6d2ff

URL: 
https://github.com/llvm/llvm-project/commit/8afcfbfb8fc1e53023ffac9d9bdc424248d6d2ff
DIFF: 
https://github.com/llvm/llvm-project/commit/8afcfbfb8fc1e53023ffac9d9bdc424248d6d2ff.diff

LOG: Use true/false instead of 1/0 (NFC)

Identified by modernize-use-bool-literals.

Added: 


Modified: 
clang-tools-extra/clangd/refactor/Rename.cpp
lld/COFF/Writer.cpp
lld/ELF/Arch/X86_64.cpp
lld/MachO/Arch/ARM.cpp
lld/MachO/InputSection.h
lldb/source/Host/common/Host.cpp

lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCTrampolineHandler.cpp
lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp
lldb/source/Symbol/TypeSystem.cpp
lldb/source/Target/TraceInstructionDumper.cpp
polly/lib/Analysis/ScopDetection.cpp
polly/lib/CodeGen/PerfMonitor.cpp

Removed: 




diff  --git a/clang-tools-extra/clangd/refactor/Rename.cpp 
b/clang-tools-extra/clangd/refactor/Rename.cpp
index 5e157db5900af..e092c677c57cf 100644
--- a/clang-tools-extra/clangd/refactor/Rename.cpp
+++ b/clang-tools-extra/clangd/refactor/Rename.cpp
@@ -906,7 +906,7 @@ llvm::Optional> 
getMappedRanges(ArrayRef Indexed,
 
   std::vector Best;
   size_t BestCost = std::numeric_limits::max();
-  bool HasMultiple = 0;
+  bool HasMultiple = false;
   std::vector ResultStorage;
   int Fuel = 1;
   findNearMiss(ResultStorage, Indexed, Lexed, 0, Fuel,

diff  --git a/lld/COFF/Writer.cpp b/lld/COFF/Writer.cpp
index 0788f3519f4e0..4a41c541ee7f9 100644
--- a/lld/COFF/Writer.cpp
+++ b/lld/COFF/Writer.cpp
@@ -1246,7 +1246,7 @@ void Writer::mergeSections() {
 if (p.first == toName)
   continue;
 StringSet<> names;
-while (1) {
+while (true) {
   if (!names.insert(toName).second)
 fatal("/merge: cycle found for section '" + p.first + "'");
   auto i = config->merge.find(toName);

diff  --git a/lld/ELF/Arch/X86_64.cpp b/lld/ELF/Arch/X86_64.cpp
index 08591d8e5f06b..161e99e3ba3fb 100644
--- a/lld/ELF/Arch/X86_64.cpp
+++ b/lld/ELF/Arch/X86_64.cpp
@@ -282,12 +282,12 @@ bool X86_64::deleteFallThruJmpInsn(InputSection &is, 
InputFile *file,
   const unsigned sizeOfJmpCCInsn = 6;
   // To flip, there must be atleast one JmpCC and one direct jmp.
   if (is.getSize() < sizeOfDirectJmpInsn + sizeOfJmpCCInsn)
-return 0;
+return false;
 
   unsigned rbIndex =
   getRelocationWithOffset(is, (is.getSize() - sizeOfDirectJmpInsn - 4));
   if (rbIndex == is.relocations.size())
-return 0;
+return false;
 
   Relocation &rB = is.relocations[rbIndex];
 

diff  --git a/lld/MachO/Arch/ARM.cpp b/lld/MachO/Arch/ARM.cpp
index 42c7b89308684..4dda94d7b0f38 100644
--- a/lld/MachO/Arch/ARM.cpp
+++ b/lld/MachO/Arch/ARM.cpp
@@ -116,7 +116,7 @@ void ARM::relocateOne(uint8_t *loc, const Reloc &r, 
uint64_t value,
 return;
   } else if (isBlx && !defined->thumb) {
 Bitfield::set(base, 0xe); // unconditional BL
-Bitfield::set>(base, 1);
+Bitfield::set>(base, true);
 isBlx = false;
   }
 } else {

diff  --git a/lld/MachO/InputSection.h b/lld/MachO/InputSection.h
index fa137223c426f..58f794227b617 100644
--- a/lld/MachO/InputSection.h
+++ b/lld/MachO/InputSection.h
@@ -234,7 +234,9 @@ class WordLiteralInputSection final : public InputSection {
   bool isLive(uint64_t off) const override {
 return live[off >> power2LiteralSize];
   }
-  void markLive(uint64_t off) override { live[off >> power2LiteralSize] = 1; }
+  void markLive(uint64_t off) override {
+live[off >> power2LiteralSize] = true;
+  }
 
   static bool classof(const InputSection *isec) {
 return isec->kind() == WordLiteralKind;

diff  --git a/lldb/source/Host/common/Host.cpp 
b/lldb/source/Host/common/Host.cpp
index d14ebe99fd155..53a096c617dff 100644
--- a/lldb/source/Host/common/Host.cpp
+++ b/lldb/source/Host/common/Host.cpp
@@ -191,7 +191,7 @@ static thread_result_t 
MonitorChildProcessThreadFunction(void *arg) {
   ::sigaction(SIGUSR1, &sigUsr1Action, nullptr);
 #endif // __linux__
 
-  while (1) {
+  while (true) {
 log = lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_PROCESS);
 LLDB_LOGF(log, "%s ::waitpid (pid = %" PRIi32 ", &status, options = 
%i)...",
   function, pid, options);

diff  --git 
a/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCTrampolineHandler.cpp
 
b/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCTrampolineHandler.cpp
index aa6306bef8b99..ff41f187ba9d0 100644
--- 
a/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCTrampolineHandler.cpp
+++ 
b/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCTrampolineHandler.cpp
@@ -889,8 +889,8 @@ 
AppleObjCTrampolineHandler::GetStepThroughDispatchPlan(Thread &thread,
   ThreadPlanSP ret_plan_sp;
   lldb::addr_t 

[Lldb-commits] [lldb] a6f1d04 - [lldb][docs] Update references to SVN

2022-01-09 Thread Dave Lee via lldb-commits

Author: Dave Lee
Date: 2022-01-09T13:21:40-08:00
New Revision: a6f1d046655c6850a355bb4557cb0dd463c9de0a

URL: 
https://github.com/llvm/llvm-project/commit/a6f1d046655c6850a355bb4557cb0dd463c9de0a
DIFF: 
https://github.com/llvm/llvm-project/commit/a6f1d046655c6850a355bb4557cb0dd463c9de0a.diff

LOG: [lldb][docs] Update references to SVN

Added: 


Modified: 
lldb/docs/use/symbolication.rst
lldb/docs/use/variable.rst

Removed: 




diff  --git a/lldb/docs/use/symbolication.rst b/lldb/docs/use/symbolication.rst
index 2c10a886d6087..f7ecf381e0a96 100644
--- a/lldb/docs/use/symbolication.rst
+++ b/lldb/docs/use/symbolication.rst
@@ -402,5 +402,5 @@ the crash log.
-i, --interactive parse all crash logs and enter interactive mode
 
 
-The source for the "symbolication" and "crashlog" modules are available in SVN.
+The source for the "symbolication" and "crashlog" modules are available in git.
 

diff  --git a/lldb/docs/use/variable.rst b/lldb/docs/use/variable.rst
index e1adb96d2ad88..c60095b2d83f0 100644
--- a/lldb/docs/use/variable.rst
+++ b/lldb/docs/use/variable.rst
@@ -487,9 +487,7 @@ themselves, but which carry a special meaning when used in 
this context:
 | ``%>`` | Print the expression path for this item 
 |
 
++--+
 
-Starting with SVN r228207, you can also specify
-``${script.var:pythonFuncName}``. Previously, back to r220821, this was
-specified with a 
diff erent syntax: ``${var.script:pythonFuncName}``.
+Since lldb 3.7.0, you can also specify ``${script.var:pythonFuncName}``.
 
 It is expected that the function name you use specifies a function whose
 signature is the same as a Python summary function. The return string from the
@@ -944,25 +942,24 @@ Being more specific, in case of exceptions, LLDB might 
assume that the given
 object has no children or it might skip printing some children, as they are
 printed one by one.
 
-[1] This method is optional. Also, a boolean value must be returned
-(starting with SVN rev153061/LLDB-134). If ``False`` is returned, then
-whenever the process reaches a new stop, this method will be invoked again to
-generate an updated list of the children for a given variable. Otherwise, if
-``True`` is returned, then the value is cached and this method won't be called
-again, effectively freezing the state of the value in subsequent stops. Beware
-that returning ``True`` incorrectly could show misleading information to the
-user.
-
-[2] This method is optional (starting with SVN rev166495/LLDB-175). While
-implementing it in terms of num_children is acceptable, implementors are
-encouraged to look for optimized coding alternatives whenever reasonable.
-
-[3] This method is optional (starting with SVN revision 219330). The `SBValue`
-you return here will most likely be a numeric type (int, float, ...) as its
-value bytes will be used as-if they were the value of the root `SBValue` 
proper.
-As a shortcut for this, you can inherit from lldb.SBSyntheticValueProvider, and
-just define get_value as other methods are defaulted in the superclass as
-returning default no-children responses.
+[1] This method is optional. Also, a boolean value must be returned (since lldb
+3.1.0). If ``False`` is returned, then whenever the process reaches a new stop,
+this method will be invoked again to generate an updated list of the children
+for a given variable. Otherwise, if ``True`` is returned, then the value is
+cached and this method won't be called again, effectively freezing the state of
+the value in subsequent stops. Beware that returning ``True`` incorrectly could
+show misleading information to the user.
+
+[2] This method is optional (since lldb 3.2.0). While implementing it in terms
+of num_children is acceptable, implementors are encouraged to look for
+optimized coding alternatives whenever reasonable.
+
+[3] This method is optional (since lldb 3.5.2). The `SBValue` you return here
+will most likely be a numeric type (int, float, ...) as its value bytes will be
+used as-if they were the value of the root `SBValue` proper.  As a shortcut for
+this, you can inherit from lldb.SBSyntheticValueProvider, and just define
+get_value as other methods are defaulted in the superclass as returning default
+no-children responses.
 
 If a synthetic child provider supplies a special child named
 ``$$dereference$$`` then it will be used when evaluating ``operator *`` and
@@ -1229,11 +1226,11 @@ not-empty category.
 Finding Formatters 101
 --
 
-Searching for a formatter (including formats, starting in SVN rev r192217)
-given a variable goes through a rather intricate set of rules. Namely, what
-happens is that LLDB starts looking in each enabled category, according to the
-order in which they were enabled (latest enabled first). In each category, LLDB
-d

[Lldb-commits] [lldb] 2bcff22 - [lldb] Set result error state in 'frame variable'

2022-01-09 Thread Dave Lee via lldb-commits

Author: Dave Lee
Date: 2022-01-09T13:26:30-08:00
New Revision: 2bcff220bf1e372e91491911fe0bb76c4c4bbef8

URL: 
https://github.com/llvm/llvm-project/commit/2bcff220bf1e372e91491911fe0bb76c4c4bbef8
DIFF: 
https://github.com/llvm/llvm-project/commit/2bcff220bf1e372e91491911fe0bb76c4c4bbef8.diff

LOG: [lldb] Set result error state in 'frame variable'

Ensure that errors in `frame variable` are reflected in result object.

The statistics for `frame variable` show invocations as being successful, even
when executing one of the error paths.

This change replaces `result.GetErrorStream()` with `result.AppendError()`,
which also sets the status to `eReturnStatusFailed`.

Differential Revision: https://reviews.llvm.org/D116788

(cherry picked from commit 2c7d10c41278181e3e45c68f28b501cd95193a8a)

Added: 


Modified: 
lldb/source/Commands/CommandObjectFrame.cpp

lldb/test/API/lang/cpp/frame-var-anon-unions/TestFrameVariableAnonymousUnions.py

Removed: 




diff  --git a/lldb/source/Commands/CommandObjectFrame.cpp 
b/lldb/source/Commands/CommandObjectFrame.cpp
index 9cfe997f92274..8dd1a79d38959 100644
--- a/lldb/source/Commands/CommandObjectFrame.cpp
+++ b/lldb/source/Commands/CommandObjectFrame.cpp
@@ -558,18 +558,16 @@ may even involve JITing and running code in the target 
program.)");
   }
 }
   } else if (num_matches == 0) {
-result.GetErrorStream().Printf("error: no variables matched "
-   "the regular expression 
'%s'.\n",
-   entry.c_str());
+result.AppendErrorWithFormat(
+"no variables matched the regular expression '%s'.",
+entry.c_str());
   }
 } else {
   if (llvm::Error err = regex.GetError())
-result.GetErrorStream().Printf(
-"error: %s\n", llvm::toString(std::move(err)).c_str());
+result.AppendError(llvm::toString(std::move(err)));
   else
-result.GetErrorStream().Printf(
-"error: unknown regex error when compiling '%s'\n",
-entry.c_str());
+result.AppendErrorWithFormat(
+"unknown regex error when compiling '%s'", entry.c_str());
 }
   } else // No regex, either exact variable names or variable
  // expressions.
@@ -605,14 +603,13 @@ may even involve JITing and running code in the target 
program.)");
   valobj_sp->GetParent() ? entry.c_str() : nullptr);
   valobj_sp->Dump(output_stream, options);
 } else {
-  const char *error_cstr = error.AsCString(nullptr);
-  if (error_cstr)
-result.GetErrorStream().Printf("error: %s\n", error_cstr);
+  if (auto error_cstr = error.AsCString(nullptr))
+result.AppendError(error_cstr);
   else
-result.GetErrorStream().Printf("error: unable to find any "
-   "variable expression path that "
-   "matches '%s'.\n",
-   entry.c_str());
+result.AppendErrorWithFormat(
+"unable to find any variable expression path that matches "
+"'%s'.",
+entry.c_str());
 }
   }
 }
@@ -680,7 +677,8 @@ may even involve JITing and running code in the target 
program.)");
   }
 }
   }
-  result.SetStatus(eReturnStatusSuccessFinishResult);
+  if (result.GetStatus() != eReturnStatusFailed)
+result.SetStatus(eReturnStatusSuccessFinishResult);
 }
 
 if (m_option_variable.show_recognized_args) {

diff  --git 
a/lldb/test/API/lang/cpp/frame-var-anon-unions/TestFrameVariableAnonymousUnions.py
 
b/lldb/test/API/lang/cpp/frame-var-anon-unions/TestFrameVariableAnonymousUnions.py
index 6352b68e7d753..2682e42be9caf 100644
--- 
a/lldb/test/API/lang/cpp/frame-var-anon-unions/TestFrameVariableAnonymousUnions.py
+++ 
b/lldb/test/API/lang/cpp/frame-var-anon-unions/TestFrameVariableAnonymousUnions.py
@@ -30,6 +30,9 @@ def test_with_run_command(self):
 
 self.expect('frame variable c', substrs=["'A"])
 
-self.expect('frame variable x', matching=False, substrs=['3'])
-self.expect('frame variable y', matching=False, substrs=["'B'"])
-self.expect('frame variable z', matching=False, substrs=['14'])
+self.expect('frame variable x', error=True,
+substrs=["no variable named 'x' found"])
+self.expect('frame variable y', error=True,
+substrs=["no variable named 'y' found"])
+self.expect('frame variabl

[Lldb-commits] [lldb] 08f70ad - Revert "[lldb] Set result error state in 'frame variable'"

2022-01-09 Thread Dave Lee via lldb-commits

Author: Dave Lee
Date: 2022-01-09T14:12:47-08:00
New Revision: 08f70adedb775ce6d41a1f8ad75c4bac225efb5b

URL: 
https://github.com/llvm/llvm-project/commit/08f70adedb775ce6d41a1f8ad75c4bac225efb5b
DIFF: 
https://github.com/llvm/llvm-project/commit/08f70adedb775ce6d41a1f8ad75c4bac225efb5b.diff

LOG: Revert "[lldb] Set result error state in 'frame variable'"

This reverts commit 2bcff220bf1e372e91491911fe0bb76c4c4bbef8.

Added: 


Modified: 
lldb/source/Commands/CommandObjectFrame.cpp

lldb/test/API/lang/cpp/frame-var-anon-unions/TestFrameVariableAnonymousUnions.py

Removed: 




diff  --git a/lldb/source/Commands/CommandObjectFrame.cpp 
b/lldb/source/Commands/CommandObjectFrame.cpp
index 8dd1a79d38959..9cfe997f92274 100644
--- a/lldb/source/Commands/CommandObjectFrame.cpp
+++ b/lldb/source/Commands/CommandObjectFrame.cpp
@@ -558,16 +558,18 @@ may even involve JITing and running code in the target 
program.)");
   }
 }
   } else if (num_matches == 0) {
-result.AppendErrorWithFormat(
-"no variables matched the regular expression '%s'.",
-entry.c_str());
+result.GetErrorStream().Printf("error: no variables matched "
+   "the regular expression 
'%s'.\n",
+   entry.c_str());
   }
 } else {
   if (llvm::Error err = regex.GetError())
-result.AppendError(llvm::toString(std::move(err)));
+result.GetErrorStream().Printf(
+"error: %s\n", llvm::toString(std::move(err)).c_str());
   else
-result.AppendErrorWithFormat(
-"unknown regex error when compiling '%s'", entry.c_str());
+result.GetErrorStream().Printf(
+"error: unknown regex error when compiling '%s'\n",
+entry.c_str());
 }
   } else // No regex, either exact variable names or variable
  // expressions.
@@ -603,13 +605,14 @@ may even involve JITing and running code in the target 
program.)");
   valobj_sp->GetParent() ? entry.c_str() : nullptr);
   valobj_sp->Dump(output_stream, options);
 } else {
-  if (auto error_cstr = error.AsCString(nullptr))
-result.AppendError(error_cstr);
+  const char *error_cstr = error.AsCString(nullptr);
+  if (error_cstr)
+result.GetErrorStream().Printf("error: %s\n", error_cstr);
   else
-result.AppendErrorWithFormat(
-"unable to find any variable expression path that matches "
-"'%s'.",
-entry.c_str());
+result.GetErrorStream().Printf("error: unable to find any "
+   "variable expression path that "
+   "matches '%s'.\n",
+   entry.c_str());
 }
   }
 }
@@ -677,8 +680,7 @@ may even involve JITing and running code in the target 
program.)");
   }
 }
   }
-  if (result.GetStatus() != eReturnStatusFailed)
-result.SetStatus(eReturnStatusSuccessFinishResult);
+  result.SetStatus(eReturnStatusSuccessFinishResult);
 }
 
 if (m_option_variable.show_recognized_args) {

diff  --git 
a/lldb/test/API/lang/cpp/frame-var-anon-unions/TestFrameVariableAnonymousUnions.py
 
b/lldb/test/API/lang/cpp/frame-var-anon-unions/TestFrameVariableAnonymousUnions.py
index 2682e42be9caf..6352b68e7d753 100644
--- 
a/lldb/test/API/lang/cpp/frame-var-anon-unions/TestFrameVariableAnonymousUnions.py
+++ 
b/lldb/test/API/lang/cpp/frame-var-anon-unions/TestFrameVariableAnonymousUnions.py
@@ -30,9 +30,6 @@ def test_with_run_command(self):
 
 self.expect('frame variable c', substrs=["'A"])
 
-self.expect('frame variable x', error=True,
-substrs=["no variable named 'x' found"])
-self.expect('frame variable y', error=True,
-substrs=["no variable named 'y' found"])
-self.expect('frame variable z', error=True,
-substrs=["no variable named 'z' found"])
+self.expect('frame variable x', matching=False, substrs=['3'])
+self.expect('frame variable y', matching=False, substrs=["'B'"])
+self.expect('frame variable z', matching=False, substrs=['14'])



___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D116901: [lldb] Guard libstdc++ specific 'frame var' test

2022-01-09 Thread Dave Lee via Phabricator via lldb-commits
kastiglione created this revision.
kastiglione added reviewers: aprantl, JDevlieghere.
kastiglione requested review of this revision.
Herald added a project: LLDB.
Herald added a subscriber: lldb-commits.

While working on D116788  (properly error out 
of `frame var`), this libstdc++
specific `frame var` invocation was found in the tests. This test is in the
generic directory, but has this one case that requires libstdc++. The fix here
is to put the one `expect()` inside of a condition that checks for libstdc++.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D116901

Files:
  
lldb/test/API/functionalities/data-formatter/data-formatter-stl/generic/list/TestDataFormatterGenericList.py


Index: 
lldb/test/API/functionalities/data-formatter/data-formatter-stl/generic/list/TestDataFormatterGenericList.py
===
--- 
lldb/test/API/functionalities/data-formatter/data-formatter-stl/generic/list/TestDataFormatterGenericList.py
+++ 
lldb/test/API/functionalities/data-formatter/data-formatter-stl/generic/list/TestDataFormatterGenericList.py
@@ -62,12 +62,14 @@
 self.expect("frame variable numbers_list --raw", matching=False,
 substrs=['size=0',
  '{}'])
-self.expect(
-"frame variable &numbers_list._M_impl._M_node --raw",
-matching=False,
-substrs=[
-'size=0',
-'{}'])
+
+if stdlib_type == USE_LIBSTDCPP:
+self.expect(
+"frame variable &numbers_list._M_impl._M_node --raw",
+matching=False,
+substrs=[
+'size=0',
+'{}'])
 
 self.expect("frame variable numbers_list",
 substrs=['size=0',


Index: lldb/test/API/functionalities/data-formatter/data-formatter-stl/generic/list/TestDataFormatterGenericList.py
===
--- lldb/test/API/functionalities/data-formatter/data-formatter-stl/generic/list/TestDataFormatterGenericList.py
+++ lldb/test/API/functionalities/data-formatter/data-formatter-stl/generic/list/TestDataFormatterGenericList.py
@@ -62,12 +62,14 @@
 self.expect("frame variable numbers_list --raw", matching=False,
 substrs=['size=0',
  '{}'])
-self.expect(
-"frame variable &numbers_list._M_impl._M_node --raw",
-matching=False,
-substrs=[
-'size=0',
-'{}'])
+
+if stdlib_type == USE_LIBSTDCPP:
+self.expect(
+"frame variable &numbers_list._M_impl._M_node --raw",
+matching=False,
+substrs=[
+'size=0',
+'{}'])
 
 self.expect("frame variable numbers_list",
 substrs=['size=0',
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D116912: [lldb] Check for arm64 in TestDisassembleRawData

2022-01-09 Thread Dave Lee via Phabricator via lldb-commits
kastiglione created this revision.
kastiglione added reviewers: jasonmolenda, JDevlieghere.
Herald added subscribers: omjavaid, kristof.beyls.
kastiglione requested review of this revision.
Herald added a project: LLDB.
Herald added a subscriber: lldb-commits.

This test checks for `aarch64` but the lit config could also contain `arm64`.
This change adds `arm64` to make the test pass in all cases.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D116912

Files:
  lldb/test/API/python_api/disassemble-raw-data/TestDisassembleRawData.py


Index: lldb/test/API/python_api/disassemble-raw-data/TestDisassembleRawData.py
===
--- lldb/test/API/python_api/disassemble-raw-data/TestDisassembleRawData.py
+++ lldb/test/API/python_api/disassemble-raw-data/TestDisassembleRawData.py
@@ -31,7 +31,7 @@
 elif re.match("powerpc64le", arch):
 target = self.dbg.CreateTargetWithFileAndTargetTriple("", 
"powerpc64le")
 raw_bytes = bytearray([0x00, 0x00, 0x80, 0x38])
-elif arch == "aarch64":
+elif arch in ("aarch64", "arm64"):
 target = self.dbg.CreateTargetWithFileAndTargetTriple("", 
"aarch64")
 raw_bytes = bytearray([0x60, 0x0c, 0x80, 0x52])
 elif arch == "arm":
@@ -57,7 +57,7 @@
 elif re.match("powerpc64le", arch):
 self.assertEqual(inst.GetMnemonic(target), "li")
 self.assertEqual(inst.GetOperands(target), "4, 0")
-elif arch == "aarch64":
+elif arch in ("aarch64", "arm64"):
 self.assertEqual(inst.GetMnemonic(target), "mov")
 self.assertEqual(inst.GetOperands(target), "w0, #0x63")
 elif arch == "arm":


Index: lldb/test/API/python_api/disassemble-raw-data/TestDisassembleRawData.py
===
--- lldb/test/API/python_api/disassemble-raw-data/TestDisassembleRawData.py
+++ lldb/test/API/python_api/disassemble-raw-data/TestDisassembleRawData.py
@@ -31,7 +31,7 @@
 elif re.match("powerpc64le", arch):
 target = self.dbg.CreateTargetWithFileAndTargetTriple("", "powerpc64le")
 raw_bytes = bytearray([0x00, 0x00, 0x80, 0x38])
-elif arch == "aarch64":
+elif arch in ("aarch64", "arm64"):
 target = self.dbg.CreateTargetWithFileAndTargetTriple("", "aarch64")
 raw_bytes = bytearray([0x60, 0x0c, 0x80, 0x52])
 elif arch == "arm":
@@ -57,7 +57,7 @@
 elif re.match("powerpc64le", arch):
 self.assertEqual(inst.GetMnemonic(target), "li")
 self.assertEqual(inst.GetOperands(target), "4, 0")
-elif arch == "aarch64":
+elif arch in ("aarch64", "arm64"):
 self.assertEqual(inst.GetMnemonic(target), "mov")
 self.assertEqual(inst.GetOperands(target), "w0, #0x63")
 elif arch == "arm":
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D116912: [lldb] Check for arm64 in TestDisassembleRawData

2022-01-09 Thread Jonas Devlieghere via Phabricator via lldb-commits
JDevlieghere accepted this revision.
JDevlieghere added a comment.
This revision is now accepted and ready to land.

LGTM


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D116912/new/

https://reviews.llvm.org/D116912

___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D116901: [lldb] Guard libstdc++ specific 'frame var' test

2022-01-09 Thread Jonas Devlieghere via Phabricator via lldb-commits
JDevlieghere accepted this revision.
JDevlieghere added a comment.
This revision is now accepted and ready to land.

LGTM


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D116901/new/

https://reviews.llvm.org/D116901

___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D116853: [CMake][LLDB] Resolve install conflict when `LLDB_BUILD_FRAMEWORK=ON`

2022-01-09 Thread Jonas Devlieghere via Phabricator via lldb-commits
JDevlieghere requested changes to this revision.
JDevlieghere added a comment.
This revision now requires changes to proceed.

Hey LJC. I'm the person maintaining the LLDB framework build, so please include 
me in any future patches that change that. I'm also on the majority of the 
blamelist for this file, which is always a useful way to find good reviewers. 
With that out of the way, I do have a few comments about this patch:

- It doesn't look like the RPATH change is really related to the install target 
so please create a separate patch for that.
- Note how the function this is (`finish_swig_python`) takes 
`lldb_python_target_dir` as an input argument. Downstream we create more than 
one directory, and this patch is going to break that.

You say that `LLDB.framework/Resources/Python` is installed by `liblldb`, but I 
can't immediately see where that's happening in `API/CMakeLists.txt`.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D116853/new/

https://reviews.llvm.org/D116853

___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] 268a42d - [lldb] Require x86 support for dwo-relative-path test

2022-01-09 Thread Dave Lee via lldb-commits

Author: Dave Lee
Date: 2022-01-09T21:35:32-08:00
New Revision: 268a42d6976d571da2edcefea36f1d77e252d5bc

URL: 
https://github.com/llvm/llvm-project/commit/268a42d6976d571da2edcefea36f1d77e252d5bc
DIFF: 
https://github.com/llvm/llvm-project/commit/268a42d6976d571da2edcefea36f1d77e252d5bc.diff

LOG: [lldb] Require x86 support for dwo-relative-path test

Added: 


Modified: 
lldb/test/Shell/SymbolFile/DWARF/dwo-relative-path.s

Removed: 




diff  --git a/lldb/test/Shell/SymbolFile/DWARF/dwo-relative-path.s 
b/lldb/test/Shell/SymbolFile/DWARF/dwo-relative-path.s
index 1916461e3ce8b..58c61a4b577a6 100644
--- a/lldb/test/Shell/SymbolFile/DWARF/dwo-relative-path.s
+++ b/lldb/test/Shell/SymbolFile/DWARF/dwo-relative-path.s
@@ -1,6 +1,8 @@
 # Test to verify LLDB searches for dwos with relative paths relative to the
 # binary location, not relative to LLDB's launch location.
 
+# REQUIRES: x86-registered-target
+
 # RUN: llvm-mc --filetype=obj --triple x86_64-pc-linux %s -o %t.o
 # RUN: llvm-objcopy --split-dwo=%T/dwo-relative-path.dwo %t.o
 



___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] aad27a8 - [lldb] Check for arm64 in TestDisassembleRawData

2022-01-09 Thread Dave Lee via lldb-commits

Author: Dave Lee
Date: 2022-01-09T21:36:55-08:00
New Revision: aad27a890754fe13bd57a99a838307fee81496ee

URL: 
https://github.com/llvm/llvm-project/commit/aad27a890754fe13bd57a99a838307fee81496ee
DIFF: 
https://github.com/llvm/llvm-project/commit/aad27a890754fe13bd57a99a838307fee81496ee.diff

LOG: [lldb] Check for arm64 in TestDisassembleRawData

This test checks for `aarch64` but the lit config could also contain `arm64`.
This change adds `arm64` to make the test pass in all cases.

Differential Revision: https://reviews.llvm.org/D116912

Added: 


Modified: 
lldb/test/API/python_api/disassemble-raw-data/TestDisassembleRawData.py

Removed: 




diff  --git 
a/lldb/test/API/python_api/disassemble-raw-data/TestDisassembleRawData.py 
b/lldb/test/API/python_api/disassemble-raw-data/TestDisassembleRawData.py
index 3dbb090ffe5c3..7175cf32c0b0b 100644
--- a/lldb/test/API/python_api/disassemble-raw-data/TestDisassembleRawData.py
+++ b/lldb/test/API/python_api/disassemble-raw-data/TestDisassembleRawData.py
@@ -31,7 +31,7 @@ def test_disassemble_raw_data(self):
 elif re.match("powerpc64le", arch):
 target = self.dbg.CreateTargetWithFileAndTargetTriple("", 
"powerpc64le")
 raw_bytes = bytearray([0x00, 0x00, 0x80, 0x38])
-elif arch == "aarch64":
+elif arch in ("aarch64", "arm64"):
 target = self.dbg.CreateTargetWithFileAndTargetTriple("", 
"aarch64")
 raw_bytes = bytearray([0x60, 0x0c, 0x80, 0x52])
 elif arch == "arm":
@@ -57,7 +57,7 @@ def test_disassemble_raw_data(self):
 elif re.match("powerpc64le", arch):
 self.assertEqual(inst.GetMnemonic(target), "li")
 self.assertEqual(inst.GetOperands(target), "4, 0")
-elif arch == "aarch64":
+elif arch in ("aarch64", "arm64"):
 self.assertEqual(inst.GetMnemonic(target), "mov")
 self.assertEqual(inst.GetOperands(target), "w0, #0x63")
 elif arch == "arm":



___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D116912: [lldb] Check for arm64 in TestDisassembleRawData

2022-01-09 Thread Dave Lee via Phabricator via lldb-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rGaad27a890754: [lldb] Check for arm64 in 
TestDisassembleRawData (authored by kastiglione).

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D116912/new/

https://reviews.llvm.org/D116912

Files:
  lldb/test/API/python_api/disassemble-raw-data/TestDisassembleRawData.py


Index: lldb/test/API/python_api/disassemble-raw-data/TestDisassembleRawData.py
===
--- lldb/test/API/python_api/disassemble-raw-data/TestDisassembleRawData.py
+++ lldb/test/API/python_api/disassemble-raw-data/TestDisassembleRawData.py
@@ -31,7 +31,7 @@
 elif re.match("powerpc64le", arch):
 target = self.dbg.CreateTargetWithFileAndTargetTriple("", 
"powerpc64le")
 raw_bytes = bytearray([0x00, 0x00, 0x80, 0x38])
-elif arch == "aarch64":
+elif arch in ("aarch64", "arm64"):
 target = self.dbg.CreateTargetWithFileAndTargetTriple("", 
"aarch64")
 raw_bytes = bytearray([0x60, 0x0c, 0x80, 0x52])
 elif arch == "arm":
@@ -57,7 +57,7 @@
 elif re.match("powerpc64le", arch):
 self.assertEqual(inst.GetMnemonic(target), "li")
 self.assertEqual(inst.GetOperands(target), "4, 0")
-elif arch == "aarch64":
+elif arch in ("aarch64", "arm64"):
 self.assertEqual(inst.GetMnemonic(target), "mov")
 self.assertEqual(inst.GetOperands(target), "w0, #0x63")
 elif arch == "arm":


Index: lldb/test/API/python_api/disassemble-raw-data/TestDisassembleRawData.py
===
--- lldb/test/API/python_api/disassemble-raw-data/TestDisassembleRawData.py
+++ lldb/test/API/python_api/disassemble-raw-data/TestDisassembleRawData.py
@@ -31,7 +31,7 @@
 elif re.match("powerpc64le", arch):
 target = self.dbg.CreateTargetWithFileAndTargetTriple("", "powerpc64le")
 raw_bytes = bytearray([0x00, 0x00, 0x80, 0x38])
-elif arch == "aarch64":
+elif arch in ("aarch64", "arm64"):
 target = self.dbg.CreateTargetWithFileAndTargetTriple("", "aarch64")
 raw_bytes = bytearray([0x60, 0x0c, 0x80, 0x52])
 elif arch == "arm":
@@ -57,7 +57,7 @@
 elif re.match("powerpc64le", arch):
 self.assertEqual(inst.GetMnemonic(target), "li")
 self.assertEqual(inst.GetOperands(target), "4, 0")
-elif arch == "aarch64":
+elif arch in ("aarch64", "arm64"):
 self.assertEqual(inst.GetMnemonic(target), "mov")
 self.assertEqual(inst.GetOperands(target), "w0, #0x63")
 elif arch == "arm":
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] 4a85493 - [lldb] Guard libstdc++ specific 'frame var' test

2022-01-09 Thread Dave Lee via lldb-commits

Author: Dave Lee
Date: 2022-01-09T21:37:42-08:00
New Revision: 4a8549354c1b77ce830e488ceefa05dfb4bc9325

URL: 
https://github.com/llvm/llvm-project/commit/4a8549354c1b77ce830e488ceefa05dfb4bc9325
DIFF: 
https://github.com/llvm/llvm-project/commit/4a8549354c1b77ce830e488ceefa05dfb4bc9325.diff

LOG: [lldb] Guard libstdc++ specific 'frame var' test

While working on D116788 (properly error out of `frame var`), this libstdc++
specific `frame var` invocation was found in the tests. This test is in the
generic directory, but has this one case that requires libstdc++. The fix here
is to put the one `expect()` inside of a condition that checks for libstdc++.

Differential Revision: https://reviews.llvm.org/D116901

Added: 


Modified: 

lldb/test/API/functionalities/data-formatter/data-formatter-stl/generic/list/TestDataFormatterGenericList.py

Removed: 




diff  --git 
a/lldb/test/API/functionalities/data-formatter/data-formatter-stl/generic/list/TestDataFormatterGenericList.py
 
b/lldb/test/API/functionalities/data-formatter/data-formatter-stl/generic/list/TestDataFormatterGenericList.py
index 82fe84efc7b45..74269ef55e824 100644
--- 
a/lldb/test/API/functionalities/data-formatter/data-formatter-stl/generic/list/TestDataFormatterGenericList.py
+++ 
b/lldb/test/API/functionalities/data-formatter/data-formatter-stl/generic/list/TestDataFormatterGenericList.py
@@ -62,12 +62,14 @@ def cleanup():
 self.expect("frame variable numbers_list --raw", matching=False,
 substrs=['size=0',
  '{}'])
-self.expect(
-"frame variable &numbers_list._M_impl._M_node --raw",
-matching=False,
-substrs=[
-'size=0',
-'{}'])
+
+if stdlib_type == USE_LIBSTDCPP:
+self.expect(
+"frame variable &numbers_list._M_impl._M_node --raw",
+matching=False,
+substrs=[
+'size=0',
+'{}'])
 
 self.expect("frame variable numbers_list",
 substrs=['size=0',



___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D116901: [lldb] Guard libstdc++ specific 'frame var' test

2022-01-09 Thread Dave Lee via Phabricator via lldb-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rG4a8549354c1b: [lldb] Guard libstdc++ specific 'frame 
var' test (authored by kastiglione).

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D116901/new/

https://reviews.llvm.org/D116901

Files:
  
lldb/test/API/functionalities/data-formatter/data-formatter-stl/generic/list/TestDataFormatterGenericList.py


Index: 
lldb/test/API/functionalities/data-formatter/data-formatter-stl/generic/list/TestDataFormatterGenericList.py
===
--- 
lldb/test/API/functionalities/data-formatter/data-formatter-stl/generic/list/TestDataFormatterGenericList.py
+++ 
lldb/test/API/functionalities/data-formatter/data-formatter-stl/generic/list/TestDataFormatterGenericList.py
@@ -62,12 +62,14 @@
 self.expect("frame variable numbers_list --raw", matching=False,
 substrs=['size=0',
  '{}'])
-self.expect(
-"frame variable &numbers_list._M_impl._M_node --raw",
-matching=False,
-substrs=[
-'size=0',
-'{}'])
+
+if stdlib_type == USE_LIBSTDCPP:
+self.expect(
+"frame variable &numbers_list._M_impl._M_node --raw",
+matching=False,
+substrs=[
+'size=0',
+'{}'])
 
 self.expect("frame variable numbers_list",
 substrs=['size=0',


Index: lldb/test/API/functionalities/data-formatter/data-formatter-stl/generic/list/TestDataFormatterGenericList.py
===
--- lldb/test/API/functionalities/data-formatter/data-formatter-stl/generic/list/TestDataFormatterGenericList.py
+++ lldb/test/API/functionalities/data-formatter/data-formatter-stl/generic/list/TestDataFormatterGenericList.py
@@ -62,12 +62,14 @@
 self.expect("frame variable numbers_list --raw", matching=False,
 substrs=['size=0',
  '{}'])
-self.expect(
-"frame variable &numbers_list._M_impl._M_node --raw",
-matching=False,
-substrs=[
-'size=0',
-'{}'])
+
+if stdlib_type == USE_LIBSTDCPP:
+self.expect(
+"frame variable &numbers_list._M_impl._M_node --raw",
+matching=False,
+substrs=[
+'size=0',
+'{}'])
 
 self.expect("frame variable numbers_list",
 substrs=['size=0',
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] ed3a4a4 - [lldb] Skip TestVSCode_coreFile if no x86 target support

2022-01-09 Thread Dave Lee via lldb-commits

Author: Dave Lee
Date: 2022-01-09T22:01:31-08:00
New Revision: ed3a4a4948dedd264732105e910405138c9c0f3b

URL: 
https://github.com/llvm/llvm-project/commit/ed3a4a4948dedd264732105e910405138c9c0f3b
DIFF: 
https://github.com/llvm/llvm-project/commit/ed3a4a4948dedd264732105e910405138c9c0f3b.diff

LOG: [lldb] Skip TestVSCode_coreFile if no x86 target support

Added: 


Modified: 
lldb/test/API/tools/lldb-vscode/coreFile/TestVSCode_coreFile.py

Removed: 




diff  --git a/lldb/test/API/tools/lldb-vscode/coreFile/TestVSCode_coreFile.py 
b/lldb/test/API/tools/lldb-vscode/coreFile/TestVSCode_coreFile.py
index 56a93ccd6c8ab..b73357f075adf 100644
--- a/lldb/test/API/tools/lldb-vscode/coreFile/TestVSCode_coreFile.py
+++ b/lldb/test/API/tools/lldb-vscode/coreFile/TestVSCode_coreFile.py
@@ -44,6 +44,7 @@ def test_core_file(self):
 
 @skipIfWindows
 @skipIfRemote
+@skipIfLLVMTargetMissing("X86")
 def test_core_file_source_mapping(self):
 ''' Test that sourceMap property is correctly applied when loading a 
core '''
 current_dir = os.path.dirname(os.path.realpath(__file__))



___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] c4cdf86 - [lldb] Skip TestTargetXMLArch if no support for x86 target

2022-01-09 Thread Dave Lee via lldb-commits

Author: Dave Lee
Date: 2022-01-09T22:40:03-08:00
New Revision: c4cdf865698eae06affbf762baf38e6ca95b4785

URL: 
https://github.com/llvm/llvm-project/commit/c4cdf865698eae06affbf762baf38e6ca95b4785
DIFF: 
https://github.com/llvm/llvm-project/commit/c4cdf865698eae06affbf762baf38e6ca95b4785.diff

LOG: [lldb] Skip TestTargetXMLArch if no support for x86 target

If LLVM is configured without X86 as one of its TARGETS_TO_BUILD, then lldb
will crash when using X86 disassembler (which it does while running `image
show-unwind`).

Added: 


Modified: 
lldb/test/API/functionalities/gdb_remote_client/TestTargetXMLArch.py

Removed: 




diff  --git 
a/lldb/test/API/functionalities/gdb_remote_client/TestTargetXMLArch.py 
b/lldb/test/API/functionalities/gdb_remote_client/TestTargetXMLArch.py
index 73016e3bfc01a..f7885459ad450 100644
--- a/lldb/test/API/functionalities/gdb_remote_client/TestTargetXMLArch.py
+++ b/lldb/test/API/functionalities/gdb_remote_client/TestTargetXMLArch.py
@@ -130,6 +130,7 @@ def test(self):
 
 @skipIfXmlSupportMissing
 @skipIfRemote
+@skipIfLLVMTargetMissing("X86")
 def test_register_augmentation(self):
 """
 Test that we correctly associate the register info with the eh_frame



___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits