<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="/source/rss.xsl.xml"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
<channel>
    <title>Changes in TestUnalignedLargeWatchpoint.py</title>
    <description></description>
    <language>en</language>
    <copyright>Copyright 2015</copyright>
    <generator>Java</generator><item>
        <title>7dd790db8b77c4a833c06632e903dc4f13877a64 - [lldb] NFC fixes addressing David&apos;s feedback</title>
        <link>http://src.rcs.uwaterloo.ca:8080/source/history/llvm-project/lldb/test/API/functionalities/watchpoint/unaligned-large-watchpoint/TestUnalignedLargeWatchpoint.py#7dd790db8b77c4a833c06632e903dc4f13877a64</link>
        <description>[lldb] NFC fixes addressing David&apos;s feedbackDavid Spickett had several suggestions forhttps://github.com/llvm/llvm-project/pull/79962 after I&apos;dalready merged it.  Address those.

            List of files:
            /llvm-project/lldb/test/API/functionalities/watchpoint/unaligned-large-watchpoint/TestUnalignedLargeWatchpoint.py</description>
        <pubDate>Fri, 02 Feb 2024 03:17:05 +0000</pubDate>
        <dc:creator>Jason Molenda &lt;jmolenda@apple.com&gt;</dc:creator>
    </item>
<item>
        <title>147d7a64f8493e78669581097a3ff06c985aa3a1 - [lldb] Add support for large watchpoints in lldb (#79962)</title>
        <link>http://src.rcs.uwaterloo.ca:8080/source/history/llvm-project/lldb/test/API/functionalities/watchpoint/unaligned-large-watchpoint/TestUnalignedLargeWatchpoint.py#147d7a64f8493e78669581097a3ff06c985aa3a1</link>
        <description>[lldb] Add support for large watchpoints in lldb (#79962)This patch is the next piece of work in my Large Watchpoint proposal,https://discourse.llvm.org/t/rfc-large-watchpoint-support-in-lldb/72116This patch breaks a user&apos;s watchpoint into one or moreWatchpointResources which reflect what the hardware registers can cover.This means we can watch objects larger than 8 bytes, and we can watchedunaligned address ranges. On a typical 64-bit target with 4 watchpointregisters you can watch 32 bytes of memory if the start address isdoubleword aligned.Additionally, if the remote stub implements AArch64 MASK stylewatchpoints (e.g. debugserver on Darwin), we can watch any power-of-2size region of memory up to 2GB, aligned to that same size.I updated the Watchpoint constructor and CommandObjectWatchpoint tocreate a CompilerType of Array&lt;UInt8&gt; when the size of the watchedregion is greater than pointer-size and we don&apos;t have a variable type touse. For pointer-size and smaller, we can display the watched granule asan integer value; for larger-than-pointer-size we will display as anarray of bytes.I have `watchpoint list` now print the WatchpointResources used toimplement the watchpoint.I added a WatchpointAlgorithm class which has a top-level static methodthat takes an enum flag mask WatchpointHardwareFeature and a useraddress and size, and returns a vector of WatchpointResources coveringthe request. It does not take into account the number of watchpointregisters the target has, or the number still available for use. Rightnow there is only one algorithm, which monitors power-of-2 regions ofmemory. For up to pointer-size, this is what Intel hardware supports.AArch64 Byte Address Select watchpoints can watch any number ofcontiguous bytes in a pointer-size memory granule, that is not currentlysupported so if you ask to watch bytes 3-5, the algorithm will watch theentire doubleword (8 bytes). The newly default &quot;modify&quot; style means wewill silently ignore modifications to bytes outside the watched range.I&apos;ve temporarily skipped TestLargeWatchpoint.py for all targets. It wasonly run on Darwin when using the in-tree debugserver, which was a proxyfor &quot;debugserver supports MASK watchpoints&quot;. I&apos;ll be adding theaforementioned feature flag from the stub and enabling full maskwatchpoints when a debugserver with that feature is enabled, andre-enable this test.I added a new TestUnalignedLargeWatchpoint.py which only has one testbut it&apos;s a great one, watching a 22-byte range that is unaligned andrequires four 8-byte watchpoints to cover.I also added a unit test, WatchpointAlgorithmsTests, which has a numberof simple tests against WatchpointAlgorithms::PowerOf2Watchpoints. Ithink there&apos;s interesting possible different approaches to how we coverthese; I note in the unit test that a user requesting a watch on address0x12e0 of 120 bytes will be covered by two watchpoints today, a128-bytes at 0x1280 and at 0x1300. But it could be done with a 16-bytewatchpoint at 0x12e0 and a 128-byte at 0x1300, which would have fewerfalse positives/private stops. As we try refining this one, it&apos;s helpfulto have a collection of tests to make sure things don&apos;t regress.I tested this on arm64 macOS, (genuine) x86_64 macOS, and AArch64Ubuntu. I have not modifed the Windows process plugins yet, I might trythat as a standalone patch, I&apos;d be making the change blind, but thenecessary changes (see ProcessGDBRemote::EnableWatchpoint) are prettysmall so it might be obvious enough that I can change it and see whatthe Windows CI thinks.There isn&apos;t yet a packet (or a qSupported feature query) for the gdbremote serial protocol stub to communicate its watchpoint capabilitiesto lldb. I&apos;ll be doing that in a patch right after this is landed,having debugserver advertise its capability of AArch64 MASK watchpoints,and have ProcessGDBRemote add eWatchpointHardwareArmMASK toWatchpointAlgorithms so we can watch larger than 32-byte requests onDarwin.I haven&apos;t yet tackled WatchpointResource *sharing* by multipleWatchpoints. This is all part of the goal, especially when we may bewatching a larger memory range than the user requested, if they then addanother watchpoint next to their first request, it may be covered by thesame WatchpointResource (hardware watchpoint register). Also one &quot;read&quot;watchpoint and one &quot;write&quot; watchpoint on the same memory granule need tobe handled, making the WatchpointResource cover all requests.As WatchpointResources aren&apos;t shared among multiple Watchpoints yet,there&apos;s no handling of running the conditions/commands/etc on multipleWatchpoints when their shared WatchpointResource is hit. The goal beyond&quot;large watchpoint&quot; is to unify (much more) the Watchpoint and Breakpointbehavior and commands. I have a feeling I may be slowly chipping away atthis for a while.Re-landing this patch after fixing two undefined behaviors inWatchpointAlgorithms found by UBSan and by failures on differentCI bots.rdar://108234227

            List of files:
            /llvm-project/lldb/test/API/functionalities/watchpoint/unaligned-large-watchpoint/TestUnalignedLargeWatchpoint.py</description>
        <pubDate>Thu, 01 Feb 2024 05:01:59 +0000</pubDate>
        <dc:creator>Jason Molenda &lt;jason@molenda.com&gt;</dc:creator>
    </item>
<item>
        <title>57c66b35a885b571f9897d75d18f1d974c29e533 - [lldb] Add support for large watchpoints in lldb (#79962)</title>
        <link>http://src.rcs.uwaterloo.ca:8080/source/history/llvm-project/lldb/test/API/functionalities/watchpoint/unaligned-large-watchpoint/TestUnalignedLargeWatchpoint.py#57c66b35a885b571f9897d75d18f1d974c29e533</link>
        <description>[lldb] Add support for large watchpoints in lldb (#79962)This patch is the next piece of work in my Large Watchpoint proposal,https://discourse.llvm.org/t/rfc-large-watchpoint-support-in-lldb/72116This patch breaks a user&apos;s watchpoint into one or moreWatchpointResources which reflect what the hardware registers can cover.This means we can watch objects larger than 8 bytes, and we can watchedunaligned address ranges. On a typical 64-bit target with 4 watchpointregisters you can watch 32 bytes of memory if the start address isdoubleword aligned.Additionally, if the remote stub implements AArch64 MASK stylewatchpoints (e.g. debugserver on Darwin), we can watch any power-of-2size region of memory up to 2GB, aligned to that same size.I updated the Watchpoint constructor and CommandObjectWatchpoint tocreate a CompilerType of Array&lt;UInt8&gt; when the size of the watchedregion is greater than pointer-size and we don&apos;t have a variable type touse. For pointer-size and smaller, we can display the watched granule asan integer value; for larger-than-pointer-size we will display as anarray of bytes.I have `watchpoint list` now print the WatchpointResources used toimplement the watchpoint.I added a WatchpointAlgorithm class which has a top-level static methodthat takes an enum flag mask WatchpointHardwareFeature and a useraddress and size, and returns a vector of WatchpointResources coveringthe request. It does not take into account the number of watchpointregisters the target has, or the number still available for use. Rightnow there is only one algorithm, which monitors power-of-2 regions ofmemory. For up to pointer-size, this is what Intel hardware supports.AArch64 Byte Address Select watchpoints can watch any number ofcontiguous bytes in a pointer-size memory granule, that is not currentlysupported so if you ask to watch bytes 3-5, the algorithm will watch theentire doubleword (8 bytes). The newly default &quot;modify&quot; style means wewill silently ignore modifications to bytes outside the watched range.I&apos;ve temporarily skipped TestLargeWatchpoint.py for all targets. It wasonly run on Darwin when using the in-tree debugserver, which was a proxyfor &quot;debugserver supports MASK watchpoints&quot;. I&apos;ll be adding theaforementioned feature flag from the stub and enabling full maskwatchpoints when a debugserver with that feature is enabled, andre-enable this test.I added a new TestUnalignedLargeWatchpoint.py which only has one testbut it&apos;s a great one, watching a 22-byte range that is unaligned andrequires four 8-byte watchpoints to cover.I also added a unit test, WatchpointAlgorithmsTests, which has a numberof simple tests against WatchpointAlgorithms::PowerOf2Watchpoints. Ithink there&apos;s interesting possible different approaches to how we coverthese; I note in the unit test that a user requesting a watch on address0x12e0 of 120 bytes will be covered by two watchpoints today, a128-bytes at 0x1280 and at 0x1300. But it could be done with a 16-bytewatchpoint at 0x12e0 and a 128-byte at 0x1300, which would have fewerfalse positives/private stops. As we try refining this one, it&apos;s helpfulto have a collection of tests to make sure things don&apos;t regress.I tested this on arm64 macOS, (genuine) x86_64 macOS, and AArch64Ubuntu. I have not modifed the Windows process plugins yet, I might trythat as a standalone patch, I&apos;d be making the change blind, but thenecessary changes (see ProcessGDBRemote::EnableWatchpoint) are prettysmall so it might be obvious enough that I can change it and see whatthe Windows CI thinks.There isn&apos;t yet a packet (or a qSupported feature query) for the gdbremote serial protocol stub to communicate its watchpoint capabilitiesto lldb. I&apos;ll be doing that in a patch right after this is landed,having debugserver advertise its capability of AArch64 MASK watchpoints,and have ProcessGDBRemote add eWatchpointHardwareArmMASK toWatchpointAlgorithms so we can watch larger than 32-byte requests onDarwin.I haven&apos;t yet tackled WatchpointResource *sharing* by multipleWatchpoints. This is all part of the goal, especially when we may bewatching a larger memory range than the user requested, if they then addanother watchpoint next to their first request, it may be covered by thesame WatchpointResource (hardware watchpoint register). Also one &quot;read&quot;watchpoint and one &quot;write&quot; watchpoint on the same memory granule need tobe handled, making the WatchpointResource cover all requests.As WatchpointResources aren&apos;t shared among multiple Watchpoints yet,there&apos;s no handling of running the conditions/commands/etc on multipleWatchpoints when their shared WatchpointResource is hit. The goal beyond&quot;large watchpoint&quot; is to unify (much more) the Watchpoint and Breakpointbehavior and commands. I have a feeling I may be slowly chipping away atthis for a while.rdar://108234227

            List of files:
            /llvm-project/lldb/test/API/functionalities/watchpoint/unaligned-large-watchpoint/TestUnalignedLargeWatchpoint.py</description>
        <pubDate>Wed, 31 Jan 2024 17:40:50 +0000</pubDate>
        <dc:creator>Jason Molenda &lt;jmolenda@apple.com&gt;</dc:creator>
    </item>
</channel>
</rss>
