BreakpointProbe.h 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. //-------------------------------------------------------------------------------------------------------
  2. // Copyright (C) Microsoft. All rights reserved.
  3. // Licensed under the MIT license. See LICENSE.txt file in the project root for full license information.
  4. //-------------------------------------------------------------------------------------------------------
  5. #pragma once
  6. namespace Js
  7. {
  8. class BreakpointProbe : public Probe
  9. {
  10. int characterOffset;
  11. int byteOffset;
  12. DebugDocument* debugDocument;
  13. FunctionBody* functionBody;
  14. UINT breakpointId;
  15. public:
  16. BreakpointProbe(DebugDocument* debugDocument, StatementLocation& statement, int breakpointId);
  17. virtual bool Install(ScriptContext* pScriptContext);
  18. virtual bool Uninstall(ScriptContext* pScriptContext);
  19. virtual bool CanHalt(InterpreterHaltState* pHaltState);
  20. virtual void DispatchHalt(InterpreterHaltState* pHaltState);
  21. virtual void CleanupHalt();
  22. bool Matches(FunctionBody* _pBody, int characterPosition);
  23. bool Matches(StatementLocation statement);
  24. bool Matches(FunctionBody* _pBody, DebugDocument* debugDocument, int byteOffset);
  25. UINT GetId() const { return this->breakpointId; }
  26. void GetStatementLocation(StatementLocation * statement);
  27. FunctionBody* GetFunctionBody() const { return this->functionBody; }
  28. int GetBytecodeOffset() const { return this->byteOffset; }
  29. DebugDocument* GetDbugDocument() { return this->debugDocument; }
  30. int GetCharacterOffset() { return this->characterOffset; }
  31. };
  32. typedef JsUtil::List<BreakpointProbe*, ArenaAllocator> BreakpointProbeList;
  33. }