DebuggerGlobalJSObject.h 931 B

123456789101112131415161718192021222324252627282930313233
  1. /*
  2. * Copyright (c) 2021, Hunter Salyer <thefalsehonesty@gmail.com>
  3. *
  4. * SPDX-License-Identifier: BSD-2-Clause
  5. */
  6. #pragma once
  7. #include <AK/Weakable.h>
  8. #include <LibDebug/DebugInfo.h>
  9. #include <LibJS/Runtime/GlobalObject.h>
  10. namespace HackStudio {
  11. class DebuggerGlobalJSObject final
  12. : public JS::GlobalObject
  13. , public Weakable<DebuggerGlobalJSObject> {
  14. JS_OBJECT(DebuggerGlobalJSObject, JS::GlobalObject);
  15. public:
  16. DebuggerGlobalJSObject();
  17. JS::Value get(const JS::PropertyName& name, JS::Value receiver, bool without_side_effects) const override;
  18. bool put(const JS::PropertyName& name, JS::Value value, JS::Value receiver) override;
  19. Optional<JS::Value> debugger_to_js(const Debug::DebugInfo::VariableInfo&) const;
  20. Optional<u32> js_to_debugger(JS::Value value, const Debug::DebugInfo::VariableInfo&) const;
  21. private:
  22. NonnullOwnPtrVector<Debug::DebugInfo::VariableInfo> m_variables;
  23. };
  24. }