[Lldb-commits] [PATCH] D136572: Harmonize cmake_policy() across standalone builds of all projects

2022-10-28 Thread Martin Storsjö via Phabricator via lldb-commits
mstorsjo added a comment.

In D136572#3890835 , @mgorny wrote:

> In D136572#3889317 , @mstorsjo 
> wrote:
>
>> Also for the record, I'd love to get rid of this symlink based setup, if I 
>> could make cmake produce project files where caching works in the same way. 
>> The main requirement for that would be to have the whole cmake build started 
>> from the toplevel llvm-project directory (so that all source from all 
>> subprojects are subdirectories to this), instead of the llvm-project/llvm 
>> directory.
>
> To be honest, I also find it weird to start monorepo builds from within 
> `llvm` subdirectory. Perhaps adding a top-level `CMakeLists.txt` that would 
> work and wouldn't break people's workflows wouldn't be that hard, though.

This has been discussed briefly before - the main issue is that LLVM does some 
cmake trickery to recreate the installed directory structure (with executables 
in `$(pwd)/bin` etc) directly in the build folder, and if `llvm-project/llvm` 
is included from a toplevel `llvm-project/CMakeLists.txt`, this all ends up in 
`$(pwd)/llvm/bin` as things stand right now. See e.g. 
https://discourse.llvm.org/t/rfc-llvm-build-system-future-direction/53430/18. 
Hopefully it wouldn't be too hard to resolve - I had a brief look at it (just 
creating a stub CMakeLists.txt at the root and including the llvm subdirectory) 
a couple years ago, but didn't spend further time on looking into how things 
are set up and what it would take to fix it.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D136572

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


[Lldb-commits] [lldb] 1dc3937 - [lldb/qemu] Stub out process info functions

2022-10-28 Thread Pavel Labath via lldb-commits

Author: Pavel Labath
Date: 2022-10-28T09:17:53+02:00
New Revision: 1dc39378c46643ec9d2544da671aca78e7c6967a

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

LOG: [lldb/qemu] Stub out process info functions

These functions return the information about the host process (so they
show the executable as "qemu" and have the "wrong" architecture), which
isn't useful and can confuse lldb.

We could theoretically try to identify which host processes are running
an emulator, and translate the process information, but that would be
tricky to implement, and the usefulness of it would be fairly limited as
qemu does not support attaching to a running process.

Added: 


Modified: 
lldb/source/Plugins/Platform/QemuUser/PlatformQemuUser.h
lldb/test/API/qemu/TestQemuAPI.py

Removed: 




diff  --git a/lldb/source/Plugins/Platform/QemuUser/PlatformQemuUser.h 
b/lldb/source/Plugins/Platform/QemuUser/PlatformQemuUser.h
index 0dd0e2f6f2b9b..a29b5bcdedc74 100644
--- a/lldb/source/Plugins/Platform/QemuUser/PlatformQemuUser.h
+++ b/lldb/source/Plugins/Platform/QemuUser/PlatformQemuUser.h
@@ -42,6 +42,16 @@ class PlatformQemuUser : public Platform {
 return nullptr;
   }
 
+  uint32_t FindProcesses(const ProcessInstanceInfoMatch &match_info,
+ ProcessInstanceInfoList &proc_infos) override {
+return 0;
+  }
+
+  bool GetProcessInfo(lldb::pid_t pid,
+  ProcessInstanceInfo &proc_info) override {
+return false;
+  }
+
   bool IsConnected() const override { return true; }
 
   void CalculateTrapHandlerSymbolNames() override {}

diff  --git a/lldb/test/API/qemu/TestQemuAPI.py 
b/lldb/test/API/qemu/TestQemuAPI.py
index 05db64fc21837..6bca22d4c17f6 100644
--- a/lldb/test/API/qemu/TestQemuAPI.py
+++ b/lldb/test/API/qemu/TestQemuAPI.py
@@ -23,3 +23,9 @@ def test_file_api(self):
 self.assertSuccess(qemu.MakeDirectory(
 self.getBuildArtifact("target_dir")))
 self.assertTrue(os.path.isdir(self.getBuildArtifact("target_dir")))
