qiyao wrote:
>
> do you think it's worth testing that the stack frame memory is correctly
> expedited in the stop reply packet in this test, too? If we ever regressed
> that, it would slow every private stop in lldb.
They tested it already. `test_stop_reply_expedites_frame_pointer_backchain`
checks `memory:` entry in stop reply is only about frame backchain, it fails if
`memory:` has anything else, for example, if expedited stack memory goes into
stop reply by mistake,
```
+ backchain_entry_size = 2 * results["ptrsize"]
+ for entry in entries:
+ addr, sep, hex_bytes = entry.partition("=")
+ self.assertEqual(sep, "=", "malformed memory entry %r" % entry)
+ self.assertEqual(
+ len(hex_bytes),
+ 2 * backchain_entry_size,
+ "memory:%s= should carry %d bytes (2 * ptrsize), got %d: %r"
+ % (addr, backchain_entry_size, len(hex_bytes) // 2, entry),
+ )
```
OTOH, `test_threads_info_expedites_stopped_frame_stack` checks the reply to
`jThreadsInfo` must have expedited stack memory in stop thread only,
```
+ if thread_info["tid"] == stopped_tid:
+ saw_stopped = True
+ # One chunk, or two when $fp is usable.
+ self.assertIn(
+ len(frame_0_stack_memory),
+ (1, 2),
+ "no frame 0 stack memory for stopped %s" % where,
+ )
+ else:
+ self.assertEqual(
+ frame_0_stack_memory,
+ [],
+ "unexpected frame 0 stack memory for %s" % where,
+ )
```
https://github.com/llvm/llvm-project/pull/216165
_______________________________________________
lldb-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits