Skip to content

Commit 3ba6a55

Browse files
committed
reformatting
1 parent 8a5e25a commit 3ba6a55

File tree

6 files changed

+26
-26
lines changed

6 files changed

+26
-26
lines changed

lldb/include/lldb/Target/Target.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1369,11 +1369,11 @@ class Target : public std::enable_shared_from_this<Target>,
13691369
}
13701370

13711371
bool GetAutoContinue() const { return m_auto_continue; }
1372-
1372+
13731373
void SetRunAtFirstStop(bool at_first_stop) {
13741374
m_at_first_stop = at_first_stop;
13751375
}
1376-
1376+
13771377
bool GetRunAtFirstStop() const { return m_at_first_stop; }
13781378

13791379
void GetDescription(Stream &s, lldb::DescriptionLevel level) const;

lldb/source/Commands/CommandObjectTarget.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4795,7 +4795,7 @@ class CommandObjectTargetStopHookAdd : public CommandObjectParsed,
47954795
m_use_one_liner = true;
47964796
m_one_liner.push_back(std::string(option_arg));
47974797
break;
4798-
4798+
47994799
case 'F': {
48004800
bool value, success;
48014801
value = OptionArgParser::ToBoolean(option_arg, false, &success);
@@ -5019,7 +5019,7 @@ Filter Options:
50195019

50205020
if (specifier_up)
50215021
new_hook_sp->SetSpecifier(specifier_up.release());
5022-
5022+
50235023
// Should we run at first stop:
50245024
new_hook_sp->SetRunAtFirstStop(m_options.m_at_first_stop);
50255025

lldb/source/Target/Target.cpp

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3056,9 +3056,9 @@ bool Target::RunStopHooks(bool at_initial_stop) {
30563056

30573057
bool no_active_hooks =
30583058
llvm::none_of(m_stop_hooks, [at_initial_stop](auto &p) {
3059-
bool should_run_now = !at_initial_stop || p.second->GetRunAtFirstStop();
3060-
return p.second->IsActive() && should_run_now;
3061-
});
3059+
bool should_run_now = !at_initial_stop || p.second->GetRunAtFirstStop();
3060+
return p.second->IsActive() && should_run_now;
3061+
});
30623062
if (no_active_hooks)
30633063
return false;
30643064

@@ -3096,14 +3096,13 @@ bool Target::RunStopHooks(bool at_initial_stop) {
30963096
if (num_exe_ctx == 0) {
30973097
if (at_initial_stop && num_threads > 0) {
30983098
lldb::ThreadSP thread_to_use_sp = cur_threadlist.GetThreadAtIndex(0);
3099-
exc_ctx_with_reasons.emplace_back(m_process_sp.get(),
3100-
thread_to_use_sp.get(),
3101-
thread_to_use_sp->GetStackFrameAtIndex(0).get());
3099+
exc_ctx_with_reasons.emplace_back(
3100+
m_process_sp.get(), thread_to_use_sp.get(),
3101+
thread_to_use_sp->GetStackFrameAtIndex(0).get());
31023102
num_exe_ctx = 1;
31033103
} else
31043104
return false;
31053105
}
3106-
31073106

31083107
StreamSP output_sp = m_debugger.GetAsyncOutputStream();
31093108
auto on_exit = llvm::make_scope_exit([output_sp] { output_sp->Flush(); });
@@ -3604,8 +3603,8 @@ Status Target::Attach(ProcessAttachInfo &attach_info, Stream *stream) {
36043603
std::nullopt, nullptr, false, attach_info.GetHijackListener(), stream,
36053604
true, SelectMostRelevantFrame);
36063605
process_sp->RestoreProcessEvents();
3607-
3608-
// Run the stop hooks here. Since we were hijacking the events, they
3606+
3607+
// Run the stop hooks here. Since we were hijacking the events, they
36093608
// wouldn't have gotten run as part of event delivery.
36103609
RunStopHooks(true /* at_initial_stop */);
36113610

lldb/test/API/commands/target/stop-hooks/TestStopHooks.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,4 +109,3 @@ def before_and_after_target(self):
109109
self.expect(
110110
"target stop-hook list", substrs=["expr g_var++", "thread backtrace"]
111111
)
112-

lldb/test/API/commands/target/stop-hooks/on-core-load/TestStopHookOnCoreLoad.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -22,15 +22,14 @@ def test_hook_runs_no_threads(self):
2222
core_path = self.getBuildArtifact("test.core")
2323
self.yaml2obj("test.core.yaml", core_path)
2424

25-
# Since mach core files don't have stop reasons, we should choose
26-
# the first thread:
25+
# Since mach core files don't have stop reasons, we should choose
26+
# the first thread:
2727
self.do_test(core_path, 1)
2828

2929
def test_hook_one_thread(self):
3030
core_path = os.path.join(self.getSourceDir(), "linux-x86_64.core")
3131
self.do_test(core_path, 3)
3232

33-
3433
def do_test(self, core_path, stop_thread):
3534
# Set debugger into synchronous mode
3635
self.dbg.SetAsync(False)
@@ -42,14 +41,15 @@ def do_test(self, core_path, stop_thread):
4241
stop_hook_path = os.path.join(self.getSourceDir(), "stop_hook.py")
4342
self.runCmd(f"command script import {stop_hook_path}")
4443
self.runCmd("target stop-hook add -P stop_hook.stop_handler")
45-
44+
4645
# Load core.
4746
process = target.LoadCore(core_path)
4847
self.assertTrue(process, PROCESS_IS_VALID)
49-
# Now run our report command and make sure we get the right answer.
50-
48+
# Now run our report command and make sure we get the right answer.
49+
5150
result = lldb.SBCommandReturnObject()
5251
self.dbg.GetCommandInterpreter().HandleCommand("report_command", result)
5352
print(f"Command Output: '{result.GetOutput}'")
54-
self.assertIn(f"Stop Threads: {stop_thread}", result.GetOutput(), "Ran the stop hook")
55-
53+
self.assertIn(
54+
f"Stop Threads: {stop_thread}", result.GetOutput(), "Ran the stop hook"
55+
)
Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
11
import lldb
22

3+
34
def report_command(debugger, command, exe_ctx, result, internal_dict):
45
global stop_thread
56
print(f"About to report out stop_thread: {stop_thread}")
67
mssg = f"Stop Threads: {stop_thread}"
78
result.AppendMessage(mssg)
89

910
result.SetStatus(lldb.eReturnStatusSuccessFinishResult)
10-
11+
12+
1113
class stop_handler:
1214
def __init__(self, target, extra_args, dict):
1315
global stop_thread
@@ -19,10 +21,10 @@ def handle_stop(self, exe_ctx, stream):
1921
thread = exe_ctx.thread
2022
stop_thread = thread.idx
2123

24+
2225
def __lldb_init_module(debugger, internal_dict):
2326
global stop_thread
2427
stop_thread = 0
2528
debugger.HandleCommand(
26-
f"command script add -o -f '{__name__}.report_command' report_command"
27-
)
28-
29+
f"command script add -o -f '{__name__}.report_command' report_command"
30+
)

0 commit comments

Comments
 (0)