-
Notifications
You must be signed in to change notification settings - Fork 61
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add array support for JDWP DSL (#74)
* add array support for JDWP DSL * fix schema bugs * update arraytype in AllClasses command * update arraytype in AllClasses command remove error type * fix out and reply mismatch
- Loading branch information
Showing
2 changed files
with
89 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
# Copyright (c) Meta Platforms, Inc. and affiliates. | ||
|
||
"""JDWP Commands for ThreadReference Command Set.""" | ||
|
||
from projects.jdwp.defs.schema import ( | ||
Command, | ||
Field, | ||
Struct, | ||
Type, | ||
Array, | ||
CommandSet, | ||
ArrayLength, | ||
IntegralType, | ||
) | ||
from projects.jdwp.defs.constants import ErrorType | ||
|
||
|
||
__AllClasses_reply_classes = Field( | ||
"classes", | ||
ArrayLength(IntegralType.INT), | ||
"Number of reference type that follow", | ||
) | ||
|
||
|
||
__AllClasses_reply_classesArray_element = Struct( | ||
[ | ||
Field("refTypeTag", IntegralType.BYTE, "Kind of following reference type"), | ||
Field("typeID", Type.REFERENCE_TYPE_ID, "Loaded reference type"), | ||
Field( | ||
"signature", Type.STRING, "The JNI signature of the loaded reference type" | ||
), | ||
Field("status", IntegralType.INT, "The current class status"), | ||
] | ||
) | ||
|
||
__AllClasses_reply = Struct( | ||
[ | ||
__AllClasses_reply_classes, | ||
Field( | ||
"classesArray", | ||
Array(__AllClasses_reply_classesArray_element, __AllClasses_reply_classes), | ||
"Array of reference type.", | ||
), | ||
] | ||
) | ||
|
||
AllClasses = Command( | ||
name="AllClasses", | ||
id=3, | ||
out=None, | ||
reply=__AllClasses_reply, | ||
error={ | ||
ErrorType.VM_DEAD, | ||
}, | ||
) | ||
|
||
|
||
VirtualMachine = CommandSet( | ||
name="VirtualMachine", | ||
id=1, | ||
commands=[ | ||
AllClasses, | ||
], | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters