Skip to content

Commit 7092bb9

Browse files
matetokodirtakacs
andcommitted
Add basics of Chrome Devtools debugger support
- Use routing table for request dispatch in DebuggerHttpRouter, for handling choosing which debugger stack to use based on the http upgrade request: - DebuggerEscargot for the python debugger and VSCode - DebuggerDevtools for connecting to Chrome Devtools - Parse mesasges with 16bit message size - Reply to the first few messages chrome sends - Refactor Debugger: - Rename DebuggerRemote to DebuggerEscargot - DebuggerEscargot and DebuggerDevtools inherit from DebuggerTcp which inherits from Debugger Co-authored-by: Roland Takacs <roland.takacs@h-lab.eu> Signed-off-by: Máté Tokodi <mate.tokodi@szteszoftver.hu>
1 parent 989e692 commit 7092bb9

18 files changed

+3001
-1652
lines changed

src/api/EscargotPublic.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1984,6 +1984,7 @@ bool DebuggerOperationsRef::updateBreakpoint(WeakCodeRef* weakCodeRef, uint32_t
19841984

19851985
class DebuggerC : public Debugger {
19861986
public:
1987+
virtual void init(const char* options, Context* context) override;
19871988
virtual void parseCompleted(String* source, String* srcName, size_t originLineOffset, String* error = nullptr) override;
19881989
virtual void stopAtBreakpoint(ByteCodeBlock* byteCodeBlock, uint32_t offset, ExecutionState* state) override;
19891990
virtual void byteCodeReleaseNotification(ByteCodeBlock* byteCodeBlock) override;
@@ -3385,7 +3386,7 @@ void ContextRef::throwException(ValueRef* exceptionValue)
33853386
toImpl(this)->throwException(s, toImpl(exceptionValue));
33863387
}
33873388

3388-
bool ContextRef::initDebugger(DebuggerOperationsRef::DebuggerClient* debuggerClient)
3389+
bool ContextRef::initDebuggerClient(DebuggerOperationsRef::DebuggerClient* debuggerClient)
33893390
{
33903391
#ifdef ESCARGOT_DEBUGGER
33913392
Context* context = toImpl(this);
@@ -3414,10 +3415,10 @@ bool ContextRef::disableDebugger()
34143415
#endif
34153416
}
34163417

3417-
bool ContextRef::initDebuggerRemote(const char* options)
3418+
bool ContextRef::initDebugger(const char* options)
34183419
{
34193420
#ifdef ESCARGOT_DEBUGGER
3420-
return toImpl(this)->initDebuggerRemote(options);
3421+
return toImpl(this)->initDebugger(options);
34213422
#else /* !ESCARGOT_DEBUGGER */
34223423
return false;
34233424
#endif /* ESCARGOT_DEBUGGER */

src/api/EscargotPublic.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -950,11 +950,11 @@ class ESCARGOT_EXPORT ContextRef {
950950
bool canThrowException();
951951
void throwException(ValueRef* exceptionValue);
952952

953-
bool initDebugger(DebuggerOperationsRef::DebuggerClient* debuggerClient);
953+
bool initDebuggerClient(DebuggerOperationsRef::DebuggerClient* debuggerClient);
954954
bool disableDebugger();
955955
// available options(separator is ';')
956956
// "--port=6501", default for TCP debugger
957-
bool initDebuggerRemote(const char* options);
957+
bool initDebugger(const char* options);
958958
bool isDebuggerRunning();
959959
bool isWaitBeforeExit();
960960
void printDebugger(StringRef* output);

0 commit comments

Comments
 (0)