mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 08:48:11 +00:00
Everywhere: Run clang-format
This commit is contained in:
parent
0376c127f6
commit
086969277e
1665 changed files with 8479 additions and 8479 deletions
|
@ -19,7 +19,7 @@ Debugger& Debugger::the()
|
|||
|
||||
void Debugger::initialize(
|
||||
String source_root,
|
||||
Function<HasControlPassedToUser(const PtraceRegisters&)> on_stop_callback,
|
||||
Function<HasControlPassedToUser(PtraceRegisters const&)> on_stop_callback,
|
||||
Function<void()> on_continue_callback,
|
||||
Function<void()> on_exit_callback)
|
||||
{
|
||||
|
@ -33,7 +33,7 @@ bool Debugger::is_initialized()
|
|||
|
||||
Debugger::Debugger(
|
||||
String source_root,
|
||||
Function<HasControlPassedToUser(const PtraceRegisters&)> on_stop_callback,
|
||||
Function<HasControlPassedToUser(PtraceRegisters const&)> on_stop_callback,
|
||||
Function<void()> on_continue_callback,
|
||||
Function<void()> on_exit_callback)
|
||||
: m_source_root(source_root)
|
||||
|
@ -45,14 +45,14 @@ Debugger::Debugger(
|
|||
pthread_cond_init(&m_ui_action_cond, nullptr);
|
||||
}
|
||||
|
||||
void Debugger::on_breakpoint_change(const String& file, size_t line, BreakpointChange change_type)
|
||||
void Debugger::on_breakpoint_change(String const& file, size_t line, BreakpointChange change_type)
|
||||
{
|
||||
auto position = create_source_position(file, line);
|
||||
|
||||
if (change_type == BreakpointChange::Added) {
|
||||
m_breakpoints.append(position);
|
||||
} else {
|
||||
m_breakpoints.remove_all_matching([&](const Debug::DebugInfo::SourcePosition& val) { return val == position; });
|
||||
m_breakpoints.remove_all_matching([&](Debug::DebugInfo::SourcePosition const& val) { return val == position; });
|
||||
}
|
||||
|
||||
auto session = Debugger::the().session();
|
||||
|
@ -77,7 +77,7 @@ void Debugger::on_breakpoint_change(const String& file, size_t line, BreakpointC
|
|||
}
|
||||
}
|
||||
|
||||
bool Debugger::set_execution_position(const String& file, size_t line)
|
||||
bool Debugger::set_execution_position(String const& file, size_t line)
|
||||
{
|
||||
auto position = create_source_position(file, line);
|
||||
auto session = Debugger::the().session();
|
||||
|
@ -92,7 +92,7 @@ bool Debugger::set_execution_position(const String& file, size_t line)
|
|||
return true;
|
||||
}
|
||||
|
||||
Debug::DebugInfo::SourcePosition Debugger::create_source_position(const String& file, size_t line)
|
||||
Debug::DebugInfo::SourcePosition Debugger::create_source_position(String const& file, size_t line)
|
||||
{
|
||||
if (file.starts_with("/"))
|
||||
return { file, line + 1 };
|
||||
|
@ -121,7 +121,7 @@ void Debugger::start()
|
|||
m_debug_session = Debug::DebugSession::exec_and_attach(m_executable_path, m_source_root, move(child_setup_callback));
|
||||
VERIFY(!!m_debug_session);
|
||||
|
||||
for (const auto& breakpoint : m_breakpoints) {
|
||||
for (auto const& breakpoint : m_breakpoints) {
|
||||
dbgln("inserting breakpoint at: {}:{}", breakpoint.file_path, breakpoint.line_number);
|
||||
auto address = m_debug_session->get_address_from_source_position(breakpoint.file_path, breakpoint.line_number);
|
||||
if (address.has_value()) {
|
||||
|
@ -218,7 +218,7 @@ void Debugger::DebuggingState::set_single_stepping(Debug::DebugInfo::SourcePosit
|
|||
m_original_source_position = original_source_position;
|
||||
}
|
||||
|
||||
bool Debugger::DebuggingState::should_stop_single_stepping(const Debug::DebugInfo::SourcePosition& current_source_position) const
|
||||
bool Debugger::DebuggingState::should_stop_single_stepping(Debug::DebugInfo::SourcePosition const& current_source_position) const
|
||||
{
|
||||
VERIFY(m_state == State::SingleStepping);
|
||||
return m_original_source_position.value() != current_source_position;
|
||||
|
@ -243,7 +243,7 @@ void Debugger::DebuggingState::add_temporary_breakpoint(FlatPtr address)
|
|||
m_addresses_of_temporary_breakpoints.append(address);
|
||||
}
|
||||
|
||||
void Debugger::do_step_out(const PtraceRegisters& regs)
|
||||
void Debugger::do_step_out(PtraceRegisters const& regs)
|
||||
{
|
||||
// To step out, we simply insert a temporary breakpoint at the
|
||||
// instruction the current function returns to, and continue
|
||||
|
@ -251,7 +251,7 @@ void Debugger::do_step_out(const PtraceRegisters& regs)
|
|||
insert_temporary_breakpoint_at_return_address(regs);
|
||||
}
|
||||
|
||||
void Debugger::do_step_over(const PtraceRegisters& regs)
|
||||
void Debugger::do_step_over(PtraceRegisters const& regs)
|
||||
{
|
||||
// To step over, we insert a temporary breakpoint at each line in the current function,
|
||||
// as well as at the current function's return point, and continue execution.
|
||||
|
@ -265,13 +265,13 @@ void Debugger::do_step_over(const PtraceRegisters& regs)
|
|||
}
|
||||
VERIFY(current_function.has_value());
|
||||
auto lines_in_current_function = lib->debug_info->source_lines_in_scope(current_function.value());
|
||||
for (const auto& line : lines_in_current_function) {
|
||||
for (auto const& line : lines_in_current_function) {
|
||||
insert_temporary_breakpoint(line.address_of_first_statement.value() + lib->base_address);
|
||||
}
|
||||
insert_temporary_breakpoint_at_return_address(regs);
|
||||
}
|
||||
|
||||
void Debugger::insert_temporary_breakpoint_at_return_address(const PtraceRegisters& regs)
|
||||
void Debugger::insert_temporary_breakpoint_at_return_address(PtraceRegisters const& regs)
|
||||
{
|
||||
auto frame_info = Debug::StackFrameUtils::get_info(*m_debug_session, regs.bp());
|
||||
VERIFY(frame_info.has_value());
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue