From 9c0f4e436d3f5669d87804a75d2afae97f4f2d43 Mon Sep 17 00:00:00 2001 From: Michael Wekesa Date: Tue, 21 Nov 2023 18:30:33 +0300 Subject: [PATCH] add version command (#82) --- .../jdwp/defs/command_sets/virtual_machine.py | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/projects/jdwp/defs/command_sets/virtual_machine.py b/projects/jdwp/defs/command_sets/virtual_machine.py index b2beef2..4795c6c 100644 --- a/projects/jdwp/defs/command_sets/virtual_machine.py +++ b/projects/jdwp/defs/command_sets/virtual_machine.py @@ -54,6 +54,28 @@ }, ) +__Version_reply = Struct( + [ + Field("description", Type.STRING, "Text information on the VM version"), + Field("jdwpMajor", IntegralType.INT, "JDWP major version number"), + Field("jdwpMinor", IntegralType.INT, "JDWP minor version number"), + Field( + "vmVersion", + Type.STRING, + "Target VM JRE version, as in the java.version property", + ), + Field("vmName", Type.STRING, "Target VM name, as in the java.vm.name property"), + ] +) + +Version = Command( + name="Version", + id=1, + out=None, + reply=__Version_reply, + error={ErrorType.VM_DEAD}, +) + Dispose = Command( name="Dispose", id=6, @@ -143,6 +165,7 @@ name="VirtualMachine", id=1, commands=[ + Version, AllClasses, Dispose, IDSizes,