[all-commits] [llvm/llvm-project] e2fb81: Add new API in SBTarget for loading core from SBFi...

GeorgeHuyubo via All-commits all-commits at lists.llvm.org
Fri Nov 17 09:53:25 PST 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: e2fb816c4f0286ddf8b1030148a343d5efc14e01
      https://github.com/llvm/llvm-project/commit/e2fb816c4f0286ddf8b1030148a343d5efc14e01
  Author: GeorgeHuyubo <113479859+GeorgeHuyubo at users.noreply.github.com>
  Date:   2023-11-17 (Fri, 17 Nov 2023)

  Changed paths:
    M lldb/include/lldb/API/SBTarget.h
    M lldb/source/API/SBTarget.cpp
    M lldb/test/API/functionalities/postmortem/elf-core/TestLinuxCore.py

  Log Message:
  -----------
  Add new API in SBTarget for loading core from SBFile (#71769)

Add a new API in SBTarget to Load Core from a SBFile.
This will enable a target to load core from a file descriptor.
So that in coredumper, we don't need to write core file to disk, instead
we can pass the input file descriptor to lldb directly.


Test:
```
(lldb) script
Python Interactive Interpreter. To exit, type 'quit()', 'exit()' or Ctrl-D.
>>> file_object = open("/home/hyubo/210hda79ms32sr0h", "r")
>>> fd=file_object.fileno()
>>> file = lldb.SBFile(fd,'r', True)
>>> error = lldb.SBError()
>>> target = lldb.debugger.CreateTarget(None)
>>> target.LoadCore(file,error)
SBProcess: pid = 56415, state = stopped, threads = 1
```




More information about the All-commits mailing list