[Lldb-commits] [lldb] [lldb] fix(lldb/**.py): fix invalid escape sequences (PR #94034)

via lldb-commits lldb-commits at lists.llvm.org
Mon Jun 3 04:05:36 PDT 2024


github-actions[bot] wrote:

<!--LLVM CODE FORMAT COMMENT: {darker}-->


:warning: Python code formatter, darker found issues in your code. :warning:

<details>
<summary>
You can test this locally with the following command:
</summary>

``````````bash
darker --check --diff -r fc21387b6510ee44520f2f17fb671f1265a9055f...5c7ba6c7d95cced5d8acc609a40a6b8307bc7fed lldb/examples/python/crashlog.py lldb/examples/python/delta.py lldb/examples/python/gdbremote.py lldb/examples/python/jump.py lldb/examples/python/performance.py lldb/examples/python/symbolication.py lldb/packages/Python/lldbsuite/test/lldbpexpect.py lldb/packages/Python/lldbsuite/test/test_runner/process_control.py lldb/test/API/commands/command/backticks/TestBackticksInAlias.py lldb/test/API/commands/expression/memory-allocation/TestMemoryAllocSettings.py lldb/test/API/commands/expression/test/TestExprs.py lldb/test/API/commands/gui/expand-threads-tree/TestGuiExpandThreadsTree.py lldb/test/API/commands/help/TestHelp.py lldb/test/API/commands/process/launch-with-shellexpand/TestLaunchWithShellExpand.py lldb/test/API/commands/register/register/TestRegistersUnavailable.py lldb/test/API/commands/settings/TestSettings.py lldb/test/API/commands/target/basic/TestTargetCommand.py lldb/test/API/commands/target/dump-separate-debug-info/dwo/TestDumpDwo.py lldb/test/API/commands/target/dump-separate-debug-info/oso/TestDumpOso.py lldb/test/API/commands/trace/TestTraceDumpInfo.py lldb/test/API/commands/trace/TestTraceEvents.py lldb/test/API/commands/trace/TestTraceStartStop.py lldb/test/API/commands/trace/TestTraceTSC.py lldb/test/API/driver/quit_speed/TestQuitWithProcess.py lldb/test/API/functionalities/breakpoint/breakpoint_by_line_and_column/TestBreakpointByLineAndColumn.py lldb/test/API/functionalities/breakpoint/breakpoint_locations/TestBreakpointLocations.py lldb/test/API/functionalities/data-formatter/data-formatter-advanced/TestDataFormatterAdv.py lldb/test/API/functionalities/data-formatter/data-formatter-cpp/TestDataFormatterCpp.py lldb/test/API/functionalities/data-formatter/data-formatter-objc/TestDataFormatterObjCNSContainer.py lldb/test/API/functionalities/data-formatter/data-formatter-skip-summary/TestDataFormatterSkipSummary.py lldb/test/API/functionalities/data-formatter/data-formatter-stl/generic/unordered/TestDataFormatterGenericUnordered.py lldb/test/API/functionalities/data-formatter/data-formatter-stl/libcxx/atomic/TestLibCxxAtomic.py lldb/test/API/functionalities/data-formatter/data-formatter-stl/libcxx/initializerlist/TestInitializerList.py lldb/test/API/functionalities/data-formatter/type_summary_list_arg/TestTypeSummaryListArg.py lldb/test/API/functionalities/memory-region/TestMemoryRegion.py lldb/test/API/functionalities/target_var/TestTargetVar.py lldb/test/API/iohandler/completion/TestIOHandlerCompletion.py lldb/test/API/lang/c/function_types/TestFunctionTypes.py lldb/test/API/lang/c/register_variables/TestRegisterVariables.py lldb/test/API/lang/c/set_values/TestSetValues.py lldb/test/API/lang/c/strings/TestCStrings.py lldb/test/API/lang/c/tls_globals/TestTlsGlobals.py lldb/test/API/lang/cpp/char1632_t/TestChar1632T.py lldb/test/API/lang/cpp/class_static/TestStaticVariables.py lldb/test/API/lang/cpp/class_types/TestClassTypes.py lldb/test/API/lang/cpp/dynamic-value/TestDynamicValue.py lldb/test/API/lang/cpp/namespace/TestNamespace.py lldb/test/API/lang/cpp/signed_types/TestSignedTypes.py lldb/test/API/lang/cpp/unsigned_types/TestUnsignedTypes.py lldb/test/API/lang/mixed/TestMixedLanguages.py lldb/test/API/lang/objc/foundation/TestObjCMethods.py lldb/test/API/lang/objc/foundation/TestObjCMethodsNSArray.py lldb/test/API/lang/objc/foundation/TestObjCMethodsNSError.py lldb/test/API/lang/objc/foundation/TestObjCMethodsString.py lldb/test/API/lang/objc/objc-dynamic-value/TestObjCDynamicValue.py lldb/test/API/lang/objcxx/objc-builtin-types/TestObjCBuiltinTypes.py lldb/test/API/linux/aarch64/mte_core_file/TestAArch64LinuxMTEMemoryTagCoreFile.py lldb/test/API/linux/aarch64/mte_tag_access/TestAArch64LinuxMTEMemoryTagAccess.py lldb/test/API/linux/aarch64/mte_tag_faults/TestAArch64LinuxMTEMemoryTagFaults.py lldb/test/API/linux/aarch64/tagged_memory_region/TestAArch64LinuxTaggedMemoryRegion.py lldb/test/API/macosx/add-dsym/TestAddDsymDownload.py lldb/test/API/macosx/lc-note/firmware-corefile/TestFirmwareCorefiles.py lldb/test/API/macosx/lc-note/kern-ver-str/TestKernVerStrLCNOTE.py lldb/test/API/macosx/lc-note/multiple-binary-corefile/TestMultipleBinaryCorefile.py lldb/test/API/macosx/simulator/TestSimulatorPlatform.py lldb/test/API/macosx/skinny-corefile/TestSkinnyCorefile.py lldb/test/API/python_api/target-arch-from-module/TestTargetArchFromModule.py lldb/test/API/source-manager/TestSourceManager.py lldb/test/API/tools/lldb-server/TestGdbRemoteModuleInfo.py lldb/test/API/tools/lldb-server/TestPtyServer.py lldb/test/API/tools/lldb-server/registers-target-xml-reading/TestGdbRemoteTargetXmlPacket.py lldb/test/API/types/AbstractBase.py lldb/utils/lui/sourcewin.py
``````````

</details>

<details>
<summary>
View the diff from darker here.
</summary>

``````````diff
--- test/API/commands/trace/TestTraceEvents.py	2024-05-31 19:41:47.000000 +0000
+++ test/API/commands/trace/TestTraceEvents.py	2024-06-03 11:05:08.986318 +0000
@@ -66,11 +66,11 @@
         self.expect("si")
         # We ensure that the paused events are printed correctly forward
         self.expect(
             "thread trace dump instructions -e -f",
             patterns=[
-                fr"""thread #1: tid = .*
+                rf"""thread #1: tid = .*
     0: \(event\) trace synchronization point \[offset \= 0x0xec0\]
     1: \(event\) hardware disabled tracing
   a.out`main \+ 23 at main.cpp:12
     2: {ADDRESS_REGEX}    movl .*
     3: \(event\) software disabled tracing
@@ -100,11 +100,11 @@
 
         # We ensure that the paused events are printed correctly backward
         self.expect(
             "thread trace dump instructions -e --id 18",
             patterns=[
-                fr"""thread #1: tid = .*
+                rf"""thread #1: tid = .*
   a.out`symbol stub for: foo\(\)
     18: {ADDRESS_REGEX}    jmpq .*
     17: \(event\) software disabled tracing
   a.out`main \+ 63 at main.cpp:16
     16: {ADDRESS_REGEX}    callq  .* ; symbol stub for: foo\(\)
--- test/API/commands/trace/TestTraceStartStop.py	2024-05-31 19:41:47.000000 +0000
+++ test/API/commands/trace/TestTraceStartStop.py	2024-06-03 11:05:09.129840 +0000
@@ -242,22 +242,22 @@
         # We can reconstruct the single instruction executed in the first line
         self.expect("n")
         self.expect(
             "thread trace dump instructions -f",
             patterns=[
-                fr"""thread #1: tid = .*
+                rf"""thread #1: tid = .*
   a.out`main \+ 4 at main.cpp:2
     2: {ADDRESS_REGEX}    movl"""
             ],
         )
 
         # We can reconstruct the instructions up to the second line
         self.expect("n")
         self.expect(
             "thread trace dump instructions -f",
             patterns=[
-                fr"""thread #1: tid = .*
+                rf"""thread #1: tid = .*
   a.out`main \+ 4 at main.cpp:2
     2: {ADDRESS_REGEX}    movl .*
   a.out`main \+ 11 at main.cpp:4
     4: {ADDRESS_REGEX}    movl .*
     6: {ADDRESS_REGEX}    jmp  .* ; <\+28> at main.cpp:4
@@ -267,11 +267,11 @@
         )
 
         self.expect(
             "thread trace dump instructions",
             patterns=[
-                fr"""thread #1: tid = .*
+                rf"""thread #1: tid = .*
   a.out`main \+ 32 at main.cpp:4
     10: {ADDRESS_REGEX}    jle  .* ; <\+20> at main.cpp:5
     8: {ADDRESS_REGEX}    cmpl .*
     6: {ADDRESS_REGEX}    jmp  .* ; <\+28> at main.cpp:4
     4: {ADDRESS_REGEX}    movl .*
@@ -295,20 +295,20 @@
         self.expect("thread trace start")
         self.expect("n")
         self.expect(
             "thread trace dump instructions -f",
             patterns=[
-                fr"""thread #1: tid = .*
+                rf"""thread #1: tid = .*
   a.out`main \+ 20 at main.cpp:5
     2: {ADDRESS_REGEX}    xorl"""
             ],
         )
 
         self.expect(
             "thread trace dump instructions",
             patterns=[
-                fr"""thread #1: tid = .*
+                rf"""thread #1: tid = .*
   a.out`main \+ 20 at main.cpp:5
     2: {ADDRESS_REGEX}    xorl"""
             ],
         )
 
@@ -334,9 +334,9 @@
         # We can reconstruct the single instruction executed in the first line
         self.expect("si")
         self.expect(
             "thread trace dump instructions -c 1",
             patterns=[
-                fr"""thread #1: tid = .*
+                rf"""thread #1: tid = .*
   a.out`main \+ 11 at main.cpp:4"""
             ],
         )
--- test/API/functionalities/data-formatter/data-formatter-advanced/TestDataFormatterAdv.py	2024-05-31 19:41:47.000000 +0000
+++ test/API/functionalities/data-formatter/data-formatter-advanced/TestDataFormatterAdv.py	2024-06-03 11:05:09.409228 +0000
@@ -102,11 +102,13 @@
             'frame variable int_array --summary-string "${*var[0-1]}"', substrs=["3"]
         )
 
         self.runCmd("type summary clear")
 
-        self.runCmd(r'type summary add --summary-string "${var[0-1]}" -x "int\[[0-9]\]"')
+        self.runCmd(
+            r'type summary add --summary-string "${var[0-1]}" -x "int\[[0-9]\]"'
+        )
 
         self.expect("frame variable int_array", substrs=["1,2"])
 
         self.runCmd('type summary add --summary-string "${var[0-1]}" "int[]"')
 
--- test/API/linux/aarch64/mte_tag_access/TestAArch64LinuxMTEMemoryTagAccess.py	2024-05-31 19:41:47.000000 +0000
+++ test/API/linux/aarch64/mte_tag_access/TestAArch64LinuxMTEMemoryTagAccess.py	2024-06-03 11:05:10.750248 +0000
@@ -522,11 +522,13 @@
         )
 
         # End of range is untagged
         self.expect(
             'memory read mte_buf+page_size-16 mte_buf+page_size+16 -f "x" -l 1 -s 16 --show-tags',
-            patterns=["0x[0-9A-Fa-f]+f0: 0x0+ \\(tag: 0xf\\)\n" "0x[0-9A-Fa-f]+00: 0x0+"],
+            patterns=[
+                "0x[0-9A-Fa-f]+f0: 0x0+ \\(tag: 0xf\\)\n" "0x[0-9A-Fa-f]+00: 0x0+"
+            ],
         )
 
         # The smallest MTE range we can get is a single page so we just check
         # parts of this result. Where we read from before the tagged page to after it.
         # Add --force here because we're reading just over 4k.
--- test/API/linux/aarch64/tagged_memory_region/TestAArch64LinuxTaggedMemoryRegion.py	2024-05-31 19:41:47.000000 +0000
+++ test/API/linux/aarch64/tagged_memory_region/TestAArch64LinuxTaggedMemoryRegion.py	2024-06-03 11:05:10.815628 +0000
@@ -37,11 +37,12 @@
             substrs=["stopped", "stop reason = breakpoint"],
         )
 
         # Despite the non address bits we should find a region
         self.expect(
-            "memory region the_page", patterns=[r"\[0x[0-9A-Fa-f]+-0x[0-9A-Fa-f]+\) r-x"]
+            "memory region the_page",
+            patterns=[r"\[0x[0-9A-Fa-f]+-0x[0-9A-Fa-f]+\) r-x"],
         )
 
         # Check that the usual error message is displayed after repeating
         # the command until the last region.
         self.runCmd("memory region 0")
@@ -66,7 +67,8 @@
             self.runCmd("memory region")
 
         # This should not error, since the user supplied address overrides
         # the previous end address.
         self.expect(
-            "memory region the_page", patterns=[r"\[0x[0-9A-Fa-f]+-0x[0-9A-Fa-f]+\) r-x"]
+            "memory region the_page",
+            patterns=[r"\[0x[0-9A-Fa-f]+-0x[0-9A-Fa-f]+\) r-x"],
         )

``````````

</details>


https://github.com/llvm/llvm-project/pull/94034


More information about the lldb-commits mailing list