https://github.com/jeffreytan81 updated
https://github.com/llvm/llvm-project/pull/80767
>From e7af15ff3c1bdd42799b25f76145b8a19739eea5 Mon Sep 17 00:00:00 2001
From: jeffreytan81
Date: Mon, 5 Feb 2024 15:58:23 -0800
Subject: [PATCH 1/3] Add a new SBProcess:: GetCoreFile() API
---
lldb/include
https://github.com/jeffreytan81 updated
https://github.com/llvm/llvm-project/pull/80767
>From e7af15ff3c1bdd42799b25f76145b8a19739eea5 Mon Sep 17 00:00:00 2001
From: jeffreytan81
Date: Mon, 5 Feb 2024 15:58:23 -0800
Subject: [PATCH 1/2] Add a new SBProcess:: GetCoreFile() API
---
lldb/include
jeffreytan81 wrote:
@bulbazord, the scenario is that user directly uses "lldb -c " to
load core file, then the python script is invoked later to fetch metadata,
resolve binaries/symbols etc...
https://github.com/llvm/llvm-project/pull/80767
___
lldb-
@@ -398,6 +398,13 @@ class LLDB_API SBProcess {
/// valid.
lldb::SBProcessInfo GetProcessInfo();
+ /// Return target dump file during postmortem debugging.
+ /// An empty file will be returned for live debugging.
+ ///
+ /// \return
+ /// The target dump file spec
https://github.com/jasonmolenda edited
https://github.com/llvm/llvm-project/pull/80767
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
@@ -1244,6 +1244,17 @@ lldb::SBProcessInfo SBProcess::GetProcessInfo() {
return sb_proc_info;
}
+lldb::SBFileSpec SBProcess::GetCoreFile() {
+ LLDB_INSTRUMENT_VA(this);
+
+ ProcessSP process_sp(GetSP());
+ FileSpec core_file;
+ if (process_sp) {
+core_file = process_
jasonmolenda wrote:
This seems like a useful addition to me, I've had some users of corefiles who
have asked for an SBProcess::IsCore() type of method. (and others asking for
ways to access metadata from the corefile itself via the Process, although I've
never thought about how to do that, ma
@@ -1244,6 +1244,17 @@ lldb::SBProcessInfo SBProcess::GetProcessInfo() {
return sb_proc_info;
}
+lldb::SBFileSpec SBProcess::GetCoreFile() {
+ LLDB_INSTRUMENT_VA(this);
+
+ ProcessSP process_sp(GetSP());
+ FileSpec core_file;
+ if (process_sp) {
+core_file = process_
@@ -398,6 +398,13 @@ class LLDB_API SBProcess {
/// valid.
lldb::SBProcessInfo GetProcessInfo();
+ /// Return target dump file during postmortem debugging.
+ /// An empty file will be returned for live debugging.
+ ///
+ /// \return
+ /// The target dump file spec
@@ -404,7 +404,7 @@ bool ProcessMachCore::LoadBinariesViaMetadata() {
// LoadCoreFileImges may have set the dynamic loader, e.g. in
// PlatformDarwinKernel::LoadPlatformBinaryAndSetup().
- // If we now have a dynamic loader, save its name so we don't
+ // If we now have
@@ -1244,6 +1244,17 @@ lldb::SBProcessInfo SBProcess::GetProcessInfo() {
return sb_proc_info;
}
+lldb::SBFileSpec SBProcess::GetCoreFile() {
+ LLDB_INSTRUMENT_VA(this);
+
+ ProcessSP process_sp(GetSP());
+ FileSpec core_file;
+ if (process_sp) {
+core_file = process_
@@ -261,7 +261,7 @@ Status ProcessElfCore::DoLoadCore() {
exe_module_spec.GetFileSpec().SetFile(m_nt_file_entries[0].path,
FileSpec::Style::native);
if (exe_module_spec.GetFileSpec()) {
-exe_module_sp = GetTarget()
@@ -398,6 +398,13 @@ class LLDB_API SBProcess {
/// valid.
lldb::SBProcessInfo GetProcessInfo();
+ /// Return target dump file during postmortem debugging.
+ /// An empty file will be returned for live debugging.
+ ///
+ /// \return
+ /// The target dump file spec
@@ -398,6 +398,13 @@ class LLDB_API SBProcess {
/// valid.
lldb::SBProcessInfo GetProcessInfo();
+ /// Return target dump file during postmortem debugging.
+ /// An empty file will be returned for live debugging.
clayborg wrote:
```
/// Get the file spe
@@ -865,7 +865,7 @@ llvm::Error
ProcessElfCore::parseOpenBSDNotes(llvm::ArrayRef notes) {
/// - NT_SIGINFO - Information about the signal that terminated the process
/// - NT_AUXV - Process auxiliary vector
/// - NT_FILE - Files mapped into memory
-///
+///
c
@@ -224,7 +224,7 @@ Status ProcessElfCore::DoLoadCore() {
ArchSpec core_arch(m_core_module_sp->GetArchitecture());
target_arch.MergeFrom(core_arch);
GetTarget().SetArchitecture(target_arch);
-
+
clayborg wrote:
revert whitespace only change
https://git
https://github.com/clayborg edited
https://github.com/llvm/llvm-project/pull/80767
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
https://github.com/clayborg requested changes to this pull request.
https://github.com/llvm/llvm-project/pull/80767
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
@@ -398,6 +398,13 @@ class LLDB_API SBProcess {
/// valid.
lldb::SBProcessInfo GetProcessInfo();
+ /// Return target dump file during postmortem debugging.
+ /// An empty file will be returned for live debugging.
+ ///
+ /// \return
+ /// The target dump file spec
bulbazord wrote:
I'm not sure I understand. Why do you need to get the path to the core file
through the SBAPI? Didn't you also load it through the SBAPI too?
https://github.com/llvm/llvm-project/pull/80767
___
lldb-commits mailing list
lldb-commits@l
github-actions[bot] wrote:
:warning: C/C++ code formatter, clang-format found issues in your code.
:warning:
You can test this locally with the following command:
``bash
git-clang-format --diff a7bc9cb6ffa91ff0ebabc45c0c7263c7c2c3a4de
e7af15ff3c1bdd42799b25f76145b8a19739eea5 --
llvmbot wrote:
@llvm/pr-subscribers-lldb
Author: None (jeffreytan81)
Changes
We have a Python script that needs to locate coredump path during debugging so
that we can retrieve certain metadata files associated with it. Currently,
there is no API for this.
This patch adds a new `SBProce
https://github.com/jeffreytan81 ready_for_review
https://github.com/llvm/llvm-project/pull/80767
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
https://github.com/jeffreytan81 created
https://github.com/llvm/llvm-project/pull/80767
We have a Python script that needs to locate coredump path during debugging so
that we can retrieve certain metadata files associated with it. Currently,
there is no API for this.
This patch adds a new `SB
24 matches
Mail list logo