[Lldb-commits] [lldb] [LLDB] On AArch64, reconfigure register context first (PR #70742)

David Spickett via lldb-commits lldb-commits at lists.llvm.org
Tue Oct 31 04:45:19 PDT 2023


DavidSpickett wrote:

This passed all the tests, and I see a reduction in the packets sent for a single step.

The value of vg is 8 and svg 4 is 4 in this case.

Before:
```
(lldb) b-remote.async>  < 800> read packet: $T05thread:p56d.56d;name:main.o;threads:56d;thread-pcs:000000000040056c;00:0000000000000000;01:38f5ffffffff0000;02:48f5ffffffff0000;03:8804400000000000;04:0000000000000000;05:3d170907e9f5e52b;06:0886fcf7ffff0000;07:0000000000010000;08:ffffffffffffffff;09:ffffffffffffff00;0a:0000000000000000;0b:1000000000000000;0c:0822e6f7ffff0000;0d:0000000000000000;0e:0000000000000000;0f:47ffff6f00000000;10:a8efe7f7ffff0000;11:0000420000000000;12:4062517300000000;13:7005400000000000;14:0000000000000000;15:5004400000000000;16:0000000000000000;17:0000000000000000;18:0000000000000000;19:0000000000000000;1a:0000000000000000;1b:0000000000000000;1c:0000000000000000;1d:e0f3ffffffff0000;1e:90f0e7f7ffff0000;1f:e0f3ffffffff0000;20:6c05400000000000;21:00002060;a1:0800000000000000;d9:0400000000000000;reason:trace;#c9
intern-state     <  20> send packet: $pa1;thread:056d;#29
intern-state     <  20> read packet: $0800000000000000#08
intern-state     <  20> send packet: $pd9;thread:056d;#34
intern-state     <  20> read packet: $0400000000000000#04
intern-state     <  20> send packet: $p20;thread:056d;#f9
intern-state     <  20> read packet: $6c05400000000000#42
intern-state     <  20> send packet: $p1f;thread:056d;#2e
intern-state     <  20> read packet: $e0f3ffffffff0000#1e
intern-state     <  20> send packet: $p1e;thread:056d;#2d
intern-state     <  20> read packet: $90f0e7f7ffff0000#90
intern-state     <  21> send packet: $xfffffffff200,200#5e
intern-state     < 516> read packet: $e4f2ffffffff0000000000000000000010f3ffffffff0000905efdf7ffff000030f4ffffffff00000000000000000000b035fff7ffff0000010000000000000000f2fff7ffff0000c8f3ffffffff0000b8f3ffffffff00002e4e3df600000000270340000000000098f5fff7ffff0000e4f2ffffffff0000e8f2ffffffff000038f5d80300000000d802400000000000c8f3ffffffff0000c079fef7ffff00000100000000000000b8f3ffffffff0000b035fff7ffff000000000000000000006035fff7ffff00000100000000000000030000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000010000000000000000f2fff7ffff000000f4ffffffff0000749efdf7ffff00000000420000000000203bfff7ffff00002043fff7ffff0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000a0f3ffffffff00003c4be9f7ffff0000a0f3ffffffff0000ac05400000000000e0f3ffffffff000038f0e7f7ffff000070054000000000000000000000000000e0f3ffffffff000054f0e7f7ffff0000700540000000000000000000000000000000000000000000840440000000000000000000000000000000000000000000#71
intern-state     <  15> send packet: $Z0,400568,4#4d
intern-state     <   6> read packet: $OK#9a
dbg.evt-handler  <  16> send packet: $jThreadsInfo#c1
dbg.evt-handler  < 224> read packet: $[{"name":"main.o","reason":"trace","registers":{"161":"0800000000000000","217":"0400000000000000","29":"e0f3ffffffff0000","30":"90f0e7f7ffff0000","31":"e0f3ffffffff0000","32":"6c05400000000000"}],"signal":5,"tid":1389}]]#76
dbg.evt-handler  <  20> send packet: $pa1;thread:056d;#29
dbg.evt-handler  <  20> read packet: $0800000000000000#08
dbg.evt-handler  <  20> send packet: $pd9;thread:056d;#34
dbg.evt-handler  <  20> read packet: $0400000000000000#04
dbg.evt-handler  <  20> send packet: $p20;thread:056d;#f9
dbg.evt-handler  <  20> read packet: $6c05400000000000#42
```

After:
```
(lldb) b-remote.async>  < 800> read packet: $T05thread:p514.514;name:main.o;threads:514;thread-pcs:000000000040056c;00:0000000000000000;01:38f5ffffffff0000;02:48f5ffffffff0000;03:8804400000000000;04:0000000000000000;05:b610134a0aa5296f;06:0886fcf7ffff0000;07:0000000000010000;08:ffffffffffffffff;09:ffffffffffffff00;0a:0000000000000000;0b:1000000000000000;0c:0822e6f7ffff0000;0d:0000000000000000;0e:0000000000000000;0f:47ffff6f00000000;10:a8efe7f7ffff0000;11:0000420000000000;12:4062517300000000;13:7005400000000000;14:0000000000000000;15:5004400000000000;16:0000000000000000;17:0000000000000000;18:0000000000000000;19:0000000000000000;1a:0000000000000000;1b:0000000000000000;1c:0000000000000000;1d:e0f3ffffffff0000;1e:90f0e7f7ffff0000;1f:e0f3ffffffff0000;20:6c05400000000000;21:00002060;a1:0800000000000000;d9:0400000000000000;reason:trace;#14
intern-state     <  20> send packet: $pa1;thread:0514;#f4
intern-state     <  20> read packet: $0800000000000000#08
intern-state     <  20> send packet: $pd9;thread:0514;#ff
intern-state     <  20> read packet: $0400000000000000#04
intern-state     <  21> send packet: $xfffffffff200,200#5e
intern-state     < 516> read packet: $e4f2ffffffff0000000000000000000010f3ffffffff0000905efdf7ffff000030f4ffffffff00000000000000000000b035fff7ffff0000010000000000000000f2fff7ffff0000c8f3ffffffff0000b8f3ffffffff00002e4e3df600000000270340000000000098f5fff7ffff0000e4f2ffffffff0000e8f2ffffffff000038f5d80300000000d802400000000000c8f3ffffffff0000c079fef7ffff00000100000000000000b8f3ffffffff0000b035fff7ffff000000000000000000006035fff7ffff00000100000000000000030000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000010000000000000000f2fff7ffff000000f4ffffffff0000749efdf7ffff00000000420000000000203bfff7ffff00002043fff7ffff0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000a0f3ffffffff00003c4be9f7ffff0000a0f3ffffffff0000ac05400000000000e0f3ffffffff000038f0e7f7ffff000070054000000000000000000000000000e0f3ffffffff000054f0e7f7ffff0000700540000000000000000000000000000000000000000000840440000000000000000000000000000000000000000000#71
intern-state     <  15> send packet: $Z0,400568,4#4d
intern-state     <   6> read packet: $OK#9a
dbg.evt-handler  <  16> send packet: $jThreadsInfo#c1
dbg.evt-handler  < 224> read packet: $[{"name":"main.o","reason":"trace","registers":{"161":"0800000000000000","217":"0400000000000000","29":"e0f3ffffffff0000","30":"90f0e7f7ffff0000","31":"e0f3ffffffff0000","32":"6c05400000000000"}],"signal":5,"tid":1300}]]#65
dbg.evt-handler  <  20> send packet: $pa1;thread:0514;#f4
dbg.evt-handler  <  20> read packet: $0800000000000000#08
dbg.evt-handler  <  20> send packet: $pd9;thread:0514;#ff
dbg.evt-handler  <  20> read packet: $0400000000000000#04
```

So this is an improvement but now I wonder why even expedite the vg and svg registers if we're going to reconfigure before parsing them, which means we send a register read anyway.

Potential workarounds:
* Invalidate only registers we know can change size.
* Parse the expedited registers once, reconfigure then parse them *again*. On the assumption that no scalable register will ever be in the expedited set.

Not sure that's your responsibility to fix, so this change could go in as is and I'll look into the rest if you like.



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


More information about the lldb-commits mailing list