Skip to content

Commit d906079

Browse files
committed
[lldb] Fix trailing whitespace in Breakpoint (NFC)
Working in the Breakpoint library is a minefield if you have your editor configured to trim trailing whitespace. Remove it and format the affected lines.
1 parent 5cf4537 commit d906079

File tree

7 files changed

+52
-55
lines changed

7 files changed

+52
-55
lines changed

lldb/include/lldb/Breakpoint/BreakpointName.h

Lines changed: 36 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -32,34 +32,35 @@ class BreakpointName {
3232
class Permissions
3333
{
3434
public:
35-
36-
enum PermissionKinds { listPerm = 0, disablePerm = 1,
37-
deletePerm = 2, allPerms = 3 };
35+
enum PermissionKinds {
36+
listPerm = 0,
37+
disablePerm = 1,
38+
deletePerm = 2,
39+
allPerms = 3
40+
};
3841

39-
Permissions(bool in_list, bool in_disable, bool in_delete)
40-
{
42+
Permissions(bool in_list, bool in_disable, bool in_delete) {
4143
m_permissions[listPerm] = in_list;
4244
m_permissions[disablePerm] = in_disable;
4345
m_permissions[deletePerm] = in_delete;
4446
m_set_mask.Set(permissions_mask[allPerms]);
4547
}
46-
48+
4749
Permissions(const Permissions &rhs)
4850
{
4951
m_permissions[listPerm] = rhs.m_permissions[listPerm];
5052
m_permissions[disablePerm] = rhs.m_permissions[disablePerm];
5153
m_permissions[deletePerm] = rhs.m_permissions[deletePerm];
5254
m_set_mask = rhs.m_set_mask;
5355
}
54-
55-
Permissions()
56-
{
56+
57+
Permissions() {
5758
m_permissions[listPerm] = true;
5859
m_permissions[disablePerm] = true;
5960
m_permissions[deletePerm] = true;
6061
m_set_mask.Clear();
6162
}
62-
63+
6364
const Permissions &operator= (const Permissions &rhs)
6465
{
6566
if (this != &rhs) {
@@ -70,11 +71,11 @@ class BreakpointName {
7071
}
7172
return *this;
7273
}
73-
74+
7475
void Clear() {
7576
*this = Permissions();
7677
}
77-
78+
7879
// Merge the permissions from incoming into this set of permissions. Only
7980
// merge set permissions, and most restrictive permission wins.
8081
void MergeInto(const Permissions &incoming)
@@ -86,13 +87,14 @@ class BreakpointName {
8687

8788
bool GetAllowList() const { return GetPermission(listPerm); }
8889
bool SetAllowList(bool value) { return SetPermission(listPerm, value); }
89-
90+
9091
bool GetAllowDelete() const { return GetPermission(deletePerm); }
9192
bool SetAllowDelete(bool value) { return SetPermission(deletePerm, value); }
92-
93+
9394
bool GetAllowDisable() const { return GetPermission(disablePerm); }
94-
bool SetAllowDisable(bool value) { return SetPermission(disablePerm,
95-
value); }
95+
bool SetAllowDisable(bool value) {
96+
return SetPermission(disablePerm, value);
97+
}
9698

9799
bool GetPermission(enum PermissionKinds permission) const
98100
{
@@ -105,85 +107,84 @@ class BreakpointName {
105107
{
106108
return m_set_mask.Test(permissions_mask[permission]);
107109
}
108-
110+
109111
bool AnySet() {
110112
return m_set_mask.AnySet(permissions_mask[allPerms]);
111113
}
112-
114+
113115
private:
114116
static const Flags::ValueType permissions_mask[allPerms + 1];
115-
117+
116118
bool m_permissions[allPerms];
117119
Flags m_set_mask;
118-
120+
119121
bool SetPermission(enum PermissionKinds permission, bool value)
120122
{
121123
bool old_value = m_permissions[permission];
122124
m_permissions[permission] = value;
123125
m_set_mask.Set(permissions_mask[permission]);
124126
return old_value;
125127
}
126-
128+
127129
// If either side disallows the permission, the resultant disallows it.
128-
void MergePermission(const Permissions &incoming,
129-
enum PermissionKinds permission)
130-
{
130+
void MergePermission(const Permissions &incoming,
131+
enum PermissionKinds permission) {
131132
if (incoming.IsSet(permission))
132133
{
133134
SetPermission(permission, !(m_permissions[permission] |
134135
incoming.m_permissions[permission]));
135136
}
136137
}
137138
};
138-
139+
139140
BreakpointName(ConstString name, const char *help = nullptr) :
140141
m_name(name), m_options(false)
141142
{
142143
SetHelp(help);
143144
}
144-
145+
145146
BreakpointName(const BreakpointName &rhs) :
146147
m_name(rhs.m_name), m_options(rhs.m_options),
147148
m_permissions(rhs.m_permissions), m_help(rhs.m_help)
148149
{}
149-
150+
150151
ConstString GetName() const { return m_name; }
151152
BreakpointOptions &GetOptions() { return m_options; }
152153
const BreakpointOptions &GetOptions() const { return m_options; }
153-
154+
154155
void SetOptions(const BreakpointOptions &options) {
155156
m_options = options;
156157
}
157-
158+
158159
Permissions &GetPermissions() { return m_permissions; }
159160
const Permissions &GetPermissions() const { return m_permissions; }
160161
void SetPermissions(const Permissions &permissions) {
161162
m_permissions = permissions;
162163
}
163-
164+
164165
bool GetPermission(Permissions::PermissionKinds permission) const
165166
{
166167
return m_permissions.GetPermission(permission);
167168
}
168-
169+
169170
void SetHelp(const char *description)
170171
{
171172
if (description)
172173
m_help.assign(description);
173174
else
174175
m_help.clear();
175176
}
176-
177+
177178
const char *GetHelp()
178179
{
179180
return m_help.c_str();
180181
}
181-
182+
182183
// Returns true if any options were set in the name
183184
bool GetDescription(Stream *s, lldb::DescriptionLevel level);
184-
185+
185186
void ConfigureBreakpoint(lldb::BreakpointSP bp_sp);
186-
187+
187188
private:
188189
ConstString m_name;
189190
BreakpointOptions m_options;

lldb/include/lldb/Breakpoint/BreakpointResolverScripted.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ class BreakpointResolverScripted : public BreakpointResolver {
6060
private:
6161
void CreateImplementationIfNeeded(lldb::BreakpointSP bkpt);
6262
ScriptInterpreter *GetScriptInterpreter();
63-
63+
6464
std::string m_class_name;
6565
lldb::SearchDepth m_depth;
6666
StructuredDataImpl m_args;

lldb/include/lldb/Breakpoint/Watchpoint.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ class Watchpoint : public std::enable_shared_from_this<Watchpoint>,
7373
bool IsHardware() const override;
7474

7575
bool ShouldStop(StoppointCallbackContext *context) override;
76-
76+
7777
bool WatchpointRead() const;
7878
bool WatchpointWrite() const;
7979
bool WatchpointModify() const;

lldb/source/Breakpoint/BreakpointIDList.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,7 @@ llvm::Error BreakpointIDList::FindAndReplaceIDRanges(
256256
else
257257
iter++;
258258
}
259-
259+
260260
if (!names_found.empty()) {
261261
for (BreakpointSP bkpt_sp : target->GetBreakpointList().Breakpoints()) {
262262
for (const std::string &name : names_found) {

lldb/source/Breakpoint/BreakpointLocationCollection.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ bool BreakpointLocationCollection::ShouldStop(
121121
size_t prev_size = GetSize();
122122
while (i < prev_size) {
123123
// ShouldStop can remove the breakpoint from the list, or even delete
124-
// it, so we should
124+
// it, so we should
125125
BreakpointLocationSP cur_loc_sp = GetByIndex(i);
126126
BreakpointSP keep_bkpt_alive_sp = cur_loc_sp->GetBreakpoint().shared_from_this();
127127
if (cur_loc_sp->ShouldStop(context))

lldb/source/Breakpoint/BreakpointName.cpp

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,8 @@ using namespace lldb;
2121
using namespace lldb_private;
2222

2323
const Flags::ValueType BreakpointName::Permissions::permissions_mask
24-
[BreakpointName::Permissions::PermissionKinds::allPerms + 1] = {
25-
(1u << 0),
26-
(1u << 1),
27-
(1u << 2),
28-
(0x5u)
29-
};
24+
[BreakpointName::Permissions::PermissionKinds::allPerms + 1] = {
25+
(1u << 0), (1u << 1), (1u << 2), (0x5u)};
3026

3127
bool BreakpointName::Permissions::GetDescription(Stream *s,
3228
lldb::DescriptionLevel level) {
@@ -36,10 +32,10 @@ bool BreakpointName::Permissions::GetDescription(Stream *s,
3632
s->Indent();
3733
if (IsSet(listPerm))
3834
s->Printf("list: %s", GetAllowList() ? "allowed" : "disallowed");
39-
35+
4036
if (IsSet(disablePerm))
4137
s->Printf("disable: %s", GetAllowDisable() ? "allowed" : "disallowed");
42-
38+
4339
if (IsSet(deletePerm))
4440
s->Printf("delete: %s", GetAllowDelete() ? "allowed" : "disallowed");
4541
s->IndentLess();

lldb/source/Breakpoint/BreakpointOptions.cpp

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -99,8 +99,8 @@ BreakpointOptions::CommandData::CreateFromStructuredData(
9999

100100
const char *BreakpointOptions::g_option_names[(
101101
size_t)BreakpointOptions::OptionNames::LastOptionName]{
102-
"ConditionText", "IgnoreCount",
103-
"EnabledState", "OneShotState", "AutoContinue"};
102+
"ConditionText", "IgnoreCount", "EnabledState", "OneShotState",
103+
"AutoContinue"};
104104

105105
// BreakpointOptions constructor
106106
BreakpointOptions::BreakpointOptions(bool all_flags_set)
@@ -113,7 +113,7 @@ BreakpointOptions::BreakpointOptions(bool all_flags_set)
113113
}
114114

115115
BreakpointOptions::BreakpointOptions(const char *condition, bool enabled,
116-
int32_t ignore, bool one_shot,
116+
int32_t ignore, bool one_shot,
117117
bool auto_continue)
118118
: m_callback(nullptr), m_baton_is_command_baton(false),
119119
m_callback_is_synchronous(false), m_enabled(enabled),
@@ -247,7 +247,7 @@ std::unique_ptr<BreakpointOptions> BreakpointOptions::CreateFromStructuredData(
247247
}
248248
set_options.Set(eOneShot);
249249
}
250-
250+
251251
key = GetKey(OptionNames::AutoContinue);
252252
if (key && options_dict.HasKey(key)) {
253253
success = options_dict.GetValueForKeyAsBoolean(key, auto_continue);
@@ -258,7 +258,7 @@ std::unique_ptr<BreakpointOptions> BreakpointOptions::CreateFromStructuredData(
258258
}
259259
set_options.Set(eAutoContinue);
260260
}
261-
261+
262262
key = GetKey(OptionNames::IgnoreCount);
263263
if (key && options_dict.HasKey(key)) {
264264
success = options_dict.GetValueForKeyAsInteger(key, ignore_count);
@@ -297,8 +297,8 @@ std::unique_ptr<BreakpointOptions> BreakpointOptions::CreateFromStructuredData(
297297
}
298298

299299
auto bp_options = std::make_unique<BreakpointOptions>(
300-
condition_ref.str().c_str(), enabled,
301-
ignore_count, one_shot, auto_continue);
300+
condition_ref.str().c_str(), enabled, ignore_count, one_shot,
301+
auto_continue);
302302
if (cmd_data_up) {
303303
if (cmd_data_up->interpreter == eScriptLanguageNone)
304304
bp_options->SetCommandDataCallback(cmd_data_up);
@@ -364,7 +364,7 @@ StructuredData::ObjectSP BreakpointOptions::SerializeToStructuredData() {
364364
if (m_set_flags.Test(eCondition))
365365
options_dict_sp->AddStringItem(GetKey(OptionNames::ConditionText),
366366
m_condition_text);
367-
367+
368368
if (m_set_flags.Test(eCallback) && m_baton_is_command_baton) {
369369
auto cmd_baton =
370370
std::static_pointer_cast<CommandBaton>(m_callback_baton_sp);

0 commit comments

Comments
 (0)