================ @@ -0,0 +1,31 @@ +#extend lldb::SBSaveCoreOptions { +#ifdef SWIGPYTHON + %pythoncode% { + '''Add a thread to the SaveCoreOptions thread list, and follow it's children N pointers deep, adding each memory region to the SaveCoreOptions Memory region list.''' + def save_thread_with_heaps(self, thread, num_pointers_deep = 3): + self.AddThread(thread) + frame = thread.GetFrameAtIndex(0) + process = thread.GetProcess() + queue = [] + for var in frame.locals: + if var.TypeIsPointerType(): + queue.append(var.Dereference()) + + while (num_pointers_deep > 0 and len(queue) > 0): + queue_size = len(queue) + for i in range(0, queue_size): + var = queue.pop(0) + memory_region = lldb.SBMemoryRegionInfo() + process.GetMemoryRegionInfo(var.GetAddress().GetOffset(), memory_region) + self.AddMemoryRegionToSave(memory_region) ---------------- Jlalond wrote:
The save-core impl will actually just omit a non readable/corrupted memory. We could have the concern that we get an a memory range that is massive, like `2^60-2^64`, but I think that's a generic concern of this API https://github.com/llvm/llvm-project/pull/111601 _______________________________________________ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits