[Lldb-commits] [PATCH] D113255: [lldb] Use is_style_posix() for path style checks

2021-11-05 Thread Martin Storsjö via Phabricator via lldb-commits
mstorsjo created this revision.
mstorsjo added reviewers: labath, dexonsmith.
mstorsjo requested review of this revision.
Herald added a project: LLDB.

Since a8b54834a186f5570b49b614e31b961a9cf1cbfe 
, there 
are two
distinct Windows path styles, `windows_backslash` (with the old
`windows` being an alias for it) and `windows_slash`.
4e4883e1f394f7c47ff3adee48039aa8374bb8d0 
 added 
helpers for
inspecting path styles.

The newly added windows_slash path style doesn't end up used in
LLDB yet anyway, as LLDB is quite decoupled from most of
llvm::sys::path and uses its own FileSpec class. To take it in
use, it could be hooked up in `FileSpec::Style::GetNativeStyle`
(in lldb/source/Utility/FileSpec.cpp) just like in the `real_style`
function in llvm/lib/Support/Path.cpp in
df0ba47c36f6bd0865e3286853b76d37e037c2d7 
.

It is not currently clear whether there's a real need for using
the Windows path style with forward slashes in LLDB (if there's any
other applications interacting with it, expecting that style), and
what other changes in LLDB are needed for that to work, but this
at least makes some of the checks more ready for the new style,
simplifying code a bit.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D113255

Files:
  lldb/include/lldb/Utility/FileSpec.h
  lldb/source/Utility/FileSpec.cpp


