forked from OSchip/llvm-project
Only include the stack memory for the caller stack
frame, don't go any further, in RNBRemote::SendStopReplyPacketForThread. These are the memory pre-fetches in the T05 packet and are included in every private stop that lldb does. lldb needs, at most, the caller stack frame so we're sending more data than needed by including additional stack memory prefetches in this reply packet. Once we've stopped for a public stop, we're going to do a jThreadsInfo which will include the stack memory prefetches for all threads, including the one which had the stop reason. llvm-svn: 242380
This commit is contained in:
parent
86a86cf725
commit
d25d72fb79
|
@ -2573,7 +2573,7 @@ typedef std::map<nub_addr_t, StackMemory> StackMemoryMap;
|
|||
|
||||
|
||||
static void
|
||||
ReadStackMemory (nub_process_t pid, nub_thread_t tid, StackMemoryMap &stack_mmap)
|
||||
ReadStackMemory (nub_process_t pid, nub_thread_t tid, StackMemoryMap &stack_mmap, uint32_t backtrace_limit = 256)
|
||||
{
|
||||
DNBRegisterValue reg_value;
|
||||
if (DNBThreadGetRegisterValueByID(pid, tid, REGISTER_SET_GENERIC, GENERIC_REGNUM_FP, ®_value))
|
||||
|
@ -2588,7 +2588,7 @@ ReadStackMemory (nub_process_t pid, nub_thread_t tid, StackMemoryMap &stack_mmap
|
|||
{
|
||||
// Make sure we never recurse more than 256 times so we don't recurse too far or
|
||||
// store up too much memory in the expedited cache
|
||||
if (++frame_count > 256)
|
||||
if (++frame_count > backtrace_limit)
|
||||
break;
|
||||
|
||||
const nub_size_t read_size = reg_value.info.size*2;
|
||||
|
@ -2791,7 +2791,7 @@ RNBRemote::SendStopReplyPacketForThread (nub_thread_t tid)
|
|||
// Add expedited stack memory so stack backtracing doesn't need to read anything from the
|
||||
// frame pointer chain.
|
||||
StackMemoryMap stack_mmap;
|
||||
ReadStackMemory (pid, tid, stack_mmap);
|
||||
ReadStackMemory (pid, tid, stack_mmap, 1);
|
||||
if (!stack_mmap.empty())
|
||||
{
|
||||
for (const auto &stack_memory : stack_mmap)
|
||||
|
|
Loading…
Reference in New Issue