Please use GitHub pull requests for new patches. Avoid migrating existing patches. Phabricator shutdown timeline
Changeset View
Changeset View
Standalone View
Standalone View
source/API/SBTarget.cpp
//===-- SBTarget.cpp --------------------------------------------*- C++ -*-===// | //===-- SBTarget.cpp --------------------------------------------*- C++ -*-===// | ||||
// | // | ||||
// The LLVM Compiler Infrastructure | // The LLVM Compiler Infrastructure | ||||
// | // | ||||
// This file is distributed under the University of Illinois Open Source | // This file is distributed under the University of Illinois Open Source | ||||
// License. See LICENSE.TXT for details. | // License. See LICENSE.TXT for details. | ||||
// | // | ||||
//===----------------------------------------------------------------------===// | //===----------------------------------------------------------------------===// | ||||
#include "lldb/lldb-python.h" | #include "lldb/lldb-python.h" | ||||
#include "lldb/API/SBTarget.h" | #include "lldb/API/SBTarget.h" | ||||
#include "lldb/lldb-public.h" | #include "lldb/lldb-public.h" | ||||
#include "lldb/API/SBDebugger.h" | #include "lldb/API/SBDebugger.h" | ||||
clayborg: Remove this. | |||||
#include "lldb/API/SBBreakpoint.h" | #include "lldb/API/SBBreakpoint.h" | ||||
#include "lldb/API/SBExpressionOptions.h" | #include "lldb/API/SBExpressionOptions.h" | ||||
#include "lldb/API/SBFileSpec.h" | #include "lldb/API/SBFileSpec.h" | ||||
#include "lldb/API/SBListener.h" | #include "lldb/API/SBListener.h" | ||||
#include "lldb/API/SBModule.h" | #include "lldb/API/SBModule.h" | ||||
#include "lldb/API/SBModuleSpec.h" | #include "lldb/API/SBModuleSpec.h" | ||||
#include "lldb/API/SBSourceManager.h" | #include "lldb/API/SBSourceManager.h" | ||||
#include "lldb/API/SBProcess.h" | #include "lldb/API/SBProcess.h" | ||||
▲ Show 20 Lines • Show All 2,538 Lines • ▼ Show 20 Lines | if (target_sp) | ||||
abi_sp = process_sp->GetABI(); | abi_sp = process_sp->GetABI(); | ||||
else | else | ||||
abi_sp = ABI::FindPlugin(target_sp->GetArchitecture()); | abi_sp = ABI::FindPlugin(target_sp->GetArchitecture()); | ||||
if (abi_sp) | if (abi_sp) | ||||
return abi_sp->GetRedZoneSize(); | return abi_sp->GetRedZoneSize(); | ||||
} | } | ||||
return 0; | return 0; | ||||
} | } | ||||
lldb::SBLaunchInfo | |||||
SBTarget::GetLaunchInfo () const | |||||
{ | |||||
clayborgUnsubmitted Not Done ReplyInline ActionsYou must check that m_opaque_sp is valid and also make a copy of it before you use it in case another thread calls SBThread::Clear(): TargetSP target_sp(GetSP()); if (target_sp) { ProcessLaunchInfo launch_info = m_opaque_sp->GetProcessLaunchInfo(); lldb::SBLaunchInfo sb_launch_info(NULL); sb_launch_info.ref() = launch_info; return sb_launch_info; } return lldb::SBLaunchInfo(); clayborg: You must check that m_opaque_sp is valid and also make a copy of it before you use it in case… | |||||
ki.stfuAuthorUnsubmitted Not Done ReplyInline Actionsoops.. ki.stfu: oops.. | |||||
ProcessLaunchInfo launch_info = m_opaque_sp->GetProcessLaunchInfo(); | |||||
lldb::SBLaunchInfo sb_launch_info(NULL); | |||||
sb_launch_info.ref() = launch_info; | |||||
return sb_launch_info; | |||||
} | |||||
void | |||||
SBTarget::SetLaunchInfo (const lldb::SBLaunchInfo &sb_launch_info) | |||||
{ | |||||
m_opaque_sp->SetProcessLaunchInfo(sb_launch_info.ref()); | |||||
clayborgUnsubmitted Not Done ReplyInline ActionsReplace with: TargetSP target_sp(GetSP()); if (target_sp) { m_opaque_sp->SetProcessLaunchInfo(sb_launch_info.ref()); } You might also want to change this to return a bool in case m_opaque_sp is invalid, you can return false. clayborg: Replace with:
```
TargetSP target_sp(GetSP());
if (target_sp)
{
m_opaque_sp… | |||||
} | |||||
Not Done ReplyInline ActionsRemove this. clayborg: Remove this. |
Remove this.