Skip to content

Commit

Permalink
breakAtPossibleNextInstructions should use const InterpreterState
Browse files Browse the repository at this point in the history
Summary:
`breakAtPossibleNextInstructions()` has the same purpose as
`breakpointCaller()` and `breakpointExceptionHandler(const
InterpreterState &state);`. Their job is to set a temporary breakpoint
for where things should pause next.

This diff just makes the function signature align with
`breakpointExceptionHandler()` by using const. This differentiates the
function from things like `stepInstruction()`.

Reviewed By: avp

Differential Revision: D55273733

fbshipit-source-id: dca8782bd1356d5d80287ab075bef8922fb60cd1
  • Loading branch information
dannysu authored and facebook-github-bot committed Mar 26, 2024
1 parent b4fe913 commit 86d391d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion include/hermes/VM/Debugger/Debugger.h
Original file line number Diff line number Diff line change
Expand Up @@ -554,7 +554,7 @@ class Debugger {
llvh::Optional<uint32_t> findJumpTarget(CodeBlock *block, uint32_t offset);

/// Set breakpoints at all possible next instructions after the current one.
void breakAtPossibleNextInstructions(InterpreterState &state);
void breakAtPossibleNextInstructions(const InterpreterState &state);

/// Get the actual OpCode produced from the source without being affected by
/// any user installed breakpoint "Debugger" OpCode overrides.
Expand Down
2 changes: 1 addition & 1 deletion lib/VM/Debugger/Debugger.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ llvh::Optional<uint32_t> Debugger::findJumpTarget(
#undef DEFINE_JUMP_LONG_VARIANT
}

void Debugger::breakAtPossibleNextInstructions(InterpreterState &state) {
void Debugger::breakAtPossibleNextInstructions(const InterpreterState &state) {
auto nextOffset = state.codeBlock->getNextOffset(state.offset);
// Set a breakpoint at the next instruction in the code block if this is not
// the last instruction.
Expand Down

0 comments on commit 86d391d

Please sign in to comment.