Index: lldb/source/Utility/FileSpec.cpp
===
--- lldb/source/Utility/FileSpec.cpp
+++ lldb/source/Utility/FileSpec.cpp
@@ -43,9 +43,7 @@
 }
 
 bool PathStyleIsPosix(FileSpec::Style style) {
-  return (style == FileSpec::Style::posix ||
-  (style == FileSpec::Style::native &&
-   GetNativeStyle() == FileSpec::Style::posix));
+  return llvm::sys::path::is_style_posix(style);
 }
 
 const char *GetPathSeparators(FileSpec::Style style) {
Index: lldb/include/lldb/Utility/FileSpec.h
===
--- lldb/include/lldb/Utility/FileSpec.h
+++ lldb/include/lldb/Utility/FileSpec.h
@@ -202,7 +202,7 @@
   /// \return
   /// \b true if the file path is case sensitive (POSIX), false
   ///  if case insensitive (Windows).
-  bool IsCaseSensitive() const { return m_style != Style::windows; }
+  bool IsCaseSensitive() const { return is_style_posix(m_style); }
 
   /// Dump this object to a Stream.
   ///


Index: lldb/source/Utility/FileSpec.cpp
===
--- lldb/source/Utility/FileSpec.cpp
+++ lldb/source/Utility/FileSpec.cpp
@@ -43,9 +43,7 @@
 }
 
 bool PathStyleIsPosix(FileSpec::Style style) {
-  return (style == FileSpec::Style::posix ||
-  (style == FileSpec::Style::native &&
-   GetNativeStyle() == FileSpec::Style::posix));
+  return llvm::sys::path::is_style_posix(style);
 }
 
 const char *GetPathSeparators(FileSpec::Style style) {
Index: lldb/include/lldb/Utility/FileSpec.h
===
--- lldb/include/lldb/Utility/FileSpec.h
+++ lldb/include/lldb/Utility/FileSpec.h
@@ -202,7 +202,7 @@
   /// \return
   /// \b true if the file path is case sensitive (POSIX), false
   ///		if case insensitive (Windows).
-  bool IsCaseSensitive() const { return m_style != Style::windows; }
+  bool IsCaseSensitive() const { return is_style_posix(m_style); }
 
   /// Dump this object to a Stream.
   ///
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D113163: [LLDB][Breakpad] Create a function for each compilation unit.

2021-11-05 Thread Pavel Labath via Phabricator via lldb-commits
labath added inline comments.



Comment at: 
lldb/source/Plugins/SymbolFile/Breakpad/SymbolFileBreakpad.cpp:388-392
   for (llvm::StringRef line : lines(Record::Func)) {
 if (auto record = FuncRecord::parse(line))
   add_symbol(record->Address, record->Size, record->Name);
   }
 

zequanwu wrote:
> labath wrote:
> > zequanwu wrote:
> > > zequanwu wrote:
> > > > labath wrote:
> > > > > zequanwu wrote:
> > > > > > labath wrote:
> > > > > > > Can you check if we can remove this now?
> > > > > > > 
> > > > > > > I originally thought that we can remove this entire function, but 
> > > > > > > I forgot about PUBLIC records -- we don't have functions or 
> > > > > > > compile units for those, so they will have to stay.
> > > > > > Removing it causes FUNC records not showing up in symtab when doing 
> > > > > > `image dump symtab ...` and fails some tests.
> > > > > > The Breakpad doc says 
> > > > > > (https://chromium.googlesource.com/breakpad/breakpad/+/HEAD/docs/symbol_files.md#records-4):
> > > > > > 
> > > > > > > If a given address is covered by both a PUBLIC record and a FUNC 
> > > > > > > record, the processor uses the FUNC data.
> > > > > > 
> > > > > It's expected that the tests verifying symtab contents need updating 
> > > > > after you remove some things from it. It's also possible some other 
> > > > > tests will need minor tweaks (like the one in `line-table.test:54`) 
> > > > > because of small differences in output format.
> > > > > 
> > > > > Whether this is a reasonable change cannot be judged by failing tests 
> > > > > alone. You also need to evaluate the overall quality of the debugger 
> > > > > output. That will have to be a judgement call, but I'm hoping it 
> > > > > won't be a hard one. For example, the change in line-table.test was 
> > > > > definitely for the better.
> > > > > 
> > > > > >> If a given address is covered by both a PUBLIC record and a FUNC 
> > > > > >> record, the processor uses the FUNC data.
> > > > > 
> > > > > And if an address is covered both by a Symtab Symbol, and an 
> > > > > SymbolFile Function, lldb will preferentially (in backtraces, for 
> > > > > instance) display information from the Function, so I think (hope) 
> > > > > that this is going to work exactly as desired.
> > > > These two commands `image lookup -n ...` and `image show-unwind -n ..` 
> > > > also failed to give any information if the name is from FUNC records.
> > > Oh, maybe those commands use `FindFunctions` to lookup for function by 
> > > name?
> > Yes, that will most likely be it.
> > 
> > If implementing FindFunctions ends up being non-trivial, we can do that 
> > (along with the symtab removal) in a separate patch.
> After implementing `FindFunctions` and removing this, `image lookup -a 
> 0x4000b0 -v` in (lldb/test/Shell/SymbolFile/Breakpad/symtab.test) shows:
> ```
> Function: id = {0x0001}, name = "f1_func", range = 
> [0x004000b0-0x004000bc)
>Symbol: id = {0x}, range = 
> [0x004000b0-0x004000c0), name="f1"
> ```
> The symbol name is different from function because symbol name is from symtab 
> and function name is from function in CU.
> 
> And `image lookup -n f1` and `image lookup -n f1_func` both give:
> ```
> Address: symtab.out[0x004000b0] (symtab.out.PT_LOAD[0]..text2 
> + 0)
> Summary: symtab.out`f1_func
> ```
> 
> Looks like we don't want to remove this part.
>> Function: id = {0x0001}, name = "f1_func", range = 
>> [0x004000b0-0x004000bc)
>> Symbol: id = {0x}, range = [0x004000b0-0x004000c0), 
>> name="f1"
I would say this is actually a good thing, because you get more information (in 
verbose mode). it's also precisely what would happen in the "regular" case if 
say elf symtab and dwarf for whatever reason disagreed on the name of the 
function.

In non-verbose contexts (the `Summary` field in image lookup, in backtraces, 
etc.) which just want a single name, lldb should prefer the one from the 
Function.

So all of this sounds WAI to me. In fact, it probably should have been 
implemented that way from the start, but I was too lazy to bother with creating 
Functions.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D113163

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


[Lldb-commits] [PATCH] D113163: [LLDB][Breakpad] Create a function for each compilation unit.

2021-11-05 Thread Zequan Wu via Phabricator via lldb-commits
zequanwu updated this revision to Diff 385109.
zequanwu added a comment.

Add FindFunctions.
Remove the loop that adds FUNC to symtab.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D113163

Files:
  lldb/source/Plugins/SymbolFile/Breakpad/SymbolFileBreakpad.cpp
  lldb/source/Plugins/SymbolFile/Breakpad/SymbolFileBreakpad.h
  lldb/test/Shell/Minidump/breakpad-symbols.test
  lldb/test/Shell/SymbolFile/Breakpad/line-table.test
  lldb/test/Shell/SymbolFile/Breakpad/symtab.test

Index: lldb/test/Shell/SymbolFile/Breakpad/symtab.test
===
--- lldb/test/Shell/SymbolFile/Breakpad/symtab.test
+++ lldb/test/Shell/SymbolFile/Breakpad/symtab.test
@@ -3,17 +3,17 @@
 # RUN:   -s %s | FileCheck %s
 
 # CHECK-LABEL: (lldb) image dump symtab symtab.out
-# CHECK: Symtab, file = {{.*}}symtab.out, num_symbols = 5:
+# CHECK: Symtab, file = {{.*}}symtab.out, num_symbols = 4:
 # CHECK: Index   UserID DSX TypeFile Address/Value Load Address   Size   Flags  Name
 # CHECK: [0]  0  SX Code0x00400x00b0 0x ___lldb_unnamed_symbol{{[0-9]*}}
-# CHECK: [1]  0   X Code0x004000b00x000c 0x f1_func
-# CHECK: [2]  0   X Code0x004000a00x000d 0x func_only
-# CHECK: [3]  0   X Code0x004000c00x0010 0x f2
-# CHECK: [4]  0   X Code0x004000d00x0022 0x _start
+# CHECK: [1]  0   X Code0x004000b00x0010 0x f1
+# CHECK: [2]  0   X Code0x004000c00x0010 0x f2
+# CHECK: [3]  0   X Code0x004000d00x0022 0x _start
 
 # CHECK-LABEL: (lldb) image lookup -a 0x4000b0 -v
 # CHECK: Address: symtab.out[0x004000b0] (symtab.out.PT_LOAD[0]..text2 + 0)
-# CHECK: Symbol: id = {0x}, range = [0x004000b0-0x004000bc), name="f1_func"
+# CHECK: Function: id = {0x0001}, name = "f1_func", range = [0x004000b0-0x004000bc)
+# CHECK: Symbol: id = {0x}, range = [0x004000b0-0x004000c0), name="f1"
 
 # CHECK-LABEL: (lldb) image lookup -n f2 -v
 # CHECK: Address: symtab.out[0x004000c0] (symtab.out.PT_LOAD[0]..text2 + 16)
Index: lldb/test/Shell/SymbolFile/Breakpad/line-table.test
===
--- lldb/test/Shell/SymbolFile/Breakpad/line-table.test
+++ lldb/test/Shell/SymbolFile/Breakpad/line-table.test
@@ -39,7 +39,16 @@
 image lookup -a 0x4000b2 -v
 # CHECK-LABEL: image lookup -a 0x4000b2 -v
 # CHECK: Summary: line-table.out`func + 2
+# CHECK: Function: id = {0x}, name = "func", range = [0x004000b0-0x004000c0)
+
+image dump symfile
+# CHECK-LABEL: Compile units:
+# CHECK-NEXT:  CompileUnit{0x}, language = "", file = '/tmp/a.c'
+# CHECK-NEXT:   Function{0x}, demangled = func, type_uid = 0x
+# CHECK:  CompileUnit{0x0001}, language = "", file = '/tmp/c.c'
+# CHECK-NEXT:  CompileUnit{0x0002}, language = "", file = '/tmp/d.c'
+# CHECK-NEXT:  CompileUnit{0x0003}, language = "", file = '/tmp/d.c'
 
 breakpoint set -f c.c -l 2
 # CHECK-LABEL: breakpoint set -f c.c -l 2
-# CHECK: Breakpoint 1: where = line-table.out`func + 2, address = 0x004000b2
+# CHECK: Breakpoint 1: where = line-table.out`func + 2 at c.c:2, address = 0x004000b2
Index: lldb/test/Shell/Minidump/breakpad-symbols.test
===
--- lldb/test/Shell/Minidump/breakpad-symbols.test
+++ lldb/test/Shell/Minidump/breakpad-symbols.test
@@ -14,9 +14,7 @@
 
 image dump symtab /tmp/test/linux-x86_64
 # CHECK-LABEL: image dump symtab /tmp/test/linux-x86_64
-# CHECK: Symtab, file = /tmp/test/linux-x86_64, num_symbols = 2:
-# CHECK: [0]  0   X Code0x004003d0 0x004003d0 0x0018 0x crash()
-# CHECK: [1]  0   X Code0x004003f0 0x004003f0 0x0010 0x _start
+# CHECK: Symtab, file = /tmp/test/linux-x86_64, num_symbols = 0
 
 image lookup -a 0x4003f3
 # CHECK-LABEL: image lookup -a 0x4003f3
Index: lldb/source/Plugins/SymbolFile/Breakpad/SymbolFileBreakpad.h
===
--- lldb/source/Plugins/SymbolFile/Breakpad/SymbolFileBreakpad.h
+++ lldb/source/Plugins/SymbolFile/Breakpad/SymbolFileBreakpad.h
@@ -63,6 +63,8 @@
 return lldb::eLanguageTypeUnknown;
   }
 
+  lldb::FunctionSP GetOrCreateFunction(Compil

[Lldb-commits] [PATCH] D113174: [lldb] Summary provider for char flexible array members

2021-11-05 Thread Shafik Yaghmour via Phabricator via lldb-commits
shafik added a comment.

In D113174#3109664 , @jingham wrote:

> Regex Type summary matching happens after the ConstString matching.  Enrico 
> did it that way because the ConstString matching is so much quicker, so if we 
> can find a match there we'll get to it more quickly...
>
> So this patch moves the char * recognition from the beginning of the type 
> summary matching to the end, and potentially makes it a slower match.
>
> I doubt that this will be noticeable on modern systems, however, just 
> something to keep in mind.
>
> It also changes the order of search slightly.  I think this is observable: it 
> would mean a regex that happens to match "char *" as well as other things 
> used to not be chosen for "char *" because it would have hit the ConstString 
> summary first.  Now it will match, because the built-in regex summary will be 
> checked after the user added ones.
>
> Again, I don't think this is a reason not to do the patch.  But something to 
> keep in mind.  The code itself looks fine.

I was looking at these char formatters a while ago and IIRC I did see some 
impact making these regex matches but I don't remember the details and did not 
look closely (so maybe there was another effect at play) b/c I went with a 
different approach.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D113174

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


[Lldb-commits] [lldb] a2c9cf4 - [lldb] Use is_style_posix() for path style checks

2021-11-05 Thread Martin Storsjö via lldb-commits

Author: Martin Storsjö
Date: 2021-11-05T21:50:45+02:00
New Revision: a2c9cf4c76974086a206c86a172085162a57de9b

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

LOG: [lldb] Use is_style_posix() for path style checks

Since a8b54834a186f5570b49b614e31b961a9cf1cbfe, there are two
distinct Windows path styles, `windows_backslash` (with the old
`windows` being an alias for it) and `windows_slash`.
4e4883e1f394f7c47ff3adee48039aa8374bb8d0 added helpers for
inspecting path styles.

The newly added windows_slash path style doesn't end up used in
LLDB yet anyway, as LLDB is quite decoupled from most of
llvm::sys::path and uses its own FileSpec class. To take it in
use, it could be hooked up in `FileSpec::Style::GetNativeStyle`
(in lldb/source/Utility/FileSpec.cpp) just like in the `real_style`
function in llvm/lib/Support/Path.cpp in
df0ba47c36f6bd0865e3286853b76d37e037c2d7.

It is not currently clear whether there's a real need for using
the Windows path style with forward slashes in LLDB (if there's any
other applications interacting with it, expecting that style), and
what other changes in LLDB are needed for that to work, but this
at least makes some of the checks more ready for the new style,
simplifying code a bit.

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

Added: 


Modified: 
lldb/include/lldb/Utility/FileSpec.h
lldb/source/Utility/FileSpec.cpp

Removed: 




diff  --git a/lldb/include/lldb/Utility/FileSpec.h 
b/lldb/include/lldb/Utility/FileSpec.h
index 0f4e6505e4337..305cd04f95c01 100644
--- a/lldb/include/lldb/Utility/FileSpec.h
+++ b/lldb/include/lldb/Utility/FileSpec.h
@@ -202,7 +202,7 @@ class FileSpec {
   /// \return
   /// \b true if the file path is case sensitive (POSIX), false
   ///  if case insensitive (Windows).
-  bool IsCaseSensitive() const { return m_style != Style::windows; }
+  bool IsCaseSensitive() const { return is_style_posix(m_style); }
 
   /// Dump this object to a Stream.
   ///

diff  --git a/lldb/source/Utility/FileSpec.cpp 
b/lldb/source/Utility/FileSpec.cpp
index bea3c6d6268b3..601edb86c1b0c 100644
--- a/lldb/source/Utility/FileSpec.cpp
+++ b/lldb/source/Utility/FileSpec.cpp
@@ -43,9 +43,7 @@ static constexpr FileSpec::Style GetNativeStyle() {
 }
 
 bool PathStyleIsPosix(FileSpec::Style style) {
-  return (style == FileSpec::Style::posix ||
-  (style == FileSpec::Style::native &&
-   GetNativeStyle() == FileSpec::Style::posix));
+  return llvm::sys::path::is_style_posix(style);
 }
 
 const char *GetPathSeparators(FileSpec::Style style) {



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


[Lldb-commits] [PATCH] D113255: [lldb] Use is_style_posix() for path style checks

2021-11-05 Thread Martin Storsjö via Phabricator via lldb-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rGa2c9cf4c7697: [lldb] Use is_style_posix() for path style 
checks (authored by mstorsjo).

Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D113255

Files:
  lldb/include/lldb/Utility/FileSpec.h
  lldb/source/Utility/FileSpec.cpp


Index: lldb/source/Utility/FileSpec.cpp
===
--- lldb/source/Utility/FileSpec.cpp
+++ lldb/source/Utility/FileSpec.cpp
@@ -43,9 +43,7 @@
 }
 
 bool PathStyleIsPosix(FileSpec::Style style) {
-  return (style == FileSpec::Style::posix ||
-  (style == FileSpec::Style::native &&
-   GetNativeStyle() == FileSpec::Style::posix));
+  return llvm::sys::path::is_style_posix(style);
 }
 
 const char *GetPathSeparators(FileSpec::Style style) {
Index: lldb/include/lldb/Utility/FileSpec.h
===
--- lldb/include/lldb/Utility/FileSpec.h
+++ lldb/include/lldb/Utility/FileSpec.h
@@ -202,7 +202,7 @@
   /// \return
   /// \b true if the file path is case sensitive (POSIX), false
   ///  if case insensitive (Windows).
-  bool IsCaseSensitive() const { return m_style != Style::windows; }
+  bool IsCaseSensitive() const { return is_style_posix(m_style); }
 
   /// Dump this object to a Stream.
   ///


Index: lldb/source/Utility/FileSpec.cpp
===
--- lldb/source/Utility/FileSpec.cpp
+++ lldb/source/Utility/FileSpec.cpp
@@ -43,9 +43,7 @@
 }
 
 bool PathStyleIsPosix(FileSpec::Style style) {
-  return (style == FileSpec::Style::posix ||
-  (style == FileSpec::Style::native &&
-   GetNativeStyle() == FileSpec::Style::posix));
+  return llvm::sys::path::is_style_posix(style);
 }
 
 const char *GetPathSeparators(FileSpec::Style style) {
Index: lldb/include/lldb/Utility/FileSpec.h
===
--- lldb/include/lldb/Utility/FileSpec.h
+++ lldb/include/lldb/Utility/FileSpec.h
@@ -202,7 +202,7 @@
   /// \return
   /// \b true if the file path is case sensitive (POSIX), false
   ///		if case insensitive (Windows).
-  bool IsCaseSensitive() const { return m_style != Style::windows; }
+  bool IsCaseSensitive() const { return is_style_posix(m_style); }
 
   /// Dump this object to a Stream.
   ///
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D113314: [lldb] Use std::string instead of llvm::Twine

2021-11-05 Thread Jonas Devlieghere via Phabricator via lldb-commits
JDevlieghere created this revision.
JDevlieghere added a reviewer: mgorny.
JDevlieghere requested review of this revision.

>From the documentation:

> A Twine is not intended for use directly and should not be stored, its 
> implementation relies on the ability to store pointers to temporary stack 
> objects which may be deallocated at the end of a statement. Twines should 
> only be used accepted as const references in arguments, when an API wishes to 
> accept possibly-concatenated strings.

rdar://84799118


https://reviews.llvm.org/D113314

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


Index: lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp
===
--- lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp
+++ lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp
@@ -1109,9 +1109,9 @@
 
   if (avail_type != CompressionType::None) {
 StringExtractorGDBRemote response;
-llvm::Twine packet = "QEnableCompression:type:" + avail_name + ";";
-if (SendPacketAndWaitForResponse(packet.str(), response) !=
-PacketResult::Success)
+std::string packet =
+"QEnableCompression:type:" + std::string(avail_name) + ";";
+if (SendPacketAndWaitForResponse(packet, response) != 
PacketResult::Success)
   return;
 
 if (response.IsOKResponse()) {


Index: lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp
===
--- lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp
+++ lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp
@@ -1109,9 +1109,9 @@
 
   if (avail_type != CompressionType::None) {
 StringExtractorGDBRemote response;
-llvm::Twine packet = "QEnableCompression:type:" + avail_name + ";";
-if (SendPacketAndWaitForResponse(packet.str(), response) !=
-PacketResult::Success)
+std::string packet =
+"QEnableCompression:type:" + std::string(avail_name) + ";";
+if (SendPacketAndWaitForResponse(packet, response) != PacketResult::Success)
   return;
 
 if (response.IsOKResponse()) {
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D113314: [lldb] Use std::string instead of llvm::Twine

2021-11-05 Thread David Blaikie via Phabricator via lldb-commits
dblaikie accepted this revision.
dblaikie added a comment.
This revision is now accepted and ready to land.

Looks good to me.

Alternatively the string concatenation could be inlined, then the Twine usage 
would be correct - but would still need an explicit "str()", like this:

  SendPacketAndWaitForResponse(("QEnableCompression:type:" + avail_name + 
";").str(), response)

Which may or may not be marginally faster because the Twine could cheaply 
compute the total length of the required buffer/presize the string... maybe.


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

https://reviews.llvm.org/D113314

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


[Lldb-commits] [PATCH] D113314: [lldb] Use std::string instead of llvm::Twine

2021-11-05 Thread Michał Górny via Phabricator via lldb-commits
mgorny accepted this revision.
mgorny added inline comments.



Comment at: 
lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp:1113
+std::string packet =
+"QEnableCompression:type:" + std::string(avail_name) + ";";
+if (SendPacketAndWaitForResponse(packet, response) != 
PacketResult::Success)

I'd personally prefer `avail_name.str()` instead of explicit `std::string()` 
but that's just me.


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

https://reviews.llvm.org/D113314

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


[Lldb-commits] [PATCH] D113314: [lldb] Use std::string instead of llvm::Twine

2021-11-05 Thread Jonas Devlieghere via Phabricator via lldb-commits
JDevlieghere marked an inline comment as done.
JDevlieghere added a subscriber: david.
JDevlieghere added a comment.

@David: Yes, I considered it, but I think this is slightly more readable.




Comment at: 
lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp:1113
+std::string packet =
+"QEnableCompression:type:" + std::string(avail_name) + ";";
+if (SendPacketAndWaitForResponse(packet, response) != 
PacketResult::Success)

mgorny wrote:
> I'd personally prefer `avail_name.str()` instead of explicit `std::string()` 
> but that's just me.
Works for me. That actually makes it fit on a single line.


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

https://reviews.llvm.org/D113314

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


[Lldb-commits] [lldb] 10eb32f - [lldb] Improve 'lang objc tagged-pointer info' command

2021-11-05 Thread Jonas Devlieghere via lldb-commits

Author: Jonas Devlieghere
Date: 2021-11-05T13:19:00-07:00
New Revision: 10eb32f45d40e180a229590f57dd0a61f97f1bc9

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

LOG: [lldb] Improve 'lang objc tagged-pointer info' command

Don't try to get a class descriptor for a pointer that doesn't look like
a tagged pointer. Also print addresses as fixed-width hex and update the
test.

Added: 


Modified: 

lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp
lldb/test/API/lang/objc/tagged-pointer/TestTaggedPointerCmd.py
lldb/test/API/lang/objc/tagged-pointer/main.m

Removed: 




diff  --git 
a/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp
 
b/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp
index 2cc05f4234fa7..bd6b6335ca8c9 100644
--- 
a/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp
+++ 
b/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp
@@ -982,10 +982,15 @@ class CommandObjectMultiwordObjC_TaggedPointer_Info
 return false;
   }
 
+  if (!tagged_ptr_vendor->IsPossibleTaggedPointer(arg_addr)) {
+result.GetOutputStream().Format("{0:x16} is not tagged\n", arg_addr);
+continue;
+  }
+
   auto descriptor_sp = tagged_ptr_vendor->GetClassDescriptor(arg_addr);
   if (!descriptor_sp) {
 result.AppendErrorWithFormatv(
-"could not get class descriptor for {0:x}\n", arg_addr);
+"could not get class descriptor for {0:x16}\n", arg_addr);
 result.SetStatus(lldb::eReturnStatusFailed);
 return false;
   }
@@ -997,15 +1002,14 @@ class CommandObjectMultiwordObjC_TaggedPointer_Info
   &payload)) {
 result.GetOutputStream().Format(
 "{0:x} is tagged\n"
-"\tpayload = {1:x}\n"
-"\tvalue = {2:x}\n"
-"\tinfo bits = {3:x}\n"
+"\tpayload = {1:x16}\n"
+"\tvalue = {2:x16}\n"
+"\tinfo bits = {3:x16}\n"
 "\tclass = {4}\n",
 arg_addr, payload, value_bits, info_bits,
 descriptor_sp->GetClassName().AsCString(""));
   } else {
-result.GetOutputStream().Format("{0:x16} is not tagged\n",
-(uint64_t)arg_addr);
+result.GetOutputStream().Format("{0:x16} is not tagged\n", arg_addr);
   }
 }
 

diff  --git a/lldb/test/API/lang/objc/tagged-pointer/TestTaggedPointerCmd.py 
b/lldb/test/API/lang/objc/tagged-pointer/TestTaggedPointerCmd.py
index fbe9de7ecf80e..4c70b53ca4b28 100644
--- a/lldb/test/API/lang/objc/tagged-pointer/TestTaggedPointerCmd.py
+++ b/lldb/test/API/lang/objc/tagged-pointer/TestTaggedPointerCmd.py
@@ -8,6 +8,7 @@ class TestTaggedPointerCommand(TestBase):
 
 mydir = TestBase.compute_mydir(__file__)
 
+@no_debug_info_test
 def test(self):
 self.build()
 lldbutil.run_to_source_breakpoint(self,"// break here", 
lldb.SBFileSpec("main.m"))
@@ -18,5 +19,5 @@ def test(self):
 self.expect("lang objc tagged-pointer info 0x0", error=True,
 patterns=["could not convert '0x0' to a valid address"])
 
-self.expect("lang objc tagged-pointer info 0x", error=True,
-patterns=["could not get class descriptor for 0x"])
+self.expect("lang objc tagged-pointer info 0x0001",
+patterns=["0x0001 is not tagged"])

diff  --git a/lldb/test/API/lang/objc/tagged-pointer/main.m 
b/lldb/test/API/lang/objc/tagged-pointer/main.m
index 4d2ccf5120042..11a9781482f11 100644
--- a/lldb/test/API/lang/objc/tagged-pointer/main.m
+++ b/lldb/test/API/lang/objc/tagged-pointer/main.m
@@ -1,6 +1,6 @@
 #import 
 int main() {
   id n1 = [NSNumber numberWithInt:1];
-  printf("%x", n1); // break here
+  printf("%x\n", n1); // break here
   return 0;
 }



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


[Lldb-commits] [lldb] 6d48e25 - [lldb] Use std::string instead of llvm::Twine in GDBRemoteCommunicationClient

2021-11-05 Thread Jonas Devlieghere via lldb-commits

Author: Jonas Devlieghere
Date: 2021-11-05T13:19:00-07:00
New Revision: 6d48e2505c7a68a470e75b61ad504d51db0f8a36

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

LOG: [lldb] Use std::string instead of llvm::Twine in 
GDBRemoteCommunicationClient

>From the documentation:

  A Twine is not intended for use directly and should not be stored, its
  implementation relies on the ability to store pointers to temporary
  stack objects which may be deallocated at the end of a statement.
  Twines should only be used accepted as const references in arguments,
  when an API wishes to accept possibly-concatenated strings.

rdar://84799118

Differential revision: https://reviews.llvm.org/D113314

Added: 


Modified: 
lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp

Removed: 




diff  --git 
a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp 
b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp
index 6fd51126762eb..364a37a0cc283 100644
--- a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp
+++ b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp
@@ -1109,9 +1109,8 @@ void GDBRemoteCommunicationClient::MaybeEnableCompression(
 
   if (avail_type != CompressionType::None) {
 StringExtractorGDBRemote response;
-llvm::Twine packet = "QEnableCompression:type:" + avail_name + ";";
-if (SendPacketAndWaitForResponse(packet.str(), response) !=
-PacketResult::Success)
+std::string packet = "QEnableCompression:type:" + avail_name.str() + ";";
+if (SendPacketAndWaitForResponse(packet, response) != 
PacketResult::Success)
   return;
 
 if (response.IsOKResponse()) {



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


[Lldb-commits] [PATCH] D113314: [lldb] Use std::string instead of llvm::Twine

2021-11-05 Thread Jonas Devlieghere via Phabricator via lldb-commits
This revision was automatically updated to reflect the committed changes.
JDevlieghere marked an inline comment as done.
Closed by commit rG6d48e2505c7a: [lldb] Use std::string instead of llvm::Twine 
in GDBRemoteCommunicationClient (authored by JDevlieghere).
Herald added a project: LLDB.

Changed prior to commit:
  https://reviews.llvm.org/D113314?vs=385168&id=385176#toc

Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D113314

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


Index: lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp
===
--- lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp
+++ lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp
@@ -1109,9 +1109,8 @@
 
   if (avail_type != CompressionType::None) {
 StringExtractorGDBRemote response;
-llvm::Twine packet = "QEnableCompression:type:" + avail_name + ";";
-if (SendPacketAndWaitForResponse(packet.str(), response) !=
-PacketResult::Success)
+std::string packet = "QEnableCompression:type:" + avail_name.str() + ";";
+if (SendPacketAndWaitForResponse(packet, response) != 
PacketResult::Success)
   return;
 
 if (response.IsOKResponse()) {


Index: lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp
===
--- lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp
+++ lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp
@@ -1109,9 +1109,8 @@
 
   if (avail_type != CompressionType::None) {
 StringExtractorGDBRemote response;
-llvm::Twine packet = "QEnableCompression:type:" + avail_name + ";";
-if (SendPacketAndWaitForResponse(packet.str(), response) !=
-PacketResult::Success)
+std::string packet = "QEnableCompression:type:" + avail_name.str() + ";";
+if (SendPacketAndWaitForResponse(packet, response) != PacketResult::Success)
   return;
 
 if (response.IsOKResponse()) {
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D113155: [lldb] Remove nested switches from ARMGetSupportedArchitectureAtIndex (NFC)

2021-11-05 Thread Jonas Devlieghere via Phabricator via lldb-commits
JDevlieghere marked 2 inline comments as done.
JDevlieghere added inline comments.



Comment at: lldb/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp:558
 
+struct CompatibleArchs {
+  const char **archs = nullptr;

labath wrote:
> Is this any different from an `ArrayRef`?
Totally forgot about that. Thanks for the suggestion.


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

https://reviews.llvm.org/D113155

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


[Lldb-commits] [PATCH] D113330: [LLDB][Breakpad] Make lldb understand INLINE and INLINE_ORIGIN records in breakpad.

2021-11-05 Thread Zequan Wu via Phabricator via lldb-commits
zequanwu created this revision.
zequanwu added a reviewer: labath.
zequanwu requested review of this revision.
Herald added a reviewer: jdoerfert.
Herald added subscribers: lldb-commits, sstefan1.
Herald added a project: LLDB.

Teach LLDB to understand INLINE and INLINE_ORIGIN records in breakpad.
They have the following formats:

  INLINE inline_nest_level call_site_line call_site_file_num origin_num 
[address size]+
  INLINE_ORIGIN origin_num name

`INLNIE_ORIGIN` is simply a string pool for INLINE so that we won't have
duplicated names for inlined functions and can show up anywhere in the symbol
file.
`INLINE` follows immediately after `FUNC` represents the ranges of momery
address that has functions inlined inside the function.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D113330

Files:
  lldb/include/lldb/Symbol/Block.h
  lldb/source/Plugins/ObjectFile/Breakpad/BreakpadRecords.cpp
  lldb/source/Plugins/ObjectFile/Breakpad/BreakpadRecords.h
  lldb/source/Plugins/ObjectFile/Breakpad/ObjectFileBreakpad.cpp
  lldb/source/Plugins/SymbolFile/Breakpad/SymbolFileBreakpad.cpp
  lldb/source/Plugins/SymbolFile/Breakpad/SymbolFileBreakpad.h
  lldb/source/Symbol/Block.cpp
  lldb/test/Shell/SymbolFile/Breakpad/Inputs/inline-record.syms
  lldb/test/Shell/SymbolFile/Breakpad/inline-record.test
  lldb/unittests/ObjectFile/Breakpad/BreakpadRecordsTest.cpp

Index: lldb/unittests/ObjectFile/Breakpad/BreakpadRecordsTest.cpp
===
--- lldb/unittests/ObjectFile/Breakpad/BreakpadRecordsTest.cpp
+++ lldb/unittests/ObjectFile/Breakpad/BreakpadRecordsTest.cpp
@@ -18,6 +18,8 @@
   EXPECT_EQ(Record::Info, Record::classify("INFO"));
   EXPECT_EQ(Record::File, Record::classify("FILE"));
   EXPECT_EQ(Record::Func, Record::classify("FUNC"));
+  EXPECT_EQ(Record::Inline, Record::classify("INLINE"));
+  EXPECT_EQ(Record::InlineOrigin, Record::classify("INLINE_ORIGIN"));
   EXPECT_EQ(Record::Public, Record::classify("PUBLIC"));
   EXPECT_EQ(Record::StackCFI, Record::classify("STACK CFI"));
   EXPECT_EQ(Record::StackWin, Record::classify("STACK WIN"));
@@ -76,6 +78,27 @@
   EXPECT_EQ(llvm::None, FuncRecord::parse("FUNC"));
 }
 
+TEST(InlineOriginRecord, parse) {
+  EXPECT_EQ(InlineOriginRecord(47, "foo"),
+InlineOriginRecord::parse("INLINE_ORIGIN 47 foo"));
+  EXPECT_EQ(llvm::None, InlineOriginRecord::parse("INLINE_ORIGIN 47"));
+  EXPECT_EQ(llvm::None, InlineOriginRecord::parse("INLINE_ORIGIN"));
+  EXPECT_EQ(llvm::None, InlineOriginRecord::parse(""));
+}
+
+TEST(InlineRecord, parse) {
+  InlineRecord record1 = InlineRecord(0, 1, 2, 3);
+  record1.Ranges.emplace_back(4, 5);
+  EXPECT_EQ(record1, InlineRecord::parse("INLINE 0 1 2 3 4 5"));
+  record1.Ranges.emplace_back(6, 7);
+  EXPECT_EQ(record1, InlineRecord::parse("INLINE 0 1 2 3 4 5 6 7"));
+  EXPECT_EQ(llvm::None, InlineRecord::parse("INLINE 0 1 2 3"));
+  EXPECT_EQ(llvm::None, InlineRecord::parse("INLINE 0 1 2 3 4 5 6"));
+  EXPECT_EQ(llvm::None, InlineRecord::parse("INLNIE 0"));
+  EXPECT_EQ(llvm::None, InlineRecord::parse(""));
+  EXPECT_EQ(llvm::None, InlineRecord::parse("FUNC"));
+}
+
 TEST(LineRecord, parse) {
   EXPECT_EQ(LineRecord(0x47, 0x74, 47, 74), LineRecord::parse("47 74 47 74"));
   EXPECT_EQ(llvm::None, LineRecord::parse("47 74 47"));
Index: lldb/test/Shell/SymbolFile/Breakpad/inline-record.test
===
--- /dev/null
+++ lldb/test/Shell/SymbolFile/Breakpad/inline-record.test
@@ -0,0 +1,29 @@
+# RUN: yaml2obj %S/Inputs/basic-elf.yaml -o %T/inline-record.out
+# RUN: %lldb %T/inline-record.out -o "target symbols add -s inline-record.out %S/Inputs/inline-record.syms" \
+# RUN:   -s %s | FileCheck %s
+
+# CHECK-LABEL: (lldb) image lookup -a 0x400010 -v
+# CHECK:  Function: id = {0x}, name = "f1", range = [0x00400010-0x00400020)
+# CHECK-NEXT:   Blocks: id = {0x}, range = [0x00400010-0x00400020)
+# CHECK-NEXT:   id = {0x0010}, ranges = [0x00400010-0x00400015)[0x00400017-0x0040001b), name = "inlined_f1"
+
+# CHECK-LABEL: (lldb) image lookup -a 0x400016 -v
+# CHECK:  Function: id = {0x}, name = "f1", range = [0x00400010-0x00400020)
+# CHECK-NEXT:   Blocks: id = {0x}, range = [0x00400010-0x00400020)
+
+# CHECK-LABEL: (lldb) image lookup -a 0x400023 -v
+# CHECK:  Function: id = {0x0001}, name = "f2", range = [0x00400020-0x00400030)
+# CHECK-NEXT:   Blocks: id = {0x0001}, range = [0x00400020-0x00400030)
+# CHECK-NEXT:   id = {0x0043}, range = [0x00400023-0x0040002d), name = "inlined_f1"
+# CHECK-NEXT:   id = {0x0057}, range = [0x00400023-0x00400028), name = "inlined_f2"
+
+# CHECK-LABEL: (lldb) image lookup -a 0x400029 -v
+# CHECK:  Function: id = {0x0001}, name = "f2", range = [0x00400020-0x00400030)
+# CHECK-NEXT:   Blocks: id = {0x0001}, range = [0x00400020-0x

[Lldb-commits] [lldb] ef2efd2 - [lldb] Remove 'result' variable which is set but not used (NFC)

2021-11-05 Thread Jonas Devlieghere via lldb-commits

Author: Jonas Devlieghere
Date: 2021-11-05T21:12:00-07:00
New Revision: ef2efd2553e00bc98c73843da9792d90e4231d30

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

LOG: [lldb] Remove 'result' variable which is set but not used (NFC)

Added: 


Modified: 
lldb/tools/debugserver/source/TTYState.cpp

Removed: 




diff  --git a/lldb/tools/debugserver/source/TTYState.cpp 
b/lldb/tools/debugserver/source/TTYState.cpp
index 96699a360499e..9fe83a3b72e53 100644
--- a/lldb/tools/debugserver/source/TTYState.cpp
+++ b/lldb/tools/debugserver/source/TTYState.cpp
@@ -39,20 +39,19 @@ bool TTYState::GetTTYState(int fd, bool saveProcessGroup) {
 }
 
 bool TTYState::SetTTYState() const {
-  int result = 0;
   if (IsValid()) {
 if (TFlagsValid())
-  result = fcntl(m_fd, F_SETFL, m_tflags);
+  fcntl(m_fd, F_SETFL, m_tflags);
 
 if (TTYStateValid())
-  result = tcsetattr(m_fd, TCSANOW, &m_ttystate);
+  tcsetattr(m_fd, TCSANOW, &m_ttystate);
 
 if (ProcessGroupValid()) {
   // Save the original signal handler.
   void (*saved_sigttou_callback)(int) = NULL;
   saved_sigttou_callback = (void (*)(int))signal(SIGTTOU, SIG_IGN);
   // Set the process group
-  result = tcsetpgrp(m_fd, m_processGroup);
+  tcsetpgrp(m_fd, m_processGroup);
   // Restore the original signal handler.
   signal(SIGTTOU, saved_sigttou_callback);
 }



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


[Lldb-commits] [lldb] 05fbe75 - [lldb] Remove nested switches from ARMGetSupportedArchitectureAtIndex (NFC)

2021-11-05 Thread Jonas Devlieghere via lldb-commits

Author: Jonas Devlieghere
Date: 2021-11-05T21:12:00-07:00
New Revision: 05fbe758906ea27344391bd27817b19788bbce91

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

LOG: [lldb] Remove nested switches from ARMGetSupportedArchitectureAtIndex (NFC)

Remove the nested switches from the ARMGetSupportedArchitectureAtIndex
implementation.

Differential revision: https://reviews.llvm.org/D113155

Added: 


Modified: 
lldb/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp
lldb/source/Plugins/Platform/MacOSX/PlatformDarwin.h
lldb/unittests/Platform/PlatformDarwinTest.cpp

Removed: 




diff  --git a/lldb/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp 
b/lldb/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp
index 88ee1618454f6..2a1f35c5507da 100644
--- a/lldb/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp
+++ b/lldb/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp
@@ -555,25 +555,105 @@ bool 
PlatformDarwin::x86GetSupportedArchitectureAtIndex(uint32_t idx,
   return false;
 }
 
+static llvm::ArrayRef GetCompatibleArchs(ArchSpec::Core core) {
+  switch (core) {
+  default:
+LLVM_FALLTHROUGH;
+  case ArchSpec::eCore_arm_arm64: {
+static const char *g_arm64_compatible_archs[] = {
+"arm64","armv7","armv7f",   "armv7k",   "armv7s",   "armv7m",
+"armv7em",  "armv6m",   "armv6","armv5","armv4","arm",
+"thumbv7",  "thumbv7f", "thumbv7k", "thumbv7s", "thumbv7m", 
"thumbv7em",
+"thumbv6m", "thumbv6",  "thumbv5",  "thumbv4t", "thumb",
+};
+return {g_arm64_compatible_archs};
+  }
+  case ArchSpec::eCore_arm_armv7: {
+static const char *g_armv7_compatible_archs[] = {
+"armv7",   "armv6m",   "armv6",   "armv5",   "armv4","arm",
+"thumbv7", "thumbv6m", "thumbv6", "thumbv5", "thumbv4t", "thumb",
+};
+return {g_armv7_compatible_archs};
+  }
+  case ArchSpec::eCore_arm_armv7f: {
+static const char *g_armv7f_compatible_archs[] = {
+"armv7f",  "armv7",   "armv6m",   "armv6",   "armv5",
+"armv4",   "arm", "thumbv7f", "thumbv7", "thumbv6m",
+"thumbv6", "thumbv5", "thumbv4t", "thumb",
+};
+return {g_armv7f_compatible_archs};
+  }
+  case ArchSpec::eCore_arm_armv7k:
+static const char *g_armv7k_compatible_archs[] = {
+"armv7k",  "armv7",   "armv6m",   "armv6",   "armv5",
+"armv4",   "arm", "thumbv7k", "thumbv7", "thumbv6m",
+"thumbv6", "thumbv5", "thumbv4t", "thumb",
+};
+return {g_armv7k_compatible_archs};
+  case ArchSpec::eCore_arm_armv7s:
+static const char *g_armv7s_compatible_archs[] = {
+"armv7s",  "armv7",   "armv6m",   "armv6",   "armv5",
+"armv4",   "arm", "thumbv7s", "thumbv7", "thumbv6m",
+"thumbv6", "thumbv5", "thumbv4t", "thumb",
+};
+return {g_armv7s_compatible_archs};
+  case ArchSpec::eCore_arm_armv7m:
+static const char *g_armv7m_compatible_archs[] = {
+"armv7m",  "armv7",   "armv6m",   "armv6",   "armv5",
+"armv4",   "arm", "thumbv7m", "thumbv7", "thumbv6m",
+"thumbv6", "thumbv5", "thumbv4t", "thumb",
+};
+return {g_armv7m_compatible_archs};
+  case ArchSpec::eCore_arm_armv7em:
+static const char *g_armv7em_compatible_archs[] = {
+"armv7em", "armv7",   "armv6m","armv6",   "armv5",
+"armv4",   "arm", "thumbv7em", "thumbv7", "thumbv6m",
+"thumbv6", "thumbv5", "thumbv4t",  "thumb",
+};
+return {g_armv7em_compatible_archs};
+  case ArchSpec::eCore_arm_armv6m:
+static const char *g_armv6m_compatible_archs[] = {
+"armv6m",   "armv6",   "armv5",   "armv4","arm",
+"thumbv6m", "thumbv6", "thumbv5", "thumbv4t", "thumb",
+};
+return {g_armv6m_compatible_archs};
+  case ArchSpec::eCore_arm_armv6:
+static const char *g_armv6_compatible_archs[] = {
+"armv6",   "armv5",   "armv4","arm",
+"thumbv6", "thumbv5", "thumbv4t", "thumb",
+};
+return {g_armv6_compatible_archs};
+  case ArchSpec::eCore_arm_armv5:
+static const char *g_armv5_compatible_archs[] = {
+"armv5", "armv4", "arm", "thumbv5", "thumbv4t", "thumb",
+};
+return {g_armv5_compatible_archs};
+  case ArchSpec::eCore_arm_armv4:
+static const char *g_armv4_compatible_archs[] = {
+"armv4",
+"arm",
+"thumbv4t",
+"thumb",
+};
+return {g_armv4_compatible_archs};
+  }
+  return {};
+}
+
+const char *PlatformDarwin::GetCompatibleArch(ArchSpec::Core core, size_t idx) 
{
+  llvm::ArrayRef compatible_archs = GetCompatibleArchs(core);
+  if (!compatible_archs.data())
+return nullptr;
+  if (idx < compatible_archs.size())
+return compatible_archs[idx];
+  return nullptr;
+}
+
 /// The architecture selection rules for a

[Lldb-commits] [PATCH] D113155: [lldb] Remove nested switches from ARMGetSupportedArchitectureAtIndex (NFC)

2021-11-05 Thread Jonas Devlieghere via Phabricator via lldb-commits
This revision was automatically updated to reflect the committed changes.
JDevlieghere marked an inline comment as done.
Closed by commit rG05fbe758906e: [lldb] Remove nested switches from 
ARMGetSupportedArchitectureAtIndex (NFC) (authored by JDevlieghere).
Herald added a project: LLDB.

Changed prior to commit:
  https://reviews.llvm.org/D113155?vs=384619&id=385228#toc

Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D113155

Files:
  lldb/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp
  lldb/source/Plugins/Platform/MacOSX/PlatformDarwin.h
  lldb/unittests/Platform/PlatformDarwinTest.cpp

Index: lldb/unittests/Platform/PlatformDarwinTest.cpp
===
--- lldb/unittests/Platform/PlatformDarwinTest.cpp
+++ lldb/unittests/Platform/PlatformDarwinTest.cpp
@@ -20,6 +20,7 @@
 struct PlatformDarwinTester : public PlatformDarwin {
 public:
   using PlatformDarwin::FindComponentInPath;
+  using PlatformDarwin::GetCompatibleArch;
 };
 
 TEST(PlatformDarwinTest, TestParseVersionBuildDir) {
@@ -66,3 +67,95 @@
   EXPECT_EQ("",
 PlatformDarwinTester::FindComponentInPath("/path/to/foo", "bar"));
 }
+
+TEST(PlatformDarwinTest, GetCompatibleArchARM64) {
+  const ArchSpec::Core core = ArchSpec::eCore_arm_arm64;
+  EXPECT_STREQ("arm64", PlatformDarwinTester::GetCompatibleArch(core, 0));
+  EXPECT_STREQ("armv7", PlatformDarwinTester::GetCompatibleArch(core, 1));
+  EXPECT_STREQ("armv4", PlatformDarwinTester::GetCompatibleArch(core, 10));
+  EXPECT_STREQ("arm", PlatformDarwinTester::GetCompatibleArch(core, 11));
+  EXPECT_STREQ("thumbv7", PlatformDarwinTester::GetCompatibleArch(core, 12));
+  EXPECT_STREQ("thumbv4t", PlatformDarwinTester::GetCompatibleArch(core, 21));
+  EXPECT_STREQ("thumb", PlatformDarwinTester::GetCompatibleArch(core, 22));
+  EXPECT_EQ(nullptr, PlatformDarwinTester::GetCompatibleArch(core, 23));
+}
+
+TEST(PlatformDarwinTest, GetCompatibleArchARMv7f) {
+  const ArchSpec::Core core = ArchSpec::eCore_arm_armv7f;
+  EXPECT_STREQ("armv7f", PlatformDarwinTester::GetCompatibleArch(core, 0));
+  EXPECT_STREQ("armv7", PlatformDarwinTester::GetCompatibleArch(core, 1));
+  EXPECT_STREQ("arm", PlatformDarwinTester::GetCompatibleArch(core, 6));
+  EXPECT_STREQ("thumbv7f", PlatformDarwinTester::GetCompatibleArch(core, 7));
+}
+
+TEST(PlatformDarwinTest, GetCompatibleArchARMv7k) {
+  const ArchSpec::Core core = ArchSpec::eCore_arm_armv7k;
+  EXPECT_STREQ("armv7k", PlatformDarwinTester::GetCompatibleArch(core, 0));
+  EXPECT_STREQ("armv7", PlatformDarwinTester::GetCompatibleArch(core, 1));
+  EXPECT_STREQ("arm", PlatformDarwinTester::GetCompatibleArch(core, 6));
+  EXPECT_STREQ("thumbv7k", PlatformDarwinTester::GetCompatibleArch(core, 7));
+}
+
+TEST(PlatformDarwinTest, GetCompatibleArchARMv7s) {
+  const ArchSpec::Core core = ArchSpec::eCore_arm_armv7s;
+  EXPECT_STREQ("armv7s", PlatformDarwinTester::GetCompatibleArch(core, 0));
+  EXPECT_STREQ("armv7", PlatformDarwinTester::GetCompatibleArch(core, 1));
+  EXPECT_STREQ("arm", PlatformDarwinTester::GetCompatibleArch(core, 6));
+  EXPECT_STREQ("thumbv7s", PlatformDarwinTester::GetCompatibleArch(core, 7));
+}
+
+TEST(PlatformDarwinTest, GetCompatibleArchARMv7m) {
+  const ArchSpec::Core core = ArchSpec::eCore_arm_armv7m;
+  EXPECT_STREQ("armv7m", PlatformDarwinTester::GetCompatibleArch(core, 0));
+  EXPECT_STREQ("armv7", PlatformDarwinTester::GetCompatibleArch(core, 1));
+  EXPECT_STREQ("arm", PlatformDarwinTester::GetCompatibleArch(core, 6));
+  EXPECT_STREQ("thumbv7m", PlatformDarwinTester::GetCompatibleArch(core, 7));
+}
+
+TEST(PlatformDarwinTest, GetCompatibleArchARMv7em) {
+  const ArchSpec::Core core = ArchSpec::eCore_arm_armv7em;
+  EXPECT_STREQ("armv7em", PlatformDarwinTester::GetCompatibleArch(core, 0));
+  EXPECT_STREQ("armv7", PlatformDarwinTester::GetCompatibleArch(core, 1));
+  EXPECT_STREQ("arm", PlatformDarwinTester::GetCompatibleArch(core, 6));
+  EXPECT_STREQ("thumbv7em", PlatformDarwinTester::GetCompatibleArch(core, 7));
+}
+
+TEST(PlatformDarwinTest, GetCompatibleArchARMv7) {
+  const ArchSpec::Core core = ArchSpec::eCore_arm_armv7;
+  EXPECT_STREQ("armv7", PlatformDarwinTester::GetCompatibleArch(core, 0));
+  EXPECT_STREQ("armv6m", PlatformDarwinTester::GetCompatibleArch(core, 1));
+  EXPECT_STREQ("arm", PlatformDarwinTester::GetCompatibleArch(core, 5));
+  EXPECT_STREQ("thumbv7", PlatformDarwinTester::GetCompatibleArch(core, 6));
+}
+
+TEST(PlatformDarwinTest, GetCompatibleArchARMv6m) {
+  const ArchSpec::Core core = ArchSpec::eCore_arm_armv6m;
+  EXPECT_STREQ("armv6m", PlatformDarwinTester::GetCompatibleArch(core, 0));
+  EXPECT_STREQ("armv6", PlatformDarwinTester::GetCompatibleArch(core, 1));
+  EXPECT_STREQ("arm", PlatformDarwinTester::GetCompatibleArch(core, 4));
+  EXPECT_STREQ("thumbv6m", PlatformDarwinTester::GetCompatibleArch(core, 5));
+}
+
+TEST(PlatformDarwinTest, GetCompatibleArchARMv

[Lldb-commits] [PATCH] D113330: [LLDB][Breakpad] Make lldb understand INLINE and INLINE_ORIGIN records in breakpad.

2021-11-05 Thread Shafik Yaghmour via Phabricator via lldb-commits
shafik added inline comments.



Comment at: lldb/source/Plugins/SymbolFile/Breakpad/SymbolFileBreakpad.cpp:316
+Declaration callsite(callsite_file, record->CallSiteLineNum);
+block_sp->SetInlinedFunctionInfo(name.str().c_str(), nullptr, nullptr,
+ &callsite);

`/*mangled=*/nullptr, /*decl_ptr=*/nullptr`

see [clang-tidy check 
bugprone-argument-comment](https://clang.llvm.org/extra/clang-tidy/checks/bugprone-argument-comment.html)


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D113330

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


[Lldb-commits] [lldb] cd7a2bf - [lldb] Don't set the OS for ARMGetSupportedArchitectureAtIndex

2021-11-05 Thread Jonas Devlieghere via lldb-commits

Author: Jonas Devlieghere
Date: 2021-11-05T22:52:28-07:00
New Revision: cd7a2bf94b69e613ce64327839b831610c4eea14

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

LOG: [lldb] Don't set the OS for ARMGetSupportedArchitectureAtIndex

Don't set the OS when computing supported architectures in
PlatformDarwin::ARMGetSupportedArchitectureAtIndex.

Differential revision: https://reviews.llvm.org/D113159

Added: 


Modified: 
lldb/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp

Removed: 




diff  --git a/lldb/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp 
b/lldb/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp
index 2a1f35c5507d..bbf6be646823 100644
--- a/lldb/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp
+++ b/lldb/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp
@@ -559,6 +559,15 @@ static llvm::ArrayRef 
GetCompatibleArchs(ArchSpec::Core core) {
   switch (core) {
   default:
 LLVM_FALLTHROUGH;
+  case ArchSpec::eCore_arm_arm64e: {
+static const char *g_arm64e_compatible_archs[] = {
+"arm64e","arm64","armv7","armv7f",   "armv7k",   "armv7s",
+"armv7m","armv7em",  "armv6m",   "armv6","armv5","armv4",
+"arm",   "thumbv7",  "thumbv7f", "thumbv7k", "thumbv7s", 
"thumbv7m",
+"thumbv7em", "thumbv6m", "thumbv6",  "thumbv5",  "thumbv4t", "thumb",
+};
+return {g_arm64e_compatible_archs};
+  }
   case ArchSpec::eCore_arm_arm64: {
 static const char *g_arm64_compatible_archs[] = {
 "arm64","armv7","armv7f",   "armv7k",   "armv7s",   "armv7m",
@@ -654,38 +663,15 @@ const char 
*PlatformDarwin::GetCompatibleArch(ArchSpec::Core core, size_t idx) {
 /// processor.
 bool PlatformDarwin::ARMGetSupportedArchitectureAtIndex(uint32_t idx,
 ArchSpec &arch) {
-#if TARGET_OS_OSX
-  if (IsHost()) {
-if (idx == 0) {
-  arch.SetTriple("arm64e-apple-macosx");
-  return true;
-} else if (idx == 1) {
-  arch.SetTriple("arm64-apple-macosx");
-  return true;
-}
-arch.Clear();
-return false;
-  }
-#endif
-
-#if defined(TARGET_OS_TV) && TARGET_OS_TV == 1
-#define OSNAME "tvos"
-#elif defined(TARGET_OS_WATCH) && TARGET_OS_WATCH == 1
-#define OSNAME "watchos"
-#elif defined(TARGET_OS_BRIDGE) && TARGET_OS_BRIDGE == 1
-#define OSNAME "bridgeos"
-#elif defined(TARGET_OS_OSX) && TARGET_OS_OSX == 1
-#define OSNAME "macosx"
-#else
-#define OSNAME "ios"
-#endif
-
   const ArchSpec system_arch = GetSystemArchitecture();
   const ArchSpec::Core system_core = system_arch.GetCore();
+
   if (const char *compatible_arch = GetCompatibleArch(system_core, idx)) {
-std::string triple =
-llvm::formatv("{0}-apple-" OSNAME, compatible_arch).str();
+llvm::Triple triple;
+triple.setArchName(compatible_arch);
+triple.setVendor(llvm::Triple::VendorType::Apple);
 arch.SetTriple(triple);
+return true;
   }
 
   arch.Clear();



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


[Lldb-commits] [PATCH] D113159: [lldb] Don't set the OS for ARMGetSupportedArchitectureAtIndex

2021-11-05 Thread Jonas Devlieghere via Phabricator via lldb-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rGcd7a2bf94b69: [lldb] Don't set the OS for 
ARMGetSupportedArchitectureAtIndex (authored by JDevlieghere).
Herald added a project: LLDB.

Changed prior to commit:
  https://reviews.llvm.org/D113159?vs=384624&id=385240#toc

Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D113159

Files:
  lldb/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp


Index: lldb/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp
===
--- lldb/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp
+++ lldb/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp
@@ -559,6 +559,15 @@
   switch (core) {
   default:
 LLVM_FALLTHROUGH;
+  case ArchSpec::eCore_arm_arm64e: {
+static const char *g_arm64e_compatible_archs[] = {
+"arm64e","arm64","armv7","armv7f",   "armv7k",   "armv7s",
+"armv7m","armv7em",  "armv6m",   "armv6","armv5","armv4",
+"arm",   "thumbv7",  "thumbv7f", "thumbv7k", "thumbv7s", 
"thumbv7m",
+"thumbv7em", "thumbv6m", "thumbv6",  "thumbv5",  "thumbv4t", "thumb",
+};
+return {g_arm64e_compatible_archs};
+  }
   case ArchSpec::eCore_arm_arm64: {
 static const char *g_arm64_compatible_archs[] = {
 "arm64","armv7","armv7f",   "armv7k",   "armv7s",   "armv7m",
@@ -654,38 +663,15 @@
 /// processor.
 bool PlatformDarwin::ARMGetSupportedArchitectureAtIndex(uint32_t idx,
 ArchSpec &arch) {
-#if TARGET_OS_OSX
-  if (IsHost()) {
-if (idx == 0) {
-  arch.SetTriple("arm64e-apple-macosx");
-  return true;
-} else if (idx == 1) {
-  arch.SetTriple("arm64-apple-macosx");
-  return true;
-}
-arch.Clear();
-return false;
-  }
-#endif
-
-#if defined(TARGET_OS_TV) && TARGET_OS_TV == 1
-#define OSNAME "tvos"
-#elif defined(TARGET_OS_WATCH) && TARGET_OS_WATCH == 1
-#define OSNAME "watchos"
-#elif defined(TARGET_OS_BRIDGE) && TARGET_OS_BRIDGE == 1
-#define OSNAME "bridgeos"
-#elif defined(TARGET_OS_OSX) && TARGET_OS_OSX == 1
-#define OSNAME "macosx"
-#else
-#define OSNAME "ios"
-#endif
-
   const ArchSpec system_arch = GetSystemArchitecture();
   const ArchSpec::Core system_core = system_arch.GetCore();
+
   if (const char *compatible_arch = GetCompatibleArch(system_core, idx)) {
-std::string triple =
-llvm::formatv("{0}-apple-" OSNAME, compatible_arch).str();
+llvm::Triple triple;
+triple.setArchName(compatible_arch);
+triple.setVendor(llvm::Triple::VendorType::Apple);
 arch.SetTriple(triple);
+return true;
   }
 
   arch.Clear();


Index: lldb/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp
===
--- lldb/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp
+++ lldb/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp
@@ -559,6 +559,15 @@
   switch (core) {
   default:
 LLVM_FALLTHROUGH;
+  case ArchSpec::eCore_arm_arm64e: {
+static const char *g_arm64e_compatible_archs[] = {
+"arm64e","arm64","armv7","armv7f",   "armv7k",   "armv7s",
+"armv7m","armv7em",  "armv6m",   "armv6","armv5","armv4",
+"arm",   "thumbv7",  "thumbv7f", "thumbv7k", "thumbv7s", "thumbv7m",
+"thumbv7em", "thumbv6m", "thumbv6",  "thumbv5",  "thumbv4t", "thumb",
+};
+return {g_arm64e_compatible_archs};
+  }
   case ArchSpec::eCore_arm_arm64: {
 static const char *g_arm64_compatible_archs[] = {
 "arm64","armv7","armv7f",   "armv7k",   "armv7s",   "armv7m",
@@ -654,38 +663,15 @@
 /// processor.
 bool PlatformDarwin::ARMGetSupportedArchitectureAtIndex(uint32_t idx,
 ArchSpec &arch) {
-#if TARGET_OS_OSX
-  if (IsHost()) {
-if (idx == 0) {
-  arch.SetTriple("arm64e-apple-macosx");
-  return true;
-} else if (idx == 1) {
-  arch.SetTriple("arm64-apple-macosx");
-  return true;
-}
-arch.Clear();
-return false;
-  }
-#endif
-
-#if defined(TARGET_OS_TV) && TARGET_OS_TV == 1
-#define OSNAME "tvos"
-#elif defined(TARGET_OS_WATCH) && TARGET_OS_WATCH == 1
-#define OSNAME "watchos"
-#elif defined(TARGET_OS_BRIDGE) && TARGET_OS_BRIDGE == 1
-#define OSNAME "bridgeos"
-#elif defined(TARGET_OS_OSX) && TARGET_OS_OSX == 1
-#define OSNAME "macosx"
-#else
-#define OSNAME "ios"
-#endif
-
   const ArchSpec system_arch = GetSystemArchitecture();
   const ArchSpec::Core system_core = system_arch.GetCore();
+
   if (const char *compatible_arch = GetCompatibleArch(system_core, idx)) {
-std::string triple =
-llvm::formatv("{0}-apple-" OSNAME, compatible_arch).str();
+llvm::Triple triple;
+triple.setArchName(compatible_arch);
+triple.setVendor(llvm::Triple::VendorType::Apple);
 arch.SetTriple(

[Lldb-commits] [lldb] 1ab9a29 - [lldb] Fix C2360: initialization of 'identifier' is skipped by 'case' label

2021-11-05 Thread Jonas Devlieghere via lldb-commits

Author: Jonas Devlieghere
Date: 2021-11-05T23:09:35-07:00
New Revision: 1ab9a2906e19cca87cafac25cc31231a36de4843

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

LOG: [lldb] Fix C2360: initialization of 'identifier' is skipped by 'case' label

Make sure that every case has its own lexical block.

Added: 


Modified: 
lldb/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp

Removed: 




diff  --git a/lldb/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp 
b/lldb/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp
index bbf6be6468233..995b0703bc459 100644
--- a/lldb/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp
+++ b/lldb/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp
@@ -592,52 +592,59 @@ static llvm::ArrayRef 
GetCompatibleArchs(ArchSpec::Core core) {
 };
 return {g_armv7f_compatible_archs};
   }
-  case ArchSpec::eCore_arm_armv7k:
+  case ArchSpec::eCore_arm_armv7k: {
 static const char *g_armv7k_compatible_archs[] = {
 "armv7k",  "armv7",   "armv6m",   "armv6",   "armv5",
 "armv4",   "arm", "thumbv7k", "thumbv7", "thumbv6m",
 "thumbv6", "thumbv5", "thumbv4t", "thumb",
 };
 return {g_armv7k_compatible_archs};
-  case ArchSpec::eCore_arm_armv7s:
+  }
+  case ArchSpec::eCore_arm_armv7s: {
 static const char *g_armv7s_compatible_archs[] = {
 "armv7s",  "armv7",   "armv6m",   "armv6",   "armv5",
 "armv4",   "arm", "thumbv7s", "thumbv7", "thumbv6m",
 "thumbv6", "thumbv5", "thumbv4t", "thumb",
 };
 return {g_armv7s_compatible_archs};
-  case ArchSpec::eCore_arm_armv7m:
+  }
+  case ArchSpec::eCore_arm_armv7m: {
 static const char *g_armv7m_compatible_archs[] = {
 "armv7m",  "armv7",   "armv6m",   "armv6",   "armv5",
 "armv4",   "arm", "thumbv7m", "thumbv7", "thumbv6m",
 "thumbv6", "thumbv5", "thumbv4t", "thumb",
 };
 return {g_armv7m_compatible_archs};
-  case ArchSpec::eCore_arm_armv7em:
+  }
+  case ArchSpec::eCore_arm_armv7em: {
 static const char *g_armv7em_compatible_archs[] = {
 "armv7em", "armv7",   "armv6m","armv6",   "armv5",
 "armv4",   "arm", "thumbv7em", "thumbv7", "thumbv6m",
 "thumbv6", "thumbv5", "thumbv4t",  "thumb",
 };
 return {g_armv7em_compatible_archs};
-  case ArchSpec::eCore_arm_armv6m:
+  }
+  case ArchSpec::eCore_arm_armv6m: {
 static const char *g_armv6m_compatible_archs[] = {
 "armv6m",   "armv6",   "armv5",   "armv4","arm",
 "thumbv6m", "thumbv6", "thumbv5", "thumbv4t", "thumb",
 };
 return {g_armv6m_compatible_archs};
-  case ArchSpec::eCore_arm_armv6:
+  }
+  case ArchSpec::eCore_arm_armv6: {
 static const char *g_armv6_compatible_archs[] = {
 "armv6",   "armv5",   "armv4","arm",
 "thumbv6", "thumbv5", "thumbv4t", "thumb",
 };
 return {g_armv6_compatible_archs};
-  case ArchSpec::eCore_arm_armv5:
+  }
+  case ArchSpec::eCore_arm_armv5: {
 static const char *g_armv5_compatible_archs[] = {
 "armv5", "armv4", "arm", "thumbv5", "thumbv4t", "thumb",
 };
 return {g_armv5_compatible_archs};
-  case ArchSpec::eCore_arm_armv4:
+  }
+  case ArchSpec::eCore_arm_armv4: {
 static const char *g_armv4_compatible_archs[] = {
 "armv4",
 "arm",
@@ -646,6 +653,7 @@ static llvm::ArrayRef 
GetCompatibleArchs(ArchSpec::Core core) {
 };
 return {g_armv4_compatible_archs};
   }
+  }
   return {};
 }
 



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