+
+def test_process_api(self):
+self.dbg.SetCurrentPlatform("qemu-user")
+self.expect("platform process list",
+substrs=['no processes were found on the "qemu-user" 
platform'],
+error=True)



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


[Lldb-commits] [PATCH] D136362: [LLDB][RISCV] Add RV64C instruction support for EmulateInstructionRISCV

2022-10-28 Thread David Spickett via Phabricator via lldb-commits
DavidSpickett added a comment.

Can you give us:

- the full cmake command you used to configure the project
- the gcc/g++ version used
- the distro used
- the architecture (unlikely to matter but I'm assuming Loongson?)
- the version of clang++ that did work

Could be tripping over a bug in g++. If that version is >= the minimum llvm 
requires we should look for a workaround.

One thing you could try is removing parts of `TestRISCVEmulator.cpp` and seeing 
what breaks the build. Though this is best done by @Emmmer, if it can be 
reproduced elsewhere.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D136362

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


[Lldb-commits] [PATCH] D134378: [lldb] Support simplified template names

2022-10-28 Thread Pavel Labath via Phabricator via lldb-commits
labath accepted this revision.
labath added a comment.
This revision is now accepted and ready to land.

In D134378#3890302 , @aeubanks wrote:

> regarding the failure in TestCPPBreakpointLocations.py (added recently in 
> https://reviews.llvm.org/D135921, seems like it's catching real issues with 
> this patch), it looks like the manual dwarf index needs a similar fix to this
>
> In D134378#3888462 , @labath wrote:
>
>> I can't say I fully understand all of this code, but I also don't know who 
>> would, so I guess I'll just say it "looks good" :)
>>
>> I am wondering about the testing situation though. If I understand 
>> correctly, you've run the test suite with hardcoded simplified names, and it 
>> all passed (?)
>
> yes, that was true until https://reviews.llvm.org/D135921, which catches some 
> missing functionality in this patch around breakpoints (I'd still like to 
> defer that to a separate patch)

Yes, sounds good.

Can you elaborate on the manual index issue. My impression that it just takes 
the strings from inside DW_AT_name, and so it should behave similarly 
(identically?) to a compiler index -- though, in this case, we have direct 
control over it, so we could e.g. make it always store simplified names 
regardless of the debug info.

>> I am definitely not suggesting we add a new test suite mode for that, but 
>> maybe we could extend this one test case with extra check that look at the 
>> type names in other contexts than in name lookup (e.g. expression 
>> evaluation, backtraces, ???) -- just to make sure that something doesn't 
>> break there in the future. WDYT?
>
> I've added expression evaluation to the test. do you have examples of 
> backtrace tests?

I don't have anything particular in mind. I figured you'd just stop the middle 
of some templated member function and run `bt`. Though, when I think of it now, 
these names come from the demangler, so they're probably not particularly 
interesting here. (Unless you build with -gsce, but in that case, they should 
come from the same code that is doing the type templatification).




Comment at: lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp:2509
+TypeSP Ty = GetTypeForDIE(die);
+llvm::StringRef qualName = Ty->GetBaseName().AsCString();
+auto it = qualName.find('<');

This isn't a qualified name anymore. I guess every instance of the string 
"qual" in this block should be replaced or deleted.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D134378

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


[Lldb-commits] [PATCH] D136362: [LLDB][RISCV] Add RV64C instruction support for EmulateInstructionRISCV

2022-10-28 Thread Tiezhu Yang via Phabricator via lldb-commits
seehearfeel added a subscriber: SixWeining.
seehearfeel added a comment.

In D136362#3890970 , @DavidSpickett 
wrote:

> Can you give us:
>
> - the full cmake command you used to configure the project



  git clone https://github.com/llvm/llvm-project.git
  mkdir -p llvm-project/llvm/build
  cd llvm-project/llvm/build
  cmake .. -G "Ninja" -DLLVM_TARGETS_TO_BUILD="BPF" \
   -DLLVM_EXPERIMENTAL_TARGETS_TO_BUILD="LoongArch" \
   -DLLVM_ENABLE_PROJECTS="clang;lldb" \
   -DCMAKE_BUILD_TYPE=Release \
   -DLLVM_BUILD_RUNTIME=OFF
  ninja
  ninja check-lldb -j1



> - the gcc/g++ version used

gcc (GCC) 13.0.0 20220919
g++ (GCC) 13.0.0 20220919

> - the distro used

clfs loongarch

> - the architecture (unlikely to matter but I'm assuming Loongson?)

LoongArch

> - the version of clang++ that did work

clang version 14.0.6

> Could be tripping over a bug in g++. If that version is >= the minimum llvm 
> requires we should look for a workaround.
>
> One thing you could try is removing parts of `TestRISCVEmulator.cpp` and 
> seeing what breaks the build. Though this is best done by @Emmmer, if it can 
> be reproduced elsewhere.

This is introduced in the following commit:

  $ git log -p lldb/unittests/Instruction/RISCV/TestRISCVEmulator.cpp
  commit 05ae747a5353811f93f5814f24d2335e6229d78a
  Author: Emmmer 
  Date:   Thu Oct 20 23:05:37 2022 +0800
  
  [LLDB][RISCV] Add RV64C instruction support for EmulateInstructionRISCV

c++ OOM is related with this vector, if it is empty, building is OK, if it has 
one element at least, build failed.

  std::vector tests = {
   };

@SixWeining can also reproduce it on his local machine.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D136362

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


[Lldb-commits] [PATCH] D136795: [LLDB] Add a `(not loaded) ` prefix to placeholder object filename to indicate they are not loaded.

2022-10-28 Thread Pavel Labath via Phabricator via lldb-commits
labath accepted this revision.
labath added a comment.
This revision is now accepted and ready to land.

I'm not entirely sold on the string "(not loaded)". Maybe would be ok for the 
user, but to me it sounds extremely weird, because the main reason we are 
creating this module is so that we can pretend there is something "loaded" at 
the given address. If you don't like "placeholder", what would you say to 
"(artificial)" ?




Comment at: lldb/test/Shell/Minidump/modules-not-loaded.yaml:7
+# CHECK:  (lldb) target modules list
+# CHEKC-NEXT: [  0] 0400-1400--0300-474E5500 0x1000 (not 
loaded) /invalid/path/on/current/system/libbreakpad.so
+




Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D136795

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


[Lldb-commits] [PATCH] D136362: [LLDB][RISCV] Add RV64C instruction support for EmulateInstructionRISCV

2022-10-28 Thread Emmmer S via Phabricator via lldb-commits
Emmmer added a comment.

I suspect the cause is that g++ tries to instantiate these generic lambdas 
inside `std::visit`, which consumes N^2 the size memory (or whatever is 
related?) when there's nested-`std::visit`

  bool compareInst(const RISCVInst &lhs, const RISCVInst &rhs) {
if (lhs.index() != rhs.index())
  return false;
return std::visit(
[&](auto &&L) {
  return std::visit(
  [&](auto &&R) {
return std::memcmp(&L, &R, sizeof(L)) == 0;
  },
  rhs);
},
lhs);
  }

we can try to change this code to :

  bool compareInst(const RISCVInst &L, const RISCVInst &R) {
return std::visit(
[](auto &&lhs, auto &&rhs) {
  return std::is_same_v &&
 memcmp(&lhs, &rhs, sizeof(lhs)) == 0;
},
L, R);
  }

But I’m unsure if it will work.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D136362

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


[Lldb-commits] [PATCH] D136928: [LLDB] Fix help text for "platform settings"

2022-10-28 Thread David Spickett via Phabricator via lldb-commits
DavidSpickett created this revision.
Herald added a project: All.
DavidSpickett requested review of this revision.
Herald added a project: LLDB.
Herald added a subscriber: lldb-commits.

This claims to take a platform name argument but doesn't.

That was probably the intent in fbb7634934d40548b650574a2f2a85ab41527674
but it has only ever worked with the current platform.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D136928

Files:
  lldb/source/Commands/CommandObjectPlatform.cpp


Index: lldb/source/Commands/CommandObjectPlatform.cpp
===
--- lldb/source/Commands/CommandObjectPlatform.cpp
+++ lldb/source/Commands/CommandObjectPlatform.cpp
@@ -379,8 +379,7 @@
 public:
   CommandObjectPlatformSettings(CommandInterpreter &interpreter)
   : CommandObjectParsed(interpreter, "platform settings",
-"Set settings for the current target's platform, "
-"or for a platform by name.",
+"Set settings for the current target's platform.",
 "platform settings", 0),
 m_option_working_dir(LLDB_OPT_SET_1, false, "working-dir", 'w',
  
CommandCompletions::eRemoteDiskDirectoryCompletion,


Index: lldb/source/Commands/CommandObjectPlatform.cpp
===
--- lldb/source/Commands/CommandObjectPlatform.cpp
+++ lldb/source/Commands/CommandObjectPlatform.cpp
@@ -379,8 +379,7 @@
 public:
   CommandObjectPlatformSettings(CommandInterpreter &interpreter)
   : CommandObjectParsed(interpreter, "platform settings",
-"Set settings for the current target's platform, "
-"or for a platform by name.",
+"Set settings for the current target's platform.",
 "platform settings", 0),
 m_option_working_dir(LLDB_OPT_SET_1, false, "working-dir", 'w',
  CommandCompletions::eRemoteDiskDirectoryCompletion,
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D136928: [LLDB] Fix help text for "platform settings"

2022-10-28 Thread David Spickett via Phabricator via lldb-commits
DavidSpickett added a reviewer: clayborg.
DavidSpickett added a comment.
Herald added a subscriber: JDevlieghere.

Alternatively, I could look at adding that option. Not sure off the top of my 
head if configuring an inactive platform would even work.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D136928

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


[Lldb-commits] [PATCH] D136934: [lldb][FormatEntity][NFC] Move function argument parsing code into separate functions

2022-10-28 Thread Michael Buch via Phabricator via lldb-commits
Michael137 created this revision.
Michael137 added reviewers: labath, aprantl.
Herald added a project: All.
Michael137 requested review of this revision.
Herald added a project: LLDB.
Herald added a subscriber: lldb-commits.

Hopefully makes the code more readable and allows
us to re-use argument pretty-printing code from
the `CPlusPlusLanguage` plugin in a follow-up commit.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D136934

Files:
  lldb/include/lldb/Core/FormatEntity.h
  lldb/source/Core/FormatEntity.cpp

Index: lldb/source/Core/FormatEntity.cpp
===
--- lldb/source/Core/FormatEntity.cpp
+++ lldb/source/Core/FormatEntity.cpp
@@ -1039,6 +1039,71 @@
   return (::strncmp(var_name_begin, var, strlen(var)) == 0);
 }
 
+/// Parses the basename out of a demangled function name
+/// that may include function arguments. Supports
+/// template functions.
+///
+/// Returns pointers to the opening and closing parenthesis of
+/// `full_name`. Can return nullptr for either parenthesis if
+/// none is exists.
+static std::pair
+ParseBaseName(char const *full_name) {
+  const char *open_paren = strchr(full_name, '(');
+  const char *close_paren = nullptr;
+  const char *generic = strchr(full_name, '<');
+  // if before the arguments list begins there is a template sign
+  // then scan to the end of the generic args before you try to find
+  // the arguments list
+  if (generic && open_paren && generic < open_paren) {
+int generic_depth = 1;
+++generic;
+for (; *generic && generic_depth > 0; generic++) {
+  if (*generic == '<')
+generic_depth++;
+  if (*generic == '>')
+generic_depth--;
+}
+if (*generic)
+  open_paren = strchr(generic, '(');
+else
+  open_paren = nullptr;
+  }
+
+  if (open_paren) {
+if (IsToken(open_paren, "(anonymous namespace)")) {
+  open_paren = strchr(open_paren + strlen("(anonymous namespace)"), '(');
+  if (open_paren)
+close_paren = strchr(open_paren, ')');
+} else
+  close_paren = strchr(open_paren, ')');
+  }
+
+  return {open_paren, close_paren};
+}
+
+/// Writes out the function name in 'full_name' to 'out_stream'
+/// but replaces each argument type with the variable name
+/// and the corresponding pretty-printed value
+static void PrettyPrintFunctionNameWithArgs(Stream &out_stream,
+char const *full_name,
+ExecutionContextScope *exe_scope,
+VariableList const &args) {
+  auto [open_paren, close_paren] = ParseBaseName(full_name);
+  if (open_paren)
+out_stream.Write(full_name, open_paren - full_name + 1);
+  else {
+out_stream.PutCString(full_name);
+out_stream.PutChar('(');
+  }
+
+  FormatEntity::PrettyPrintFunctionArguments(out_stream, args, exe_scope);
+
+  if (close_paren)
+out_stream.PutCString(close_paren);
+  else
+out_stream.PutChar(')');
+}
+
 bool FormatEntity::FormatStringRef(const llvm::StringRef &format_str, Stream &s,
const SymbolContext *sc,
const ExecutionContext *exe_ctx,
@@ -1645,100 +1710,7 @@
 variable_list_sp->AppendVariablesWithScope(
 eValueTypeVariableArgument, args);
   if (args.GetSize() > 0) {
-const char *open_paren = strchr(cstr, '(');
-const char *close_paren = nullptr;
-const char *generic = strchr(cstr, '<');
-// if before the arguments list begins there is a template sign
-// then scan to the end of the generic args before you try to find
-// the arguments list
-if (generic && open_paren && generic < open_paren) {
-  int generic_depth = 1;
-  ++generic;
-  for (; *generic && generic_depth > 0; generic++) {
-if (*generic == '<')
-  generic_depth++;
-if (*generic == '>')
-  generic_depth--;
-  }
-  if (*generic)
-open_paren = strchr(generic, '(');
-  else
-open_paren = nullptr;
-}
-if (open_paren) {
-  if (IsToken(open_paren, "(anonymous namespace)")) {
-open_paren =
-strchr(open_paren + strlen("(anonymous namespace)"), '(');
-if (open_paren)
-  close_paren = strchr(open_paren, ')');
-  } else
-close_paren = strchr(open_paren, ')');
-}
-
-if (open_paren)
-  s.Write(cstr, open_paren - cstr + 1);
-else {
-  s.PutCString(cstr);
-  s.PutChar('(');
-}
-const size_t num_args = args.GetSize();
-for (size_t arg_idx = 0; arg_idx < num_args; ++arg_idx) {
-

[Lldb-commits] [PATCH] D136935: [lldb][CPlusPlus] Introuce CPlusPlusLanguage::MethodName::GetReturnType

2022-10-28 Thread Michael Buch via Phabricator via lldb-commits
Michael137 created this revision.
Michael137 added reviewers: labath, aprantl.
Herald added a project: All.
Michael137 requested review of this revision.
Herald added a project: LLDB.
Herald added a subscriber: lldb-commits.

This patch adds a way to extract the return type out
of the `CPlusPlusNameParser`. This will be useful
for cases where we want a function's basename *and* the
return type but not the function arguments; this is
currently not possible (the parser either gives us the
full name or just the basename). Since the parser knows
how to handle return types already we should just expose
this to users that need it.

**Testing**

- Added unit-tests


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D136935

Files:
  lldb/source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.cpp
  lldb/source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.h
  lldb/source/Plugins/Language/CPlusPlus/CPlusPlusNameParser.cpp
  lldb/source/Plugins/Language/CPlusPlus/CPlusPlusNameParser.h
  lldb/unittests/Language/CPlusPlus/CPlusPlusLanguageTest.cpp

Index: lldb/unittests/Language/CPlusPlus/CPlusPlusLanguageTest.cpp
===
--- lldb/unittests/Language/CPlusPlus/CPlusPlusLanguageTest.cpp
+++ lldb/unittests/Language/CPlusPlus/CPlusPlusLanguageTest.cpp
@@ -17,130 +17,136 @@
 TEST(CPlusPlusLanguage, MethodNameParsing) {
   struct TestCase {
 std::string input;
-std::string context, basename, arguments, qualifiers, scope_qualified_name;
+std::string return_type, context, basename, arguments, qualifiers,
+scope_qualified_name;
   };
 
   TestCase test_cases[] = {
-  {"main(int, char *[]) ", "", "main", "(int, char *[])", "", "main"},
-  {"foo::bar(baz) const", "foo", "bar", "(baz)", "const", "foo::bar"},
-  {"foo::~bar(baz)", "foo", "~bar", "(baz)", "", "foo::~bar"},
-  {"a::b::c::d(e,f)", "a::b::c", "d", "(e,f)", "", "a::b::c::d"},
-  {"void f(int)", "", "f", "(int)", "", "f"},
+  {"main(int, char *[]) ", "", "", "main", "(int, char *[])", "", "main"},
+  {"foo::bar(baz) const", "", "foo", "bar", "(baz)", "const", "foo::bar"},
+  {"foo::~bar(baz)", "", "foo", "~bar", "(baz)", "", "foo::~bar"},
+  {"a::b::c::d(e,f)", "", "a::b::c", "d", "(e,f)", "", "a::b::c::d"},
+  {"void f(int)", "void", "", "f", "(int)", "", "f"},
 
   // Operators
   {"std::basic_ostream >& "
"std::operator<< >"
+   "std::basic_ostream >&",
"(std::basic_ostream >&, char const*)",
"std", "operator<< >",
"(std::basic_ostream >&, char const*)", "",
"std::operator<< >"},
   {"operator delete[](void*, clang::ASTContext const&, unsigned long)", "",
-   "operator delete[]", "(void*, clang::ASTContext const&, unsigned long)",
-   "", "operator delete[]"},
-  {"llvm::Optional::operator bool() const",
+   "", "operator delete[]",
+   "(void*, clang::ASTContext const&, unsigned long)", "",
+   "operator delete[]"},
+  {"llvm::Optional::operator bool() const", "",
"llvm::Optional", "operator bool", "()", "const",
"llvm::Optional::operator bool"},
-  {"(anonymous namespace)::FactManager::operator[](unsigned short)",
+  {"(anonymous namespace)::FactManager::operator[](unsigned short)", "",
"(anonymous namespace)::FactManager", "operator[]", "(unsigned short)",
"", "(anonymous namespace)::FactManager::operator[]"},
   {"const int& std::map>::operator[](short) const",
-   "std::map>", "operator[]", "(short)", "const",
-   "std::map>::operator[]"},
-  {"CompareInsn::operator()(llvm::StringRef, InsnMatchEntry const&)",
+   "const int&", "std::map>", "operator[]", "(short)",
+   "const", "std::map>::operator[]"},
+  {"CompareInsn::operator()(llvm::StringRef, InsnMatchEntry const&)", "",
"CompareInsn", "operator()", "(llvm::StringRef, InsnMatchEntry const&)",
"", "CompareInsn::operator()"},
-  {"llvm::Optional::operator*() const &",
+  {"llvm::Optional::operator*() const &", "",
"llvm::Optional", "operator*", "()", "const &",
"llvm::Optional::operator*"},
   {"auto std::__1::ranges::__begin::__fn::operator()[abi:v16](char const (&) [18ul]) const",
-   "std::__1::ranges::__begin::__fn",
+   "auto", "std::__1::ranges::__begin::__fn",
"operator()[abi:v16]", "(char const (&) [18ul])",
"const",
"std::__1::ranges::__begin::__fn::operator()[abi:v16]"},
   // Internal classes
-  {"operator<<(Cls, Cls)::Subclass::function()",
+  {"operator<<(Cls, Cls)::Subclass::function()", "",
"operator<<(Cls, Cls)::Subclass", "function", "()", "",
"operator<<(Cls, Cls)::Subclass::function"},
-  {"SAEC::checkFunction(context&) const::CallBack::CallBack(int)",
+  {"SAEC::checkFunction(context&) const::CallBack::CallBack(int)", "",
"SAEC::checkFunction(context&) const::CallBack", "CallBack", "

[Lldb-commits] [lldb] bf07c33 - Revert "[clang] Instantiate NTTPs and template default arguments with sugar"

2022-10-28 Thread Haojian Wu via lldb-commits

Author: Haojian Wu
Date: 2022-10-28T11:56:19+02:00
New Revision: bf07c338bb78c54b8d96fb42a75b168bf1550ad7

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

LOG: Revert "[clang] Instantiate NTTPs and template default arguments with 
sugar"

This patch reverts
- commit d4b1964f0554046b1e64908e5c1cd701b25f4c9e
- commit 59f0827e2cf3755834620e7e0b6d946832440f80([clang] Instantiate alias 
templates with sugar)

As it makes clang fail to pass some code it used to compile.
See comments: https://reviews.llvm.org/D136564#3891065

Added: 


Modified: 
clang-tools-extra/clangd/unittests/HoverTests.cpp
clang/include/clang/Sema/Sema.h
clang/lib/Sema/SemaTemplate.cpp
clang/lib/Sema/SemaTemplateDeduction.cpp
clang/test/AST/ast-dump-template-decls.cpp
clang/test/CXX/drs/dr3xx.cpp
clang/test/CXX/expr/expr.const/p3-0x.cpp
clang/test/CXX/temp/temp.deduct.guide/p3.cpp
clang/test/Misc/diag-template-diffing.cpp
clang/test/SemaCXX/sizeless-1.cpp
clang/test/SemaTemplate/instantiation-default-1.cpp
clang/test/SemaTemplate/make_integer_seq.cpp
clang/test/SemaTemplate/temp_arg_nontype.cpp

lldb/test/API/commands/expression/import-std-module/shared_ptr/TestSharedPtrFromStdModule.py

lldb/test/API/commands/expression/import-std-module/weak_ptr-dbg-info-content/TestDbgInfoContentWeakPtrFromStdModule.py

lldb/test/API/commands/expression/import-std-module/weak_ptr/TestWeakPtrFromStdModule.py

Removed: 




diff  --git a/clang-tools-extra/clangd/unittests/HoverTests.cpp 
b/clang-tools-extra/clangd/unittests/HoverTests.cpp
index 8bca0dc974539..9f64defaf898f 100644
--- a/clang-tools-extra/clangd/unittests/HoverTests.cpp
+++ b/clang-tools-extra/clangd/unittests/HoverTests.cpp
@@ -1067,7 +1067,7 @@ class Foo final {})cpp";
  HI.LocalScope = "";
  HI.Kind = index::SymbolKind::TypeAlias;
  HI.Definition = "template  using AA = A";
- HI.Type = {"A", "T"};
+ HI.Type = {"A", "type-parameter-0-0"}; // FIXME: should be 'T'
  HI.TemplateParameters = {{{"typename"}, std::string("T"), 
llvm::None}};
}},
   {// Constant array

diff  --git a/clang/include/clang/Sema/Sema.h b/clang/include/clang/Sema/Sema.h
index b7a52aeea592c..b32dfe158c8f3 100644
--- a/clang/include/clang/Sema/Sema.h
+++ b/clang/include/clang/Sema/Sema.h
@@ -8199,11 +8199,14 @@ class Sema final {
 SourceLocation TemplateLoc,
 Declarator &D);
 
-  TemplateArgumentLoc SubstDefaultTemplateArgumentIfAvailable(
-  TemplateDecl *Template, SourceLocation TemplateLoc,
-  SourceLocation RAngleLoc, Decl *Param,
-  ArrayRef SugaredConverted,
-  ArrayRef CanonicalConverted, bool &HasDefaultArg);
+  TemplateArgumentLoc
+  SubstDefaultTemplateArgumentIfAvailable(TemplateDecl *Template,
+  SourceLocation TemplateLoc,
+  SourceLocation RAngleLoc,
+  Decl *Param,
+  SmallVectorImpl
+&Converted,
+  bool &HasDefaultArg);
 
   /// Specifies the context in which a particular template
   /// argument is being checked.

diff  --git a/clang/lib/Sema/SemaTemplate.cpp b/clang/lib/Sema/SemaTemplate.cpp
index 802c9574745f0..bf6acd52f2856 100644
--- a/clang/lib/Sema/SemaTemplate.cpp
+++ b/clang/lib/Sema/SemaTemplate.cpp
@@ -3854,8 +3854,8 @@ QualType Sema::CheckTemplateIdType(TemplateName Name,
 
 // Only substitute for the innermost template argument list.
 MultiLevelTemplateArgumentList TemplateArgLists;
-TemplateArgLists.addOuterTemplateArguments(Template, SugaredConverted,
-   /*Final=*/true);
+TemplateArgLists.addOuterTemplateArguments(Template, CanonicalConverted,
+   /*Final=*/false);
 TemplateArgLists.addOuterRetainedLevels(
 AliasTemplate->getTemplateParameters()->getDepth());
 
@@ -5261,25 +5261,27 @@ bool Sema::CheckTemplateTypeArgument(
 /// \param Converted the list of template arguments provided for template
 /// parameters that precede \p Param in the template parameter list.
 /// \returns the substituted template argument, or NULL if an error occurred.
-static TypeSourceInfo *SubstDefaultTemplateArgument(
-Sema &SemaRef, TemplateDecl *Template, SourceLocation TemplateLoc,
-SourceLocation RAngleLoc, TemplateTypeParmDecl *Param,
-ArrayRef SugaredConverted,
-ArrayRef CanonicalConverted) {
+static TypeSourceInfo *
+SubstDefaultTemplateArgument(Sema &SemaRef,
+ Templa

[Lldb-commits] [PATCH] D136761: [lldb][FormatEntity] Fix closing parenthesis for function.name-with-args frame format

2022-10-28 Thread Michael Buch via Phabricator via lldb-commits
Michael137 updated this revision to Diff 471468.
Michael137 added a comment.

- Use the C++ language-plugin to format the function name


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D136761

Files:
  lldb/source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.cpp
  lldb/source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.h
  lldb/test/Shell/Settings/Inputs/names.cpp
  lldb/test/Shell/Settings/TestFrameFormatNameWithArgs.test

Index: lldb/test/Shell/Settings/TestFrameFormatNameWithArgs.test
===
--- /dev/null
+++ lldb/test/Shell/Settings/TestFrameFormatNameWithArgs.test
@@ -0,0 +1,22 @@
+# RUN: %clangxx_host -g -O0 %S/Inputs/names.cpp -std=c++17 -o %t.out
+# RUN: %lldb -b -s %s %t.out | FileCheck %s
+settings set -f frame-format "frame ${function.name-with-args}\n"
+break set -n foo
+break set -n operator<<
+run
+# CHECK: frame int ns::foo(t={{.*}})
+c
+# CHECK: frame int ns::foo>(t= Function = bar() )
+c
+# CHECK: frame int ns::foo<(anonymous namespace)::$_0>(t={{.*}})
+c
+# CHECK: frame int ns::foo>(t= Function = (anonymous namespace)::anon_bar() )
+c
+# CHECK: frame int ns::foo const&) const noexcept>(t={{.*}})
+c
+# CHECK: frame void Foo::foo>(this={{.*}}, t= Function = bar() ) const
+c
+# CHECK: frame void Foo::foo>(this={{.*}}, t= Function = (anonymous namespace)::anon_bar() ) const
+c
+# CHECK: frame void Foo::operator<<<1ul>(this={{.*}}, (null)=0)
+q
Index: lldb/test/Shell/Settings/Inputs/names.cpp
===
--- /dev/null
+++ lldb/test/Shell/Settings/Inputs/names.cpp
@@ -0,0 +1,31 @@
+#include 
+
+struct Foo {
+  template  void foo(T const &t) const noexcept(true) {}
+
+  template  void operator<<(size_t) {}
+};
+
+namespace ns {
+template  int foo(T const &t) noexcept(false) { return 0; }
+} // namespace ns
+
+int bar() { return 1; }
+
+namespace {
+int anon_bar() { return 1; }
+auto anon_lambda = [](std::function) mutable {};
+} // namespace
+
+int main() {
+  ns::foo(bar);
+  ns::foo(std::function{bar});
+  ns::foo(anon_lambda);
+  ns::foo(std::function{anon_bar});
+  ns::foo(&Foo::foo>);
+  Foo f;
+  f.foo(std::function{bar});
+  f.foo(std::function{anon_bar});
+  f.operator<< <(2 > 1)>(0);
+  return 0;
+}
Index: lldb/source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.h
===
--- lldb/source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.h
+++ lldb/source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.h
@@ -132,6 +132,11 @@
   ConstString
   GetDemangledFunctionNameWithoutArguments(Mangled mangled) const override;
 
+  bool GetFunctionDisplayName(const SymbolContext *sc,
+  const ExecutionContext *exe_ctx,
+  FunctionNameRepresentation representation,
+  Stream &s) override;
+
   static bool IsCPPMangledName(llvm::StringRef name);
 
   // Extract C++ context and identifier from a string using heuristic matching
Index: lldb/source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.cpp
===
--- lldb/source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.cpp
+++ lldb/source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.cpp
@@ -23,11 +23,13 @@
 #include "lldb/Core/Module.h"
 #include "lldb/Core/PluginManager.h"
 #include "lldb/Core/UniqueCStringMap.h"
+#include "lldb/Core/ValueObjectVariable.h"
 #include "lldb/DataFormatters/CXXFunctionPointer.h"
 #include "lldb/DataFormatters/DataVisualization.h"
 #include "lldb/DataFormatters/FormattersHelpers.h"
 #include "lldb/DataFormatters/VectorType.h"
 #include "lldb/Symbol/SymbolFile.h"
+#include "lldb/Symbol/VariableList.h"
 #include "lldb/Utility/ConstString.h"
 #include "lldb/Utility/LLDBLog.h"
 #include "lldb/Utility/Log.h"
@@ -171,6 +173,39 @@
   return idx == basename.size();
 }
 
+/// Writes out the function name in 'full_name' to 'out_stream'
+/// but replaces each argument type with the variable name
+/// and the corresponding pretty-printed value
+static bool PrettyPrintFunctionNameWithArgs(Stream &out_stream,
+char const *full_name,
+ExecutionContextScope *exe_scope,
+VariableList const &args) {
+  CPlusPlusLanguage::MethodName cpp_method{ConstString(full_name)};
+
+  if (!cpp_method.IsValid())
+return false;
+
+  llvm::StringRef return_type = cpp_method.GetReturnType();
+  if (!return_type.empty()) {
+out_stream.PutCString(return_type);
+out_stream.PutChar(' ');
+  }
+  out_stream.PutCString(cpp_method.GetScopeQualifiedName());
+  out_stream.PutChar('(');
+
+  FormatEntity::PrettyPrintFunctionArguments(out_stream, args, exe_scope);
+
+  out_stream.PutChar(')');
+
+  llvm::StringRef qualifiers = cpp_method.GetQu

[Lldb-commits] [PATCH] D136761: [lldb][CPlusPlus] Implement CPlusPlusLanguage::GetFunctionDisplayName

2022-10-28 Thread Michael Buch via Phabricator via lldb-commits
Michael137 added inline comments.



Comment at: lldb/source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.cpp:1538
+  cstr = inline_info->GetName().GetCString();
+}
+

Not great that this is copied from `FormatEntity` but didn't see a great way of 
making this a useful API across both components


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D136761

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


[Lldb-commits] [PATCH] D136935: [lldb][CPlusPlus] Introuce CPlusPlusLanguage::MethodName::GetReturnType

2022-10-28 Thread Michael Buch via Phabricator via lldb-commits
Michael137 updated this revision to Diff 471474.
Michael137 added a comment.

- Fix unit-tests
- Handle function pointer types


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D136935

Files:
  lldb/source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.cpp
  lldb/source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.h
  lldb/source/Plugins/Language/CPlusPlus/CPlusPlusNameParser.cpp
  lldb/source/Plugins/Language/CPlusPlus/CPlusPlusNameParser.h
  lldb/unittests/Language/CPlusPlus/CPlusPlusLanguageTest.cpp

Index: lldb/unittests/Language/CPlusPlus/CPlusPlusLanguageTest.cpp
===
--- lldb/unittests/Language/CPlusPlus/CPlusPlusLanguageTest.cpp
+++ lldb/unittests/Language/CPlusPlus/CPlusPlusLanguageTest.cpp
@@ -17,130 +17,136 @@
 TEST(CPlusPlusLanguage, MethodNameParsing) {
   struct TestCase {
 std::string input;
-std::string context, basename, arguments, qualifiers, scope_qualified_name;
+std::string return_type, context, basename, arguments, qualifiers,
+scope_qualified_name;
   };
 
   TestCase test_cases[] = {
-  {"main(int, char *[]) ", "", "main", "(int, char *[])", "", "main"},
-  {"foo::bar(baz) const", "foo", "bar", "(baz)", "const", "foo::bar"},
-  {"foo::~bar(baz)", "foo", "~bar", "(baz)", "", "foo::~bar"},
-  {"a::b::c::d(e,f)", "a::b::c", "d", "(e,f)", "", "a::b::c::d"},
-  {"void f(int)", "", "f", "(int)", "", "f"},
+  {"main(int, char *[]) ", "", "", "main", "(int, char *[])", "", "main"},
+  {"foo::bar(baz) const", "", "foo", "bar", "(baz)", "const", "foo::bar"},
+  {"foo::~bar(baz)", "", "foo", "~bar", "(baz)", "", "foo::~bar"},
+  {"a::b::c::d(e,f)", "", "a::b::c", "d", "(e,f)", "", "a::b::c::d"},
+  {"void f(int)", "void", "", "f", "(int)", "", "f"},
 
   // Operators
   {"std::basic_ostream >& "
-   "std::operator<< >"
-   "(std::basic_ostream >&, char const*)",
-   "std", "operator<< >",
+   "std::operator<< >(std::basic_ostream >&, char const*)",
+   "std::basic_ostream >&", "std",
+   "operator<< >",
"(std::basic_ostream >&, char const*)", "",
"std::operator<< >"},
   {"operator delete[](void*, clang::ASTContext const&, unsigned long)", "",
-   "operator delete[]", "(void*, clang::ASTContext const&, unsigned long)",
-   "", "operator delete[]"},
-  {"llvm::Optional::operator bool() const",
+   "", "operator delete[]",
+   "(void*, clang::ASTContext const&, unsigned long)", "",
+   "operator delete[]"},
+  {"llvm::Optional::operator bool() const", "",
"llvm::Optional", "operator bool", "()", "const",
"llvm::Optional::operator bool"},
-  {"(anonymous namespace)::FactManager::operator[](unsigned short)",
+  {"(anonymous namespace)::FactManager::operator[](unsigned short)", "",
"(anonymous namespace)::FactManager", "operator[]", "(unsigned short)",
"", "(anonymous namespace)::FactManager::operator[]"},
   {"const int& std::map>::operator[](short) const",
-   "std::map>", "operator[]", "(short)", "const",
-   "std::map>::operator[]"},
-  {"CompareInsn::operator()(llvm::StringRef, InsnMatchEntry const&)",
+   "const int&", "std::map>", "operator[]", "(short)",
+   "const", "std::map>::operator[]"},
+  {"CompareInsn::operator()(llvm::StringRef, InsnMatchEntry const&)", "",
"CompareInsn", "operator()", "(llvm::StringRef, InsnMatchEntry const&)",
"", "CompareInsn::operator()"},
-  {"llvm::Optional::operator*() const &",
+  {"llvm::Optional::operator*() const &", "",
"llvm::Optional", "operator*", "()", "const &",
"llvm::Optional::operator*"},
   {"auto std::__1::ranges::__begin::__fn::operator()[abi:v16](char const (&) [18ul]) const",
-   "std::__1::ranges::__begin::__fn",
+   "auto", "std::__1::ranges::__begin::__fn",
"operator()[abi:v16]", "(char const (&) [18ul])",
"const",
"std::__1::ranges::__begin::__fn::operator()[abi:v16]"},
   // Internal classes
-  {"operator<<(Cls, Cls)::Subclass::function()",
+  {"operator<<(Cls, Cls)::Subclass::function()", "",
"operator<<(Cls, Cls)::Subclass", "function", "()", "",
"operator<<(Cls, Cls)::Subclass::function"},
-  {"SAEC::checkFunction(context&) const::CallBack::CallBack(int)",
+  {"SAEC::checkFunction(context&) const::CallBack::CallBack(int)", "",
"SAEC::checkFunction(context&) const::CallBack", "CallBack", "(int)", "",
"SAEC::checkFunction(context&) const::CallBack::CallBack"},
   // Anonymous namespace
-  {"XX::(anonymous namespace)::anon_class::anon_func() const",
+  {"XX::(anonymous namespace)::anon_class::anon_func() const", "",
"XX::(anonymous namespace)::anon_class", "anon_func", "()", "const",
"XX::(anonymous namespace)::anon_class::a

[Lldb-commits] [PATCH] D136938: [LLDB] Fix code breakpoints on tagged addresses

2022-10-28 Thread David Spickett via Phabricator via lldb-commits
DavidSpickett created this revision.
Herald added subscribers: atanasyan, arichardson, sdardis.
Herald added a project: All.
DavidSpickett requested review of this revision.
Herald added a project: LLDB.
Herald added a subscriber: lldb-commits.

This allows you to break on the value of a function pointer
with non-address bits in it. For example your ABI might mandate
function pointer signing.

Previously it would either try to write to an address that was
incorrect, or try to set a hardware register incorrectly.

I have placed the ABI check before GetBreakableLoadAddress
on the logic that that function probably works best with a
fixed address.

This is somewhat academic because the only user of
GetBreakableLoadAddress is MIPS where we don't support any
form of address tagging.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D136938

Files:
  lldb/source/Target/Target.cpp
  lldb/test/API/linux/aarch64/tagged_code_break/Makefile
  
lldb/test/API/linux/aarch64/tagged_code_break/TestAArch64LinuxTaggedCodeBreak.py
  lldb/test/API/linux/aarch64/tagged_code_break/main.c

Index: lldb/test/API/linux/aarch64/tagged_code_break/main.c
===
--- /dev/null
+++ lldb/test/API/linux/aarch64/tagged_code_break/main.c
@@ -0,0 +1,18 @@
+#include 
+
+void foo(void) {}
+typedef void (*FooPtr)(void);
+
+int main() {
+  FooPtr fnptr = foo;
+  // Set top byte.
+  fnptr = (FooPtr)((uintptr_t)fnptr | (uintptr_t)0xff << 56);
+  // Then apply a PAuth signature to it.
+  __asm__ __volatile__("pacdza %0" : "=r"(fnptr) : "r"(fnptr));
+  // fnptr is now:
+  // <8 bit top byte tag>
+
+  foo(); // Set break point at this line.
+
+  return 0;
+}
Index: lldb/test/API/linux/aarch64/tagged_code_break/TestAArch64LinuxTaggedCodeBreak.py
===
--- /dev/null
+++ lldb/test/API/linux/aarch64/tagged_code_break/TestAArch64LinuxTaggedCodeBreak.py
@@ -0,0 +1,57 @@
+"""
+Test that "breakpoint set -a" uses the ABI plugin to remove non-address bits
+before attempting to set a breakpoint.
+"""
+
+import lldb
+from lldbsuite.test.decorators import *
+from lldbsuite.test.lldbtest import *
+from lldbsuite.test import lldbutil
+
+
+class AArch64LinuxTaggedCodeBreak(TestBase):
+
+NO_DEBUG_INFO_TESTCASE = True
+
+def do_tagged_break(self, hardware):
+if not self.isAArch64PAuth():
+self.skipTest('Target must support pointer authentication.')
+
+self.build()
+self.runCmd("file " + self.getBuildArtifact("a.out"), CURRENT_EXECUTABLE_SET)
+
+lldbutil.run_break_set_by_file_and_line(self, "main.c",
+line_number('main.c', '// Set break point at this line.'),
+num_expected_locations=1)
+
+self.runCmd("run", RUN_SUCCEEDED)
+
+if self.process().GetState() == lldb.eStateExited:
+self.fail("Test program failed to run.")
+
+self.expect("thread list", STOPPED_DUE_TO_BREAKPOINT,
+substrs=['stopped',
+ 'stop reason = breakpoint'])
+
+cmd = "breakpoint set -a fnptr"
+# LLDB only has the option to force hardware break, not software.
+# It prefers sofware break when it can and this will be one of those cases.
+if hardware:
+cmd += " --hardware"
+self.expect(cmd)
+
+self.runCmd("continue")
+self.assertEqual(self.process().GetState(), lldb.eStateStopped)
+self.expect("thread list", STOPPED_DUE_TO_BREAKPOINT,
+substrs=['stopped', '`foo at main.c', 'stop reason = breakpoint'])
+
+# AArch64 Linux always enables the top byte ignore feature
+@skipUnlessArch("aarch64")
+@skipUnlessPlatform(["linux"])
+def test_software_break(self):
+self.do_tagged_break(False)
+
+@skipUnlessArch("aarch64")
+@skipUnlessPlatform(["linux"])
+def test_hardware_break(self):
+self.do_tagged_break(True)
\ No newline at end of file
Index: lldb/test/API/linux/aarch64/tagged_code_break/Makefile
===
--- /dev/null
+++ lldb/test/API/linux/aarch64/tagged_code_break/Makefile
@@ -0,0 +1,5 @@
+C_SOURCES := main.c
+
+CFLAGS_EXTRAS := -march=armv8.3-a
+
+include Makefile.rules
Index: lldb/source/Target/Target.cpp
===
--- lldb/source/Target/Target.cpp
+++ lldb/source/Target/Target.cpp
@@ -2626,8 +2626,14 @@
 }
 
 lldb::addr_t Target::GetBreakableLoadAddress(lldb::addr_t addr) {
-  auto arch_plugin = GetArchitecturePlugin();
-  return arch_plugin ? arch_plugin->GetBreakableLoadAddress(addr, *this) : addr;
+  lldb::ABISP abi_plugin = m_process_sp ? m_process_sp->GetABI() : nullptr;
+  if (abi_plugin)
+addr = abi_plugin->FixCodeAddress(addr);
+
+  if (auto arch_plugin = GetArchitecturePlugin())
+addr = arch_plugin->GetBreakableLoadAddress(addr, *this);
+
+  return addr;
 }
 
 SourceManage

[Lldb-commits] [lldb] 2a812bd - [lldb][Docs][NFC] Fix sphinx warnings/errors for LLDB docs

2022-10-28 Thread Michael Buch via lldb-commits

Author: Michael Buch
Date: 2022-10-28T11:31:15+01:00
New Revision: 2a812bdc70c6153f41907db056e348d9b322f01c

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

LOG: [lldb][Docs][NFC] Fix sphinx warnings/errors for LLDB docs

Ran `ninja docs-lldb-html` and made sure the docs are fixed.

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

Added: 


Modified: 
lldb/bindings/interface/SBModule.i
lldb/bindings/interface/SBTarget.i
lldb/bindings/interface/SBType.i
lldb/docs/resources/build.rst
lldb/docs/resources/test.rst
lldb/docs/use/intel_pt.rst

Removed: 




diff  --git a/lldb/bindings/interface/SBModule.i 
b/lldb/bindings/interface/SBModule.i
index bda602d15690e..de476f706261c 100644
--- a/lldb/bindings/interface/SBModule.i
+++ b/lldb/bindings/interface/SBModule.i
@@ -137,8 +137,11 @@ public:
 void
 Clear();
 
-%feature("docstring", "Check if the module is file backed.
+%feature("docstring", "
+Check if the module is file backed.
+
 @return
+
 True, if the module is backed by an object file on disk.
 False, if the module is backed by an object file in memory.") 
IsFileBacked;
 bool

diff  --git a/lldb/bindings/interface/SBTarget.i 
b/lldb/bindings/interface/SBTarget.i
index a6a764944d02e..e887762b83134 100644
--- a/lldb/bindings/interface/SBTarget.i
+++ b/lldb/bindings/interface/SBTarget.i
@@ -947,7 +947,7 @@ public:
 %feature("docstring", "
 Returns true if the module has been loaded in this `SBTarget`.
 A module can be loaded either by the dynamic loader or by being manually
-added to the target (see `SBTarget.AddModule` and the `target module add` 
command).
+added to the target (see `SBTarget.AddModule` and the ``target module 
add`` command).
 
 :rtype: bool
 ") IsLoaded;

diff  --git a/lldb/bindings/interface/SBType.i 
b/lldb/bindings/interface/SBType.i
index ba33f9231f0e8..5bead82cd2c5e 100644
--- a/lldb/bindings/interface/SBType.i
+++ b/lldb/bindings/interface/SBType.i
@@ -229,7 +229,7 @@ public:
   function returns ``0``.
 * C++: Same as in C.
 * Objective-C: Same as in C. For Objective-C classes this always returns
-  `0`` as the actual size depends on runtime information.
+  ``0`` as the actual size depends on runtime information.
 ") GetByteSize;
 uint64_t
 GetByteSize();
@@ -506,7 +506,7 @@ public:
 
 Language-specific behaviour:
 
-* C: Returns a constant-size array `T[size]` for any non-void type.
+* C: Returns a constant-size array ``T[size]`` for any non-void type.
 * C++: Same as in C.
 * Objective-C: Same as in C.
 

diff  --git a/lldb/docs/resources/build.rst b/lldb/docs/resources/build.rst
index c44bdeee22c89..36b61bcf78990 100644
--- a/lldb/docs/resources/build.rst
+++ b/lldb/docs/resources/build.rst
@@ -99,7 +99,7 @@ Windows
   or even write new tests at all, PTVS is an indispensable debugging
   extension to VS that enables full editing and debugging support for Python
   (including mixed native/managed debugging).
-* `SWIG for Windows _`
+* `SWIG for Windows `_
 
 The steps outlined here describes how to set up your system and install the
 required dependencies such that they can be found when needed during the build

diff  --git a/lldb/docs/resources/test.rst b/lldb/docs/resources/test.rst
index 2ecce85fd9dbf..f91285980f2a8 100644
--- a/lldb/docs/resources/test.rst
+++ b/lldb/docs/resources/test.rst
@@ -229,7 +229,7 @@ good testing practices.
 time (e.g., C and C++) there is also usually no process necessary to test
 the `SBType`-related parts of the API. With those languages it's also
 possible to test `SBValue` by running expressions with
-`SBTarget.EvaluateExpression` or the `expect_expr` testing utility.
+`SBTarget.EvaluateExpression` or the ``expect_expr`` testing utility.
 
 Functionality that always requires a running process is everything that
 tests the `SBProcess`, `SBThread`, and `SBFrame` classes. The same is true
@@ -315,27 +315,27 @@ A better way to write the test above would be using 
LLDB's testing function
 self.expect_expr("2 + 2", result_value="0")
 
 **Prefer using specific asserts over the generic assertTrue/assertFalse.**.
-The `self.assertTrue`/`self.assertFalse` functions should always be your
+The ``self.assertTrue``/``self.assertFalse`` functions should always be 
your
 last option as they give non-descriptive error messages. The test class has
-several expressive asserts such as `self.assertIn` that automatically
+several expressive asserts such as ``self.assertIn`` that automatically
 generate an explanation how the received values 
diff er from the expecte

[Lldb-commits] [PATCH] D136766: [lldb][Docs][NFC] Fix sphinx warnings/errors for LLDB docs

2022-10-28 Thread Michael Buch via Phabricator via lldb-commits
This revision was not accepted when it landed; it landed in state "Needs 
Review".
This revision was automatically updated to reflect the committed changes.
Closed by commit rG2a812bdc70c6: [lldb][Docs][NFC] Fix sphinx warnings/errors 
for LLDB docs (authored by Michael137).

Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D136766

Files:
  lldb/bindings/interface/SBModule.i
  lldb/bindings/interface/SBTarget.i
  lldb/bindings/interface/SBType.i
  lldb/docs/resources/build.rst
  lldb/docs/resources/test.rst
  lldb/docs/use/intel_pt.rst

Index: lldb/docs/use/intel_pt.rst
===
--- lldb/docs/use/intel_pt.rst
+++ lldb/docs/use/intel_pt.rst
@@ -39,8 +39,8 @@
   $ cd libipt-build
   $ make
 
-This will generate a few files in the `/lib`
-and `/libipt/include` directories.
+This will generate a few files in the ``/lib``
+and ``/libipt/include`` directories.
 
 Configure and build LLDB with Intel PT support
 
Index: lldb/docs/resources/test.rst
===
--- lldb/docs/resources/test.rst
+++ lldb/docs/resources/test.rst
@@ -229,7 +229,7 @@
 time (e.g., C and C++) there is also usually no process necessary to test
 the `SBType`-related parts of the API. With those languages it's also
 possible to test `SBValue` by running expressions with
-`SBTarget.EvaluateExpression` or the `expect_expr` testing utility.
+`SBTarget.EvaluateExpression` or the ``expect_expr`` testing utility.
 
 Functionality that always requires a running process is everything that
 tests the `SBProcess`, `SBThread`, and `SBFrame` classes. The same is true
@@ -315,27 +315,27 @@
 self.expect_expr("2 + 2", result_value="0")
 
 **Prefer using specific asserts over the generic assertTrue/assertFalse.**.
-The `self.assertTrue`/`self.assertFalse` functions should always be your
+The ``self.assertTrue``/``self.assertFalse`` functions should always be your
 last option as they give non-descriptive error messages. The test class has
-several expressive asserts such as `self.assertIn` that automatically
+several expressive asserts such as ``self.assertIn`` that automatically
 generate an explanation how the received values differ from the expected
-ones. Check the documentation of Python's `unittest` module to see what
+ones. Check the documentation of Python's ``unittest`` module to see what
 asserts are available. LLDB also has a few custom asserts that are tailored
 to our own data types.
 
 +---+-+
-| **Assert**| **Description**   |
+| **Assert**| **Description** |
 +---+-+
-| ``assertSuccess`` | Assert that an ``lldb.SBError`` is in the "success" state.|
+| ``assertSuccess`` | Assert that an ``lldb.SBError`` is in the "success" state.  |
 +---+-+
-| ``assertState``   | Assert that two states (``lldb.eState*``) are equal.  |
+| ``assertState``   | Assert that two states (``lldb.eState*``) are equal.|
 +---+-+
 | ``assertStopReason``  | Assert that two stop reasons (``lldb.eStopReason*``) are equal. |
 +---+-+
 
 If you can't find a specific assert that fits your needs and you fall back
 to a generic assert, make sure you put useful information into the assert's
-`msg` argument that helps explain the failure.
+``msg`` argument that helps explain the failure.
 
 ::
 
@@ -599,8 +599,6 @@
 
alias lldb self.dbg.HandleCommand("%*")
 
-::
-
 Debugging Test Failures on Windows
 ``
 
Index: lldb/docs/resources/build.rst
===
--- lldb/docs/resources/build.rst
+++ lldb/docs/resources/build.rst
@@ -99,7 +99,7 @@
   or even write new tests at all, PTVS is an indispensable debugging
   extension to VS that enables full editing and debugging support for Python
   (including mixed native/managed debugging).
-* `SWIG for Windows _`
+* `SWIG for Windows `_
 
 The steps

[Lldb-commits] [PATCH] D136938: [LLDB] Fix code breakpoints on tagged addresses

2022-10-28 Thread David Spickett via Phabricator via lldb-commits
DavidSpickett updated this revision to Diff 471481.
DavidSpickett added a comment.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

Add a release note.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D136938

Files:
  lldb/source/Target/Target.cpp
  lldb/test/API/linux/aarch64/tagged_code_break/Makefile
  
lldb/test/API/linux/aarch64/tagged_code_break/TestAArch64LinuxTaggedCodeBreak.py
  lldb/test/API/linux/aarch64/tagged_code_break/main.c
  llvm/docs/ReleaseNotes.rst

Index: llvm/docs/ReleaseNotes.rst
===
--- llvm/docs/ReleaseNotes.rst
+++ llvm/docs/ReleaseNotes.rst
@@ -193,6 +193,10 @@
 Changes to LLDB
 -
 
+* LLDB is now able to breakpoint tagged addresses. This will most commonly be
+  function pointers that use AArch64's Top Byte Ignore, Memory Tagging, or
+  Pointer Authentication.
+
 Changes to Sanitizers
 -
 
Index: lldb/test/API/linux/aarch64/tagged_code_break/main.c
===
--- /dev/null
+++ lldb/test/API/linux/aarch64/tagged_code_break/main.c
@@ -0,0 +1,18 @@
+#include 
+
+void foo(void) {}
+typedef void (*FooPtr)(void);
+
+int main() {
+  FooPtr fnptr = foo;
+  // Set top byte.
+  fnptr = (FooPtr)((uintptr_t)fnptr | (uintptr_t)0xff << 56);
+  // Then apply a PAuth signature to it.
+  __asm__ __volatile__("pacdza %0" : "=r"(fnptr) : "r"(fnptr));
+  // fnptr is now:
+  // <8 bit top byte tag>
+
+  foo(); // Set break point at this line.
+
+  return 0;
+}
Index: lldb/test/API/linux/aarch64/tagged_code_break/TestAArch64LinuxTaggedCodeBreak.py
===
--- /dev/null
+++ lldb/test/API/linux/aarch64/tagged_code_break/TestAArch64LinuxTaggedCodeBreak.py
@@ -0,0 +1,57 @@
+"""
+Test that "breakpoint set -a" uses the ABI plugin to remove non-address bits
+before attempting to set a breakpoint.
+"""
+
+import lldb
+from lldbsuite.test.decorators import *
+from lldbsuite.test.lldbtest import *
+from lldbsuite.test import lldbutil
+
+
+class AArch64LinuxTaggedCodeBreak(TestBase):
+
+NO_DEBUG_INFO_TESTCASE = True
+
+def do_tagged_break(self, hardware):
+if not self.isAArch64PAuth():
+self.skipTest('Target must support pointer authentication.')
+
+self.build()
+self.runCmd("file " + self.getBuildArtifact("a.out"), CURRENT_EXECUTABLE_SET)
+
+lldbutil.run_break_set_by_file_and_line(self, "main.c",
+line_number('main.c', '// Set break point at this line.'),
+num_expected_locations=1)
+
+self.runCmd("run", RUN_SUCCEEDED)
+
+if self.process().GetState() == lldb.eStateExited:
+self.fail("Test program failed to run.")
+
+self.expect("thread list", STOPPED_DUE_TO_BREAKPOINT,
+substrs=['stopped',
+ 'stop reason = breakpoint'])
+
+cmd = "breakpoint set -a fnptr"
+# LLDB only has the option to force hardware break, not software.
+# It prefers sofware break when it can and this will be one of those cases.
+if hardware:
+cmd += " --hardware"
+self.expect(cmd)
+
+self.runCmd("continue")
+self.assertEqual(self.process().GetState(), lldb.eStateStopped)
+self.expect("thread list", STOPPED_DUE_TO_BREAKPOINT,
+substrs=['stopped', '`foo at main.c', 'stop reason = breakpoint'])
+
+# AArch64 Linux always enables the top byte ignore feature
+@skipUnlessArch("aarch64")
+@skipUnlessPlatform(["linux"])
+def test_software_break(self):
+self.do_tagged_break(False)
+
+@skipUnlessArch("aarch64")
+@skipUnlessPlatform(["linux"])
+def test_hardware_break(self):
+self.do_tagged_break(True)
\ No newline at end of file
Index: lldb/test/API/linux/aarch64/tagged_code_break/Makefile
===
--- /dev/null
+++ lldb/test/API/linux/aarch64/tagged_code_break/Makefile
@@ -0,0 +1,5 @@
+C_SOURCES := main.c
+
+CFLAGS_EXTRAS := -march=armv8.3-a
+
+include Makefile.rules
Index: lldb/source/Target/Target.cpp
===
--- lldb/source/Target/Target.cpp
+++ lldb/source/Target/Target.cpp
@@ -2626,8 +2626,14 @@
 }
 
 lldb::addr_t Target::GetBreakableLoadAddress(lldb::addr_t addr) {
-  auto arch_plugin = GetArchitecturePlugin();
-  return arch_plugin ? arch_plugin->GetBreakableLoadAddress(addr, *this) : addr;
+  lldb::ABISP abi_plugin = m_process_sp ? m_process_sp->GetABI() : nullptr;
+  if (abi_plugin)
+addr = abi_plugin->FixCodeAddress(addr);
+
+  if (auto arch_plugin = GetArchitecturePlugin())
+addr = arch_plugin->GetBreakableLoadAddress(addr, *this);
+
+  return addr;
 }
 
 SourceManager &Target::GetSourceManager() {
__

[Lldb-commits] [PATCH] D136938: [LLDB] Fix code breakpoints on tagged addresses

2022-10-28 Thread David Spickett via Phabricator via lldb-commits
DavidSpickett added a comment.

Tests will run only for armv8.3-a hardware so I've tested them with 
`qemu-system`. Existing tests pass on Armv8 Linux as before.

Some of these PAC tests could run on Apple Silicon now that I think about it. 
That's for another time, needs extra work.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D136938

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


[Lldb-commits] [PATCH] D136938: [LLDB] Fix code breakpoints on tagged addresses

2022-10-28 Thread David Spickett via Phabricator via lldb-commits
DavidSpickett added a comment.

If you want to understand the motivation beyond "this should work why doesn't 
it", here it is.

If your ABI mandated signing all function pointers you might store a callback 
in a struct somewhere. Not knowing what that callback points to you would like 
to be able to do `breakpoint set -a mystruct.callback` and not have to first 
print it, then break on the function name or manually fix the address.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D136938

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


[Lldb-commits] [PATCH] D135664: [wasm] Always treat DWARF expression addresses as load addresses

2022-10-28 Thread Philip Pfaffe via Phabricator via lldb-commits
pfaffe updated this revision to Diff 471484.
pfaffe added a comment.
Herald added a subscriber: lldb-commits.

Full context with arcanist


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D135664

Files:
  lldb/source/Expression/DWARFExpression.cpp
  lldb/unittests/Expression/DWARFExpressionTest.cpp


Index: lldb/unittests/Expression/DWARFExpressionTest.cpp
===
--- lldb/unittests/Expression/DWARFExpressionTest.cpp
+++ lldb/unittests/Expression/DWARFExpressionTest.cpp
@@ -401,3 +401,35 @@
   Evaluate({DW_OP_lit4, DW_OP_deref, DW_OP_stack_value}, {}, {}, &exe_ctx),
   llvm::HasValue(GetScalar(32, 0x07060504, false)));
 }
+
+TEST_F(DWARFExpressionMockProcessTest, WASM_DW_OP_addr) {
+
+  ArchSpec arch("wasm32-unknown-unknown-wasm");
+  lldb::PlatformSP host_platform_sp =
+  platform_linux::PlatformLinux::CreateInstance(true, &arch);
+  ASSERT_TRUE(host_platform_sp);
+  Platform::SetHostPlatform(host_platform_sp);
+  lldb::DebuggerSP debugger_sp = Debugger::CreateInstance();
+  ASSERT_TRUE(debugger_sp);
+  lldb::TargetSP target_sp;
+  lldb::PlatformSP platform_sp;
+  debugger_sp->GetTargetList().CreateTarget(*debugger_sp, "", arch,
+lldb_private::eLoadDependentsNo,
+platform_sp, target_sp);
+
+  ExecutionContext exe_ctx(target_sp, false);
+  // Single DW_OP_addr takes a single operand of address size width:
+  uint8_t expr[] = {DW_OP_addr, 0x40, 0x0, 0x0, 0x0};
+  DataExtractor extractor(expr, sizeof(expr), lldb::eByteOrderLittle,
+  /*addr_size*/ 4);
+  Value result;
+  Status status;
+  ASSERT_TRUE(DWARFExpression::Evaluate(
+  &exe_ctx, /*reg_ctx*/ nullptr, /*module_sp*/ {}, extractor,
+  /*unit*/ nullptr, lldb::eRegisterKindLLDB,
+  /*initial_value_ptr*/ nullptr,
+  /*object_address_ptr*/ nullptr, result, &status))
+  << status.ToError();
+
+  ASSERT_EQ(result.GetValueType(), Value::ValueType::LoadAddress);
+}
Index: lldb/source/Expression/DWARFExpression.cpp
===
--- lldb/source/Expression/DWARFExpression.cpp
+++ lldb/source/Expression/DWARFExpression.cpp
@@ -847,10 +847,12 @@
 
   Process *process = nullptr;
   StackFrame *frame = nullptr;
+  Target *target = nullptr;
 
   if (exe_ctx) {
 process = exe_ctx->GetProcessPtr();
 frame = exe_ctx->GetFramePtr();
+target = exe_ctx->GetTargetPtr();
   }
   if (reg_ctx == nullptr && frame)
 reg_ctx = frame->GetRegisterContext().get();
@@ -906,12 +908,17 @@
 // address and whose size is the size of an address on the target machine.
 case DW_OP_addr:
   stack.push_back(Scalar(opcodes.GetAddress(&offset)));
-  stack.back().SetValueType(Value::ValueType::FileAddress);
-  // Convert the file address to a load address, so subsequent
-  // DWARF operators can operate on it.
-  if (frame)
-stack.back().ConvertToLoadAddress(module_sp.get(),
-  frame->CalculateTarget().get());
+  if (target &&
+  target->GetArchitecture().GetCore() == ArchSpec::eCore_wasm32) {
+stack.back().SetValueType(Value::ValueType::LoadAddress);
+  } else {
+stack.back().SetValueType(Value::ValueType::FileAddress);
+// Convert the file address to a load address, so subsequent
+// DWARF operators can operate on it.
+if (frame)
+  stack.back().ConvertToLoadAddress(module_sp.get(),
+frame->CalculateTarget().get());
+  }
   break;
 
 // The DW_OP_addr_sect_offset4 is used for any location expressions in
@@ -2507,7 +2514,12 @@
   uint64_t index = opcodes.GetULEB128(&offset);
   lldb::addr_t value = dwarf_cu->ReadAddressFromDebugAddrSection(index);
   stack.push_back(Scalar(value));
-  stack.back().SetValueType(Value::ValueType::FileAddress);
+  if (target &&
+  target->GetArchitecture().GetCore() == ArchSpec::eCore_wasm32) {
+stack.back().SetValueType(Value::ValueType::LoadAddress);
+  } else {
+stack.back().SetValueType(Value::ValueType::FileAddress);
+  }
 } break;
 
 // OPCODE: DW_OP_GNU_const_index


Index: lldb/unittests/Expression/DWARFExpressionTest.cpp
===
--- lldb/unittests/Expression/DWARFExpressionTest.cpp
+++ lldb/unittests/Expression/DWARFExpressionTest.cpp
@@ -401,3 +401,35 @@
   Evaluate({DW_OP_lit4, DW_OP_deref, DW_OP_stack_value}, {}, {}, &exe_ctx),
   llvm::HasValue(GetScalar(32, 0x07060504, false)));
 }
+
+TEST_F(DWARFExpressionMockProcessTest, WASM_DW_OP_addr) {
+
+  ArchSpec arch("wasm32-unknown-unknown-wasm");
+  lldb::PlatformSP host_platform_sp =
+  platform_linux::PlatformLinux::CreateInstance

[Lldb-commits] [PATCH] D135664: [wasm] Always treat DWARF expression addresses as load addresses

2022-10-28 Thread Philip Pfaffe via Phabricator via lldb-commits
pfaffe updated this revision to Diff 471485.
pfaffe added a comment.

Add comments.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D135664

Files:
  lldb/source/Expression/DWARFExpression.cpp


Index: lldb/source/Expression/DWARFExpression.cpp
===
--- lldb/source/Expression/DWARFExpression.cpp
+++ lldb/source/Expression/DWARFExpression.cpp
@@ -910,6 +910,8 @@
   stack.push_back(Scalar(opcodes.GetAddress(&offset)));
   if (target &&
   target->GetArchitecture().GetCore() == ArchSpec::eCore_wasm32) {
+// wasm file sections aren't mapped into memory, therefore addresses 
can
+// never point into a file section and are always LoadAddresses.
 stack.back().SetValueType(Value::ValueType::LoadAddress);
   } else {
 stack.back().SetValueType(Value::ValueType::FileAddress);
@@ -2516,6 +2518,8 @@
   stack.push_back(Scalar(value));
   if (target &&
   target->GetArchitecture().GetCore() == ArchSpec::eCore_wasm32) {
+// wasm file sections aren't mapped into memory, therefore addresses 
can
+// never point into a file section and are always LoadAddresses.
 stack.back().SetValueType(Value::ValueType::LoadAddress);
   } else {
 stack.back().SetValueType(Value::ValueType::FileAddress);


Index: lldb/source/Expression/DWARFExpression.cpp
===
--- lldb/source/Expression/DWARFExpression.cpp
+++ lldb/source/Expression/DWARFExpression.cpp
@@ -910,6 +910,8 @@
   stack.push_back(Scalar(opcodes.GetAddress(&offset)));
   if (target &&
   target->GetArchitecture().GetCore() == ArchSpec::eCore_wasm32) {
+// wasm file sections aren't mapped into memory, therefore addresses can
+// never point into a file section and are always LoadAddresses.
 stack.back().SetValueType(Value::ValueType::LoadAddress);
   } else {
 stack.back().SetValueType(Value::ValueType::FileAddress);
@@ -2516,6 +2518,8 @@
   stack.push_back(Scalar(value));
   if (target &&
   target->GetArchitecture().GetCore() == ArchSpec::eCore_wasm32) {
+// wasm file sections aren't mapped into memory, therefore addresses can
+// never point into a file section and are always LoadAddresses.
 stack.back().SetValueType(Value::ValueType::LoadAddress);
   } else {
 stack.back().SetValueType(Value::ValueType::FileAddress);
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D135664: [wasm] Always treat DWARF expression addresses as load addresses

2022-10-28 Thread Philip Pfaffe via Phabricator via lldb-commits
pfaffe updated this revision to Diff 471486.
pfaffe added a comment.

Bring back lost changes...


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D135664

Files:
  lldb/source/Expression/DWARFExpression.cpp
  lldb/unittests/Expression/DWARFExpressionTest.cpp


Index: lldb/unittests/Expression/DWARFExpressionTest.cpp
===
--- lldb/unittests/Expression/DWARFExpressionTest.cpp
+++ lldb/unittests/Expression/DWARFExpressionTest.cpp
@@ -401,3 +401,35 @@
   Evaluate({DW_OP_lit4, DW_OP_deref, DW_OP_stack_value}, {}, {}, &exe_ctx),
   llvm::HasValue(GetScalar(32, 0x07060504, false)));
 }
+
+TEST_F(DWARFExpressionMockProcessTest, WASM_DW_OP_addr) {
+
+  ArchSpec arch("wasm32-unknown-unknown-wasm");
+  lldb::PlatformSP host_platform_sp =
+  platform_linux::PlatformLinux::CreateInstance(true, &arch);
+  ASSERT_TRUE(host_platform_sp);
+  Platform::SetHostPlatform(host_platform_sp);
+  lldb::DebuggerSP debugger_sp = Debugger::CreateInstance();
+  ASSERT_TRUE(debugger_sp);
+  lldb::TargetSP target_sp;
+  lldb::PlatformSP platform_sp;
+  debugger_sp->GetTargetList().CreateTarget(*debugger_sp, "", arch,
+lldb_private::eLoadDependentsNo,
+platform_sp, target_sp);
+
+  ExecutionContext exe_ctx(target_sp, false);
+  // Single DW_OP_addr takes a single operand of address size width:
+  uint8_t expr[] = {DW_OP_addr, 0x40, 0x0, 0x0, 0x0};
+  DataExtractor extractor(expr, sizeof(expr), lldb::eByteOrderLittle,
+  /*addr_size*/ 4);
+  Value result;
+  Status status;
+  ASSERT_TRUE(DWARFExpression::Evaluate(
+  &exe_ctx, /*reg_ctx*/ nullptr, /*module_sp*/ {}, extractor,
+  /*unit*/ nullptr, lldb::eRegisterKindLLDB,
+  /*initial_value_ptr*/ nullptr,
+  /*object_address_ptr*/ nullptr, result, &status))
+  << status.ToError();
+
+  ASSERT_EQ(result.GetValueType(), Value::ValueType::LoadAddress);
+}
Index: lldb/source/Expression/DWARFExpression.cpp
===
--- lldb/source/Expression/DWARFExpression.cpp
+++ lldb/source/Expression/DWARFExpression.cpp
@@ -847,10 +847,12 @@
 
   Process *process = nullptr;
   StackFrame *frame = nullptr;
+  Target *target = nullptr;
 
   if (exe_ctx) {
 process = exe_ctx->GetProcessPtr();
 frame = exe_ctx->GetFramePtr();
+target = exe_ctx->GetTargetPtr();
   }
   if (reg_ctx == nullptr && frame)
 reg_ctx = frame->GetRegisterContext().get();
@@ -906,12 +908,19 @@
 // address and whose size is the size of an address on the target machine.
 case DW_OP_addr:
   stack.push_back(Scalar(opcodes.GetAddress(&offset)));
-  stack.back().SetValueType(Value::ValueType::FileAddress);
-  // Convert the file address to a load address, so subsequent
-  // DWARF operators can operate on it.
-  if (frame)
-stack.back().ConvertToLoadAddress(module_sp.get(),
-  frame->CalculateTarget().get());
+  if (target &&
+  target->GetArchitecture().GetCore() == ArchSpec::eCore_wasm32) {
+// wasm file sections aren't mapped into memory, therefore addresses 
can
+// never point into a file section and are always LoadAddresses.
+stack.back().SetValueType(Value::ValueType::LoadAddress);
+  } else {
+stack.back().SetValueType(Value::ValueType::FileAddress);
+// Convert the file address to a load address, so subsequent
+// DWARF operators can operate on it.
+if (frame)
+  stack.back().ConvertToLoadAddress(module_sp.get(),
+frame->CalculateTarget().get());
+  }
   break;
 
 // The DW_OP_addr_sect_offset4 is used for any location expressions in
@@ -2507,7 +2516,14 @@
   uint64_t index = opcodes.GetULEB128(&offset);
   lldb::addr_t value = dwarf_cu->ReadAddressFromDebugAddrSection(index);
   stack.push_back(Scalar(value));
-  stack.back().SetValueType(Value::ValueType::FileAddress);
+  if (target &&
+  target->GetArchitecture().GetCore() == ArchSpec::eCore_wasm32) {
+// wasm file sections aren't mapped into memory, therefore addresses 
can
+// never point into a file section and are always LoadAddresses.
+stack.back().SetValueType(Value::ValueType::LoadAddress);
+  } else {
+stack.back().SetValueType(Value::ValueType::FileAddress);
+  }
 } break;
 
 // OPCODE: DW_OP_GNU_const_index


Index: lldb/unittests/Expression/DWARFExpressionTest.cpp
===
--- lldb/unittests/Expression/DWARFExpressionTest.cpp
+++ lldb/unittests/Expression/DWARFExpressionTest.cpp
@@ -401,3 +401,35 @@
   Evaluate({DW_OP_lit4, DW_OP_deref, DW_OP_stack_value}, {}, {}, &e

[Lldb-commits] [PATCH] D135664: [wasm] Always treat DWARF expression addresses as load addresses

2022-10-28 Thread David Spickett via Phabricator via lldb-commits
DavidSpickett added inline comments.



Comment at: lldb/unittests/Expression/DWARFExpressionTest.cpp:435
+  ASSERT_EQ(result.GetValueType(), Value::ValueType::LoadAddress);
+}

DavidSpickett wrote:
> There are two `target && target->GetArchitecture().GetCore() == 
> ArchSpec::eCore_wasm32` checks, does this cover both?
> 
> (will probably be obvious once the diff has context)
I think the answer to this is no, you need to add a test for 
`DW_OP_GNU_addr_index`? Not sure.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D135664

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


[Lldb-commits] [PATCH] D128504: debugserver: spawn process in its own process group

2022-10-28 Thread Alessandro Arzilli via Phabricator via lldb-commits
aarzilli added a comment.

Ping


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D128504

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


[Lldb-commits] [PATCH] D135664: [wasm] Always treat DWARF expression addresses as load addresses

2022-10-28 Thread Philip Pfaffe via Phabricator via lldb-commits
pfaffe updated this revision to Diff 471543.
pfaffe added a comment.

Add unittest for DW_OP_addrx as well.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D135664

Files:
  lldb/source/Expression/DWARFExpression.cpp
  lldb/unittests/Expression/DWARFExpressionTest.cpp

Index: lldb/unittests/Expression/DWARFExpressionTest.cpp
===
--- lldb/unittests/Expression/DWARFExpressionTest.cpp
+++ lldb/unittests/Expression/DWARFExpressionTest.cpp
@@ -8,6 +8,7 @@
 
 #include "lldb/Expression/DWARFExpression.h"
 #include "Plugins/Platform/Linux/PlatformLinux.h"
+#include "Plugins/SymbolFile/DWARF/DWARFDebugInfo.h"
 #include "Plugins/TypeSystem/Clang/TypeSystemClang.h"
 #include "TestingSupport/Symbol/YAMLModuleTester.h"
 #include "lldb/Core/Debugger.h"
@@ -401,3 +402,115 @@
   Evaluate({DW_OP_lit4, DW_OP_deref, DW_OP_stack_value}, {}, {}, &exe_ctx),
   llvm::HasValue(GetScalar(32, 0x07060504, false)));
 }
+
+TEST_F(DWARFExpressionMockProcessTest, WASM_DW_OP_addr) {
+  // Set up a wasm target
+  ArchSpec arch("wasm32-unknown-unknown-wasm");
+  lldb::PlatformSP host_platform_sp =
+  platform_linux::PlatformLinux::CreateInstance(true, &arch);
+  ASSERT_TRUE(host_platform_sp);
+  Platform::SetHostPlatform(host_platform_sp);
+  lldb::DebuggerSP debugger_sp = Debugger::CreateInstance();
+  ASSERT_TRUE(debugger_sp);
+  lldb::TargetSP target_sp;
+  lldb::PlatformSP platform_sp;
+  debugger_sp->GetTargetList().CreateTarget(*debugger_sp, "", arch,
+lldb_private::eLoadDependentsNo,
+platform_sp, target_sp);
+
+  ExecutionContext exe_ctx(target_sp, false);
+  // DW_OP_addr takes a single operand of address size width:
+  uint8_t expr[] = {DW_OP_addr, 0x40, 0x0, 0x0, 0x0};
+  DataExtractor extractor(expr, sizeof(expr), lldb::eByteOrderLittle,
+  /*addr_size*/ 4);
+  Value result;
+  Status status;
+  ASSERT_TRUE(DWARFExpression::Evaluate(
+  &exe_ctx, /*reg_ctx*/ nullptr, /*module_sp*/ {}, extractor,
+  /*unit*/ nullptr, lldb::eRegisterKindLLDB,
+  /*initial_value_ptr*/ nullptr,
+  /*object_address_ptr*/ nullptr, result, &status))
+  << status.ToError();
+
+  ASSERT_EQ(result.GetValueType(), Value::ValueType::LoadAddress);
+}
+
+TEST_F(DWARFExpressionMockProcessTest, WASM_DW_OP_addr_index) {
+  const char *yamldata = R"(
+--- !ELF
+FileHeader:
+  Class:   ELFCLASS64
+  Data:ELFDATA2LSB
+  Type:ET_EXEC
+  Machine: EM_386
+DWARF:
+  debug_abbrev:
+- Table:
+- Code:0x0001
+  Tag: DW_TAG_compile_unit
+  Children:DW_CHILDREN_no
+  Attributes:
+- Attribute:   DW_AT_addr_base
+  Form:DW_FORM_sec_offset
+
+  debug_info:
+- Version: 5
+  AddrSize:4
+  UnitType:DW_UT_compile
+  Entries:
+- AbbrCode:0x0001
+  Values:
+- Value:   0x8 # Offset of the first Address past the header
+- AbbrCode:0x0
+
+  debug_addr:
+- Version: 5
+  AddressSize: 4
+  Entries:
+- Address: 0x1234
+- Address: 0x5678
+)";
+
+  // Can't use DWARFExpressionTester from above because subsystems overlap with
+  // the fixture.
+  SubsystemRAII subsystems;
+  llvm::Expected file = TestFile::fromYaml(yamldata);
+  EXPECT_THAT_EXPECTED(file, llvm::Succeeded());
+  auto module_sp = std::make_shared(file->moduleSpec());
+  auto *dwarf_cu = llvm::cast(module_sp->GetSymbolFile())
+   ->DebugInfo()
+   .GetUnitAtIndex(0);
+  ASSERT_TRUE(dwarf_cu);
+  dwarf_cu->ExtractDIEsIfNeeded();
+
+  // Set up a wasm target
+  ArchSpec arch("wasm32-unknown-unknown-wasm");
+  lldb::PlatformSP host_platform_sp =
+  platform_linux::PlatformLinux::CreateInstance(true, &arch);
+  ASSERT_TRUE(host_platform_sp);
+  Platform::SetHostPlatform(host_platform_sp);
+  lldb::DebuggerSP debugger_sp = Debugger::CreateInstance();
+  ASSERT_TRUE(debugger_sp);
+  lldb::TargetSP target_sp;
+  lldb::PlatformSP platform_sp;
+  debugger_sp->GetTargetList().CreateTarget(*debugger_sp, "", arch,
+lldb_private::eLoadDependentsNo,
+platform_sp, target_sp);
+
+  ExecutionContext exe_ctx(target_sp, false);
+  // DW_OP_addrx takes a single leb128 operand, the index in the addr table:
+  uint8_t expr[] = {DW_OP_addrx, 0x01};
+  DataExtractor extractor(expr, sizeof(expr), lldb::eByteOrderLittle,
+  /*addr_size*/ 4);
+  Value result;
+  Status status;
+  ASSERT_TRUE(DWARFExpression::Evaluate(
+  &exe_ctx, /*reg_ctx*/ nullptr, /*module_sp*/ {}, extractor, dwarf_cu,
+  lldb::eRegisterKindLLDB,
+  /*initial_value_ptr*/ nullptr,
+   

[Lldb-commits] [PATCH] D135664: [wasm] Always treat DWARF expression addresses as load addresses

2022-10-28 Thread David Spickett via Phabricator via lldb-commits
DavidSpickett accepted this revision.
DavidSpickett added a comment.
This revision is now accepted and ready to land.

LGTM, thanks!


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D135664

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


[Lldb-commits] [PATCH] D136935: [lldb][CPlusPlus] Introduce CPlusPlusLanguage::MethodName::GetReturnType

2022-10-28 Thread Pavel Labath via Phabricator via lldb-commits
labath added a comment.

The return type handling for function pointers is not correct. If it's hard to 
do, then maybe we could skip it (i suspect the original code didn't handle that 
either), but I have a feeling it might not be that hard, given that we're 
already able correctly extract the innermost argument types.




Comment at: lldb/unittests/Language/CPlusPlus/CPlusPlusLanguageTest.cpp:85
   // Function pointers
-  {"string (*f(vector&&))(float)", "", "f", "(vector&&)", "",
-   "f"},
-  {"void (*&std::_Any_data::_M_access())()", "std::_Any_data",
-   "_M_access", "()", "",
+  {"string (*f(vector&&))(float)", "string", "", "f",
+   "(vector&&)", "", "f"},

I believe the return type here should be something like `string (*)(float)` (a 
pointer to a function that takes a float and returns a string).


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D136935

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


[Lldb-commits] [PATCH] D136935: [lldb][CPlusPlus] Introduce CPlusPlusLanguage::MethodName::GetReturnType

2022-10-28 Thread Michael Buch via Phabricator via lldb-commits
Michael137 added a comment.

In D136935#3892082 , @labath wrote:

> The return type handling for function pointers is not correct. If it's hard 
> to do, then maybe we could skip it (i suspect the original code didn't handle 
> that either), but I have a feeling it might not be that hard, given that 
> we're already able correctly extract the innermost argument types.

Ah good catch, yes the original code just seems to skip the first typename 
(which need not be the actual return type if we're returning function pointers) 
since it only cares about the base name and arguments. Will see how easy this 
is to handle


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D136935

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


[Lldb-commits] [PATCH] D136958: [lldb] Document QSetDetachOnError packet

2022-10-28 Thread Felipe de Azevedo Piovezan via Phabricator via lldb-commits
fdeazeve created this revision.
Herald added a project: All.
fdeazeve requested review of this revision.
Herald added a project: LLDB.
Herald added a subscriber: lldb-commits.

The packet was introduced in 106d02866d4d54b09c08e6a12915dba58e709294.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D136958

Files:
  lldb/docs/lldb-gdb-remote.txt


Index: lldb/docs/lldb-gdb-remote.txt
===
--- lldb/docs/lldb-gdb-remote.txt
+++ lldb/docs/lldb-gdb-remote.txt
@@ -2136,3 +2136,20 @@
 { "port": 5432 },
 { "socket_name": "foo" }
 ]
+
+//--
+// "QSetDetachOnError"
+//
+// BRIEF
+//  Sets what the server should do when the communication channel with LLDB
+//  goes down. Either kill the inferior process (0) or remove breakpoints and
+//  detach (1).
+//
+// PRIORITY TO IMPLEMENT
+//  Low. Only required if the target wants to keep the inferior process alive
+//  when the communication channel goes down.
+//--
+
+The data in this packet is a single a character, which should be '0' if the
+inferior process should be killed, or '1' if the server should remove all
+breakpoints and detach from the inferior.


Index: lldb/docs/lldb-gdb-remote.txt
===
--- lldb/docs/lldb-gdb-remote.txt
+++ lldb/docs/lldb-gdb-remote.txt
@@ -2136,3 +2136,20 @@
 { "port": 5432 },
 { "socket_name": "foo" }
 ]
+
+//--
+// "QSetDetachOnError"
+//
+// BRIEF
+//  Sets what the server should do when the communication channel with LLDB
+//  goes down. Either kill the inferior process (0) or remove breakpoints and
+//  detach (1).
+//
+// PRIORITY TO IMPLEMENT
+//  Low. Only required if the target wants to keep the inferior process alive
+//  when the communication channel goes down.
+//--
+
+The data in this packet is a single a character, which should be '0' if the
+inferior process should be killed, or '1' if the server should remove all
+breakpoints and detach from the inferior.
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D136959: clang: Improve errors for DiagnosticInfoResourceLimit

2022-10-28 Thread Matt Arsenault via Phabricator via lldb-commits
arsenm created this revision.
arsenm added reviewers: nickdesaulniers, yaxunl, aaron.ballman, qcolombet, 
aeubanks, olista01, dnovillo, echristo, MaskRay.
Herald added subscribers: kosarev, StephenFan, tpr.
Herald added a project: All.
arsenm requested review of this revision.
Herald added a subscriber: wdng.

Print source location info and demangle the name, compared
to the default behavior.

  

Several observations:

1. Specially handling this seems to give source locations

without enabling debug info, and also gives columns compared
to the backend diagnostic. This seems like a bug?

 

2. We're duplicating diagnostic effort in DiagnosticInfo

and clang. This feels wrong, but clang can demangle and I guess
have better debug info available? Should clang really have any of this
code? For the purposes of this diagnostic, the important piece
is just reading the source location out of the llvm::Function.

  

3. lld is not duplicating the same effort as clang with LTO, and just

directly printing the DiagnosticInfo as-is. e.g.


  $ clang -fgpu-rdc
lld: error: local memory (48) exceeds limit (65536) in function 
'_Z12use_huge_ldsIiEvv'
lld: error: local memory (96) exceeds limit (65536) in function 
'_Z12use_huge_ldsIdEvv'

  $ clang -fno-gpu-rdc
backend-resource-limit-diagnostics.hip:8:17: error: local memory 
(48) exceeds limit (65536) in 'void use_huge_lds()'
 __global__ void use_huge_lds() {
^
backend-resource-limit-diagnostics.hip:8:17: error: local memory 
(96) exceeds limit (65536) in 'void use_huge_lds()'
2 errors generated when compiling for gfx90a.


4. Backend errors are not observed with -save-temps and -fno-gpu-rdc or -flto,

and the compile incorrectly succeeds.

  

5. The backend version prints error: ; clang prints : error:

6. -emit-codegen-only is totally broken for AMDGPU. MC

gets a null target streamer. I do not understand why this
is a thing. This just creates a horrible edge case.
Just work around this by emitting actual code instead of blocking
this patch.


https://reviews.llvm.org/D136959

Files:
  clang/include/clang/Basic/DiagnosticFrontendKinds.td
  clang/lib/CodeGen/CodeGenAction.cpp
  clang/test/Misc/backend-resource-limit-diagnostics.cl
  clang/test/Misc/backend-resource-limit-diagnostics.hip

Index: clang/test/Misc/backend-resource-limit-diagnostics.hip
===
--- clang/test/Misc/backend-resource-limit-diagnostics.hip
+++ clang/test/Misc/backend-resource-limit-diagnostics.hip
@@ -1,4 +1,4 @@
-// RUN: not %clang_cc1 -debug-info-kind=standalone -triple amdgcn-amd-amdhsa -target-cpu gfx906 -x hip -fcuda-is-device -S -o /dev/null < %s 2>&1 | FileCheck %s
+// RUN: not %clang_cc1 -triple amdgcn-amd-amdhsa -target-cpu gfx906 -x hip -fcuda-is-device -S -o /dev/null %s 2>&1 | FileCheck %s
 // FIXME: Use -emit-codegen-only
 
 #define __global__ __attribute__((global))
@@ -10,10 +10,10 @@
 huge[0] = 2;
 }
 
-// CHECK: error: :[[@LINE-5]]:0: local memory (48) exceeds limit (65536) in function '_Z12use_huge_ldsIiEvv'
+// CHECK: :[[@LINE-5]]:17: error: local memory (48) exceeds limit (65536) in 'void use_huge_lds()'
  template
  __global__ void use_huge_lds();
 
-// CHECK: error: :[[@LINE-9]]:0: local memory (96) exceeds limit (65536) in function '_Z12use_huge_ldsIdEvv'
+// CHECK: :[[@LINE-9]]:17: error: local memory (96) exceeds limit (65536) in 'void use_huge_lds()'
  template
  __global__ void use_huge_lds();
Index: clang/test/Misc/backend-resource-limit-diagnostics.cl
===
--- clang/test/Misc/backend-resource-limit-diagnostics.cl
+++ clang/test/Misc/backend-resource-limit-diagnostics.cl
@@ -1,7 +1,7 @@
 // REQUIRES: amdgpu-registered-target
-// RUN: not %clang_cc1 -debug-info-kind=standalone -x cl -emit-codegen-only -triple=amdgcn-- < %s 2>&1 | FileCheck %s
+// RUN: not %clang_cc1 -x cl -emit-codegen-only -triple=amdgcn-- < %s 2>&1 | FileCheck %s
 
-// CHECK: error: :[[@LINE+1]]:0: local memory (48) exceeds limit (32768) in function 'use_huge_lds'
+// CHECK: :[[@LINE+1]]:13: error: local memory (48) exceeds limit (32768) in 'use_huge_lds'
 kernel void use_huge_lds() {
 volatile local int huge[12];
 huge[0] = 2;
Index: clang/lib/CodeGen/CodeGenAction.cpp
===
--- clang/lib/CodeGen/CodeGenAction.cpp
+++ clang/lib/CodeGen/CodeGenAction.cpp
@@ -435,6 +435,11 @@
 /// \return True if the diagnostic has been successfully reported, false
 /// otherwise.
 bool StackSizeDiagHandler(const llvm::DiagnosticInfoStackSize &D);
+/// Specialized handler for ResourceLimit diagnostic.
+/// \return True if the diagnostic has been successfully reported, false
+/// otherwise.
+bool ResourceLimitDiagHandler(const llvm::DiagnosticInfoResourceLimit

[Lldb-commits] [PATCH] D128504: debugserver: spawn process in its own process group

2022-10-28 Thread Jason Molenda via Phabricator via lldb-commits
jasonmolenda added a comment.

Sorry for the delay in replying to this, I'm fine with integrating this change. 
 I won't pretend to understand all the ins & outs of signal delivery to process 
groups, but the best way to find if there's an issue with this kind of change 
is to try it out.  Do you have commit access to the repository?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D128504

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


[Lldb-commits] [PATCH] D128504: debugserver: spawn process in its own process group

2022-10-28 Thread Alessandro Arzilli via Phabricator via lldb-commits
aarzilli added a comment.

> Do you have commit access to the repository?

I do not.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D128504

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


[Lldb-commits] [PATCH] D136958: [lldb] Document QSetDetachOnError packet

2022-10-28 Thread Jim Ingham via Phabricator via lldb-commits
jingham accepted this revision.
jingham added a comment.
This revision is now accepted and ready to land.

LGTM, thanks for adding this.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D136958

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


[Lldb-commits] [PATCH] D136935: [lldb][CPlusPlus] Introduce CPlusPlusLanguage::MethodName::GetReturnType

2022-10-28 Thread Michael Buch via Phabricator via lldb-commits
Michael137 added a comment.

In D136935#3892082 , @labath wrote:

> The return type handling for function pointers is not correct. If it's hard 
> to do, then maybe we could skip it (i suspect the original code didn't handle 
> that either), but I have a feeling it might not be that hard, given that 
> we're already able correctly extract the innermost argument types.

The slightly unfortunate bit is that if we wanted to collect all but the inner 
function name into `m_return_type` we'd have to allocate a new string and do 
some concatenation (or create some sort of `struct ReturnType { llvm::StringRef 
LHS, RHS }`). Not too difficult to implement AFAICT but not sure we need to 
support this at the moment. Functions that have a function return type encoded 
in the mangled name currently don't format correctly so not supporting it 
wouldn't regress that.

Either way a great test-case to add


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D136935

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


[Lldb-commits] [PATCH] D132734: [lldb] Fix member access in GetExpressionPath

2022-10-28 Thread Will Hawkins via Phabricator via lldb-commits
hawkinsw added a comment.

Mr. Sabolčec,

Thank you for the kind response -- I hope my work was helpful! It was lots of 
fun to dig in to this part of the codebase!

Sincerely,
Will


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D132734

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


[Lldb-commits] [PATCH] D134378: [lldb] Support simplified template names

2022-10-28 Thread Arthur Eubanks via Phabricator via lldb-commits
aeubanks updated this revision to Diff 471585.
aeubanks added a comment.

rename variables


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D134378

Files:
  lldb/include/lldb/Symbol/CompilerType.h
  lldb/include/lldb/Symbol/Type.h
  lldb/include/lldb/Symbol/TypeSystem.h
  lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp
  lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.h
  lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
  lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.cpp
  lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.h
  lldb/source/Symbol/CompilerType.cpp
  lldb/source/Symbol/Type.cpp
  lldb/test/API/lang/cpp/complete-type-check/TestCppIsTypeComplete.py
  lldb/test/API/lang/cpp/unique-types2/Makefile
  lldb/test/API/lang/cpp/unique-types2/TestUniqueTypes.py
  lldb/test/API/lang/cpp/unique-types2/main.cpp

Index: lldb/test/API/lang/cpp/unique-types2/main.cpp
===
--- /dev/null
+++ lldb/test/API/lang/cpp/unique-types2/main.cpp
@@ -0,0 +1,27 @@
+template  struct Foo {
+  T t;
+  template  class Nested {
+U u;
+  };
+};
+
+template  class FooPack {
+  T t;
+};
+
+int main() {
+  Foo t1;
+  Foo t2;
+  Foo> t3;
+
+  FooPack p1;
+  FooPack p2;
+  FooPack> p3;
+  FooPack p4;
+  FooPack p5;
+  FooPack p6;
+  FooPack p7;
+
+  Foo::Nested n1;
+  // Set breakpoint here
+}
Index: lldb/test/API/lang/cpp/unique-types2/TestUniqueTypes.py
===
--- /dev/null
+++ lldb/test/API/lang/cpp/unique-types2/TestUniqueTypes.py
@@ -0,0 +1,61 @@
+"""
+Test that we return only the requested template instantiation.
+"""
+
+import lldb
+import lldbsuite.test.lldbutil as lldbutil
+from lldbsuite.test.decorators import *
+from lldbsuite.test.lldbtest import *
+
+class UniqueTypesTestCase(TestBase):
+def do_test(self, debug_flags):
+"""Test that we only display the requested Foo instantiation, not all Foo instantiations."""
+self.build(dictionary=debug_flags)
+lldbutil.run_to_source_breakpoint(self, "// Set breakpoint here", lldb.SBFileSpec("main.cpp"))
+
+self.expect("image lookup -A -t '::Foo'", DATA_TYPES_DISPLAYED_CORRECTLY, substrs=["1 match found"])
+self.expect("image lookup -A -t 'Foo'", DATA_TYPES_DISPLAYED_CORRECTLY, substrs=["1 match found"])
+self.expect("image lookup -A -t 'Foo'", DATA_TYPES_DISPLAYED_CORRECTLY, substrs=["1 match found"])
+self.expect("image lookup -A -t 'Foo >'", DATA_TYPES_DISPLAYED_CORRECTLY, substrs=["1 match found"])
+self.expect("image lookup -A -t 'Foo'", DATA_TYPES_DISPLAYED_CORRECTLY, error=True)
+
+self.expect("image lookup -A -t '::FooPack'", DATA_TYPES_DISPLAYED_CORRECTLY, substrs=["1 match found"])
+self.expect("image lookup -A -t 'FooPack'", DATA_TYPES_DISPLAYED_CORRECTLY, substrs=["1 match found"])
+self.expect("image lookup -A -t 'FooPack'", DATA_TYPES_DISPLAYED_CORRECTLY, substrs=["1 match found"])
+self.expect("image lookup -A -t 'FooPack >'", DATA_TYPES_DISPLAYED_CORRECTLY, substrs=["1 match found"])
+self.expect("image lookup -A -t 'FooPack'", DATA_TYPES_DISPLAYED_CORRECTLY, substrs=["1 match found"])
+self.expect("image lookup -A -t 'FooPack'", DATA_TYPES_DISPLAYED_CORRECTLY, substrs=["1 match found"])
+self.expect("image lookup -A -t 'FooPack'", DATA_TYPES_DISPLAYED_CORRECTLY, substrs=["1 match found"])
+self.expect("image lookup -A -t 'FooPack'", DATA_TYPES_DISPLAYED_CORRECTLY, substrs=["1 match found"])
+self.expect("image lookup -A -t 'FooPack'", DATA_TYPES_DISPLAYED_CORRECTLY, error=True)
+self.expect("image lookup -A -t 'FooPack'", DATA_TYPES_DISPLAYED_CORRECTLY, error=True)
+
+self.expect("image lookup -A -t '::Foo::Nested'", DATA_TYPES_DISPLAYED_CORRECTLY, substrs=["1 match found"])
+self.expect("image lookup -A -t 'Foo::Nested'", DATA_TYPES_DISPLAYED_CORRECTLY, substrs=["1 match found"])
+self.expect("image lookup -A -t 'Foo::Nested'", DATA_TYPES_DISPLAYED_CORRECTLY, error=True)
+self.expect("image lookup -A -t 'Foo::Nested'", DATA_TYPES_DISPLAYED_CORRECTLY, error=True)
+self.expect("image lookup -A -t 'Nested'", DATA_TYPES_DISPLAYED_CORRECTLY, substrs=["1 match found"])
+self.expect("image lookup -A -t '::Nested'", DATA_TYPES_DISPLAYED_CORRECTLY, error=True)
+
+self.expect_expr("t1", result_type="Foo")
+self.expect_expr("t1", result_type="Foo")
+self.expect_expr("t2", result_type="Foo")
+self.expect_expr("t3", result_type="Foo >")
+self.expect_expr("p1", result_type="FooPack")
+self.expect_expr("p2", result_type="FooPack")
+self.expect_expr("p3", result_type="FooPack >")
+self.expect_expr("p4", result_type="FooPack")
+self.expect_expr("p5", result_type="FooPack")

[Lldb-commits] [PATCH] D114288: [NFC] Refactor symbol table parsing.

2022-10-28 Thread Dave Lee via Phabricator via lldb-commits
kastiglione added a comment.

> Do you have an repro case that will show this issue? I would need to debug it.

@clayborg sorry for the late reply. The repro happened to me while debugging 
some Swift:

  func main() {
  let digits = /\d+/
  let match = "abc123".firstMatch(of: digits)
  // stop here
  }

at the stop command, I ran `p match?.anyRegexOutput` which causes the deadlock.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D114288

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


[Lldb-commits] [PATCH] D136934: [lldb][FormatEntity][NFC] Move function argument parsing code into separate functions

2022-10-28 Thread Adrian Prantl via Phabricator via lldb-commits
aprantl accepted this revision.
aprantl added inline comments.
This revision is now accepted and ready to land.



Comment at: lldb/source/Core/FormatEntity.cpp:1057
+  // the arguments list
+  if (generic && open_paren && generic < open_paren) {
+int generic_depth = 1;

Would be nice to rewrite this on top of StringRef at some point.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D136934

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


[Lldb-commits] [PATCH] D136959: clang: Improve errors for DiagnosticInfoResourceLimit

2022-10-28 Thread Arthur Eubanks via Phabricator via lldb-commits
aeubanks added a comment.

see https://reviews.llvm.org/D110665 for how we get line/col from a function. 
basically, we have a map from function name hashes to source location available 
in clang

if we don't have clang source information for functions available, there's not 
much more we can do other than rely on debug info, which is what the default 
LLVM handlers use when possible. that's why lld doesn't have its own handler

> Backend errors are not observed with -save-temps and -fno-gpu-rdc or -flto, 
> and the compile incorrectly succeeds.

not sure why this would be happening




Comment at: clang/include/clang/Basic/DiagnosticFrontendKinds.td:42
+def note_fe_backend_resource_limit: Note<"%0 (%1) exceeds limit (%2) in 
'%3'">, BackendInfo;
+
+

ultra nit: extra blank line


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

https://reviews.llvm.org/D136959

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


[Lldb-commits] [PATCH] D136935: [lldb][CPlusPlus] Introduce CPlusPlusLanguage::MethodName::GetReturnType

2022-10-28 Thread Will Hawkins via Phabricator via lldb-commits
hawkinsw added inline comments.



Comment at: lldb/unittests/Language/CPlusPlus/CPlusPlusLanguageTest.cpp:85
   // Function pointers
-  {"string (*f(vector&&))(float)", "", "f", "(vector&&)", "",
-   "f"},
-  {"void (*&std::_Any_data::_M_access())()", "std::_Any_data",
-   "_M_access", "()", "",
+  {"string (*f(vector&&))(float)", "string", "", "f",
+   "(vector&&)", "", "f"},

labath wrote:
> I believe the return type here should be something like `string (*)(float)` 
> (a pointer to a function that takes a float and returns a string).
I read this "nice" function pointer declaration as:

declare `f` as a function that takes a `vector` by r-value reference that, 
in turn, returns a pointer to a function taking a `float` by value that returns 
a `string`. 

Upon writing that out, I realize that I am basically saying the same thing as 
@labath. Sorry! 


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D136935

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


[Lldb-commits] [PATCH] D136798: [lldb] Explicitly open file to write with utf-8 encoding in crashlog.py

2022-10-28 Thread Augusto Noronha via Phabricator via lldb-commits
augusto2112 updated this revision to Diff 471662.
augusto2112 added a comment.

Added encoding parameter to all "open" calls


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D136798

Files:
  lldb/examples/python/crashlog.py


Index: lldb/examples/python/crashlog.py
===
--- lldb/examples/python/crashlog.py
+++ lldb/examples/python/crashlog.py
@@ -449,7 +449,7 @@
 head, _, tail = buffer.partition('\n')
 return json.loads(tail)
 
-with open(path, 'r') as f:
+with open(path, 'r', encoding='utf-8') as f:
 buffer = f.read()
 try:
 return parse_json(buffer)
@@ -644,7 +644,7 @@
 }
 
 def parse(self):
-with open(self.path,'r') as f:
+with open(self.path,'r', encoding='utf-8') as f:
 lines = f.read().splitlines()
 
 for line in lines:
@@ -865,7 +865,7 @@
 result.PutCString(
 "error: invalid arguments, a single output file is the only valid 
argument")
 return
-out_file = open(args[0], 'w')
+out_file = open(args[0], 'w', encoding='utf-8')
 if not out_file:
 result.PutCString(
 "error: failed to open file '%s' for writing...",


Index: lldb/examples/python/crashlog.py
===
--- lldb/examples/python/crashlog.py
+++ lldb/examples/python/crashlog.py
@@ -449,7 +449,7 @@
 head, _, tail = buffer.partition('\n')
 return json.loads(tail)
 
-with open(path, 'r') as f:
+with open(path, 'r', encoding='utf-8') as f:
 buffer = f.read()
 try:
 return parse_json(buffer)
@@ -644,7 +644,7 @@
 }
 
 def parse(self):
-with open(self.path,'r') as f:
+with open(self.path,'r', encoding='utf-8') as f:
 lines = f.read().splitlines()
 
 for line in lines:
@@ -865,7 +865,7 @@
 result.PutCString(
 "error: invalid arguments, a single output file is the only valid argument")
 return
-out_file = open(args[0], 'w')
+out_file = open(args[0], 'w', encoding='utf-8')
 if not out_file:
 result.PutCString(
 "error: failed to open file '%s' for writing...",
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D136798: [lldb] Explicitly open file to write with utf-8 encoding in crashlog.py

2022-10-28 Thread Med Ismail Bennani via Phabricator via lldb-commits
mib accepted this revision.
mib added a comment.

LGTM! Thanks Augusto!


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D136798

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


[Lldb-commits] [PATCH] D136798: [lldb] Explicitly open file to write with utf-8 encoding in crashlog.py

2022-10-28 Thread Augusto Noronha via Phabricator via lldb-commits
This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rGb3b517d57239: [lldb] Explicitly open file to write with 
utf-8 encoding in crashlog.py (authored by augusto2112).

Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D136798

Files:
  lldb/examples/python/crashlog.py


Index: lldb/examples/python/crashlog.py
===
--- lldb/examples/python/crashlog.py
+++ lldb/examples/python/crashlog.py
@@ -449,7 +449,7 @@
 head, _, tail = buffer.partition('\n')
 return json.loads(tail)
 
-with open(path, 'r') as f:
+with open(path, 'r', encoding='utf-8') as f:
 buffer = f.read()
 try:
 return parse_json(buffer)
@@ -644,7 +644,7 @@
 }
 
 def parse(self):
-with open(self.path,'r') as f:
+with open(self.path,'r', encoding='utf-8') as f:
 lines = f.read().splitlines()
 
 for line in lines:
@@ -865,7 +865,7 @@
 result.PutCString(
 "error: invalid arguments, a single output file is the only valid 
argument")
 return
-out_file = open(args[0], 'w')
+out_file = open(args[0], 'w', encoding='utf-8')
 if not out_file:
 result.PutCString(
 "error: failed to open file '%s' for writing...",


Index: lldb/examples/python/crashlog.py
===
--- lldb/examples/python/crashlog.py
+++ lldb/examples/python/crashlog.py
@@ -449,7 +449,7 @@
 head, _, tail = buffer.partition('\n')
 return json.loads(tail)
 
-with open(path, 'r') as f:
+with open(path, 'r', encoding='utf-8') as f:
 buffer = f.read()
 try:
 return parse_json(buffer)
@@ -644,7 +644,7 @@
 }
 
 def parse(self):
-with open(self.path,'r') as f:
+with open(self.path,'r', encoding='utf-8') as f:
 lines = f.read().splitlines()
 
 for line in lines:
@@ -865,7 +865,7 @@
 result.PutCString(
 "error: invalid arguments, a single output file is the only valid argument")
 return
-out_file = open(args[0], 'w')
+out_file = open(args[0], 'w', encoding='utf-8')
 if not out_file:
 result.PutCString(
 "error: failed to open file '%s' for writing...",
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] b3b517d - [lldb] Explicitly open file to write with utf-8 encoding in crashlog.py

2022-10-28 Thread Augusto Noronha via lldb-commits

Author: Augusto Noronha
Date: 2022-10-28T15:04:24-07:00
New Revision: b3b517d572391d9799d1f29bddd66e2bad1acb54

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

LOG: [lldb] Explicitly open file to write with utf-8 encoding in crashlog.py

The python "open" function will use the default encoding for the
locale (the result of "locale.getpreferredencoding()"). Explicitly set
the locale to utf-8 when opening the crashlog for writing, as there may
be non-ascii symbols in there (for example, Swift uses "τ" to indicate
generic parameters).

rdar://101402755

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

Added: 


Modified: 
lldb/examples/python/crashlog.py

Removed: 




diff  --git a/lldb/examples/python/crashlog.py 
b/lldb/examples/python/crashlog.py
index eb43e07d27f4..e80ecd91579a 100755
--- a/lldb/examples/python/crashlog.py
+++ b/lldb/examples/python/crashlog.py
@@ -449,7 +449,7 @@ def parse_json(buffer):
 head, _, tail = buffer.partition('\n')
 return json.loads(tail)
 
-with open(path, 'r') as f:
+with open(path, 'r', encoding='utf-8') as f:
 buffer = f.read()
 try:
 return parse_json(buffer)
@@ -644,7 +644,7 @@ def __init__(self, debugger, path, verbose):
 }
 
 def parse(self):
-with open(self.path,'r') as f:
+with open(self.path,'r', encoding='utf-8') as f:
 lines = f.read().splitlines()
 
 for line in lines:
@@ -865,7 +865,7 @@ def save_crashlog(debugger, command, exe_ctx, result, dict):
 result.PutCString(
 "error: invalid arguments, a single output file is the only valid 
argument")
 return
-out_file = open(args[0], 'w')
+out_file = open(args[0], 'w', encoding='utf-8')
 if not out_file:
 result.PutCString(
 "error: failed to open file '%s' for writing...",



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


[Lldb-commits] [PATCH] D136697: Add formatting support for VSCode logpoints message

2022-10-28 Thread jeffrey tan via Phabricator via lldb-commits
yinghuitan updated this revision to Diff 471676.
yinghuitan added a comment.

Add failure case testcase


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D136697

Files:
  lldb/test/API/tools/lldb-vscode/breakpoint/TestVSCode_logpoints.py
  lldb/tools/lldb-vscode/BreakpointBase.cpp
  lldb/tools/lldb-vscode/BreakpointBase.h

Index: lldb/tools/lldb-vscode/BreakpointBase.h
===
--- lldb/tools/lldb-vscode/BreakpointBase.h
+++ lldb/tools/lldb-vscode/BreakpointBase.h
@@ -22,7 +22,7 @@
   struct LogMessagePart {
 LogMessagePart(llvm::StringRef text, bool is_expr)
 : text(text), is_expr(is_expr) {}
-llvm::StringRef text;
+std::string text;
 bool is_expr;
   };
   // An optional expression for conditional breakpoints.
@@ -45,6 +45,13 @@
   void SetHitCondition();
   void SetLogMessage();
   void UpdateBreakpoint(const BreakpointBase &request_bp);
+
+  // Format \param text and return formatted text in \param formatted.
+  // \return any formatting failures.
+  lldb::SBError FormatLogText(llvm::StringRef text, std::string &formatted);
+  lldb::SBError AppendLogMessagePart(llvm::StringRef part, bool is_expr);
+  void NotifyLogMessageError(llvm::StringRef error);
+
   static const char *GetBreakpointLabel();
   static bool BreakpointHitCallback(void *baton, lldb::SBProcess &process,
 lldb::SBThread &thread,
Index: lldb/tools/lldb-vscode/BreakpointBase.cpp
===
--- lldb/tools/lldb-vscode/BreakpointBase.cpp
+++ lldb/tools/lldb-vscode/BreakpointBase.cpp
@@ -25,6 +25,144 @@
 bp.SetIgnoreCount(hitCount - 1);
 }
 
+lldb::SBError BreakpointBase::AppendLogMessagePart(llvm::StringRef part,
+   bool is_expr) {
+  if (is_expr) {
+logMessageParts.emplace_back(part, is_expr);
+  } else {
+std::string formatted;
+lldb::SBError error = FormatLogText(part, formatted);
+if (error.Fail())
+  return error;
+logMessageParts.emplace_back(formatted, is_expr);
+  }
+  return lldb::SBError();
+}
+
+// TODO: consolidate this code with the implementation in
+// FormatEntity::ParseInternal().
+lldb::SBError BreakpointBase::FormatLogText(llvm::StringRef text,
+std::string &formatted) {
+  lldb::SBError error;
+  while (!text.empty()) {
+size_t backslash_pos = text.find_first_of('\\');
+if (backslash_pos == std::string::npos) {
+  formatted += text.str();
+  return error;
+}
+
+formatted += text.substr(0, backslash_pos).str();
+// Skip the characters before and including '\'.
+text = text.drop_front(backslash_pos + 1);
+
+if (text.empty()) {
+  error.SetErrorString(
+  "'\\' character was not followed by another character");
+  return error;
+}
+
+const char desens_char = text[0];
+text = text.drop_front(); // Skip the desensitized char character
+switch (desens_char) {
+case 'a':
+  formatted.push_back('\a');
+  break;
+case 'b':
+  formatted.push_back('\b');
+  break;
+case 'f':
+  formatted.push_back('\f');
+  break;
+case 'n':
+  formatted.push_back('\n');
+  break;
+case 'r':
+  formatted.push_back('\r');
+  break;
+case 't':
+  formatted.push_back('\t');
+  break;
+case 'v':
+  formatted.push_back('\v');
+  break;
+case '\'':
+  formatted.push_back('\'');
+  break;
+case '\\':
+  formatted.push_back('\\');
+  break;
+case '0':
+  // 1 to 3 octal chars
+  {
+if (text.empty()) {
+  error.SetErrorString("missing octal number following '\\0'");
+  return error;
+}
+
+// Make a string that can hold onto the initial zero char, up to 3
+// octal digits, and a terminating NULL.
+char oct_str[5] = {0, 0, 0, 0, 0};
+
+size_t i;
+for (i = 0;
+ i < text.size() && i < 4 && (text[i] >= '0' && text[i] <= '7');
+ ++i) {
+  oct_str[i] = text[i];
+}
+
+text = text.drop_front(i);
+unsigned long octal_value = ::strtoul(oct_str, nullptr, 8);
+if (octal_value <= UINT8_MAX) {
+  formatted.push_back((char)octal_value);
+} else {
+  error.SetErrorString("octal number is larger than a single byte");
+  return error;
+}
+  }
+  break;
+
+case 'x': {
+  if (text.empty()) {
+error.SetErrorString("missing hex number following '\\x'");
+return error;
+  }
+  // hex number in the text
+  if (isxdigit(text[0])) {
+// Make a string that can hold onto two hex chars plus a
+// NULL terminator
+char hex_str[3] = {0, 0, 0};
+hex_str[0] = text[0];
+
+text = 

[Lldb-commits] [lldb] a842f74 - [lldb] Support simplified template names

2022-10-28 Thread Arthur Eubanks via lldb-commits

Author: Arthur Eubanks
Date: 2022-10-28T16:15:37-07:00
New Revision: a842f74056793d9ab41411aa343811368164e6a8

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

LOG: [lldb] Support simplified template names

See https://discourse.llvm.org/t/dwarf-using-simplified-template-names/58417 
for background on simplified template names.

lldb doesn't work with simplified template names because it uses DW_AT_name 
which doesn't contain template parameters under simplified template names.

Two major changes are required to make lldb work with simplified template names.

1) When building clang ASTs for struct-like dies, we use the name as a cache 
key. To distinguish between different instantiations of a template class, we 
need to add in the template parameters.

2) When looking up types, if the requested type name contains '<' and we didn't 
initially find any types from the index searching the name, strip the template 
parameters and search the index, then filter out results with non-matching 
template parameters. This takes advantage of the clang AST's ability to print 
full names rather than doing it by ourself.

An alternative is to fix up the names in the index to contain the fully 
qualified name, but that doesn't respect .debug_names.

Reviewed By: labath

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

Added: 
lldb/test/API/lang/cpp/unique-types2/Makefile
lldb/test/API/lang/cpp/unique-types2/TestUniqueTypes.py
lldb/test/API/lang/cpp/unique-types2/main.cpp

Modified: 
lldb/include/lldb/Symbol/CompilerType.h
lldb/include/lldb/Symbol/Type.h
lldb/include/lldb/Symbol/TypeSystem.h
lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp
lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.h
lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.cpp
lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.h
lldb/source/Symbol/CompilerType.cpp
lldb/source/Symbol/Type.cpp
lldb/test/API/lang/cpp/complete-type-check/TestCppIsTypeComplete.py

Removed: 




diff  --git a/lldb/include/lldb/Symbol/CompilerType.h 
b/lldb/include/lldb/Symbol/CompilerType.h
index f0443fceb28d0..ef9f283cefec9 100644
--- a/lldb/include/lldb/Symbol/CompilerType.h
+++ b/lldb/include/lldb/Symbol/CompilerType.h
@@ -163,7 +163,7 @@ class CompilerType {
   /// \{
   TypeSystem *GetTypeSystem() const { return m_type_system; }
 
-  ConstString GetTypeName() const;
+  ConstString GetTypeName(bool BaseOnly = false) const;
 
   ConstString GetDisplayTypeName() const;
 

diff  --git a/lldb/include/lldb/Symbol/Type.h b/lldb/include/lldb/Symbol/Type.h
index 9ecd677a7106f..fd4577028faaa 100644
--- a/lldb/include/lldb/Symbol/Type.h
+++ b/lldb/include/lldb/Symbol/Type.h
@@ -135,6 +135,8 @@ class Type : public std::enable_shared_from_this, 
public UserID {
 
   ConstString GetName();
 
+  ConstString GetBaseName();
+
   llvm::Optional GetByteSize(ExecutionContextScope *exe_scope);
 
   uint32_t GetNumChildren(bool omit_empty_base_classes);

diff  --git a/lldb/include/lldb/Symbol/TypeSystem.h 
b/lldb/include/lldb/Symbol/TypeSystem.h
index 63f9495ad916d..93959f4596d61 100644
--- a/lldb/include/lldb/Symbol/TypeSystem.h
+++ b/lldb/include/lldb/Symbol/TypeSystem.h
@@ -208,7 +208,8 @@ class TypeSystem : public PluginInterface {
 
   // Accessors
 
-  virtual ConstString GetTypeName(lldb::opaque_compiler_type_t type) = 0;
+  virtual ConstString GetTypeName(lldb::opaque_compiler_type_t type,
+  bool BaseOnly) = 0;
 
   virtual ConstString GetDisplayTypeName(lldb::opaque_compiler_type_t type) = 
0;
 

diff  --git a/lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp 
b/lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp
index 3f2614af64d4d..6e76203dcf94a 100644
--- a/lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp
+++ b/lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp
@@ -1523,6 +1523,41 @@ TypeSP 
DWARFASTParserClang::UpdateSymbolContextScopeForType(
   return type_sp;
 }
 
+std::string
+DWARFASTParserClang::GetTemplateParametersString(const DWARFDIE &die) {
+  if (llvm::StringRef(die.GetName()).contains("<"))
+return std::string();
+  TypeSystemClang::TemplateParameterInfos template_param_infos;
+  if (!ParseTemplateParameterInfos(die, template_param_infos))
+return std::string();
+  std::string all_template_names;
+  llvm::SmallVector args =
+  template_param_infos.args;
+  if (template_param_infos.hasParameterPack())
+args.append(template_param_infos.packed_args->args);
+  if (args.empty())
+return std::string();
+  for (auto &arg : args) {
+std::string template_name;
+llvm::raw_string_ostream os(template_name);
+arg.pr

[Lldb-commits] [PATCH] D134378: [lldb] Support simplified template names

2022-10-28 Thread Arthur Eubanks via Phabricator via lldb-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rGa842f7405679: [lldb] Support simplified template names 
(authored by aeubanks).

Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D134378

Files:
  lldb/include/lldb/Symbol/CompilerType.h
  lldb/include/lldb/Symbol/Type.h
  lldb/include/lldb/Symbol/TypeSystem.h
  lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp
  lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.h
  lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
  lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.cpp
  lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.h
  lldb/source/Symbol/CompilerType.cpp
  lldb/source/Symbol/Type.cpp
  lldb/test/API/lang/cpp/complete-type-check/TestCppIsTypeComplete.py
  lldb/test/API/lang/cpp/unique-types2/Makefile
  lldb/test/API/lang/cpp/unique-types2/TestUniqueTypes.py
  lldb/test/API/lang/cpp/unique-types2/main.cpp

Index: lldb/test/API/lang/cpp/unique-types2/main.cpp
===
--- /dev/null
+++ lldb/test/API/lang/cpp/unique-types2/main.cpp
@@ -0,0 +1,27 @@
+template  struct Foo {
+  T t;
+  template  class Nested {
+U u;
+  };
+};
+
+template  class FooPack {
+  T t;
+};
+
+int main() {
+  Foo t1;
+  Foo t2;
+  Foo> t3;
+
+  FooPack p1;
+  FooPack p2;
+  FooPack> p3;
+  FooPack p4;
+  FooPack p5;
+  FooPack p6;
+  FooPack p7;
+
+  Foo::Nested n1;
+  // Set breakpoint here
+}
Index: lldb/test/API/lang/cpp/unique-types2/TestUniqueTypes.py
===
--- /dev/null
+++ lldb/test/API/lang/cpp/unique-types2/TestUniqueTypes.py
@@ -0,0 +1,61 @@
+"""
+Test that we return only the requested template instantiation.
+"""
+
+import lldb
+import lldbsuite.test.lldbutil as lldbutil
+from lldbsuite.test.decorators import *
+from lldbsuite.test.lldbtest import *
+
+class UniqueTypesTestCase(TestBase):
+def do_test(self, debug_flags):
+"""Test that we only display the requested Foo instantiation, not all Foo instantiations."""
+self.build(dictionary=debug_flags)
+lldbutil.run_to_source_breakpoint(self, "// Set breakpoint here", lldb.SBFileSpec("main.cpp"))
+
+self.expect("image lookup -A -t '::Foo'", DATA_TYPES_DISPLAYED_CORRECTLY, substrs=["1 match found"])
+self.expect("image lookup -A -t 'Foo'", DATA_TYPES_DISPLAYED_CORRECTLY, substrs=["1 match found"])
+self.expect("image lookup -A -t 'Foo'", DATA_TYPES_DISPLAYED_CORRECTLY, substrs=["1 match found"])
+self.expect("image lookup -A -t 'Foo >'", DATA_TYPES_DISPLAYED_CORRECTLY, substrs=["1 match found"])
+self.expect("image lookup -A -t 'Foo'", DATA_TYPES_DISPLAYED_CORRECTLY, error=True)
+
+self.expect("image lookup -A -t '::FooPack'", DATA_TYPES_DISPLAYED_CORRECTLY, substrs=["1 match found"])
+self.expect("image lookup -A -t 'FooPack'", DATA_TYPES_DISPLAYED_CORRECTLY, substrs=["1 match found"])
+self.expect("image lookup -A -t 'FooPack'", DATA_TYPES_DISPLAYED_CORRECTLY, substrs=["1 match found"])
+self.expect("image lookup -A -t 'FooPack >'", DATA_TYPES_DISPLAYED_CORRECTLY, substrs=["1 match found"])
+self.expect("image lookup -A -t 'FooPack'", DATA_TYPES_DISPLAYED_CORRECTLY, substrs=["1 match found"])
+self.expect("image lookup -A -t 'FooPack'", DATA_TYPES_DISPLAYED_CORRECTLY, substrs=["1 match found"])
+self.expect("image lookup -A -t 'FooPack'", DATA_TYPES_DISPLAYED_CORRECTLY, substrs=["1 match found"])
+self.expect("image lookup -A -t 'FooPack'", DATA_TYPES_DISPLAYED_CORRECTLY, substrs=["1 match found"])
+self.expect("image lookup -A -t 'FooPack'", DATA_TYPES_DISPLAYED_CORRECTLY, error=True)
+self.expect("image lookup -A -t 'FooPack'", DATA_TYPES_DISPLAYED_CORRECTLY, error=True)
+
+self.expect("image lookup -A -t '::Foo::Nested'", DATA_TYPES_DISPLAYED_CORRECTLY, substrs=["1 match found"])
+self.expect("image lookup -A -t 'Foo::Nested'", DATA_TYPES_DISPLAYED_CORRECTLY, substrs=["1 match found"])
+self.expect("image lookup -A -t 'Foo::Nested'", DATA_TYPES_DISPLAYED_CORRECTLY, error=True)
+self.expect("image lookup -A -t 'Foo::Nested'", DATA_TYPES_DISPLAYED_CORRECTLY, error=True)
+self.expect("image lookup -A -t 'Nested'", DATA_TYPES_DISPLAYED_CORRECTLY, substrs=["1 match found"])
+self.expect("image lookup -A -t '::Nested'", DATA_TYPES_DISPLAYED_CORRECTLY, error=True)
+
+self.expect_expr("t1", result_type="Foo")
+self.expect_expr("t1", result_type="Foo")
+self.expect_expr("t2", result_type="Foo")
+self.expect_expr("t3", result_type="Foo >")
+self.expect_expr("p1", result_type="FooPack")
+self.expect_expr("p2", result_type="FooPack")
+self.expect_expr("p3", result_type="FooPack >")
+self.expect_expr("p

[Lldb-commits] [PATCH] D137000: [lldb] Make callback-based formatter matching available from the CLI.

2022-10-28 Thread Jorge Gorbe Moya via Phabricator via lldb-commits
jgorbe created this revision.
jgorbe added reviewers: jingham, labath.
jgorbe added a project: LLDB.
Herald added a subscriber: JDevlieghere.
Herald added a project: All.
jgorbe requested review of this revision.

This change adds a `--recognizer-function` (`-R`) to `type summary add`
and `type synth add` that allows users to specify that the names in
the command are not type names but python function names.

It also adds an example to lldb/examples, and a section in the data
formatters documentation on how to use recognizer functions.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D137000

Files:
  lldb/docs/use/variable.rst
  lldb/examples/synthetic/recognizer_function/example.py
  lldb/examples/synthetic/recognizer_function/lldb-commands
  lldb/examples/synthetic/recognizer_function/program.cpp
  lldb/source/Commands/CommandObjectType.cpp
  lldb/source/Commands/Options.td
  
lldb/test/API/functionalities/data-formatter/callback-matching/TestDataFormatterCallbackMatching.py
  
lldb/test/API/functionalities/data-formatter/callback-matching/formatters_with_callback.py

Index: lldb/test/API/functionalities/data-formatter/callback-matching/formatters_with_callback.py
===
--- lldb/test/API/functionalities/data-formatter/callback-matching/formatters_with_callback.py
+++ lldb/test/API/functionalities/data-formatter/callback-matching/formatters_with_callback.py
@@ -24,7 +24,7 @@
 return None
 
 
-def __lldb_init_module(debugger, dict):
+def register_formatters(debugger):
 cat = debugger.CreateCategory("callback_formatters")
 cat.AddTypeSummary(
 lldb.SBTypeNameSpecifier("formatters_with_callback.derives_from_base",
Index: lldb/test/API/functionalities/data-formatter/callback-matching/TestDataFormatterCallbackMatching.py
===
--- lldb/test/API/functionalities/data-formatter/callback-matching/TestDataFormatterCallbackMatching.py
+++ lldb/test/API/functionalities/data-formatter/callback-matching/TestDataFormatterCallbackMatching.py
@@ -16,7 +16,7 @@
 # Find the line number to break at.
 self.line = line_number('main.cpp', '// Set break point at this line.')
 
-def test_callback_matchers(self):
+def test_callback_matchers_api_registration(self):
 """Test data formatter commands."""
 self.build()
 
@@ -31,6 +31,7 @@
 # now set up a summary function that uses a python callback to match
 # classes that derive from `Base`.
 self.runCmd("command script import --allow-reload ./formatters_with_callback.py")
+self.runCmd("script formatters_with_callback.register_formatters(lldb.debugger)")
 
 # Now `derived` should use our callback summary + synthetic children.
 self.expect("frame variable derived",
@@ -47,3 +48,38 @@
 substrs=['hello from callback summary'])
 self.expect("frame variable nd",
 substrs=['z = '])
+
+def test_callback_matchers_cli_registration(self):
+"""Test data formatter commands."""
+self.build()
+
+_, process, thread, _ = lldbutil.run_to_line_breakpoint(
+self, lldb.SBFileSpec("main.cpp"), self.line)
+
+# Print derived without a formatter.
+self.expect("frame variable derived",
+substrs=['x = ',
+ 'y = '])
+
+# now set up a summary function that uses a python callback to match
+# classes that derive from `Base`.
+self.runCmd("command script import --allow-reload ./formatters_with_callback.py")
+self.runCmd("type summary add -e -s 'hello from callback summary' -R formatters_with_callback.derives_from_base")
+self.runCmd("type synth add -l formatters_with_callback.SynthProvider -R formatters_with_callback.derives_from_base")
+
+# Now `derived` should use our callback summary + synthetic children.
+self.expect("frame variable derived",
+substrs=['hello from callback summary',
+ 'synthetic_child = '])
+
+# But not other classes.
+self.expect("frame variable base", matching=False,
+substrs=['hello from callback summary'])
+self.expect("frame variable base",
+substrs=['x = '])
+
+self.expect("frame variable nd", matching=False,
+substrs=['hello from callback summary'])
+self.expect("frame variable nd",
+substrs=['z = '])
+
Index: lldb/source/Commands/Options.td
===
--- lldb/source/Commands/Options.td
+++ lldb/source/Commands/Options.td
@@ -1184,6 +1184,9 @@
 Desc<"Don't use this format for references-to-type objects.">;
   def type_summary_add_regex : Option<"regex", "x">,
 Desc<"Type names are 

Re: [Lldb-commits] [lldb] d765664 - [lldb] Add matching based on Python callbacks for data formatters.

2022-10-28 Thread Jorge Gorbe Moya via lldb-commits
Sent you https://reviews.llvm.org/D137000 for review :)

On Wed, Oct 19, 2022 at 2:16 PM Jorge Gorbe Moya  wrote:

> Hi Jim,
>
> Thanks for the encouragement! It's unfortunate that you missed the
> notifications and couldn't contribute to the code reviews, but I'm glad you
> think the code looks fine.
>
> Of course I don't mind adding these as a follow-up, it would be a shame if
> I didn't expose the new feature for CLI users after doing all the work
> to get to this point. In fact, I was planning to ask about it after landing
> the change, so thank you for the details about how to proceed next :)
>
> On Wed, Oct 19, 2022 at 2:00 PM Jim Ingham  wrote:
>
>> Jorge,
>>
>> It's great to see you worked your way through this change!
>>
>> Something in our mail pipeline is dropping all my lldb-commits and review
>> comment notifications.  Still haven't figured out who is doing that, so I
>> didn't get a chance to look over the final version.
>>
>> The code looks fine, but nobody will know how to use this if they don't
>> read lldb source code fairly carefully, or browse our tests.
>>
>> To finish off the feature, there should be an example to put in the
>> examples directory, and there should be a paragraph showing how to use it
>> in lldb/doc/use/formatting.rst.
>>
>> It would also be good to add something an option to "type summary add"
>> and "type synthetic add" to indicate that the name passed is neither a type
>> name nor a regex but a recognizer function instead.  Maybe
>> -R/--recognizer-function?
>>
>> Is it too horrible of me to ask you to do these as a follow-up?
>> Otherwise I fear you will be the only one to use this feature...
>>
>> Jim
>>
>>
>> > On Oct 19, 2022, at 12:54 PM, Jorge Gorbe Moya via lldb-commits <
>> lldb-commits@lists.llvm.org> wrote:
>> >
>> >
>> > Author: Jorge Gorbe Moya
>> > Date: 2022-10-19T12:53:38-07:00
>> > New Revision: d76566417e592cfac9c710f82575473b1b4a9285
>> >
>> > URL:
>> https://github.com/llvm/llvm-project/commit/d76566417e592cfac9c710f82575473b1b4a9285
>> > DIFF:
>> https://github.com/llvm/llvm-project/commit/d76566417e592cfac9c710f82575473b1b4a9285.diff
>> >
>> > LOG: [lldb] Add matching based on Python callbacks for data formatters.
>> >
>> > This patch adds a new matching method for data formatters, in addition
>> > to the existing exact typename and regex-based matching. The new method
>> > allows users to specify the name of a Python callback function that
>> > takes a `SBType` object and decides whether the type is a match or not.
>> >
>> > Here is an overview of the changes performed:
>> >
>> > - Add a new `eFormatterMatchCallback` matching type, and logic to handle
>> >  it in `TypeMatcher` and `SBTypeNameSpecifier`.
>> >
>> > - Extend `FormattersMatchCandidate` instances with a pointer to the
>> >  current `ScriptInterpreter` and the `TypeImpl` corresponding to the
>> >  candidate type, so we can run registered callbacks and pass the type
>> >  to them. All matcher search functions now receive a
>> >  `FormattersMatchCandidate` instead of a type name.
>> >
>> > - Add some glue code to ScriptInterpreterPython and the SWIG bindings to
>> >  allow calling a formatter matching callback. Most of this code is
>> >  modeled after the equivalent code for watchpoint callback functions.
>> >
>> > - Add an API test for the new callback-based matching feature.
>> >
>> > For more context, please check the RFC thread where this feature was
>> > originally discussed:
>> >
>> https://discourse.llvm.org/t/rfc-python-callback-for-data-formatters-type-matching/64204/11
>> >
>> > Differential Revision: https://reviews.llvm.org/D135648
>> >
>> > Added:
>> >
>> lldb/test/API/functionalities/data-formatter/callback-matching/Makefile
>> >
>> lldb/test/API/functionalities/data-formatter/callback-matching/TestDataFormatterCallbackMatching.py
>> >
>> lldb/test/API/functionalities/data-formatter/callback-matching/formatters_with_callback.py
>> >
>> lldb/test/API/functionalities/data-formatter/callback-matching/main.cpp
>> >
>> > Modified:
>> >lldb/bindings/python/python-swigsafecast.swig
>> >lldb/bindings/python/python-wrapper.swig
>> >lldb/include/lldb/API/SBType.h
>> >lldb/include/lldb/DataFormatters/DataVisualization.h
>> >lldb/include/lldb/DataFormatters/FormatClasses.h
>> >lldb/include/lldb/DataFormatters/FormatManager.h
>> >lldb/include/lldb/DataFormatters/FormattersContainer.h
>> >lldb/include/lldb/DataFormatters/TypeCategory.h
>> >lldb/include/lldb/DataFormatters/TypeCategoryMap.h
>> >lldb/include/lldb/Interpreter/ScriptInterpreter.h
>> >lldb/include/lldb/Target/Language.h
>> >lldb/include/lldb/lldb-enumerations.h
>> >lldb/source/API/SBTypeNameSpecifier.cpp
>> >lldb/source/Commands/CommandObjectType.cpp
>> >lldb/source/DataFormatters/DataVisualization.cpp
>> >lldb/source/DataFormatters/FormatManager.cpp
>> >lldb/source/DataFormatters/TypeCategory.cpp
>> >lldb/source/DataFormatters/TypeCategoryMap.cpp
>> > 

[Lldb-commits] [PATCH] D136959: clang: Improve errors for DiagnosticInfoResourceLimit

2022-10-28 Thread Matt Arsenault via Phabricator via lldb-commits
arsenm closed this revision.
arsenm added a comment.

0ebd4638af1f71788ca55f521ed8e1ed8cab518d 



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

https://reviews.llvm.org/D136959

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