[lldb][NFC] Fix all formatting errors in .cpp file headers
Summary:
A *.cpp file header in LLDB (and in LLDB) should like this:
```
//===-- TestUtilities.cpp -------------------------------------------------===//
```
However in LLDB most of our source files have arbitrary changes to this format and
these changes are spreading through LLDB as folks usually just use the existing
source files as templates for their new files (most notably the unnecessary
editor language indicator `-*- C++ -*-` is spreading and in every review
someone is pointing out that this is wrong, resulting in people pointing out that this
is done in the same way in other files).
This patch removes most of these inconsistencies including the editor language indicators,
all the different missing/additional '-' characters, files that center the file name, missing
trailing `===//` (mostly caused by clang-format breaking the line).
Reviewers: aprantl, espindola, jfb, shafik, JDevlieghere
Reviewed By: JDevlieghere
Subscribers: dexonsmith, wuzish, emaste, sdardis, nemanjai, kbarton, MaskRay, atanasyan, arphaman, jfb, abidh, jsji, JDevlieghere, usaxena95, lldb-commits
Tags: #lldb
Differential Revision: https://reviews.llvm.org/D73258
2020-01-24 15:23:27 +08:00
|
|
|
//===-- SBAttachInfo.cpp --------------------------------------------------===//
|
2015-02-16 08:04:19 +08:00
|
|
|
//
|
2019-01-19 16:50:56 +08:00
|
|
|
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
|
|
|
|
// See https://llvm.org/LICENSE.txt for license information.
|
|
|
|
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
2015-02-16 08:04:19 +08:00
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
|
|
|
#include "lldb/API/SBAttachInfo.h"
|
2019-03-06 08:05:55 +08:00
|
|
|
#include "Utils.h"
|
2015-02-16 08:04:19 +08:00
|
|
|
#include "lldb/API/SBFileSpec.h"
|
|
|
|
#include "lldb/API/SBListener.h"
|
|
|
|
#include "lldb/Target/Process.h"
|
2022-01-20 03:38:26 +08:00
|
|
|
#include "lldb/Utility/Instrumentation.h"
|
2015-02-16 08:04:19 +08:00
|
|
|
|
|
|
|
using namespace lldb;
|
|
|
|
using namespace lldb_private;
|
|
|
|
|
2019-03-06 08:06:00 +08:00
|
|
|
SBAttachInfo::SBAttachInfo() : m_opaque_sp(new ProcessAttachInfo()) {
|
2022-01-20 03:38:26 +08:00
|
|
|
LLDB_INSTRUMENT_VA(this);
|
2019-03-06 08:06:00 +08:00
|
|
|
}
|
2015-02-16 08:04:19 +08:00
|
|
|
|
|
|
|
SBAttachInfo::SBAttachInfo(lldb::pid_t pid)
|
|
|
|
: m_opaque_sp(new ProcessAttachInfo()) {
|
2022-01-20 03:38:26 +08:00
|
|
|
LLDB_INSTRUMENT_VA(this, pid);
|
2019-03-06 08:06:00 +08:00
|
|
|
|
2015-02-16 08:04:19 +08:00
|
|
|
m_opaque_sp->SetProcessID(pid);
|
|
|
|
}
|
|
|
|
|
|
|
|
SBAttachInfo::SBAttachInfo(const char *path, bool wait_for)
|
|
|
|
: m_opaque_sp(new ProcessAttachInfo()) {
|
2022-01-20 03:38:26 +08:00
|
|
|
LLDB_INSTRUMENT_VA(this, path, wait_for);
|
2019-03-06 08:06:00 +08:00
|
|
|
|
2015-02-16 08:04:19 +08:00
|
|
|
if (path && path[0])
|
2018-11-02 05:05:36 +08:00
|
|
|
m_opaque_sp->GetExecutableFile().SetFile(path, FileSpec::Style::native);
|
2015-02-16 08:04:19 +08:00
|
|
|
m_opaque_sp->SetWaitForLaunch(wait_for);
|
|
|
|
}
|
|
|
|
|
|
|
|
SBAttachInfo::SBAttachInfo(const char *path, bool wait_for, bool async)
|
|
|
|
: m_opaque_sp(new ProcessAttachInfo()) {
|
2022-01-20 03:38:26 +08:00
|
|
|
LLDB_INSTRUMENT_VA(this, path, wait_for, async);
|
2019-03-06 08:06:00 +08:00
|
|
|
|
2015-02-16 08:04:19 +08:00
|
|
|
if (path && path[0])
|
2018-11-02 05:05:36 +08:00
|
|
|
m_opaque_sp->GetExecutableFile().SetFile(path, FileSpec::Style::native);
|
2015-02-16 08:04:19 +08:00
|
|
|
m_opaque_sp->SetWaitForLaunch(wait_for);
|
2015-10-06 06:58:37 +08:00
|
|
|
m_opaque_sp->SetAsync(async);
|
2015-02-16 08:04:19 +08:00
|
|
|
}
|
|
|
|
|
2015-10-06 06:58:37 +08:00
|
|
|
SBAttachInfo::SBAttachInfo(const SBAttachInfo &rhs)
|
|
|
|
: m_opaque_sp(new ProcessAttachInfo()) {
|
2022-01-20 03:38:26 +08:00
|
|
|
LLDB_INSTRUMENT_VA(this, rhs);
|
2019-03-06 08:06:00 +08:00
|
|
|
|
2019-03-06 08:05:55 +08:00
|
|
|
m_opaque_sp = clone(rhs.m_opaque_sp);
|
2015-10-06 06:58:37 +08:00
|
|
|
}
|
|
|
|
|
2020-02-18 14:57:06 +08:00
|
|
|
SBAttachInfo::~SBAttachInfo() = default;
|
2015-02-16 08:04:19 +08:00
|
|
|
|
|
|
|
lldb_private::ProcessAttachInfo &SBAttachInfo::ref() { return *m_opaque_sp; }
|
|
|
|
|
|
|
|
SBAttachInfo &SBAttachInfo::operator=(const SBAttachInfo &rhs) {
|
2022-01-20 03:38:26 +08:00
|
|
|
LLDB_INSTRUMENT_VA(this, rhs);
|
2019-03-06 08:06:00 +08:00
|
|
|
|
2015-02-16 08:04:19 +08:00
|
|
|
if (this != &rhs)
|
2019-03-06 08:05:55 +08:00
|
|
|
m_opaque_sp = clone(rhs.m_opaque_sp);
|
2022-01-10 14:54:08 +08:00
|
|
|
return *this;
|
2015-02-16 08:04:19 +08:00
|
|
|
}
|
|
|
|
|
2019-03-06 08:06:00 +08:00
|
|
|
lldb::pid_t SBAttachInfo::GetProcessID() {
|
2022-01-20 03:38:26 +08:00
|
|
|
LLDB_INSTRUMENT_VA(this);
|
2019-03-06 08:06:00 +08:00
|
|
|
|
|
|
|
return m_opaque_sp->GetProcessID();
|
|
|
|
}
|
2015-02-16 08:04:19 +08:00
|
|
|
|
|
|
|
void SBAttachInfo::SetProcessID(lldb::pid_t pid) {
|
2022-01-20 03:38:26 +08:00
|
|
|
LLDB_INSTRUMENT_VA(this, pid);
|
2019-03-06 08:06:00 +08:00
|
|
|
|
2015-02-16 08:04:19 +08:00
|
|
|
m_opaque_sp->SetProcessID(pid);
|
|
|
|
}
|
|
|
|
|
|
|
|
uint32_t SBAttachInfo::GetResumeCount() {
|
2022-01-20 03:38:26 +08:00
|
|
|
LLDB_INSTRUMENT_VA(this);
|
2019-03-06 08:06:00 +08:00
|
|
|
|
2015-02-16 08:04:19 +08:00
|
|
|
return m_opaque_sp->GetResumeCount();
|
|
|
|
}
|
|
|
|
|
|
|
|
void SBAttachInfo::SetResumeCount(uint32_t c) {
|
2022-01-20 03:38:26 +08:00
|
|
|
LLDB_INSTRUMENT_VA(this, c);
|
2019-03-06 08:06:00 +08:00
|
|
|
|
2015-02-16 08:04:19 +08:00
|
|
|
m_opaque_sp->SetResumeCount(c);
|
|
|
|
}
|
|
|
|
|
|
|
|
const char *SBAttachInfo::GetProcessPluginName() {
|
2022-01-20 03:38:26 +08:00
|
|
|
LLDB_INSTRUMENT_VA(this);
|
2019-03-06 08:06:00 +08:00
|
|
|
|
2015-02-16 08:04:19 +08:00
|
|
|
return m_opaque_sp->GetProcessPluginName();
|
|
|
|
}
|
|
|
|
|
|
|
|
void SBAttachInfo::SetProcessPluginName(const char *plugin_name) {
|
2022-01-20 03:38:26 +08:00
|
|
|
LLDB_INSTRUMENT_VA(this, plugin_name);
|
2019-03-06 08:06:00 +08:00
|
|
|
|
2015-02-16 08:04:19 +08:00
|
|
|
return m_opaque_sp->SetProcessPluginName(plugin_name);
|
|
|
|
}
|
|
|
|
|
|
|
|
void SBAttachInfo::SetExecutable(const char *path) {
|
2022-01-20 03:38:26 +08:00
|
|
|
LLDB_INSTRUMENT_VA(this, path);
|
2019-03-06 08:06:00 +08:00
|
|
|
|
2015-02-16 08:04:19 +08:00
|
|
|
if (path && path[0])
|
2018-11-02 05:05:36 +08:00
|
|
|
m_opaque_sp->GetExecutableFile().SetFile(path, FileSpec::Style::native);
|
2015-02-16 08:04:19 +08:00
|
|
|
else
|
|
|
|
m_opaque_sp->GetExecutableFile().Clear();
|
|
|
|
}
|
|
|
|
|
|
|
|
void SBAttachInfo::SetExecutable(SBFileSpec exe_file) {
|
2022-01-20 03:38:26 +08:00
|
|
|
LLDB_INSTRUMENT_VA(this, exe_file);
|
2019-03-06 08:06:00 +08:00
|
|
|
|
2015-02-16 08:04:19 +08:00
|
|
|
if (exe_file.IsValid())
|
|
|
|
m_opaque_sp->GetExecutableFile() = exe_file.ref();
|
|
|
|
else
|
|
|
|
m_opaque_sp->GetExecutableFile().Clear();
|
|
|
|
}
|
|
|
|
|
|
|
|
bool SBAttachInfo::GetWaitForLaunch() {
|
2022-01-20 03:38:26 +08:00
|
|
|
LLDB_INSTRUMENT_VA(this);
|
2019-03-06 08:06:00 +08:00
|
|
|
|
2015-02-16 08:04:19 +08:00
|
|
|
return m_opaque_sp->GetWaitForLaunch();
|
|
|
|
}
|
|
|
|
|
|
|
|
void SBAttachInfo::SetWaitForLaunch(bool b) {
|
2022-01-20 03:38:26 +08:00
|
|
|
LLDB_INSTRUMENT_VA(this, b);
|
2019-03-06 08:06:00 +08:00
|
|
|
|
2015-02-16 08:04:19 +08:00
|
|
|
m_opaque_sp->SetWaitForLaunch(b);
|
|
|
|
}
|
|
|
|
|
2015-10-06 06:58:37 +08:00
|
|
|
void SBAttachInfo::SetWaitForLaunch(bool b, bool async) {
|
2022-01-20 03:38:26 +08:00
|
|
|
LLDB_INSTRUMENT_VA(this, b, async);
|
2019-03-06 08:06:00 +08:00
|
|
|
|
2015-10-06 06:58:37 +08:00
|
|
|
m_opaque_sp->SetWaitForLaunch(b);
|
|
|
|
m_opaque_sp->SetAsync(async);
|
|
|
|
}
|
|
|
|
|
2015-02-16 08:04:19 +08:00
|
|
|
bool SBAttachInfo::GetIgnoreExisting() {
|
2022-01-20 03:38:26 +08:00
|
|
|
LLDB_INSTRUMENT_VA(this);
|
2019-03-06 08:06:00 +08:00
|
|
|
|
2015-02-16 08:04:19 +08:00
|
|
|
return m_opaque_sp->GetIgnoreExisting();
|
|
|
|
}
|
|
|
|
|
|
|
|
void SBAttachInfo::SetIgnoreExisting(bool b) {
|
2022-01-20 03:38:26 +08:00
|
|
|
LLDB_INSTRUMENT_VA(this, b);
|
2019-03-06 08:06:00 +08:00
|
|
|
|
2015-02-16 08:04:19 +08:00
|
|
|
m_opaque_sp->SetIgnoreExisting(b);
|
|
|
|
}
|
|
|
|
|
2019-03-06 08:06:00 +08:00
|
|
|
uint32_t SBAttachInfo::GetUserID() {
|
2022-01-20 03:38:26 +08:00
|
|
|
LLDB_INSTRUMENT_VA(this);
|
2015-02-16 08:04:19 +08:00
|
|
|
|
2019-03-06 08:06:00 +08:00
|
|
|
return m_opaque_sp->GetUserID();
|
|
|
|
}
|
2015-02-16 08:04:19 +08:00
|
|
|
|
2019-03-06 08:06:00 +08:00
|
|
|
uint32_t SBAttachInfo::GetGroupID() {
|
2022-01-20 03:38:26 +08:00
|
|
|
LLDB_INSTRUMENT_VA(this);
|
2015-02-16 08:04:19 +08:00
|
|
|
|
2019-03-06 08:06:00 +08:00
|
|
|
return m_opaque_sp->GetGroupID();
|
|
|
|
}
|
2015-02-16 08:04:19 +08:00
|
|
|
|
2019-03-06 08:06:00 +08:00
|
|
|
bool SBAttachInfo::UserIDIsValid() {
|
2022-01-20 03:38:26 +08:00
|
|
|
LLDB_INSTRUMENT_VA(this);
|
2015-02-16 08:04:19 +08:00
|
|
|
|
2019-03-06 08:06:00 +08:00
|
|
|
return m_opaque_sp->UserIDIsValid();
|
|
|
|
}
|
|
|
|
|
|
|
|
bool SBAttachInfo::GroupIDIsValid() {
|
2022-01-20 03:38:26 +08:00
|
|
|
LLDB_INSTRUMENT_VA(this);
|
2019-03-06 08:06:00 +08:00
|
|
|
|
|
|
|
return m_opaque_sp->GroupIDIsValid();
|
|
|
|
}
|
|
|
|
|
|
|
|
void SBAttachInfo::SetUserID(uint32_t uid) {
|
2022-01-20 03:38:26 +08:00
|
|
|
LLDB_INSTRUMENT_VA(this, uid);
|
2019-03-06 08:06:00 +08:00
|
|
|
|
|
|
|
m_opaque_sp->SetUserID(uid);
|
|
|
|
}
|
|
|
|
|
|
|
|
void SBAttachInfo::SetGroupID(uint32_t gid) {
|
2022-01-20 03:38:26 +08:00
|
|
|
LLDB_INSTRUMENT_VA(this, gid);
|
2019-03-06 08:06:00 +08:00
|
|
|
|
|
|
|
m_opaque_sp->SetGroupID(gid);
|
|
|
|
}
|
2015-02-16 08:04:19 +08:00
|
|
|
|
|
|
|
uint32_t SBAttachInfo::GetEffectiveUserID() {
|
2022-01-20 03:38:26 +08:00
|
|
|
LLDB_INSTRUMENT_VA(this);
|
2019-03-06 08:06:00 +08:00
|
|
|
|
2015-02-16 08:04:19 +08:00
|
|
|
return m_opaque_sp->GetEffectiveUserID();
|
|
|
|
}
|
|
|
|
|
|
|
|
uint32_t SBAttachInfo::GetEffectiveGroupID() {
|
2022-01-20 03:38:26 +08:00
|
|
|
LLDB_INSTRUMENT_VA(this);
|
2019-03-06 08:06:00 +08:00
|
|
|
|
2015-02-16 08:04:19 +08:00
|
|
|
return m_opaque_sp->GetEffectiveGroupID();
|
|
|
|
}
|
|
|
|
|
|
|
|
bool SBAttachInfo::EffectiveUserIDIsValid() {
|
2022-01-20 03:38:26 +08:00
|
|
|
LLDB_INSTRUMENT_VA(this);
|
2019-03-06 08:06:00 +08:00
|
|
|
|
2015-02-16 08:04:19 +08:00
|
|
|
return m_opaque_sp->EffectiveUserIDIsValid();
|
|
|
|
}
|
|
|
|
|
|
|
|
bool SBAttachInfo::EffectiveGroupIDIsValid() {
|
2022-01-20 03:38:26 +08:00
|
|
|
LLDB_INSTRUMENT_VA(this);
|
2019-03-06 08:06:00 +08:00
|
|
|
|
2015-02-16 08:04:19 +08:00
|
|
|
return m_opaque_sp->EffectiveGroupIDIsValid();
|
|
|
|
}
|
|
|
|
|
|
|
|
void SBAttachInfo::SetEffectiveUserID(uint32_t uid) {
|
2022-01-20 03:38:26 +08:00
|
|
|
LLDB_INSTRUMENT_VA(this, uid);
|
2019-03-06 08:06:00 +08:00
|
|
|
|
2015-02-16 08:04:19 +08:00
|
|
|
m_opaque_sp->SetEffectiveUserID(uid);
|
|
|
|
}
|
|
|
|
|
|
|
|
void SBAttachInfo::SetEffectiveGroupID(uint32_t gid) {
|
2022-01-20 03:38:26 +08:00
|
|
|
LLDB_INSTRUMENT_VA(this, gid);
|
2019-03-06 08:06:00 +08:00
|
|
|
|
2015-02-16 08:04:19 +08:00
|
|
|
m_opaque_sp->SetEffectiveGroupID(gid);
|
|
|
|
}
|
|
|
|
|
|
|
|
lldb::pid_t SBAttachInfo::GetParentProcessID() {
|
2022-01-20 03:38:26 +08:00
|
|
|
LLDB_INSTRUMENT_VA(this);
|
2019-03-06 08:06:00 +08:00
|
|
|
|
2015-02-16 08:04:19 +08:00
|
|
|
return m_opaque_sp->GetParentProcessID();
|
|
|
|
}
|
|
|
|
|
|
|
|
void SBAttachInfo::SetParentProcessID(lldb::pid_t pid) {
|
2022-01-20 03:38:26 +08:00
|
|
|
LLDB_INSTRUMENT_VA(this, pid);
|
2019-03-06 08:06:00 +08:00
|
|
|
|
2015-02-16 08:04:19 +08:00
|
|
|
m_opaque_sp->SetParentProcessID(pid);
|
|
|
|
}
|
|
|
|
|
|
|
|
bool SBAttachInfo::ParentProcessIDIsValid() {
|
2022-01-20 03:38:26 +08:00
|
|
|
LLDB_INSTRUMENT_VA(this);
|
2019-03-06 08:06:00 +08:00
|
|
|
|
2015-02-16 08:04:19 +08:00
|
|
|
return m_opaque_sp->ParentProcessIDIsValid();
|
|
|
|
}
|
|
|
|
|
|
|
|
SBListener SBAttachInfo::GetListener() {
|
2022-01-20 03:38:26 +08:00
|
|
|
LLDB_INSTRUMENT_VA(this);
|
2019-03-06 08:06:00 +08:00
|
|
|
|
2022-01-10 14:54:08 +08:00
|
|
|
return SBListener(m_opaque_sp->GetListener());
|
2015-02-16 08:04:19 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
void SBAttachInfo::SetListener(SBListener &listener) {
|
2022-01-20 03:38:26 +08:00
|
|
|
LLDB_INSTRUMENT_VA(this, listener);
|
2019-03-06 08:06:00 +08:00
|
|
|
|
2015-02-16 08:04:19 +08:00
|
|
|
m_opaque_sp->SetListener(listener.GetSP());
|
|
|
|
}
|