forked from OSchip/llvm-project
Modified patch from Prabhat Verma to enable loading core files through the SBTarget API.
llvm-svn: 177932
This commit is contained in:
parent
cd3d440b82
commit
4d8ad55c78
|
@ -366,6 +366,9 @@ public:
|
|||
|
||||
SBProcess
|
||||
Launch (SBLaunchInfo &launch_info, SBError& error);
|
||||
|
||||
SBProcess
|
||||
LoadCore (const char *core_file);
|
||||
|
||||
SBProcess
|
||||
Attach (SBAttachInfo &attach_info, SBError& error);
|
||||
|
|
|
@ -389,6 +389,26 @@ public:
|
|||
|
||||
lldb::SBProcess
|
||||
Launch (lldb::SBLaunchInfo &launch_info, lldb::SBError& error);
|
||||
|
||||
%feature("docstring", "
|
||||
//------------------------------------------------------------------
|
||||
/// Load a core file
|
||||
///
|
||||
/// @param[in] core_file
|
||||
/// File path of the core dump.
|
||||
///
|
||||
/// @return
|
||||
/// A process object for the newly created core file.
|
||||
//------------------------------------------------------------------
|
||||
|
||||
For example,
|
||||
|
||||
process = target.LoadCore('./a.out.core')
|
||||
|
||||
loads a new core file and returns the process object.
|
||||
") LoadCore;
|
||||
lldb::SBProcess
|
||||
LoadCore(const char *core_file);
|
||||
|
||||
lldb::SBProcess
|
||||
Attach (lldb::SBAttachInfo &attach_info, lldb::SBError& error);
|
||||
|
|
|
@ -556,6 +556,26 @@ SBTarget::GetDebugger () const
|
|||
return debugger;
|
||||
}
|
||||
|
||||
SBProcess
|
||||
SBTarget::LoadCore (const char *core_file)
|
||||
{
|
||||
SBProcess sb_process;
|
||||
TargetSP target_sp(GetSP());
|
||||
if (target_sp)
|
||||
{
|
||||
FileSpec filespec(core_file, true);
|
||||
ProcessSP process_sp (target_sp->CreateProcess(target_sp->GetDebugger().GetListener(),
|
||||
NULL,
|
||||
&filespec));
|
||||
if (process_sp)
|
||||
{
|
||||
process_sp->LoadCore();
|
||||
sb_process.SetSP (process_sp);
|
||||
}
|
||||
}
|
||||
return sb_process;
|
||||
}
|
||||
|
||||
SBProcess
|
||||
SBTarget::LaunchSimple
|
||||
(
|
||||
|
|
Loading…
Reference in New Issue