#include "src/inspector/v8-debugger.h"
#include "include/v8-container.h"
#include "include/v8-context.h"
#include "include/v8-function.h"
#include "include/v8-microtask-queue.h"
#include "include/v8-profiler.h"
#include "include/v8-util.h"
#include "src/inspector/inspected-context.h"
#include "src/inspector/protocol/Protocol.h"
#include "src/inspector/string-util.h"
#include "src/inspector/v8-debugger-agent-impl.h"
#include "src/inspector/v8-heap-profiler-agent-impl.h"
#include "src/inspector/v8-inspector-impl.h"
#include "src/inspector/v8-inspector-session-impl.h"
#include "src/inspector/v8-runtime-agent-impl.h"
#include "src/inspector/v8-stack-trace-impl.h"
#include "src/inspector/v8-value-utils.h"
namespace v8_inspector {
namespace {
static const size_t kMaxAsyncTaskStacks = …;
static const int kNoBreakpointId = …;
template <typename Map>
void cleanupExpiredWeakPointers(Map& map) { … }
START_ALLOW_USE_DEPRECATED(…)
class MatchPrototypePredicate : public v8::QueryObjectPredicate { … };
END_ALLOW_USE_DEPRECATED(…)
}
V8Debugger::V8Debugger(v8::Isolate* isolate, V8InspectorImpl* inspector)
: … { … }
V8Debugger::~V8Debugger() { … }
void V8Debugger::enable() { … }
void V8Debugger::disable() { … }
bool V8Debugger::isPausedInContextGroup(int contextGroupId) const { … }
bool V8Debugger::enabled() const { … }
std::vector<std::unique_ptr<V8DebuggerScript>> V8Debugger::getCompiledScripts(
int contextGroupId, V8DebuggerAgentImpl* agent) { … }
void V8Debugger::setBreakpointsActive(bool active) { … }
void V8Debugger::removeBreakpoint(v8::debug::BreakpointId id) { … }
v8::debug::ExceptionBreakState V8Debugger::getPauseOnExceptionsState() { … }
void V8Debugger::setPauseOnExceptionsState(
v8::debug::ExceptionBreakState pauseOnExceptionsState) { … }
void V8Debugger::setPauseOnNextCall(bool pause, int targetContextGroupId) { … }
bool V8Debugger::canBreakProgram() { … }
bool V8Debugger::isInInstrumentationPause() const { … }
void V8Debugger::breakProgram(int targetContextGroupId) { … }
void V8Debugger::interruptAndBreak(int targetContextGroupId) { … }
void V8Debugger::requestPauseAfterInstrumentation() { … }
void V8Debugger::quitMessageLoopIfAgentsFinishedInstrumentation() { … }
void V8Debugger::continueProgram(int targetContextGroupId,
bool terminateOnResume) { … }
void V8Debugger::breakProgramOnAssert(int targetContextGroupId) { … }
void V8Debugger::stepIntoStatement(int targetContextGroupId,
bool breakOnAsyncCall) { … }
void V8Debugger::stepOverStatement(int targetContextGroupId) { … }
void V8Debugger::stepOutOfFunction(int targetContextGroupId) { … }
void V8Debugger::terminateExecution(
v8::Local<v8::Context> context,
std::unique_ptr<TerminateExecutionCallback> callback) { … }
void V8Debugger::installTerminateExecutionCallbacks(
v8::Local<v8::Context> context) { … }
void V8Debugger::reportTermination() { … }
void V8Debugger::terminateExecutionCompletedCallback(v8::Isolate* isolate) { … }
void V8Debugger::terminateExecutionCompletedCallbackIgnoringData(
v8::Isolate* isolate, void* data) { … }
Response V8Debugger::continueToLocation(
int targetContextGroupId, V8DebuggerScript* script,
std::unique_ptr<protocol::Debugger::Location> location,
const String16& targetCallFrames) { … }
bool V8Debugger::restartFrame(int targetContextGroupId, int callFrameOrdinal) { … }
bool V8Debugger::shouldContinueToCurrentLocation() { … }
void V8Debugger::clearContinueToLocation() { … }
void V8Debugger::handleProgramBreak(
v8::Local<v8::Context> pausedContext, v8::Local<v8::Value> exception,
const std::vector<v8::debug::BreakpointId>& breakpointIds,
v8::debug::BreakReasons breakReasons,
v8::debug::ExceptionType exceptionType, bool isUncaught) { … }
namespace {
size_t HeapLimitForDebugging(size_t initial_heap_limit) { … }
}
size_t V8Debugger::nearHeapLimitCallback(void* data, size_t current_heap_limit,
size_t initial_heap_limit) { … }
void V8Debugger::ScriptCompiled(v8::Local<v8::debug::Script> script,
bool is_live_edited, bool has_compile_error) { … }
V8Debugger::ActionAfterInstrumentation V8Debugger::BreakOnInstrumentation(
v8::Local<v8::Context> pausedContext,
v8::debug::BreakpointId instrumentationId) { … }
void V8Debugger::BreakProgramRequested(
v8::Local<v8::Context> pausedContext,
const std::vector<v8::debug::BreakpointId>& break_points_hit,
v8::debug::BreakReasons reasons) { … }
void V8Debugger::ExceptionThrown(v8::Local<v8::Context> pausedContext,
v8::Local<v8::Value> exception,
v8::Local<v8::Value> promise, bool isUncaught,
v8::debug::ExceptionType exceptionType) { … }
bool V8Debugger::IsFunctionBlackboxed(v8::Local<v8::debug::Script> script,
const v8::debug::Location& start,
const v8::debug::Location& end) { … }
bool V8Debugger::ShouldBeSkipped(v8::Local<v8::debug::Script> script, int line,
int column) { … }
void V8Debugger::BreakpointConditionEvaluated(
v8::Local<v8::Context> context, v8::debug::BreakpointId breakpoint_id,
bool exception_thrown, v8::Local<v8::Value> exception) { … }
void V8Debugger::AsyncEventOccurred(v8::debug::DebugAsyncActionType type,
int id, bool isBlackboxed) { … }
std::shared_ptr<AsyncStackTrace> V8Debugger::currentAsyncParent() { … }
V8StackTraceId V8Debugger::currentExternalParent() { … }
v8::MaybeLocal<v8::Value> V8Debugger::getTargetScopes(
v8::Local<v8::Context> context, v8::Local<v8::Value> value,
ScopeTargetKind kind) { … }
v8::MaybeLocal<v8::Value> V8Debugger::functionScopes(
v8::Local<v8::Context> context, v8::Local<v8::Function> function) { … }
v8::MaybeLocal<v8::Value> V8Debugger::generatorScopes(
v8::Local<v8::Context> context, v8::Local<v8::Value> generator) { … }
v8::MaybeLocal<v8::Array> V8Debugger::collectionsEntries(
v8::Local<v8::Context> context, v8::Local<v8::Value> collection) { … }
v8::MaybeLocal<v8::Array> V8Debugger::privateMethods(
v8::Local<v8::Context> context, v8::Local<v8::Value> receiver) { … }
v8::MaybeLocal<v8::Array> V8Debugger::internalProperties(
v8::Local<v8::Context> context, v8::Local<v8::Value> value) { … }
v8::Local<v8::Array> V8Debugger::queryObjects(v8::Local<v8::Context> context,
v8::Local<v8::Object> prototype) { … }
std::unique_ptr<V8StackTraceImpl> V8Debugger::createStackTrace(
v8::Local<v8::StackTrace> v8StackTrace) { … }
void V8Debugger::setAsyncCallStackDepth(V8DebuggerAgentImpl* agent, int depth) { … }
void V8Debugger::setMaxCallStackSizeToCapture(V8RuntimeAgentImpl* agent,
int size) { … }
std::shared_ptr<AsyncStackTrace> V8Debugger::stackTraceFor(
int contextGroupId, const V8StackTraceId& id) { … }
V8StackTraceId V8Debugger::storeCurrentStackTrace(
const StringView& description) { … }
uintptr_t V8Debugger::storeStackTrace(
std::shared_ptr<AsyncStackTrace> asyncStack) { … }
void V8Debugger::externalAsyncTaskStarted(const V8StackTraceId& parent) { … }
void V8Debugger::externalAsyncTaskFinished(const V8StackTraceId& parent) { … }
void V8Debugger::asyncTaskScheduled(const StringView& taskName, void* task,
bool recurring) { … }
void V8Debugger::asyncTaskCanceled(void* task) { … }
void V8Debugger::asyncTaskStarted(void* task) { … }
void V8Debugger::asyncTaskFinished(void* task) { … }
void V8Debugger::asyncTaskScheduledForStack(const StringView& taskName,
void* task, bool recurring,
bool skipTopFrame) { … }
void V8Debugger::asyncTaskCanceledForStack(void* task) { … }
void V8Debugger::asyncTaskStartedForStack(void* task) { … }
void V8Debugger::asyncTaskFinishedForStack(void* task) { … }
void V8Debugger::asyncTaskCandidateForStepping(void* task) { … }
void V8Debugger::asyncTaskStartedForStepping(void* task) { … }
void V8Debugger::asyncTaskFinishedForStepping(void* task) { … }
void V8Debugger::asyncTaskCanceledForStepping(void* task) { … }
void V8Debugger::allAsyncTasksCanceled() { … }
void V8Debugger::muteScriptParsedEvents() { … }
void V8Debugger::unmuteScriptParsedEvents() { … }
std::unique_ptr<V8StackTraceImpl> V8Debugger::captureStackTrace(
bool fullStack) { … }
int V8Debugger::currentContextGroupId() { … }
void V8Debugger::collectOldAsyncStacksIfNeeded() { … }
std::shared_ptr<StackFrame> V8Debugger::symbolize(
v8::Local<v8::StackFrame> v8Frame) { … }
void V8Debugger::setMaxAsyncTaskStacksForTest(int limit) { … }
internal::V8DebuggerId V8Debugger::debuggerIdFor(int contextGroupId) { … }
bool V8Debugger::addInternalObject(v8::Local<v8::Context> context,
v8::Local<v8::Object> object,
V8InternalValueType type) { … }
void V8Debugger::dumpAsyncTaskStacksStateForTest() { … }
bool V8Debugger::hasScheduledBreakOnNextFunctionCall() const { … }
}