diff --git a/ecmascript/tooling/agent/debugger_impl.cpp b/ecmascript/tooling/agent/debugger_impl.cpp index a0f638f1a33002034e311919d314f86ea1dccfd6..f7e064b665578f48494334ce5322b4b591845914 100644 --- a/ecmascript/tooling/agent/debugger_impl.cpp +++ b/ecmascript/tooling/agent/debugger_impl.cpp @@ -272,7 +272,7 @@ void DebuggerImpl::DispatcherImpl::Enable(const DispatchRequest &request) } UniqueDebuggerId id; - DispatchResponse response = debugger_->Enable(std::move(params), &id); + DispatchResponse response = debugger_->Enable(*params, &id); EnableReturns result(id); SendResponse(request, response, result); @@ -293,7 +293,7 @@ void DebuggerImpl::DispatcherImpl::EvaluateOnCallFrame(const DispatchRequest &re return; } std::unique_ptr result1; - DispatchResponse response = debugger_->EvaluateOnCallFrame(std::move(params), &result1); + DispatchResponse response = debugger_->EvaluateOnCallFrame(*params, &result1); EvaluateOnCallFrameReturns result(std::move(result1)); SendResponse(request, response, result); @@ -308,7 +308,7 @@ void DebuggerImpl::DispatcherImpl::GetPossibleBreakpoints(const DispatchRequest return; } std::vector> locations; - DispatchResponse response = debugger_->GetPossibleBreakpoints(std::move(params), &locations); + DispatchResponse response = debugger_->GetPossibleBreakpoints(*params, &locations); GetPossibleBreakpointsReturns result(std::move(locations)); SendResponse(request, response, result); } @@ -322,7 +322,7 @@ void DebuggerImpl::DispatcherImpl::GetScriptSource(const DispatchRequest &reques return; } std::string source; - DispatchResponse response = debugger_->GetScriptSource(std::move(params), &source); + DispatchResponse response = debugger_->GetScriptSource(*params, &source); GetScriptSourceReturns result(source); SendResponse(request, response, result); } @@ -341,7 +341,7 @@ void DebuggerImpl::DispatcherImpl::RemoveBreakpoint(const DispatchRequest &reque SendResponse(request, DispatchResponse::Fail("wrong params")); return; } - DispatchResponse response = debugger_->RemoveBreakpoint(std::move(params)); + DispatchResponse response = debugger_->RemoveBreakpoint(*params); SendResponse(request, response); } @@ -352,7 +352,7 @@ void DebuggerImpl::DispatcherImpl::Resume(const DispatchRequest &request) SendResponse(request, DispatchResponse::Fail("wrong params")); return; } - DispatchResponse response = debugger_->Resume(std::move(params)); + DispatchResponse response = debugger_->Resume(*params); SendResponse(request, response); } @@ -373,7 +373,7 @@ void DebuggerImpl::DispatcherImpl::SetBreakpointByUrl(const DispatchRequest &req std::string out_id; std::vector> outLocations; - DispatchResponse response = debugger_->SetBreakpointByUrl(std::move(params), &out_id, &outLocations); + DispatchResponse response = debugger_->SetBreakpointByUrl(*params, &out_id, &outLocations); SetBreakpointByUrlReturns result(out_id, std::move(outLocations)); SendResponse(request, response, result); } @@ -387,7 +387,7 @@ void DebuggerImpl::DispatcherImpl::SetPauseOnExceptions(const DispatchRequest &r return; } - DispatchResponse response = debugger_->SetPauseOnExceptions(std::move(params)); + DispatchResponse response = debugger_->SetPauseOnExceptions(*params); SendResponse(request, response); } @@ -398,7 +398,7 @@ void DebuggerImpl::DispatcherImpl::StepInto(const DispatchRequest &request) SendResponse(request, DispatchResponse::Fail("wrong params")); return; } - DispatchResponse response = debugger_->StepInto(std::move(params)); + DispatchResponse response = debugger_->StepInto(*params); SendResponse(request, response); } @@ -415,7 +415,7 @@ void DebuggerImpl::DispatcherImpl::StepOver(const DispatchRequest &request) SendResponse(request, DispatchResponse::Fail("wrong params")); return; } - DispatchResponse response = debugger_->StepOver(std::move(params)); + DispatchResponse response = debugger_->StepOver(*params); SendResponse(request, response); } @@ -498,7 +498,7 @@ void DebuggerImpl::Frontend::WaitForDebugger(const EcmaVM *vm) channel_->WaitForDebugger(); } -DispatchResponse DebuggerImpl::Enable([[maybe_unused]] std::unique_ptr params, UniqueDebuggerId *id) +DispatchResponse DebuggerImpl::Enable([[maybe_unused]] const EnableParams ¶ms, UniqueDebuggerId *id) { ASSERT(id != nullptr); *id = 0; @@ -515,12 +515,12 @@ DispatchResponse DebuggerImpl::Disable() return DispatchResponse::Ok(); } -DispatchResponse DebuggerImpl::EvaluateOnCallFrame(std::unique_ptr params, +DispatchResponse DebuggerImpl::EvaluateOnCallFrame(const EvaluateOnCallFrameParams ¶ms, std::unique_ptr *result) { - CallFrameId callFrameId = params->GetCallFrameId(); - std::string expression = params->GetExpression(); - if (callFrameId < 0 || callFrameId >= callFrameHandlers_.size()) { + CallFrameId callFrameId = params.GetCallFrameId(); + const std::string &expression = params.GetExpression(); + if (callFrameId < 0 || callFrameId >= static_cast(callFrameHandlers_.size())) { return DispatchResponse::Fail("Invalid callFrameId."); } @@ -552,10 +552,10 @@ DispatchResponse DebuggerImpl::EvaluateOnCallFrame(std::unique_ptr params, +DispatchResponse DebuggerImpl::GetPossibleBreakpoints(const GetPossibleBreakpointsParams ¶ms, std::vector> *locations) { - Location *start = params->GetStart(); + Location *start = params.GetStart(); auto iter = scripts_.find(start->GetScriptId()); if (iter == scripts_.end()) { return DispatchResponse::Fail("Unknown file name."); @@ -579,9 +579,9 @@ DispatchResponse DebuggerImpl::GetPossibleBreakpoints(std::unique_ptr params, std::string *source) +DispatchResponse DebuggerImpl::GetScriptSource(const GetScriptSourceParams ¶ms, std::string *source) { - ScriptId scriptId = params->GetScriptId(); + ScriptId scriptId = params.GetScriptId(); auto iter = scripts_.find(scriptId); if (iter == scripts_.end()) { *source = ""; @@ -598,9 +598,9 @@ DispatchResponse DebuggerImpl::Pause() return DispatchResponse::Ok(); } -DispatchResponse DebuggerImpl::RemoveBreakpoint(std::unique_ptr params) +DispatchResponse DebuggerImpl::RemoveBreakpoint(const RemoveBreakpointParams ¶ms) { - std::string id = params->GetBreakpointId(); + std::string id = params.GetBreakpointId(); LOG(INFO, DEBUGGER) << "RemoveBreakpoint: " << id; BreakpointDetails metaData{}; if (!BreakpointDetails::ParseBreakpointId(id, &metaData)) { @@ -636,7 +636,7 @@ DispatchResponse DebuggerImpl::RemoveBreakpoint(std::unique_ptr params) +DispatchResponse DebuggerImpl::Resume([[maybe_unused]] const ResumeParams ¶ms) { frontend_.Resumed(vm_); singleStepper_.reset(); @@ -649,14 +649,14 @@ DispatchResponse DebuggerImpl::SetAsyncCallStackDepth() return DispatchResponse::Ok(); } -DispatchResponse DebuggerImpl::SetBreakpointByUrl(std::unique_ptr params, +DispatchResponse DebuggerImpl::SetBreakpointByUrl(const SetBreakpointByUrlParams ¶ms, std::string *outId, std::vector> *outLocations) { - const std::string &url = params->GetUrl(); - int32_t lineNumber = params->GetLine(); - int32_t columnNumber = params->GetColumn(); - auto condition = params->HasCondition() ? params->GetCondition() : std::optional {}; + const std::string &url = params.GetUrl(); + int32_t lineNumber = params.GetLine(); + int32_t columnNumber = params.GetColumn(); + auto condition = params.HasCondition() ? params.GetCondition() : std::optional {}; JSPtExtractor *extractor = GetExtractor(url); if (extractor == nullptr) { @@ -709,15 +709,15 @@ DispatchResponse DebuggerImpl::SetBreakpointByUrl(std::unique_ptr params) +DispatchResponse DebuggerImpl::SetPauseOnExceptions(const SetPauseOnExceptionsParams ¶ms) { - PauseOnExceptionsState state = params->GetState(); + PauseOnExceptionsState state = params.GetState(); pauseOnException_ = (state != PauseOnExceptionsState::UNCAUGHT); return DispatchResponse::Ok(); } -DispatchResponse DebuggerImpl::StepInto([[maybe_unused]] std::unique_ptr params) +DispatchResponse DebuggerImpl::StepInto([[maybe_unused]] const StepIntoParams ¶ms) { JSMethod *method = DebuggerApi::GetMethod(vm_); JSPtExtractor *extractor = GetExtractor(method->GetJSPandaFile()); @@ -745,7 +745,7 @@ DispatchResponse DebuggerImpl::StepOut() return DispatchResponse::Ok(); } -DispatchResponse DebuggerImpl::StepOver([[maybe_unused]] std::unique_ptr params) +DispatchResponse DebuggerImpl::StepOver([[maybe_unused]] const StepOverParams ¶ms) { JSMethod *method = DebuggerApi::GetMethod(vm_); JSPtExtractor *extractor = GetExtractor(method->GetJSPandaFile()); diff --git a/ecmascript/tooling/agent/debugger_impl.h b/ecmascript/tooling/agent/debugger_impl.h index a86d0d459be6abda206fd838ad241e1384144d5f..38bceeac609f1dd651447c5962bb9ad1ba87401d 100644 --- a/ecmascript/tooling/agent/debugger_impl.h +++ b/ecmascript/tooling/agent/debugger_impl.h @@ -39,23 +39,23 @@ public: void NotifyPaused(std::optional location, PauseReason reason); void NotifyPendingJobEntry(); - DispatchResponse Enable(std::unique_ptr params, UniqueDebuggerId *id); + DispatchResponse Enable(const EnableParams ¶ms, UniqueDebuggerId *id); DispatchResponse Disable(); - DispatchResponse EvaluateOnCallFrame(std::unique_ptr params, + DispatchResponse EvaluateOnCallFrame(const EvaluateOnCallFrameParams ¶ms, std::unique_ptr *result); - DispatchResponse GetPossibleBreakpoints(std::unique_ptr params, + DispatchResponse GetPossibleBreakpoints(const GetPossibleBreakpointsParams ¶ms, std::vector> *outLocations); - DispatchResponse GetScriptSource(std::unique_ptr params, std::string *source); + DispatchResponse GetScriptSource(const GetScriptSourceParams ¶ms, std::string *source); DispatchResponse Pause(); - DispatchResponse RemoveBreakpoint(std::unique_ptr params); - DispatchResponse Resume(std::unique_ptr params); + DispatchResponse RemoveBreakpoint(const RemoveBreakpointParams ¶ms); + DispatchResponse Resume(const ResumeParams ¶ms); DispatchResponse SetAsyncCallStackDepth(); - DispatchResponse SetBreakpointByUrl(std::unique_ptr params, std::string *outId, + DispatchResponse SetBreakpointByUrl(const SetBreakpointByUrlParams ¶ms, std::string *outId, std::vector> *outLocations); - DispatchResponse SetPauseOnExceptions(std::unique_ptr params); - DispatchResponse StepInto(std::unique_ptr params); + DispatchResponse SetPauseOnExceptions(const SetPauseOnExceptionsParams ¶ms); + DispatchResponse StepInto(const StepIntoParams ¶ms); DispatchResponse StepOut(); - DispatchResponse StepOver(std::unique_ptr params); + DispatchResponse StepOver(const StepOverParams ¶ms); DispatchResponse SetBlackboxPatterns(); /** diff --git a/ecmascript/tooling/agent/heapprofiler_impl.cpp b/ecmascript/tooling/agent/heapprofiler_impl.cpp index c2508501d1a1cfa1276935f627f50736d04a184f..a7088faaf557822e4fe92ad74232669806eddad5 100644 --- a/ecmascript/tooling/agent/heapprofiler_impl.cpp +++ b/ecmascript/tooling/agent/heapprofiler_impl.cpp @@ -51,7 +51,7 @@ void HeapProfilerImpl::DispatcherImpl::AddInspectedHeapObject(const DispatchRequ SendResponse(request, DispatchResponse::Fail("wrong params")); return; } - DispatchResponse response = heapprofiler_->AddInspectedHeapObject(std::move(params)); + DispatchResponse response = heapprofiler_->AddInspectedHeapObject(*params); SendResponse(request, response); } @@ -83,7 +83,7 @@ void HeapProfilerImpl::DispatcherImpl::GetHeapObjectId(const DispatchRequest &re } HeapSnapshotObjectId objectId; - DispatchResponse response = heapprofiler_->GetHeapObjectId(std::move(params), &objectId); + DispatchResponse response = heapprofiler_->GetHeapObjectId(*params, &objectId); GetHeapObjectIdReturns result(std::move(objectId)); SendResponse(request, response, result); } @@ -98,7 +98,7 @@ void HeapProfilerImpl::DispatcherImpl::GetObjectByHeapObjectId(const DispatchReq } std::unique_ptr remoteObjectResult; - DispatchResponse response = heapprofiler_->GetObjectByHeapObjectId(std::move(params), &remoteObjectResult); + DispatchResponse response = heapprofiler_->GetObjectByHeapObjectId(*params, &remoteObjectResult); GetObjectByHeapObjectIdReturns result(std::move(remoteObjectResult)); SendResponse(request, response, result); } @@ -120,7 +120,7 @@ void HeapProfilerImpl::DispatcherImpl::StartSampling(const DispatchRequest &requ SendResponse(request, DispatchResponse::Fail("wrong params")); return; } - DispatchResponse response = heapprofiler_->StartSampling(std::move(params)); + DispatchResponse response = heapprofiler_->StartSampling(*params); SendResponse(request, response); } @@ -132,7 +132,7 @@ void HeapProfilerImpl::DispatcherImpl::StartTrackingHeapObjects(const DispatchRe SendResponse(request, DispatchResponse::Fail("wrong params")); return; } - DispatchResponse response = heapprofiler_->StartTrackingHeapObjects(std::move(params)); + DispatchResponse response = heapprofiler_->StartTrackingHeapObjects(*params); SendResponse(request, response); } @@ -153,7 +153,7 @@ void HeapProfilerImpl::DispatcherImpl::StopTrackingHeapObjects(const DispatchReq SendResponse(request, DispatchResponse::Fail("wrong params")); return; } - DispatchResponse response = heapprofiler_->StopTrackingHeapObjects(std::move(params)); + DispatchResponse response = heapprofiler_->StopTrackingHeapObjects(*params); SendResponse(request, response); } @@ -165,7 +165,7 @@ void HeapProfilerImpl::DispatcherImpl::TakeHeapSnapshot(const DispatchRequest &r SendResponse(request, DispatchResponse::Fail("wrong params")); return; } - DispatchResponse response = heapprofiler_->TakeHeapSnapshot(std::move(params)); + DispatchResponse response = heapprofiler_->TakeHeapSnapshot(*params); SendResponse(request, response); } @@ -244,7 +244,7 @@ void HeapProfilerImpl::Frontend::ResetProfiles() } DispatchResponse HeapProfilerImpl::AddInspectedHeapObject( - [[maybe_unused]] std::unique_ptr params) + [[maybe_unused]] const AddInspectedHeapObjectParams ¶ms) { LOG(ERROR, DEBUGGER) << "AddInspectedHeapObject not support now."; return DispatchResponse::Ok(); @@ -268,7 +268,7 @@ DispatchResponse HeapProfilerImpl::Disable() return DispatchResponse::Ok(); } -DispatchResponse HeapProfilerImpl::GetHeapObjectId([[maybe_unused]] std::unique_ptr params, +DispatchResponse HeapProfilerImpl::GetHeapObjectId([[maybe_unused]] const GetHeapObjectIdParams ¶ms, HeapSnapshotObjectId *objectId) { ASSERT(objectId != nullptr); @@ -278,7 +278,7 @@ DispatchResponse HeapProfilerImpl::GetHeapObjectId([[maybe_unused]] std::unique_ } DispatchResponse HeapProfilerImpl::GetObjectByHeapObjectId( - [[maybe_unused]] std::unique_ptr params, + [[maybe_unused]] const GetObjectByHeapObjectIdParams ¶ms, [[maybe_unused]] std::unique_ptr *remoteObjectResult) { LOG(ERROR, DEBUGGER) << "GetObjectByHeapObjectId not support now."; @@ -291,14 +291,14 @@ DispatchResponse HeapProfilerImpl::GetSamplingProfile([[maybe_unused]]std::uniqu return DispatchResponse::Ok(); } -DispatchResponse HeapProfilerImpl::StartSampling([[maybe_unused]]std::unique_ptr params) +DispatchResponse HeapProfilerImpl::StartSampling([[maybe_unused]]const StartSamplingParams ¶ms) { LOG(ERROR, DEBUGGER) << "StartSampling not support now."; return DispatchResponse::Ok(); } DispatchResponse HeapProfilerImpl::StartTrackingHeapObjects( - [[maybe_unused]]std::unique_ptr params) + [[maybe_unused]]const StartTrackingHeapObjectsParams ¶ms) { bool result = panda::DFXJSNApi::StartHeapTracking(vm_, INTERVAL, true, &stream_); if (result) { @@ -314,10 +314,10 @@ DispatchResponse HeapProfilerImpl::StopSampling([[maybe_unused]]std::unique_ptr< return DispatchResponse::Ok(); } -DispatchResponse HeapProfilerImpl::StopTrackingHeapObjects(std::unique_ptr params) +DispatchResponse HeapProfilerImpl::StopTrackingHeapObjects(const StopTrackingHeapObjectsParams ¶ms) { bool result = false; - if (params->GetReportProgress()) { + if (params.GetReportProgress()) { HeapProfilerProgress progress(&frontend_); result = panda::DFXJSNApi::StopHeapTracking(vm_, &stream_, &progress); } else { @@ -330,9 +330,9 @@ DispatchResponse HeapProfilerImpl::StopTrackingHeapObjects(std::unique_ptr params) +DispatchResponse HeapProfilerImpl::TakeHeapSnapshot(const StopTrackingHeapObjectsParams ¶ms) { - if (params->GetReportProgress()) { + if (params.GetReportProgress()) { HeapProfilerProgress progress(&frontend_); panda::DFXJSNApi::DumpHeapSnapshot(vm_, 0, &stream_, &progress, true); } else { diff --git a/ecmascript/tooling/agent/heapprofiler_impl.h b/ecmascript/tooling/agent/heapprofiler_impl.h index 2c9d28ce32085a05c05fe0f6af85739f32901303..a5c2bc60c2f0cedef7c5af438116a9ada6834acb 100644 --- a/ecmascript/tooling/agent/heapprofiler_impl.h +++ b/ecmascript/tooling/agent/heapprofiler_impl.h @@ -38,20 +38,20 @@ public: : vm_(vm), frontend_(channel), stream_(&frontend_) {} ~HeapProfilerImpl() = default; - DispatchResponse AddInspectedHeapObject(std::unique_ptr params); + DispatchResponse AddInspectedHeapObject(const AddInspectedHeapObjectParams ¶ms); DispatchResponse CollectGarbage(); DispatchResponse Enable(); DispatchResponse Disable(); - DispatchResponse GetHeapObjectId(std::unique_ptr params, HeapSnapshotObjectId *objectId); - DispatchResponse GetObjectByHeapObjectId(std::unique_ptr params, + DispatchResponse GetHeapObjectId(const GetHeapObjectIdParams ¶ms, HeapSnapshotObjectId *objectId); + DispatchResponse GetObjectByHeapObjectId(const GetObjectByHeapObjectIdParams ¶ms, std::unique_ptr *remoteObjectResult); DispatchResponse GetSamplingProfile(std::unique_ptr *profile); - DispatchResponse StartSampling(std::unique_ptr params); - DispatchResponse StartTrackingHeapObjects(std::unique_ptr params); + DispatchResponse StartSampling(const StartSamplingParams ¶ms); + DispatchResponse StartTrackingHeapObjects(const StartTrackingHeapObjectsParams ¶ms); DispatchResponse StopSampling(std::unique_ptr *profile); - DispatchResponse StopTrackingHeapObjects(std::unique_ptr params); + DispatchResponse StopTrackingHeapObjects(const StopTrackingHeapObjectsParams ¶ms); // The params type of TakeHeapSnapshot is the same as of StopTrackingHeapObjects. - DispatchResponse TakeHeapSnapshot(std::unique_ptr params); + DispatchResponse TakeHeapSnapshot(const StopTrackingHeapObjectsParams ¶ms); class DispatcherImpl final : public DispatcherBase { public: diff --git a/ecmascript/tooling/agent/profiler_impl.cpp b/ecmascript/tooling/agent/profiler_impl.cpp index b07e4abd7002b1c0abaa51a9a79f4a22e3e89748..022030a075282c0d6f2d768c74b31694abd09e8f 100644 --- a/ecmascript/tooling/agent/profiler_impl.cpp +++ b/ecmascript/tooling/agent/profiler_impl.cpp @@ -82,7 +82,7 @@ void ProfilerImpl::DispatcherImpl::SetSamplingInterval(const DispatchRequest &re SendResponse(request, DispatchResponse::Fail("wrong params")); return; } - DispatchResponse response = profiler_->SetSamplingInterval(std::move(params)); + DispatchResponse response = profiler_->SetSamplingInterval(*params); SendResponse(request, response); } @@ -106,13 +106,13 @@ void ProfilerImpl::DispatcherImpl::TakePreciseCoverage(const DispatchRequest &re void ProfilerImpl::DispatcherImpl::StartPreciseCoverage(const DispatchRequest &request) { - std::unique_ptr params = - StartPreciseCoverageParam::Create(request.GetEcmaVM(), request.GetParamsObj()); + std::unique_ptr params = + StartPreciseCoverageParams::Create(request.GetEcmaVM(), request.GetParamsObj()); if (params == nullptr) { SendResponse(request, DispatchResponse::Fail("wrong params")); return; } - DispatchResponse response = profiler_->StartPreciseCoverage(std::move(params)); + DispatchResponse response = profiler_->StartPreciseCoverage(*params); SendResponse(request, response); } @@ -198,9 +198,9 @@ DispatchResponse ProfilerImpl::Stop(std::unique_ptr *profile) return DispatchResponse::Ok(); } -DispatchResponse ProfilerImpl::SetSamplingInterval(std::unique_ptr params) +DispatchResponse ProfilerImpl::SetSamplingInterval(const SetSamplingIntervalParams ¶ms) { - panda::DFXJSNApi::SetCpuSamplingInterval(params->GetInterval()); + panda::DFXJSNApi::SetCpuSamplingInterval(params.GetInterval()); return DispatchResponse::Ok(); } @@ -222,7 +222,7 @@ DispatchResponse ProfilerImpl::TakePreciseCoverage() return DispatchResponse::Ok(); } -DispatchResponse ProfilerImpl::StartPreciseCoverage([[maybe_unused]] std::unique_ptr params) +DispatchResponse ProfilerImpl::StartPreciseCoverage([[maybe_unused]] const StartPreciseCoverageParams ¶ms) { LOG(ERROR, DEBUGGER) << "StartPreciseCoverage not support now."; return DispatchResponse::Ok(); diff --git a/ecmascript/tooling/agent/profiler_impl.h b/ecmascript/tooling/agent/profiler_impl.h index d7791f62bdf306d04e36cc540696712d858c3cfb..47f9a5ea5a679916d217ea7def6455d1fb787255 100644 --- a/ecmascript/tooling/agent/profiler_impl.h +++ b/ecmascript/tooling/agent/profiler_impl.h @@ -32,11 +32,11 @@ public: DispatchResponse Enable(); DispatchResponse Start(); DispatchResponse Stop(std::unique_ptr *profile); - DispatchResponse SetSamplingInterval(std::unique_ptr params); + DispatchResponse SetSamplingInterval(const SetSamplingIntervalParams ¶ms); DispatchResponse GetBestEffortCoverage(); DispatchResponse StopPreciseCoverage(); DispatchResponse TakePreciseCoverage(); - DispatchResponse StartPreciseCoverage (std::unique_ptr params); + DispatchResponse StartPreciseCoverage (const StartPreciseCoverageParams ¶ms); DispatchResponse StartTypeProfile(); DispatchResponse StopTypeProfile(); DispatchResponse TakeTypeProfile(); diff --git a/ecmascript/tooling/agent/runtime_impl.cpp b/ecmascript/tooling/agent/runtime_impl.cpp index 67e6ed9ce874e76d0226bfe0cb4c99db13cb5236..ded0e698f248d730036c1ae2c5433ce93b847791 100644 --- a/ecmascript/tooling/agent/runtime_impl.cpp +++ b/ecmascript/tooling/agent/runtime_impl.cpp @@ -76,7 +76,7 @@ void RuntimeImpl::DispatcherImpl::GetProperties(const DispatchRequest &request) std::optional>> outInternalDescs; std::optional>> outPrivateProperties; std::optional> outExceptionDetails; - DispatchResponse response = runtime_->GetProperties(std::move(params), &outPropertyDesc, &outInternalDescs, + DispatchResponse response = runtime_->GetProperties(*params, &outPropertyDesc, &outInternalDescs, &outPrivateProperties, &outExceptionDetails); if (outExceptionDetails) { LOG(WARNING, DEBUGGER) << "GetProperties thrown an exception"; @@ -99,7 +99,7 @@ void RuntimeImpl::DispatcherImpl::CallFunctionOn(const DispatchRequest &request) std::unique_ptr outRemoteObject; std::optional> outExceptionDetails; - DispatchResponse response = runtime_->CallFunctionOn(std::move(params), &outRemoteObject, &outExceptionDetails); + DispatchResponse response = runtime_->CallFunctionOn(*params, &outRemoteObject, &outExceptionDetails); if (outExceptionDetails) { LOG(WARNING, DEBUGGER) << "CallFunctionOn thrown an exception"; } @@ -146,7 +146,7 @@ DispatchResponse RuntimeImpl::RunIfWaitingForDebugger() return DispatchResponse::Ok(); } -DispatchResponse RuntimeImpl::CallFunctionOn([[maybe_unused]] std::unique_ptr params, +DispatchResponse RuntimeImpl::CallFunctionOn([[maybe_unused]] const CallFunctionOnParams ¶ms, std::unique_ptr *outRemoteObject, [[maybe_unused]] std::optional> *outExceptionDetails) { @@ -163,15 +163,15 @@ DispatchResponse RuntimeImpl::GetHeapUsage(double *usedSize, double *totalSize) return DispatchResponse::Ok(); } -DispatchResponse RuntimeImpl::GetProperties(std::unique_ptr params, +DispatchResponse RuntimeImpl::GetProperties(const GetPropertiesParams ¶ms, std::vector> *outPropertyDesc, [[maybe_unused]] std::optional>> *outInternalDescs, [[maybe_unused]] std::optional>> *outPrivateProps, [[maybe_unused]] std::optional> *outExceptionDetails) { - RemoteObjectId objectId = params->GetObjectId(); - bool isOwn = params->GetOwnProperties(); - bool isAccessorOnly = params->GetAccessPropertiesOnly(); + RemoteObjectId objectId = params.GetObjectId(); + bool isOwn = params.GetOwnProperties(); + bool isAccessorOnly = params.GetAccessPropertiesOnly(); auto iter = properties_.find(objectId); if (iter == properties_.end()) { LOG(ERROR, DEBUGGER) << "RuntimeImpl::GetProperties Unknown object id: " << objectId; diff --git a/ecmascript/tooling/agent/runtime_impl.h b/ecmascript/tooling/agent/runtime_impl.h index 5ebad5ef43fb63612d06853023c4ab0da76c18c9..2feae617c17f2d325b144bd253242e2b0894ff4d 100644 --- a/ecmascript/tooling/agent/runtime_impl.h +++ b/ecmascript/tooling/agent/runtime_impl.h @@ -31,12 +31,12 @@ public: DispatchResponse Disable(); DispatchResponse RunIfWaitingForDebugger(); DispatchResponse CallFunctionOn( - std::unique_ptr params, + const CallFunctionOnParams ¶ms, std::unique_ptr *outRemoteObject, std::optional> *outExceptionDetails); DispatchResponse GetHeapUsage(double *usedSize, double *totalSize); DispatchResponse GetProperties( - std::unique_ptr params, + const GetPropertiesParams ¶ms, std::vector> *outPropertyDesc, std::optional>> *outInternalDescs, std::optional>> *outPrivateProps, diff --git a/ecmascript/tooling/base/pt_events.h b/ecmascript/tooling/base/pt_events.h index 314b98066c54c33cfb74f1eb8f4dae348d88a615..5044ff8759a77dae0f15b03be8d56f26c787ba29 100644 --- a/ecmascript/tooling/base/pt_events.h +++ b/ecmascript/tooling/base/pt_events.h @@ -336,6 +336,7 @@ public: const std::string &GetSourceMapURL() const { + ASSERT(HasSourceMapUrl()); return sourceMapUrl_.value(); } @@ -345,7 +346,7 @@ public: return *this; } - bool HasSourceMapURL() const + bool HasSourceMapUrl() const { return sourceMapUrl_.has_value(); } @@ -416,6 +417,7 @@ public: const std::string &GetScriptLanguage() const { + ASSERT(HasScriptLanguage()); return scriptLanguage_.value(); } @@ -432,6 +434,7 @@ public: const std::string &GetEmbedderName() const { + ASSERT(HasEmbedderName()); return embedderName_.value(); } @@ -601,6 +604,7 @@ public: const std::string &GetSourceMapURL() const { + ASSERT(HasSourceMapUrl()); return sourceMapUrl_.value(); } @@ -610,7 +614,7 @@ public: return *this; } - bool HasSourceMapURL() const + bool HasSourceMapUrl() const { return sourceMapUrl_.has_value(); } @@ -681,6 +685,7 @@ public: const std::string &GetScriptLanguage() const { + ASSERT(HasScriptLanguage()); return scriptLanguage_.value(); } @@ -697,6 +702,7 @@ public: const std::string &GetEmbedderName() const { + ASSERT(HasEmbedderName()); return embedderName_.value(); } @@ -802,6 +808,7 @@ public: const std::string &GetTitle() const { + ASSERT(HasTitle()); return title_.value(); } @@ -860,6 +867,7 @@ public: const std::string &GetTitle() const { + ASSERT(HasTitle()); return title_.value(); } diff --git a/ecmascript/tooling/base/pt_params.cpp b/ecmascript/tooling/base/pt_params.cpp index 39643baafa2f9d2336cebe6e746618749fc0d0e2..741625e544bdde4d295a19a2673eb3030b27bc82 100644 --- a/ecmascript/tooling/base/pt_params.cpp +++ b/ecmascript/tooling/base/pt_params.cpp @@ -1009,16 +1009,16 @@ Local GetObjectByHeapObjectIdParams::ToObject(const EcmaVM *ecmaVm) c return params; } -std::unique_ptr StartPreciseCoverageParam::Create(const EcmaVM *ecmaVm, +std::unique_ptr StartPreciseCoverageParams::Create(const EcmaVM *ecmaVm, const Local ¶ms) { ASSERT(ecmaVm); if (params.IsEmpty()) { - LOG(ERROR, DEBUGGER) << "StartPreciseCoverageParam::Create params is nullptr"; + LOG(ERROR, DEBUGGER) << "StartPreciseCoverageParams::Create params is nullptr"; return nullptr; } std::string error; - auto paramsObject = std::make_unique(); + auto paramsObject = std::make_unique(); Local result = Local(params)->Get(ecmaVm, Local(StringRef::NewFromUtf8(ecmaVm, "callCount"))); @@ -1051,13 +1051,13 @@ std::unique_ptr StartPreciseCoverageParam::Create(con } if (!error.empty()) { - LOG(ERROR, DEBUGGER) << "StartPreciseCoverageParam::Create " << error; + LOG(ERROR, DEBUGGER) << "StartPreciseCoverageParams::Create " << error; return nullptr; } return paramsObject; } -Local StartPreciseCoverageParam::ToObject(const EcmaVM *ecmaVm) const +Local StartPreciseCoverageParams::ToObject(const EcmaVM *ecmaVm) const { Local params = NewObject(ecmaVm); diff --git a/ecmascript/tooling/base/pt_params.h b/ecmascript/tooling/base/pt_params.h index d792ad3875a617901680affc7b243e07f81960ae..99571ded3cf9cb28ada264916918668a62d4b8df 100644 --- a/ecmascript/tooling/base/pt_params.h +++ b/ecmascript/tooling/base/pt_params.h @@ -71,12 +71,12 @@ public: return Local(); } - CallFrameId GetCallFrameId() + CallFrameId GetCallFrameId() const { return callFrameId_; } - const std::string &GetExpression() + const std::string &GetExpression() const { return expression_; } @@ -280,6 +280,7 @@ public: const std::string &GetUrl() const { + ASSERT(HasUrl()); return url_.value(); } @@ -290,6 +291,7 @@ public: const std::string &GetUrlRegex() const { + ASSERT(HasUrlRegex()); return urlRegex_.value(); } @@ -300,6 +302,7 @@ public: const std::string &GetScriptHash() const { + ASSERT(HasScriptHash()); return scriptHash_.value(); } @@ -320,6 +323,7 @@ public: const std::string &GetCondition() const { + ASSERT(HasCondition()); return condition_.value(); } @@ -528,7 +532,7 @@ public: RemoteObjectId GetObjectId() const { - return objectId_.value(); + return objectId_.value_or(-1); } CallFunctionOnParams &SetObjectId(RemoteObjectId objectId) @@ -623,6 +627,7 @@ public: const std::string &GetObjectGroup() const { + ASSERT(HasObjectGroup()); return objectGroup_.value(); } @@ -806,6 +811,7 @@ public: const std::string &GetObjectGroup() const { + ASSERT(HasObjectGroup()); return objectGroup_.value(); } @@ -822,12 +828,12 @@ private: std::optional objectGroup_ {}; }; -class StartPreciseCoverageParam : public PtBaseParams { +class StartPreciseCoverageParams : public PtBaseParams { public: - StartPreciseCoverageParam() = default; - ~StartPreciseCoverageParam() override = default; + StartPreciseCoverageParams() = default; + ~StartPreciseCoverageParams() override = default; - static std::unique_ptr Create(const EcmaVM *ecmaVm, + static std::unique_ptr Create(const EcmaVM *ecmaVm, const Local ¶ms); Local ToObject(const EcmaVM *ecmaVm) const override; @@ -862,8 +868,8 @@ public: } private: - NO_COPY_SEMANTIC(StartPreciseCoverageParam); - NO_MOVE_SEMANTIC(StartPreciseCoverageParam); + NO_COPY_SEMANTIC(StartPreciseCoverageParams); + NO_MOVE_SEMANTIC(StartPreciseCoverageParams); std::optional callCount_ {}; std::optional detailed_ {}; diff --git a/ecmascript/tooling/base/pt_types.cpp b/ecmascript/tooling/base/pt_types.cpp index 1aaecbfda3767ea2829b0c03dbfab07ae7a84ee4..08bc27a4ed81ad19fe75b9be4d3207a0e0992c09 100644 --- a/ecmascript/tooling/base/pt_types.cpp +++ b/ecmascript/tooling/base/pt_types.cpp @@ -338,7 +338,7 @@ std::unique_ptr RemoteObject::Create(const EcmaVM *ecmaVm, const L if (result->IsString()) { auto type = DebuggerApi::ToStdString(result); if (ObjectSubType::Valid(type)) { - remoteObject->subtype_ = type; + remoteObject->subType_ = type; } else { error += "'subtype' is invalid;"; } @@ -398,10 +398,10 @@ Local RemoteObject::ToObject(const EcmaVM *ecmaVm) const params->Set(ecmaVm, Local(StringRef::NewFromUtf8(ecmaVm, "type")), Local(StringRef::NewFromUtf8(ecmaVm, type_.c_str()))); - if (subtype_) { + if (subType_) { params->Set(ecmaVm, Local(StringRef::NewFromUtf8(ecmaVm, "subtype")), - Local(StringRef::NewFromUtf8(ecmaVm, subtype_->c_str()))); + Local(StringRef::NewFromUtf8(ecmaVm, subType_->c_str()))); } if (className_) { params->Set(ecmaVm, diff --git a/ecmascript/tooling/base/pt_types.h b/ecmascript/tooling/base/pt_types.h index f9ef610e5afda9ba041f852d9f8416f0c3872588..3e852693d3ad4a479c953081d7ff95233b776d52 100644 --- a/ecmascript/tooling/base/pt_types.h +++ b/ecmascript/tooling/base/pt_types.h @@ -87,15 +87,15 @@ struct BreakpointDetails { }; // Debugger.CallFrameId -using CallFrameId = uint32_t; +using CallFrameId = int32_t; // ========== Runtime types begin // Runtime.ScriptId -using ScriptId = uint32_t; +using ScriptId = int32_t; // Runtime.RemoteObjectId -using RemoteObjectId = uint32_t; +using RemoteObjectId = int32_t; // Runtime.ExecutionContextId using ExecutionContextId = int32_t; @@ -104,7 +104,7 @@ using ExecutionContextId = int32_t; using UnserializableValue = std::string; // Runtime.UniqueDebuggerId -using UniqueDebuggerId = uint32_t; +using UniqueDebuggerId = int32_t; // Runtime.RemoteObject class RemoteObject : public PtBaseTypes { @@ -134,22 +134,24 @@ public: */ const std::string &GetSubType() const { - return subtype_.value(); + ASSERT(HasSubType()); + return subType_.value(); } RemoteObject &SetSubType(const std::string &type) { - subtype_ = type; + subType_ = type; return *this; } bool HasSubType() const { - return subtype_.has_value(); + return subType_.has_value(); } const std::string &GetClassName() const { + ASSERT(HasClassName()); return className_.value(); } @@ -182,6 +184,7 @@ public: const UnserializableValue &GetUnserializableValue() const { + ASSERT(HasUnserializableValue()); return unserializableValue_.value(); } @@ -198,6 +201,7 @@ public: const std::string &GetDescription() const { + ASSERT(HasDescription()); return description_.value(); } @@ -322,7 +326,7 @@ private: NO_MOVE_SEMANTIC(RemoteObject); std::string type_ {}; - std::optional subtype_ {}; + std::optional subType_ {}; std::optional className_ {}; std::optional> value_ {}; std::optional unserializableValue_ {}; @@ -470,6 +474,7 @@ public: const std::string &GetUrl() const { + ASSERT(HasUrl()); return url_.value(); } @@ -878,6 +883,7 @@ public: const UnserializableValue &GetUnserializableValue() const { + ASSERT(HasUnserializableValue()); return unserializableValue_.value(); } @@ -1150,6 +1156,7 @@ public: */ const std::string &GetType() const { + ASSERT(HasType()); return type_.value(); } @@ -1243,6 +1250,7 @@ public: const std::string &GetName() const { + ASSERT(HasName()); return name_.value(); } @@ -1778,6 +1786,7 @@ public: int32_t GetHitCount() const { + ASSERT(HasHitCount()); return hitCount_.value(); } @@ -1832,6 +1841,7 @@ public: const std::string &GetDeoptReason() const { + ASSERT(HasDeoptReason()); return deoptReason_.value(); } diff --git a/ecmascript/tooling/test/debugger_params_test.cpp b/ecmascript/tooling/test/debugger_params_test.cpp index 521e71ec88a361bec383f40a758f16436e5daf1e..3333835efad8ec2b2548706b632ddda3cb264160 100644 --- a/ecmascript/tooling/test/debugger_params_test.cpp +++ b/ecmascript/tooling/test/debugger_params_test.cpp @@ -492,47 +492,47 @@ HWTEST_F_L0(DebuggerParamsTest, GetObjectByHeapObjectIdParamsToObjectTest) HWTEST_F_L0(DebuggerParamsTest, StartPreciseCoverageParamCreateTest) { std::string msg; - std::unique_ptr objectData; + std::unique_ptr objectData; // abnormal params of null msg msg = std::string() + R"({})"; - objectData = StartPreciseCoverageParam::Create(ecmaVm, DispatchRequest(ecmaVm, msg).GetParamsObj()); + objectData = StartPreciseCoverageParams::Create(ecmaVm, DispatchRequest(ecmaVm, msg).GetParamsObj()); EXPECT_EQ(objectData, nullptr); // abnormal params of unexist key params msg = std::string() + R"({"id":0,"method":"Debugger.Test"})"; - objectData = StartPreciseCoverageParam::Create(ecmaVm, DispatchRequest(ecmaVm, msg).GetParamsObj()); + objectData = StartPreciseCoverageParams::Create(ecmaVm, DispatchRequest(ecmaVm, msg).GetParamsObj()); EXPECT_EQ(objectData, nullptr); // abnormal params of null params.sub-key msg = std::string() + R"({"id":0,"method":"Debugger.Test","params":{}})"; - objectData = StartPreciseCoverageParam::Create(ecmaVm, DispatchRequest(ecmaVm, msg).GetParamsObj()); + objectData = StartPreciseCoverageParams::Create(ecmaVm, DispatchRequest(ecmaVm, msg).GetParamsObj()); ASSERT_NE(objectData, nullptr); // abnormal params of unknown params.sub-key msg = std::string() + R"({"id":0,"method":"Debugger.Test","params":{"unknownKey":100}})"; - objectData = StartPreciseCoverageParam::Create(ecmaVm, DispatchRequest(ecmaVm, msg).GetParamsObj()); + objectData = StartPreciseCoverageParams::Create(ecmaVm, DispatchRequest(ecmaVm, msg).GetParamsObj()); ASSERT_NE(objectData, nullptr); msg = std::string() + R"({"id":0,"method":"Debugger.Test","params":{ "callCount":8, "detailed":8, "allowTriggeredUpdates":8}})"; - objectData = StartPreciseCoverageParam::Create(ecmaVm, DispatchRequest(ecmaVm, msg).GetParamsObj()); + objectData = StartPreciseCoverageParams::Create(ecmaVm, DispatchRequest(ecmaVm, msg).GetParamsObj()); EXPECT_EQ(objectData, nullptr); msg = std::string() + R"({"id":0,"method":"Debugger.Test","params":{ "callCount":"Test", "detailed":"Test", "allowTriggeredUpdates":"Test"}})"; - objectData = StartPreciseCoverageParam::Create(ecmaVm, DispatchRequest(ecmaVm, msg).GetParamsObj()); + objectData = StartPreciseCoverageParams::Create(ecmaVm, DispatchRequest(ecmaVm, msg).GetParamsObj()); EXPECT_EQ(objectData, nullptr); msg = std::string() + R"({"id":0,"method":"Debugger.Test","params":{ "callCount":true, "detailed":true, "allowTriggeredUpdates":true}})"; - objectData = StartPreciseCoverageParam::Create(ecmaVm, DispatchRequest(ecmaVm, msg).GetParamsObj()); + objectData = StartPreciseCoverageParams::Create(ecmaVm, DispatchRequest(ecmaVm, msg).GetParamsObj()); ASSERT_NE(objectData, nullptr); ASSERT_TRUE(objectData->GetCallCount()); ASSERT_TRUE(objectData->GetDetailed()); @@ -542,14 +542,14 @@ HWTEST_F_L0(DebuggerParamsTest, StartPreciseCoverageParamCreateTest) HWTEST_F_L0(DebuggerParamsTest, StartPreciseCoverageParamToObjectTest) { std::string msg; - std::unique_ptr startTrackingData; + std::unique_ptr startTrackingData; Local tmpStr; msg = std::string() + R"({"id":0,"method":"Debugger.Test","params":{ "callCount":true, "detailed":true, "allowTriggeredUpdates":true}})"; - startTrackingData = StartPreciseCoverageParam::Create(ecmaVm, DispatchRequest(ecmaVm, msg).GetParamsObj()); + startTrackingData = StartPreciseCoverageParams::Create(ecmaVm, DispatchRequest(ecmaVm, msg).GetParamsObj()); ASSERT_NE(startTrackingData, nullptr); Local object = startTrackingData->ToObject(ecmaVm); diff --git a/ecmascript/tooling/test/debugger_returns_test.cpp b/ecmascript/tooling/test/debugger_returns_test.cpp index ac261edc4a2d3f02b5b76a2596d42ab72cb96092..1d60edf8e2a56b6d5c795a23f8b3f6614a63ce80 100644 --- a/ecmascript/tooling/test/debugger_returns_test.cpp +++ b/ecmascript/tooling/test/debugger_returns_test.cpp @@ -78,7 +78,7 @@ HWTEST_F_L0(DebuggerReturnsTest, SetBreakpointByUrlReturnsToObjectTest) std::unique_ptr location = std::make_unique(); location->SetScriptId(1); locations.emplace_back(std::move(location)); - ASSERT_EQ(locations.back()->GetScriptId(), 1U); + ASSERT_EQ(locations.back()->GetScriptId(), 1); std::unique_ptr setBreakpointByUrlReturns = std::make_unique("11", std::move(locations)); @@ -208,7 +208,7 @@ HWTEST_F_L0(DebuggerReturnsTest, SetScriptSourceReturnsToObjectTest) ASSERT_NE(setScriptSourceReturns, nullptr); exceptionDetails->SetScriptId(5); - ASSERT_EQ(exceptionDetails->GetScriptId(), 5U); + ASSERT_EQ(exceptionDetails->GetScriptId(), 5); } HWTEST_F_L0(DebuggerReturnsTest, GetPropertiesReturnsToObjectTest) @@ -220,7 +220,7 @@ HWTEST_F_L0(DebuggerReturnsTest, GetPropertiesReturnsToObjectTest) (std::move(descriptor)); ASSERT_NE(getPropertiesReturns, nullptr); exceptionDetails->SetScriptId(6); - ASSERT_EQ(exceptionDetails->GetScriptId(), 6U); + ASSERT_EQ(exceptionDetails->GetScriptId(), 6); Local getObject = getPropertiesReturns->ToObject(ecmaVm); Local tmpStr = StringRef::NewFromUtf8(ecmaVm, "result"); diff --git a/ecmascript/tooling/test/debugger_script_test.cpp b/ecmascript/tooling/test/debugger_script_test.cpp index afad8207dd732920e90c96dc79f206000bfbe47f..cc8ab425ce6facb1ee223d4312415057c302ab0e 100644 --- a/ecmascript/tooling/test/debugger_script_test.cpp +++ b/ecmascript/tooling/test/debugger_script_test.cpp @@ -60,7 +60,7 @@ HWTEST_F_L0(DebuggerScriptTest, ScriptIdTest) { std::unique_ptr script = std::make_unique(1, "name_1", "url_1", "source_1"); script->SetScriptId(100); - ASSERT_EQ(script->GetScriptId(), 100U); + ASSERT_EQ(script->GetScriptId(), 100); } HWTEST_F_L0(DebuggerScriptTest, FileNameTest) diff --git a/ecmascript/tooling/test/debugger_types_test.cpp b/ecmascript/tooling/test/debugger_types_test.cpp index de2864a1324a1b562fb5237d9f0630e46a7cb802..235c2d697a8febcc5d91be18ebd7d9fb5d84d9f9 100644 --- a/ecmascript/tooling/test/debugger_types_test.cpp +++ b/ecmascript/tooling/test/debugger_types_test.cpp @@ -239,7 +239,7 @@ HWTEST_F_L0(DebuggerTypesTest, RemoteObjectCreateTest) ASSERT_NE(remoteObject, nullptr); EXPECT_EQ(ObjectType::Object, remoteObject->GetType()); ASSERT_TRUE(remoteObject->HasObjectId()); - EXPECT_EQ(1U, remoteObject->GetObjectId()); + EXPECT_EQ(remoteObject->GetObjectId(), 1); } HWTEST_F_L0(DebuggerTypesTest, RemoteObjectToObjectTest) @@ -399,7 +399,7 @@ HWTEST_F_L0(DebuggerTypesTest, ExceptionDetailsCreateTest) EXPECT_EQ("text0", exceptionMetaData->GetText()); EXPECT_EQ(exceptionMetaData->GetLine(), 10); EXPECT_EQ(exceptionMetaData->GetColumn(), 20); - EXPECT_EQ(0U, exceptionMetaData->GetScriptId()); + EXPECT_EQ(exceptionMetaData->GetScriptId(), 0); // abnormal params of params.sub-key = // [exceptionId=3,"text"="text0","lineNumber"=10,"columnNumber"=20,"url"=10] @@ -1085,7 +1085,7 @@ HWTEST_F_L0(DebuggerTypesTest, LocationCreateTest) }})"; location = Location::Create(DispatchRequest(ecmaVm, msg).GetParams()); ASSERT_NE(location, nullptr); - EXPECT_EQ(222U, location->GetScriptId()); + EXPECT_EQ(location->GetScriptId(), 222); EXPECT_EQ(location->GetLine(), 899); EXPECT_EQ(location->GetColumn(), 138); @@ -1095,7 +1095,7 @@ HWTEST_F_L0(DebuggerTypesTest, LocationCreateTest) }})"; location = Location::Create(DispatchRequest(ecmaVm, msg).GetParams()); ASSERT_NE(location, nullptr); - EXPECT_EQ(2122U, location->GetScriptId()); + EXPECT_EQ(location->GetScriptId(), 2122); EXPECT_EQ(location->GetLine(), 8299); } @@ -1239,7 +1239,7 @@ HWTEST_F_L0(DebuggerTypesTest, BreakLocationCreateTest) }})"; breakLocation = BreakLocation::Create(ecmaVm, DispatchRequest(ecmaVm, msg).GetParamsObj()); ASSERT_NE(breakLocation, nullptr); - EXPECT_EQ(222U, breakLocation->GetScriptId()); + EXPECT_EQ(breakLocation->GetScriptId(), 222); EXPECT_EQ(breakLocation->GetLine(), 899); EXPECT_EQ(breakLocation->GetColumn(), 138); EXPECT_EQ("return", breakLocation->GetType()); @@ -1250,7 +1250,7 @@ HWTEST_F_L0(DebuggerTypesTest, BreakLocationCreateTest) }})"; breakLocation = BreakLocation::Create(ecmaVm, DispatchRequest(ecmaVm, msg).GetParamsObj()); ASSERT_NE(breakLocation, nullptr); - EXPECT_EQ(2122U, breakLocation->GetScriptId()); + EXPECT_EQ(breakLocation->GetScriptId(), 2122); EXPECT_EQ(breakLocation->GetLine(), 8299); } @@ -1670,11 +1670,11 @@ HWTEST_F_L0(DebuggerTypesTest, CallFrameCreateTest) R"("}}],"this":{"type":")" + ObjectType::Object + R"(","subtype":")" + ObjectSubType::V128 + R"("}}})"; callFrame = CallFrame::Create(ecmaVm, DispatchRequest(ecmaVm, msg).GetParamsObj()); ASSERT_NE(callFrame, nullptr); - EXPECT_EQ(0U, callFrame->GetCallFrameId()); + EXPECT_EQ(callFrame->GetCallFrameId(), 0); EXPECT_EQ("name0", callFrame->GetFunctionName()); ASSERT_FALSE(callFrame->HasFunctionLocation()); Location *location = callFrame->GetLocation(); - EXPECT_EQ(5U, location->GetScriptId()); + EXPECT_EQ(location->GetScriptId(), 5); EXPECT_EQ(location->GetLine(), 19); EXPECT_EQ("url7", callFrame->GetUrl()); const std::vector> *scopeChain = callFrame->GetScopeChain(); @@ -1695,13 +1695,13 @@ HWTEST_F_L0(DebuggerTypesTest, CallFrameCreateTest) R"("},"returnValue":{"type":")" + ObjectType::Object + R"(","subtype":")" + ObjectSubType::I32 + R"("}}})"; callFrame = CallFrame::Create(ecmaVm, DispatchRequest(ecmaVm, msg).GetParamsObj()); ASSERT_NE(callFrame, nullptr); - EXPECT_EQ(10U, callFrame->GetCallFrameId()); + EXPECT_EQ(callFrame->GetCallFrameId(), 10); EXPECT_EQ("name0", callFrame->GetFunctionName()); Location *functionLocation = callFrame->GetFunctionLocation(); - EXPECT_EQ(3U, functionLocation->GetScriptId()); + EXPECT_EQ(functionLocation->GetScriptId(), 3); EXPECT_EQ(functionLocation->GetLine(), 16); location = callFrame->GetLocation(); - EXPECT_EQ(5U, location->GetScriptId()); + EXPECT_EQ(location->GetScriptId(), 5); EXPECT_EQ(location->GetLine(), 19); EXPECT_EQ("url7", callFrame->GetUrl()); scopeChain = callFrame->GetScopeChain();