Debugger.h 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. /*
  2. * Copyright (C) 1999-2001 Harri Porten (porten@kde.org)
  3. * Copyright (C) 2001 Peter Kelly (pmk@post.com)
  4. * Copyright (C) 2008, 2009 Apple Inc. All rights reserved.
  5. *
  6. * This library is free software; you can redistribute it and/or
  7. * modify it under the terms of the GNU Lesser General Public
  8. * License as published by the Free Software Foundation; either
  9. * version 2 of the License, or (at your option) any later version.
  10. *
  11. * This library is distributed in the hope that it will be useful,
  12. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  14. * Lesser General Public License for more details.
  15. *
  16. * You should have received a copy of the GNU Lesser General Public
  17. * License along with this library; if not, write to the Free Software
  18. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  19. *
  20. */
  21. #ifndef Debugger_h
  22. #define Debugger_h
  23. #include <wtf/HashSet.h>
  24. namespace JSC {
  25. class DebuggerCallFrame;
  26. class ExecState;
  27. class VM;
  28. class JSGlobalObject;
  29. class JSValue;
  30. class SourceProvider;
  31. class JS_EXPORT_PRIVATE Debugger {
  32. public:
  33. virtual ~Debugger();
  34. void attach(JSGlobalObject*);
  35. virtual void detach(JSGlobalObject*);
  36. virtual void sourceParsed(ExecState*, SourceProvider*, int errorLineNumber, const WTF::String& errorMessage) = 0;
  37. virtual void exception(const DebuggerCallFrame&, intptr_t, int, int, bool) = 0;
  38. virtual void atStatement(const DebuggerCallFrame&, intptr_t, int, int) = 0;
  39. virtual void callEvent(const DebuggerCallFrame&, intptr_t, int, int) = 0;
  40. virtual void returnEvent(const DebuggerCallFrame&, intptr_t, int, int) = 0;
  41. virtual void willExecuteProgram(const DebuggerCallFrame&, intptr_t, int, int) = 0;
  42. virtual void didExecuteProgram(const DebuggerCallFrame&, intptr_t, int, int) = 0;
  43. virtual void didReachBreakpoint(const DebuggerCallFrame&, intptr_t, int, int) = 0;
  44. void recompileAllJSFunctions(VM*);
  45. private:
  46. HashSet<JSGlobalObject*> m_globalObjects;
  47. };
  48. // This function exists only for backwards compatibility with existing WebScriptDebugger clients.
  49. JS_EXPORT_PRIVATE JSValue evaluateInGlobalCallFrame(const WTF::String&, JSValue& exception, JSGlobalObject*);
  50. } // namespace JSC
  51. #endif // Debugger_h