[Lldb-commits] [lldb] 9ce7b40 - Use the default parameters of countTrailingZeros and find{First, Last}Set (NFC)

2023-01-15 Thread Kazu Hirata via lldb-commits

Author: Kazu Hirata
Date: 2023-01-15T09:04:57-08:00
New Revision: 9ce7b40ad49f4e16c74d0a181c5cd25d21e417c8

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

LOG: Use the default parameters of countTrailingZeros and find{First,Last}Set 
(NFC)

This patch uses the default parameters of countTrailingZeros,
findFirstSet, and findLastSet, which are ZB_Width, ZB_Max, and ZB_Max,
respectively.

Added: 


Modified: 
lldb/source/Symbol/CompactUnwindInfo.cpp
llvm/lib/Support/APInt.cpp

Removed: 




diff  --git a/lldb/source/Symbol/CompactUnwindInfo.cpp 
b/lldb/source/Symbol/CompactUnwindInfo.cpp
index 822ac7b8fbe90..b82ead94faa1a 100644
--- a/lldb/source/Symbol/CompactUnwindInfo.cpp
+++ b/lldb/source/Symbol/CompactUnwindInfo.cpp
@@ -155,8 +155,7 @@ FLAGS_ANONYMOUS_ENUM(){
 #endif
 
 #define EXTRACT_BITS(value, mask)  
\
-  ((value >>   
\
-llvm::countTrailingZeros(static_cast(mask), llvm::ZB_Width)) &   
\
+  ((value >> llvm::countTrailingZeros(static_cast(mask))) &  
\
(((1 << llvm::countPopulation(static_cast(mask - 1))
 
 // constructor

diff  --git a/llvm/lib/Support/APInt.cpp b/llvm/lib/Support/APInt.cpp
index 3351c9127ee27..3b89b01f1dfd5 100644
--- a/llvm/lib/Support/APInt.cpp
+++ b/llvm/lib/Support/APInt.cpp
@@ -2293,13 +2293,13 @@ static inline APInt::WordType highHalf(APInt::WordType 
part) {
 /// Returns the bit number of the most significant set bit of a part.
 /// If the input number has no bits set -1U is returned.
 static unsigned partMSB(APInt::WordType value) {
-  return findLastSet(value, ZB_Max);
+  return findLastSet(value);
 }
 
 /// Returns the bit number of the least significant set bit of a part.  If the
 /// input number has no bits set -1U is returned.
 static unsigned partLSB(APInt::WordType value) {
-  return findFirstSet(value, ZB_Max);
+  return findFirstSet(value);
 }
 
 /// Sets the least significant part of a bignum to the input value, and zeroes



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


[Lldb-commits] [lldb] 93ccccb - [lldb] Fix typos and update "GDB To LLDB Command Map" to be a bit more clear

2023-01-15 Thread Jonas Devlieghere via lldb-commits

Author: Saagar Jha
Date: 2023-01-15T11:10:52-08:00
New Revision: 93b00d9717b58ba93f0942a243ba6dac4ef6

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

LOG: [lldb] Fix typos and update "GDB To LLDB Command Map" to be a bit more 
clear

I've gone through the GDB To LLDB Command Map and tried to improve it:

 - Fix obvious typos (e.g.  → )
 - Wrap code and program names in  tags
 - Reword a couple parts where (IMHO) the phrasing could be a bit better

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

Added: 


Modified: 
lldb/docs/use/map.rst

Removed: 




diff  --git a/lldb/docs/use/map.rst b/lldb/docs/use/map.rst
index fd02fb8ac15c6..b11d583a22749 100644
--- a/lldb/docs/use/map.rst
+++ b/lldb/docs/use/map.rst
@@ -1,7 +1,7 @@
 GDB to LLDB command map
 ===
 
-Below is a table of GDB commands with the LLDB counterparts. The built in
+Below is a table of GDB commands with their LLDB counterparts. The built in
 GDB-compatibility aliases in LLDB are also listed. The full lldb command names
 are often long, but any unique short form can be used. Instead of "**breakpoint
 set**", "**br se**" is also acceptable.
@@ -58,7 +58,7 @@ Execution Commands
  
 
  
-   Launch a process for with 
arguments a.out 1 2 3 without having to supply the args 
every time.
+   Launch process 
a.out with arguments 1 2 3 without 
having to supply the args every time.
  
  

@@ -124,9 +124,7 @@ Execution Commands
  
 
  
-   Launch a process with arguments 
in existing terminal
-  /dev/ttys006 (macOS only).
-   
+   Launch a process with arguments 
 in existing terminal /dev/ttys006 (macOS 
only).
  
  

@@ -205,7 +203,7 @@ Execution Commands
  
 
  
-   Attach to a process with process 
ID 123.
+   Attach to the process with 
process ID 123.
  
  

@@ -219,7 +217,7 @@ Execution Commands
  
 
  
-   Attach to a process named 
"a.out".
+   Attach to the process named 
"a.out".
  
  

@@ -443,7 +441,7 @@ Breakpoint Commands
  
 
  
-   Set a breakpoint at all 
functions named main.
+   Set a breakpoint at all 
functions named main.
  
  

@@ -459,7 +457,7 @@ Breakpoint Commands
  
 
  
-   Set a breakpoint in file 
test.c at line 12.
+   Set a breakpoint in file 
test.c at line 12.
  
  

@@ -475,7 +473,7 @@ Breakpoint Commands
  
 
  
-   Set a breakpoint at all C++ 
methods whose basename is main.
+   Set a breakpoint at all C++ 
methods whose basename is main.
  
  

@@ -492,7 +490,7 @@ Breakpoint Commands
  
 
  
-   Set a breakpoint at and object C 
function: -[NSString stringWithFormat:].
+   Set a breakpoint at an 
Objective-C function -[NSString stringWithFormat:].
  
  

@@ -508,7 +506,7 @@ Breakpoint Commands
  
 
  
-   Set a breakpoint at all 
Objective-C methods whose selector is count.
+   Set a breakpoint at all 
Objective-C methods whose selector is count.
  
  

@@ -541,7 +539,7 @@ Breakpoint Commands
  
 
  
-   Ensure that breakpoints by file 
and line work for #included .c/.cpp/.m files.
+   Ensure that breakpoints by file 
and line work for #include .c/.cpp/.m files.
  
 
  
@@ -577,7 +575,7 @@ Breakpoint Commands
  
 
  
-   Set a conditional breakpoint
+   Set a conditional 
breakpoint.
  
 
  
@@ -901,7 +899,7 @@ Examining Variables
  
 
  
-   Display the variables "argc" and 
"argv" only when you stop in the function named main.
+   Display the variables "argc" and 
"argv" only when you stop in the function named main.
  
  

@@ -915,7 +913,7 @@ Examining Variables
  
 
  
-   Display the variable "*this" 
only when you stop in c class named MyClass.
+   Display the variable "*this" 
only when you stop in c class named MyClass.
  
  

@@ -1043,7 +1041,7 @@ Evaluating Expressions
  
 
  
-   Calling a function so you can 
stop at a breakpoint in the function.
+   Call a function so you can stop 

[Lldb-commits] [PATCH] D28758: Fix typos and update "GDB To LLDB Command Map" to be a bit more clear

2023-01-15 Thread Jonas Devlieghere via Phabricator via lldb-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rG93b00d97: [lldb] Fix typos and update "GDB To LLDB 
Command Map" to be a bit more clear (authored by saagarjha, committed by 
JDevlieghere).

Changed prior to commit:
  https://reviews.llvm.org/D28758?vs=84516&id=489380#toc

Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D28758

Files:
  lldb/docs/use/map.rst

Index: lldb/docs/use/map.rst
===
--- lldb/docs/use/map.rst
+++ lldb/docs/use/map.rst
@@ -1,7 +1,7 @@
 GDB to LLDB command map
 ===
 
-Below is a table of GDB commands with the LLDB counterparts. The built in
+Below is a table of GDB commands with their LLDB counterparts. The built in
 GDB-compatibility aliases in LLDB are also listed. The full lldb command names
 are often long, but any unique short form can be used. Instead of "**breakpoint
 set**", "**br se**" is also acceptable.
@@ -58,7 +58,7 @@
  
 
  
-   Launch a process for with arguments a.out 1 2 3 without having to supply the args every time.
+   Launch process a.out with arguments 1 2 3 without having to supply the args every time.
  
  

@@ -124,9 +124,7 @@
  
 
  
-   Launch a process with arguments in existing terminal
-  /dev/ttys006 (macOS only).
-   
+   Launch a process with arguments  in existing terminal /dev/ttys006 (macOS only).
  
  

@@ -205,7 +203,7 @@
  
 
  
-   Attach to a process with process ID 123.
+   Attach to the process with process ID 123.
  
  

@@ -219,7 +217,7 @@
  
 
  
-   Attach to a process named "a.out".
+   Attach to the process named "a.out".
  
  

@@ -443,7 +441,7 @@
  
 
  
-   Set a breakpoint at all functions named main.
+   Set a breakpoint at all functions named main.
  
  

@@ -459,7 +457,7 @@
  
 
  
-   Set a breakpoint in file test.c at line 12.
+   Set a breakpoint in file test.c at line 12.
  
  

@@ -475,7 +473,7 @@
  
 
  
-   Set a breakpoint at all C++ methods whose basename is main.
+   Set a breakpoint at all C++ methods whose basename is main.
  
  

@@ -492,7 +490,7 @@
  
 
  
-   Set a breakpoint at and object C function: -[NSString stringWithFormat:].
+   Set a breakpoint at an Objective-C function -[NSString stringWithFormat:].
  
  

@@ -508,7 +506,7 @@
  
 
  
-   Set a breakpoint at all Objective-C methods whose selector is count.
+   Set a breakpoint at all Objective-C methods whose selector is count.
  
  

@@ -541,7 +539,7 @@
  
 
  
-   Ensure that breakpoints by file and line work for #included .c/.cpp/.m files.
+   Ensure that breakpoints by file and line work for #include .c/.cpp/.m files.
  
 
  
@@ -577,7 +575,7 @@
  
 
  
-   Set a conditional breakpoint
+   Set a conditional breakpoint.
  
 
  
@@ -901,7 +899,7 @@
  
 
  
-   Display the variables "argc" and "argv" only when you stop in the function named main.
+   Display the variables "argc" and "argv" only when you stop in the function named main.
  
  

@@ -915,7 +913,7 @@
  
 
  
-   Display the variable "*this" only when you stop in c class named MyClass.
+   Display the variable "*this" only when you stop in c class named MyClass.
  
  

@@ -1043,7 +1041,7 @@
  
 
  
-   Calling a function so you can stop at a breakpoint in the function.
+   Call a function so you can stop at a breakpoint in it.
  
  

@@ -1059,7 +1057,7 @@
  
 
  
-   Calling a function that crashes, and stopping when the function crashes.
+   Call a function that crashes, then stop when it does.
  
  

@@ -1292,7 +1290,7 @@
  
 
  
-   Show the general purpose registers for the current thread formatted as signed decimal. LLDB tries to use the same format characters as printf(3) when possible. Type "help format" to see the full list of format specifiers.
+   Show the general purpose 

[Lldb-commits] [PATCH] D28758: Fix typos and update "GDB To LLDB Command Map" to be a bit more clear

2023-01-15 Thread Jonas Devlieghere via Phabricator via lldb-commits
JDevlieghere added a comment.

Thanks Saagar!


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D28758

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


[Lldb-commits] [lldb] 8959968 - [lldb] Unbreak test after 931d04be2fc8f3f0505b43e64297f75d526cb42a

2023-01-15 Thread Benjamin Kramer via lldb-commits

Author: Benjamin Kramer
Date: 2023-01-15T21:39:31+01:00
New Revision: 8959968b7225d154dca05cdeee17f9477429c420

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

LOG: [lldb] Unbreak test after 931d04be2fc8f3f0505b43e64297f75d526cb42a

Added: 


Modified: 
lldb/unittests/Core/SourceLocationSpecTest.cpp

Removed: 




diff  --git a/lldb/unittests/Core/SourceLocationSpecTest.cpp 
b/lldb/unittests/Core/SourceLocationSpecTest.cpp
index 0cf1683906eed..0b451f56c765a 100644
--- a/lldb/unittests/Core/SourceLocationSpecTest.cpp
+++ b/lldb/unittests/Core/SourceLocationSpecTest.cpp
@@ -122,7 +122,7 @@ TEST(SourceLocationSpecTest, Equal) {
 
 TEST(SourceLocationSpecTest, Compare) {
   auto Cmp = [](SourceLocationSpec a, SourceLocationSpec b) {
-return SourceLocationSpec::Compare(a, b);
+return std::clamp(SourceLocationSpec::Compare(a, b), -1, 1);
   };
 
   FileSpec fs("/foo/bar", FileSpec::Style::posix);



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


[Lldb-commits] [PATCH] D140358: [lldb-vscode] Add support for disassembly view

2023-01-15 Thread Enrico Loparco via Phabricator via lldb-commits
eloparco added inline comments.



Comment at: lldb/tools/lldb-vscode/lldb-vscode.cpp:2177
+  const auto max_instruction_size = g_vsc.target.GetMaximumOpcodeByteSize();
+  const auto bytes_offset = -instruction_offset * max_instruction_size;
+  auto start_addr = base_addr - bytes_offset;

clayborg wrote:
> Just checked out your changes, and you are still just subtracting a value 
> from the start address and attempting to disassemble from memory which is the 
> problem. We need to take that subtracted address, and look it up as suggested 
> in previous code examples I posted. If you find a function to symbol, ask 
> those objects for their instructions. and then try to use those. 
> 
> But basically for _any_ disassembly this is what I would recommend doing:
> - first resolve the "start_address" (no matter how you come up the address) 
> that want to disassemble into a SBAddress
> - check its section. If the section is valid and contains instructions, call 
> a function that will disassemble the address range for the section that 
> starts at "start_address" and ends at the end of the section. We can call 
> this "disassemble_code" as a function. More details on this below
> - If the section does not contain instructions, just read the bytes and emit 
> a lines like:
> ```
> 0x1000 .byte 0x12
> 0x1000 .byte 0x34
> ...
> ```
> 
> Now for the disassemble_code function. We know the address range for this is 
> in code. We then need to resolve the address passed to "disassemble_code" 
> into a SBAddress and ask that address for a SBFunction or SBSymbol as I 
> mentioned. Then we ask the SBFunction or SBSymbol for all instructions that 
> they contain, and then use any instructions that fall into the range we have. 
> If there is no SBFunction or SBSymbol, then disassemble an instruction at a 
> time and then see if the new address will resolve to a function or symbol.
Tried my changes on a linux x86 machine and the loop `for (unsigned i = 0; i < 
max_instruction_size; i++) {` (L2190) takes care of the `start_address` 
possibly being in the middle of an instruction, so that's not a problem.  The 
problem I faced is that it tries to read too far from `base_addr` and the 
`ReadMemory()` operation returns few instructions (without reaching 
`base_addr`). That was not happening on my macOS M1 (arm) machine. 

To solve, I changed the loop at L2190 to
```
for (unsigned i = 0; i < bytes_offset; i++) {
auto sb_instructions =
_get_instructions_from_memory(start_addr + i, disassemble_bytes);
```
and if `start_addr` is in `sb_instructions` we're done and can exit the loop. 
That worked.

Another similar thing that can be done is to start from `start_sbaddr` as you 
were saying, increment the address until a valid section is found. Then call 
`_get_instructions_from_memory()` passing the section start.
What do you think? Delegating the disassembling to `ReadMemory()` + 
`GetInstructions()` looks simpler to me than to manually iterate over sections 
and get instructions from symbols and functions.
Is there any shortcoming I'm not seeing?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D140358

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


[Lldb-commits] [PATCH] D141814: [llvm][ADT] Replace uses of `makeMutableArrayRef` with deduction guides

2023-01-15 Thread Joe Loser via Phabricator via lldb-commits
jloser created this revision.
jloser added reviewers: MaskRay, serge-sans-paille, dblaikie.
Herald added subscribers: Moerafaat, zero9178, bzcheeseman, kosarev, ayermolo, 
sdasgup3, wenzhicui, wrengr, foad, cota, teijeong, rdzhabarov, tatianashp, 
msifontes, jurahul, Kayjukh, grosul1, Joonsoo, kerbowa, liufengdb, aartbik, 
mgester, arpith-jacob, csigg, antiagainst, shauheen, rriddle, mehdi_amini, 
kadircet, arphaman, hiraditya, arichardson, jvesely, emaste, arsenm.
Herald added a reviewer: aartbik.
Herald added a reviewer: bondhugula.
Herald added a reviewer: rafauler.
Herald added a reviewer: Amir.
Herald added a reviewer: maksfb.
Herald added a project: All.
jloser requested review of this revision.
Herald added a reviewer: nicolasvasilache.
Herald added subscribers: cfe-commits, llvm-commits, lldb-commits, 
pcwang-thead, yota9, stephenneuendorffer, nicolasvasilache.
Herald added a reviewer: dcaballe.
Herald added projects: clang, LLDB, MLIR, LLVM, clang-tools-extra.

Similar to how `makeArrayRef` is deprecated in favor of deduction guides, do the
same for `makeMutableArrayRef`.

Once all of the places in-tree are using the deduction guides for
`MutableArrayRef`, we can mark `makeMutableArrayRef` as deprecated.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D141814

Files:
  bolt/lib/Profile/DataAggregator.cpp
  clang-tools-extra/clangd/FuzzyMatch.cpp
  clang-tools-extra/clangd/SemanticSelection.cpp
  clang-tools-extra/clangd/index/dex/Trigram.cpp
  clang-tools-extra/pseudo/include/clang-pseudo/Forest.h
  clang/include/clang/AST/DeclOpenMP.h
  clang/include/clang/AST/OpenMPClause.h
  clang/include/clang/AST/StmtOpenMP.h
  clang/include/clang/Lex/MacroInfo.h
  clang/lib/AST/StmtOpenMP.cpp
  lld/COFF/Chunks.cpp
  lld/COFF/DebugTypes.cpp
  lld/COFF/Writer.cpp
  lld/ELF/InputFiles.h
  lld/ELF/SyntheticSections.cpp
  lldb/source/Host/common/NativeProcessProtocol.cpp
  llvm/include/llvm/DebugInfo/DWARF/DWARFUnitIndex.h
  llvm/include/llvm/IR/DataLayout.h
  llvm/include/llvm/IR/Metadata.h
  llvm/include/llvm/ProfileData/InstrProf.h
  llvm/include/llvm/Support/Parallel.h
  llvm/lib/Analysis/ConstantFolding.cpp
  llvm/lib/ExecutionEngine/ExecutionEngine.cpp
  llvm/lib/Support/Path.cpp
  llvm/lib/Target/AMDGPU/AMDGPULegalizerInfo.cpp
  llvm/lib/Transforms/Scalar/IndVarSimplify.cpp
  llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
  llvm/unittests/Support/Path.cpp
  mlir/lib/Bytecode/Writer/IRNumbering.cpp
  mlir/lib/Dialect/Affine/Transforms/LoopCoalescing.cpp
  mlir/test/mlir-tblgen/constraint-unique.td
  mlir/tools/mlir-tblgen/OpDefinitionsGen.cpp

Index: mlir/tools/mlir-tblgen/OpDefinitionsGen.cpp
===
--- mlir/tools/mlir-tblgen/OpDefinitionsGen.cpp
+++ mlir/tools/mlir-tblgen/OpDefinitionsGen.cpp
@@ -2746,7 +2746,7 @@
   ///
   /// {0}: The region's index.
   const char *const getSingleRegion =
-  "::llvm::makeMutableArrayRef((*this)->getRegion({0}))";
+  "::llvm::MutableArrayRef((*this)->getRegion({0}))";
 
   // If we have no regions, there is nothing more to do.
   const auto canSkip = [](const NamedRegion ®ion) {
@@ -2781,7 +2781,7 @@
   /// Get a single successor.
   ///
   /// {0}: The successor's name.
-  const char *const getSingleSuccessor = "::llvm::makeMutableArrayRef({0}())";
+  const char *const getSingleSuccessor = "::llvm::MutableArrayRef({0}())";
 
   // If we have no successors, there is nothing more to do.
   const auto canSkip = [](const NamedSuccessor &successor) {
Index: mlir/test/mlir-tblgen/constraint-unique.td
===
--- mlir/test/mlir-tblgen/constraint-unique.td
+++ mlir/test/mlir-tblgen/constraint-unique.td
@@ -127,10 +127,10 @@
 // CHECK: for (auto [[$RET_VALUE:.*]] : [[$RET_VALUE_GROUP]])
 // CHECK-NEXT:  if (::mlir::failed([[$A_TYPE_CONSTRAINT]](*this, [[$RET_VALUE]].getType(), "result", index++)))
 // CHECK-NEXT:return ::mlir::failure();
-// CHECK: for (auto ®ion : ::llvm::makeMutableArrayRef((*this)->getRegion(0)))
+// CHECK: for (auto ®ion : ::llvm::MutableArrayRef((*this)->getRegion(0)))
 // CHECK-NEXT:  if (::mlir::failed([[$A_REGION_CONSTRAINT]](*this, region, "d", index++)))
 // CHECK-NEXT:return ::mlir::failure();
-// CHECK: for (auto *successor : ::llvm::makeMutableArrayRef(c()))
+// CHECK: for (auto *successor : ::llvm::MutableArrayRef(c()))
 // CHECK-NEXT:  if (::mlir::failed([[$A_SUCCESSOR_CONSTRAINT]](*this, successor, "c", index++)))
 // CHECK-NEXT:return ::mlir::failure();
 
@@ -148,9 +148,9 @@
 // CHECK: for (auto [[$RET_VALUE:.*]] : [[$RET_VALUE_GROUP]])
 // CHECK-NEXT:  if (::mlir::failed([[$O_TYPE_CONSTRAINT]](*this, [[$RET_VALUE]].getType(), "result", index++)))
 // CHECK-NEXT:return ::mlir::failure();
-// CHECK: for (auto ®ion : ::llvm::makeMutableArrayRef((*this)->getRegion(0)))
+// CHECK: for (auto ®io

[Lldb-commits] [PATCH] D141816: [lldb] Fix comments referring to BCR_M_IMVA_MATCH

2023-01-15 Thread Saagar Jha via Phabricator via lldb-commits
saagarjha created this revision.
Herald added a project: All.
saagarjha requested review of this revision.
Herald added a project: LLDB.
Herald added a subscriber: lldb-commits.

It seems like these were copied from the single-step code and not
updated to match the new flags.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D141816

Files:
  lldb/source/Plugins/Process/Utility/RegisterContextDarwin_arm.cpp
  lldb/tools/debugserver/source/MacOSX/arm/DNBArchImpl.cpp


Index: lldb/tools/debugserver/source/MacOSX/arm/DNBArchImpl.cpp
===
--- lldb/tools/debugserver/source/MacOSX/arm/DNBArchImpl.cpp
+++ lldb/tools/debugserver/source/MacOSX/arm/DNBArchImpl.cpp
@@ -1011,7 +1011,7 @@
 // We have a thumb breakpoint
 // We have an ARM breakpoint
 m_state.dbg.__bcr[i] =
-BCR_M_IMVA_MATCH | // Stop on address mismatch
+BCR_M_IMVA_MATCH | // Stop on address match
 byte_addr_select | // Set the correct byte address select so we 
only
// trigger on the correct opcode
 S_USER |   // Which modes should this breakpoint stop in?
@@ -1025,7 +1025,7 @@
   } else if (size == 4) {
 // We have an ARM breakpoint
 m_state.dbg.__bcr[i] =
-BCR_M_IMVA_MATCH | // Stop on address mismatch
+BCR_M_IMVA_MATCH | // Stop on address match
 BAS_IMVA_ALL | // Stop on any of the four bytes following the IMVA
 S_USER |   // Which modes should this breakpoint stop in?
 BCR_ENABLE;// Enable this hardware breakpoint
Index: lldb/source/Plugins/Process/Utility/RegisterContextDarwin_arm.cpp
===
--- lldb/source/Plugins/Process/Utility/RegisterContextDarwin_arm.cpp
+++ lldb/source/Plugins/Process/Utility/RegisterContextDarwin_arm.cpp
@@ -1491,7 +1491,7 @@
 
 // We have a thumb breakpoint
 // We have an ARM breakpoint
-dbg.bcr[i] = BCR_M_IMVA_MATCH | // Stop on address mismatch
+dbg.bcr[i] = BCR_M_IMVA_MATCH | // Stop on address match
  byte_addr_select | // Set the correct byte address select
 // so we only trigger on the correct
 // opcode
@@ -1510,7 +1510,7 @@
   } else if (size == 4) {
 // We have an ARM breakpoint
 dbg.bcr[i] =
-BCR_M_IMVA_MATCH | // Stop on address mismatch
+BCR_M_IMVA_MATCH | // Stop on address match
 BAS_IMVA_ALL | // Stop on any of the four bytes following the IMVA
 S_USER |   // Which modes should this breakpoint stop in?
 BCR_ENABLE;// Enable this hardware breakpoint


Index: lldb/tools/debugserver/source/MacOSX/arm/DNBArchImpl.cpp
===
--- lldb/tools/debugserver/source/MacOSX/arm/DNBArchImpl.cpp
+++ lldb/tools/debugserver/source/MacOSX/arm/DNBArchImpl.cpp
@@ -1011,7 +1011,7 @@
 // We have a thumb breakpoint
 // We have an ARM breakpoint
 m_state.dbg.__bcr[i] =
-BCR_M_IMVA_MATCH | // Stop on address mismatch
+BCR_M_IMVA_MATCH | // Stop on address match
 byte_addr_select | // Set the correct byte address select so we only
// trigger on the correct opcode
 S_USER |   // Which modes should this breakpoint stop in?
@@ -1025,7 +1025,7 @@
   } else if (size == 4) {
 // We have an ARM breakpoint
 m_state.dbg.__bcr[i] =
-BCR_M_IMVA_MATCH | // Stop on address mismatch
+BCR_M_IMVA_MATCH | // Stop on address match
 BAS_IMVA_ALL | // Stop on any of the four bytes following the IMVA
 S_USER |   // Which modes should this breakpoint stop in?
 BCR_ENABLE;// Enable this hardware breakpoint
Index: lldb/source/Plugins/Process/Utility/RegisterContextDarwin_arm.cpp
===
--- lldb/source/Plugins/Process/Utility/RegisterContextDarwin_arm.cpp
+++ lldb/source/Plugins/Process/Utility/RegisterContextDarwin_arm.cpp
@@ -1491,7 +1491,7 @@
 
 // We have a thumb breakpoint
 // We have an ARM breakpoint
-dbg.bcr[i] = BCR_M_IMVA_MATCH | // Stop on address mismatch
+dbg.bcr[i] = BCR_M_IMVA_MATCH | // Stop on address match
  byte_addr_select | // Set the correct byte address select
 // so we only trigger on the correct
 // opcode
@@ -1510,7 +1510,7 @@
   } else if (size == 4) {
 // We have an ARM breakpoint
 dbg.bcr[i] =
-BCR_M_IMVA_MATCH | // Stop on address mismatch
+BCR_M_IMVA_MATCH | // Stop on address match
  

[Lldb-commits] [PATCH] D141816: [lldb] Fix comments referring to BCR_M_IMVA_MATCH

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

Right: `BCR_M_IMVA_MISMATCH` would be mismatch. LGTM.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D141816

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


[Lldb-commits] [lldb] 08d6cf2 - [lldb] Fix comments referring to BCR_M_IMVA_MATCH

2023-01-15 Thread Jonas Devlieghere via lldb-commits

Author: Saagar Jha
Date: 2023-01-15T23:39:22-08:00
New Revision: 08d6cf232c0e4ca8ebafc3e2b9eb488f014f5b41

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

LOG: [lldb] Fix comments referring to BCR_M_IMVA_MATCH

It seems like these were copied from the single-step code and not
updated to match the new flags.

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

Added: 


Modified: 
lldb/source/Plugins/Process/Utility/RegisterContextDarwin_arm.cpp
lldb/tools/debugserver/source/MacOSX/arm/DNBArchImpl.cpp

Removed: 




diff  --git a/lldb/source/Plugins/Process/Utility/RegisterContextDarwin_arm.cpp 
b/lldb/source/Plugins/Process/Utility/RegisterContextDarwin_arm.cpp
index 8891512fc0b3..b29d44176c94 100644
--- a/lldb/source/Plugins/Process/Utility/RegisterContextDarwin_arm.cpp
+++ b/lldb/source/Plugins/Process/Utility/RegisterContextDarwin_arm.cpp
@@ -1491,7 +1491,7 @@ uint32_t 
RegisterContextDarwin_arm::SetHardwareBreakpoint(lldb::addr_t addr,
 
 // We have a thumb breakpoint
 // We have an ARM breakpoint
-dbg.bcr[i] = BCR_M_IMVA_MATCH | // Stop on address mismatch
+dbg.bcr[i] = BCR_M_IMVA_MATCH | // Stop on address match
  byte_addr_select | // Set the correct byte address select
 // so we only trigger on the correct
 // opcode
@@ -1510,7 +1510,7 @@ uint32_t 
RegisterContextDarwin_arm::SetHardwareBreakpoint(lldb::addr_t addr,
   } else if (size == 4) {
 // We have an ARM breakpoint
 dbg.bcr[i] =
-BCR_M_IMVA_MATCH | // Stop on address mismatch
+BCR_M_IMVA_MATCH | // Stop on address match
 BAS_IMVA_ALL | // Stop on any of the four bytes following the IMVA
 S_USER |   // Which modes should this breakpoint stop in?
 BCR_ENABLE;// Enable this hardware breakpoint

diff  --git a/lldb/tools/debugserver/source/MacOSX/arm/DNBArchImpl.cpp 
b/lldb/tools/debugserver/source/MacOSX/arm/DNBArchImpl.cpp
index 0748223c4217..92717f1c5754 100644
--- a/lldb/tools/debugserver/source/MacOSX/arm/DNBArchImpl.cpp
+++ b/lldb/tools/debugserver/source/MacOSX/arm/DNBArchImpl.cpp
@@ -1011,7 +1011,7 @@ uint32_t 
DNBArchMachARM::EnableHardwareBreakpoint(nub_addr_t addr,
 // We have a thumb breakpoint
 // We have an ARM breakpoint
 m_state.dbg.__bcr[i] =
-BCR_M_IMVA_MATCH | // Stop on address mismatch
+BCR_M_IMVA_MATCH | // Stop on address match
 byte_addr_select | // Set the correct byte address select so we 
only
// trigger on the correct opcode
 S_USER |   // Which modes should this breakpoint stop in?
@@ -1025,7 +1025,7 @@ uint32_t 
DNBArchMachARM::EnableHardwareBreakpoint(nub_addr_t addr,
   } else if (size == 4) {
 // We have an ARM breakpoint
 m_state.dbg.__bcr[i] =
-BCR_M_IMVA_MATCH | // Stop on address mismatch
+BCR_M_IMVA_MATCH | // Stop on address match
 BAS_IMVA_ALL | // Stop on any of the four bytes following the IMVA
 S_USER |   // Which modes should this breakpoint stop in?
 BCR_ENABLE;// Enable this hardware breakpoint



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


[Lldb-commits] [PATCH] D141816: [lldb] Fix comments referring to BCR_M_IMVA_MATCH

2023-01-15 Thread Jonas Devlieghere via Phabricator via lldb-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rG08d6cf232c0e: [lldb] Fix comments referring to 
BCR_M_IMVA_MATCH (authored by saagarjha, committed by JDevlieghere).

Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D141816

Files:
  lldb/source/Plugins/Process/Utility/RegisterContextDarwin_arm.cpp
  lldb/tools/debugserver/source/MacOSX/arm/DNBArchImpl.cpp


Index: lldb/tools/debugserver/source/MacOSX/arm/DNBArchImpl.cpp
===
--- lldb/tools/debugserver/source/MacOSX/arm/DNBArchImpl.cpp
+++ lldb/tools/debugserver/source/MacOSX/arm/DNBArchImpl.cpp
@@ -1011,7 +1011,7 @@
 // We have a thumb breakpoint
 // We have an ARM breakpoint
 m_state.dbg.__bcr[i] =
-BCR_M_IMVA_MATCH | // Stop on address mismatch
+BCR_M_IMVA_MATCH | // Stop on address match
 byte_addr_select | // Set the correct byte address select so we 
only
// trigger on the correct opcode
 S_USER |   // Which modes should this breakpoint stop in?
@@ -1025,7 +1025,7 @@
   } else if (size == 4) {
 // We have an ARM breakpoint
 m_state.dbg.__bcr[i] =
-BCR_M_IMVA_MATCH | // Stop on address mismatch
+BCR_M_IMVA_MATCH | // Stop on address match
 BAS_IMVA_ALL | // Stop on any of the four bytes following the IMVA
 S_USER |   // Which modes should this breakpoint stop in?
 BCR_ENABLE;// Enable this hardware breakpoint
Index: lldb/source/Plugins/Process/Utility/RegisterContextDarwin_arm.cpp
===
--- lldb/source/Plugins/Process/Utility/RegisterContextDarwin_arm.cpp
+++ lldb/source/Plugins/Process/Utility/RegisterContextDarwin_arm.cpp
@@ -1491,7 +1491,7 @@
 
 // We have a thumb breakpoint
 // We have an ARM breakpoint
-dbg.bcr[i] = BCR_M_IMVA_MATCH | // Stop on address mismatch
+dbg.bcr[i] = BCR_M_IMVA_MATCH | // Stop on address match
  byte_addr_select | // Set the correct byte address select
 // so we only trigger on the correct
 // opcode
@@ -1510,7 +1510,7 @@
   } else if (size == 4) {
 // We have an ARM breakpoint
 dbg.bcr[i] =
-BCR_M_IMVA_MATCH | // Stop on address mismatch
+BCR_M_IMVA_MATCH | // Stop on address match
 BAS_IMVA_ALL | // Stop on any of the four bytes following the IMVA
 S_USER |   // Which modes should this breakpoint stop in?
 BCR_ENABLE;// Enable this hardware breakpoint


Index: lldb/tools/debugserver/source/MacOSX/arm/DNBArchImpl.cpp
===
--- lldb/tools/debugserver/source/MacOSX/arm/DNBArchImpl.cpp
+++ lldb/tools/debugserver/source/MacOSX/arm/DNBArchImpl.cpp
@@ -1011,7 +1011,7 @@
 // We have a thumb breakpoint
 // We have an ARM breakpoint
 m_state.dbg.__bcr[i] =
-BCR_M_IMVA_MATCH | // Stop on address mismatch
+BCR_M_IMVA_MATCH | // Stop on address match
 byte_addr_select | // Set the correct byte address select so we only
// trigger on the correct opcode
 S_USER |   // Which modes should this breakpoint stop in?
@@ -1025,7 +1025,7 @@
   } else if (size == 4) {
 // We have an ARM breakpoint
 m_state.dbg.__bcr[i] =
-BCR_M_IMVA_MATCH | // Stop on address mismatch
+BCR_M_IMVA_MATCH | // Stop on address match
 BAS_IMVA_ALL | // Stop on any of the four bytes following the IMVA
 S_USER |   // Which modes should this breakpoint stop in?
 BCR_ENABLE;// Enable this hardware breakpoint
Index: lldb/source/Plugins/Process/Utility/RegisterContextDarwin_arm.cpp
===
--- lldb/source/Plugins/Process/Utility/RegisterContextDarwin_arm.cpp
+++ lldb/source/Plugins/Process/Utility/RegisterContextDarwin_arm.cpp
@@ -1491,7 +1491,7 @@
 
 // We have a thumb breakpoint
 // We have an ARM breakpoint
-dbg.bcr[i] = BCR_M_IMVA_MATCH | // Stop on address mismatch
+dbg.bcr[i] = BCR_M_IMVA_MATCH | // Stop on address match
  byte_addr_select | // Set the correct byte address select
 // so we only trigger on the correct
 // opcode
@@ -1510,7 +1510,7 @@
   } else if (size == 4) {
 // We have an ARM breakpoint
 dbg.bcr[i] =
-BCR_M_IMVA_MATCH | // Stop on address mismatch
+BCR_M_IMVA_MATCH | // Stop on address match
   

[Lldb-commits] [PATCH] D141814: [llvm][ADT] Replace uses of `makeMutableArrayRef` with deduction guides

2023-01-15 Thread serge via Phabricator via lldb-commits
serge-sans-paille added a comment.

LGTM




Comment at: lldb/source/Host/common/NativeProcessProtocol.cpp:652
 
   auto data =
+  llvm::MutableArrayRef(static_cast(buf), bytes_read);

random nit: This could be rewritten as

```
llvm::MutableArrayRef data(static_cast(buf), bytes_read);
```

now


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D141814

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