8236913: debug agent's jdwp command logging should include the command set name and command name

Reviewed-by: amenkov, sspitsyn
This commit is contained in:
Chris Plummer 2020-01-23 04:14:11 +00:00
parent b1d5bee8ca
commit 78ff45ee33
37 changed files with 324 additions and 210 deletions

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1998, 2005, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1998, 2020, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -586,8 +586,10 @@ setValues(PacketInputStream *in, PacketOutputStream *out)
return JNI_TRUE;
}
Command ArrayReference_Commands[] = {
{length, "Length"},
{getValues, "GetValues"},
{setValues, "SetValues"}
};
void *ArrayReference_Cmds[] = { (void *)0x3
,(void *)length
,(void *)getValues
,(void *)setValues};
DEBUG_DISPATCH_DEFINE_CMDSET(ArrayReference)

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1998, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1998, 2020, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -22,4 +22,7 @@
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
extern void *ArrayReference_Cmds[];
#include "debugDispatch.h"
extern CommandSet ArrayReference_CmdSet;

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1998, 2005, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1998, 2020, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -240,5 +240,8 @@ newInstance(PacketInputStream *in, PacketOutputStream *out)
return JNI_TRUE;
}
void *ArrayType_Cmds[] = { (void *)0x1
,(void *)newInstance};
Command ArrayType_Commands[] = {
{newInstance, "NewInstance"}
};
DEBUG_DISPATCH_DEFINE_CMDSET(ArrayType)

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1998, 1999, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1998, 2020, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -22,4 +22,7 @@
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
extern void *ArrayType_Cmds[];
#include "debugDispatch.h"
extern CommandSet ArrayType_CmdSet;

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1998, 2005, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1998, 2020, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -71,6 +71,8 @@ visibleClasses(PacketInputStream *in, PacketOutputStream *out)
return JNI_TRUE;
}
void *ClassLoaderReference_Cmds[] = { (void *)0x1
,(void *)visibleClasses
Command ClassLoaderReference_Commands[] = {
{visibleClasses, "VisibleClasses"}
};
DEBUG_DISPATCH_DEFINE_CMDSET(ClassLoaderReference)

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1998, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1998, 2020, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -22,4 +22,7 @@
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
extern void *ClassLoaderReference_Cmds[];
#include "debugDispatch.h"
extern CommandSet ClassLoaderReference_CmdSet;

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1999, 2005, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1999, 2020, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -55,6 +55,8 @@ reflectedType(PacketInputStream *in, PacketOutputStream *out)
return JNI_TRUE;
}
void *ClassObjectReference_Cmds[] = { (void *)1
,(void *)reflectedType
Command ClassObjectReference_Commands[] = {
{reflectedType, "ReflectedType"}
};
DEBUG_DISPATCH_DEFINE_CMDSET(ClassObjectReference)

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1999, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1999, 2020, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -22,4 +22,7 @@
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
extern void *ClassObjectReference_Cmds[];
#include "debugDispatch.h"
extern CommandSet ClassObjectReference_CmdSet;

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1998, 2005, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1998, 2020, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -175,9 +175,11 @@ invokeStatic(PacketInputStream *in, PacketOutputStream *out)
return sharedInvoke(in, out);
}
void *ClassType_Cmds[] = { (void *)0x4
,(void *)superclass
,(void *)setValues
,(void *)invokeStatic
,(void *)invokeStatic
Command ClassType_Commands[] = {
{superclass, "Superclass"},
{setValues, "SetValues"},
{invokeStatic, "InvokeMethod"},
{invokeStatic, "NewInstance"}
};
DEBUG_DISPATCH_DEFINE_CMDSET(ClassType)

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1998, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1998, 2020, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -22,4 +22,7 @@
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
extern void *ClassType_Cmds[];
#include "debugDispatch.h"
extern CommandSet ClassType_CmdSet;

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1998, 2005, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1998, 2020, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -346,7 +346,10 @@ clearAllBreakpoints(PacketInputStream *in, PacketOutputStream *out)
return JNI_TRUE;
}
void *EventRequest_Cmds[] = { (void *)0x3
,(void *)setCommand
,(void *)clearCommand
,(void *)clearAllBreakpoints};
Command EventRequest_Commands[] = {
{setCommand, "SetCommand"},
{clearCommand, "ClearCommand"},
{clearAllBreakpoints, "ClearAllBreakpoints"}
};
DEBUG_DISPATCH_DEFINE_CMDSET(EventRequest)

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1998, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1998, 2020, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -22,4 +22,7 @@
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
extern void *EventRequest_Cmds[];
#include "debugDispatch.h"
extern CommandSet EventRequest_CmdSet;

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1998, 2003, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1998, 2020, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -25,4 +25,6 @@
#include "FieldImpl.h"
void *Field_Cmds[] = { (void *)0x0 };
CommandSet Field_CmdSet = {
0, "Field", NULL
};

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1998, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1998, 2020, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -22,4 +22,7 @@
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
extern void *Field_Cmds[];
#include "debugDispatch.h"
extern CommandSet Field_CmdSet;

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1998, 2005, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1998, 2020, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -34,6 +34,8 @@ invokeStatic(PacketInputStream *in, PacketOutputStream *out)
return sharedInvoke(in, out);
}
void *InterfaceType_Cmds[] = { (void *)0x1
, (void *)invokeStatic
Command InterfaceType_Commands[] = {
{invokeStatic, "InvokeMethod"}
};
DEBUG_DISPATCH_DEFINE_CMDSET(InterfaceType)

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1998, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1998, 2020, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -22,4 +22,7 @@
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
extern void *InterfaceType_Cmds[];
#include "debugDispatch.h"
extern CommandSet InterfaceType_CmdSet;

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1998, 2005, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1998, 2020, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -231,10 +231,12 @@ isObsolete(PacketInputStream *in, PacketOutputStream *out)
return JNI_TRUE;
}
void *Method_Cmds[] = { (void *)0x5
,(void *)lineTable
,(void *)variableTable
,(void *)bytecodes
,(void *)isObsolete
,(void *)variableTableWithGenerics
Command Method_Commands[] = {
{lineTable, "LineTable"},
{variableTable, "VariableTable"},
{bytecodes, "Bytecodes"},
{isObsolete, "IsObsolete"},
{variableTableWithGenerics, "VariableTableWithGenerics"}
};
DEBUG_DISPATCH_DEFINE_CMDSET(Method)

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1998, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1998, 2020, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -22,4 +22,7 @@
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
extern void *Method_Cmds[];
#include "debugDispatch.h"
extern CommandSet Method_CmdSet;

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2016, 2020, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -83,8 +83,9 @@ getClassLoader(PacketInputStream *in, PacketOutputStream *out)
return JNI_TRUE;
}
void *ModuleReference_Cmds[] = { (void *)3
,(void *)getName
,(void *)getClassLoader
Command ModuleReference_Commands[] = {
{getName, "GetName"},
{getClassLoader, "GetClassLoader"}
};
DEBUG_DISPATCH_DEFINE_CMDSET(ModuleReference)

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2016, 2020, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -22,4 +22,7 @@
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
extern void *ModuleReference_Cmds[];
#include "debugDispatch.h"
extern CommandSet ModuleReference_CmdSet;

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1998, 2005, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1998, 2020, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -352,15 +352,17 @@ referringObjects(PacketInputStream *in, PacketOutputStream *out)
return JNI_TRUE;
}
void *ObjectReference_Cmds[] = { (void *)10
,(void *)referenceType
,(void *)getValues
,(void *)setValues
,(void *)NULL /* no longer used */
,(void *)monitorInfo
,(void *)invokeInstance
,(void *)disableCollection
,(void *)enableCollection
,(void *)isCollected
,(void *)referringObjects
};
Command ObjectReference_Commands[] = {
{referenceType, "ReferenceType"},
{getValues, "GetValues"},
{setValues, "SetValues"},
{NULL, "<unused>"},
{monitorInfo, "MonitorInfo"},
{invokeInstance, "InvokeInstance"},
{disableCollection, "DisableCollection"},
{enableCollection, "EnableCollection"},
{isCollected, "IsCollected"},
{referringObjects, "ReferringObjects"}
};
DEBUG_DISPATCH_DEFINE_CMDSET(ObjectReference)

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1998, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1998, 2020, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -22,4 +22,7 @@
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
extern void *ObjectReference_Cmds[];
#include "debugDispatch.h"
extern CommandSet ObjectReference_CmdSet;

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1998, 2016, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1998, 2020, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -233,8 +233,7 @@ methods1(PacketInputStream *in, PacketOutputStream *out,
}
static jboolean
methods(PacketInputStream *in, PacketOutputStream *out,
int outputGenerics)
methods(PacketInputStream *in, PacketOutputStream *out)
{
return methods1(in, out, 0);
}
@ -625,24 +624,26 @@ classObject(PacketInputStream *in, PacketOutputStream *out)
return JNI_TRUE;
}
void *ReferenceType_Cmds[] = { (void *)19
,(void *)signature
,(void *)getClassLoader
,(void *)modifiers
,(void *)fields
,(void *)methods
,(void *)getValues
,(void *)sourceFile
,(void *)nestedTypes
,(void *)getClassStatus
,(void *)interfaces
,(void *)classObject
,(void *)sourceDebugExtension
,(void *)signatureWithGeneric
,(void *)fieldsWithGeneric
,(void *)methodsWithGeneric
,(void *)instances
,(void *)getClassVersion
,(void *)getConstantPool
,(void *)getModule
Command ReferenceType_Commands[] = {
{signature, "Signature"},
{getClassLoader, "GetClassLoader"},
{modifiers, "Modifiers"},
{fields, "Fields"},
{methods, "Methods"},
{getValues, "GetValues"},
{sourceFile, "SourceFile"},
{nestedTypes, "NestedTypes"},
{getClassStatus, "GetClassStatus"},
{interfaces, "Interfaces"},
{classObject, "ClassObject"},
{sourceDebugExtension, "SourceDebugExtension"},
{signatureWithGeneric, "SignatureWithGeneric"},
{fieldsWithGeneric, "FieldsWithGeneric"},
{methodsWithGeneric, "MethodsWithGeneric"},
{instances, "Instances"},
{getClassVersion, "GetClassVersion"},
{getConstantPool, "GetConstantPool"},
{getModule, "GetModule"}
};
DEBUG_DISPATCH_DEFINE_CMDSET(ReferenceType)

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1998, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1998, 2020, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -22,4 +22,7 @@
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
extern void *ReferenceType_Cmds[];
#include "debugDispatch.h"
extern CommandSet ReferenceType_CmdSet;

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1998, 2005, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1998, 2020, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -456,9 +456,11 @@ popFrames(PacketInputStream *in, PacketOutputStream *out)
return JNI_TRUE;
}
void *StackFrame_Cmds[] = { (void *)0x4
,(void *)getValues
,(void *)setValues
,(void *)thisObject
,(void *)popFrames
Command StackFrame_Commands[] = {
{getValues, "GetValues"},
{setValues, "SetValues"},
{thisObject, "ThisObject"},
{popFrames, "PopFrames"}
};
DEBUG_DISPATCH_DEFINE_CMDSET(StackFrame)

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1998, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1998, 2020, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -22,4 +22,7 @@
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
extern void *StackFrame_Cmds[];
#include "debugDispatch.h"
extern CommandSet StackFrame_CmdSet;

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1998, 2005, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1998, 2020, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -56,5 +56,8 @@ value(PacketInputStream *in, PacketOutputStream *out)
return JNI_TRUE;
}
void *StringReference_Cmds[] = { (void *)0x1
,(void *)value};
Command StringReference_Commands[] = {
{value, "Value"}
};
DEBUG_DISPATCH_DEFINE_CMDSET(StringReference)

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1998, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1998, 2020, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -22,4 +22,7 @@
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
extern void *StringReference_Cmds[];
#include "debugDispatch.h"
extern CommandSet StringReference_CmdSet;

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1998, 2020, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -135,7 +135,10 @@ children(PacketInputStream *in, PacketOutputStream *out)
return JNI_TRUE;
}
void *ThreadGroupReference_Cmds[] = { (void *)3,
(void *)name,
(void *)parent,
(void *)children };
Command ThreadGroupReference_Commands[] = {
{name, "Name"},
{parent, "Parent"},
{children, "Children"}
};
DEBUG_DISPATCH_DEFINE_CMDSET(ThreadGroupReference)

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1998, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1998, 2020 Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -22,4 +22,7 @@
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
extern void *ThreadGroupReference_Cmds[];
#include "debugDispatch.h"
extern CommandSet ThreadGroupReference_CmdSet;

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1998, 2018, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1998, 2020, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -665,20 +665,21 @@ forceEarlyReturn(PacketInputStream *in, PacketOutputStream *out)
return JNI_TRUE;
}
Command ThreadReference_Commands[] = {
{name, "Name"},
{suspend, "Suspend"},
{resume, "Resume"},
{status, "Status"},
{threadGroup, "ThreadGroup"},
{frames, "Frames"},
{getFrameCount, "GetFrameCount"},
{ownedMonitors, "OwnedMonitors"},
{currentContendedMonitor, "CurrentContendedMonitor"},
{stop, "Stop"},
{interrupt, "Interrupt"},
{suspendCount, "SuspendCount"},
{ownedMonitorsWithStackDepth, "OwnedMonitorsWithStackDepth"},
{forceEarlyReturn, "ForceEarlyReturn"}
};
void *ThreadReference_Cmds[] = { (void *)14,
(void *)name,
(void *)suspend,
(void *)resume,
(void *)status,
(void *)threadGroup,
(void *)frames,
(void *)getFrameCount,
(void *)ownedMonitors,
(void *)currentContendedMonitor,
(void *)stop,
(void *)interrupt,
(void *)suspendCount,
(void *)ownedMonitorsWithStackDepth,
(void *)forceEarlyReturn
};
DEBUG_DISPATCH_DEFINE_CMDSET(ThreadReference)

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1998, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1998, 2020, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -22,4 +22,7 @@
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
extern void *ThreadReference_Cmds[];
#include "debugDispatch.h"
extern CommandSet ThreadReference_CmdSet;

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1998, 2019, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1998, 2020, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -927,27 +927,29 @@ releaseEvents(PacketInputStream *in, PacketOutputStream *out)
return JNI_TRUE;
}
void *VirtualMachine_Cmds[] = { (void *)22
,(void *)version
,(void *)classesForSignature
,(void *)allClasses
,(void *)getAllThreads
,(void *)topLevelThreadGroups
,(void *)dispose
,(void *)idSizes
,(void *)suspend
,(void *)resume
,(void *)doExit
,(void *)createString
,(void *)capabilities
,(void *)classPaths
,(void *)disposeObjects
,(void *)holdEvents
,(void *)releaseEvents
,(void *)capabilitiesNew
,(void *)redefineClasses
,(void *)setDefaultStratum
,(void *)allClassesWithGeneric
,(void *)instanceCounts
,(void *)allModules
Command VirtualMachine_Commands[] = {
{version, "Version"},
{classesForSignature, "ClassesForSignature"},
{allClasses, "AllClasses"},
{getAllThreads, "GetAllThreads"},
{topLevelThreadGroups, "TopLevelThreadGroups"},
{dispose, "Dispose"},
{idSizes, "IDSizes"},
{suspend, "Suspend"},
{resume, "Resume"},
{doExit, "DoExit"},
{createString, "CreateString"},
{capabilities, "Capabilities"},
{classPaths, "ClassPaths"},
{disposeObjects, "DisposeObjects"},
{holdEvents, "HoldEvents"},
{releaseEvents, "ReleaseEvents"},
{capabilitiesNew, "CapabilitiesNew"},
{redefineClasses, "RedefineClasses"},
{setDefaultStratum, "SetDefaultStratum"},
{allClassesWithGeneric, "AllClassesWithGeneric"},
{instanceCounts, "InstanceCounts"},
{allModules, "AllModules"}
};
DEBUG_DISPATCH_DEFINE_CMDSET(VirtualMachine)

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1998, 2003, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1998, 2020, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -23,4 +23,6 @@
* questions.
*/
extern void *VirtualMachine_Cmds[];
#include "debugDispatch.h"
extern CommandSet VirtualMachine_CmdSet;

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1998, 2016, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1998, 2020, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -44,7 +44,7 @@
#include "EventRequestImpl.h"
#include "StackFrameImpl.h"
static void **l1Array;
static CommandSet **cmdSetsArray;
void
debugDispatch_initialize(void)
@ -54,36 +54,36 @@ debugDispatch_initialize(void)
* Zero the table so that unknown CommandSets do not
* cause random errors.
*/
l1Array = jvmtiAllocate((JDWP_HIGHEST_COMMAND_SET+1) * sizeof(void *));
cmdSetsArray = jvmtiAllocate((JDWP_HIGHEST_COMMAND_SET+1) * sizeof(CommandSet *));
if (l1Array == NULL) {
if (cmdSetsArray == NULL) {
EXIT_ERROR(AGENT_ERROR_OUT_OF_MEMORY,"command set array");
}
(void)memset(l1Array, 0, (JDWP_HIGHEST_COMMAND_SET+1) * sizeof(void *));
(void)memset(cmdSetsArray, 0, (JDWP_HIGHEST_COMMAND_SET+1) * sizeof(CommandSet *));
/*
* Create the level-two (Command) dispatch tables to the
* corresponding slots in the CommandSet dispatch table..
*/
l1Array[JDWP_COMMAND_SET(VirtualMachine)] = (void *)VirtualMachine_Cmds;
l1Array[JDWP_COMMAND_SET(ReferenceType)] = (void *)ReferenceType_Cmds;
l1Array[JDWP_COMMAND_SET(ClassType)] = (void *)ClassType_Cmds;
l1Array[JDWP_COMMAND_SET(InterfaceType)] = (void *)InterfaceType_Cmds;
l1Array[JDWP_COMMAND_SET(ArrayType)] = (void *)ArrayType_Cmds;
cmdSetsArray[JDWP_COMMAND_SET(VirtualMachine)] = &VirtualMachine_CmdSet;
cmdSetsArray[JDWP_COMMAND_SET(ReferenceType)] = &ReferenceType_CmdSet;
cmdSetsArray[JDWP_COMMAND_SET(ClassType)] = &ClassType_CmdSet;
cmdSetsArray[JDWP_COMMAND_SET(InterfaceType)] = &InterfaceType_CmdSet;
cmdSetsArray[JDWP_COMMAND_SET(ArrayType)] = &ArrayType_CmdSet;
l1Array[JDWP_COMMAND_SET(Field)] = (void *)Field_Cmds;
l1Array[JDWP_COMMAND_SET(Method)] = (void *)Method_Cmds;
l1Array[JDWP_COMMAND_SET(ObjectReference)] = (void *)ObjectReference_Cmds;
l1Array[JDWP_COMMAND_SET(StringReference)] = (void *)StringReference_Cmds;
l1Array[JDWP_COMMAND_SET(ThreadReference)] = (void *)ThreadReference_Cmds;
l1Array[JDWP_COMMAND_SET(ThreadGroupReference)] = (void *)ThreadGroupReference_Cmds;
l1Array[JDWP_COMMAND_SET(ClassLoaderReference)] = (void *)ClassLoaderReference_Cmds;
l1Array[JDWP_COMMAND_SET(ArrayReference)] = (void *)ArrayReference_Cmds;
l1Array[JDWP_COMMAND_SET(EventRequest)] = (void *)EventRequest_Cmds;
l1Array[JDWP_COMMAND_SET(StackFrame)] = (void *)StackFrame_Cmds;
l1Array[JDWP_COMMAND_SET(ClassObjectReference)] = (void *)ClassObjectReference_Cmds;
l1Array[JDWP_COMMAND_SET(ModuleReference)] = (void *)ModuleReference_Cmds;
cmdSetsArray[JDWP_COMMAND_SET(Field)] = &Field_CmdSet;
cmdSetsArray[JDWP_COMMAND_SET(Method)] = &Method_CmdSet;
cmdSetsArray[JDWP_COMMAND_SET(ObjectReference)] = &ObjectReference_CmdSet;
cmdSetsArray[JDWP_COMMAND_SET(StringReference)] = &StringReference_CmdSet;
cmdSetsArray[JDWP_COMMAND_SET(ThreadReference)] = &ThreadReference_CmdSet;
cmdSetsArray[JDWP_COMMAND_SET(ThreadGroupReference)] = &ThreadGroupReference_CmdSet;
cmdSetsArray[JDWP_COMMAND_SET(ClassLoaderReference)] = &ClassLoaderReference_CmdSet;
cmdSetsArray[JDWP_COMMAND_SET(ArrayReference)] = &ArrayReference_CmdSet;
cmdSetsArray[JDWP_COMMAND_SET(EventRequest)] = &EventRequest_CmdSet;
cmdSetsArray[JDWP_COMMAND_SET(StackFrame)] = &StackFrame_CmdSet;
cmdSetsArray[JDWP_COMMAND_SET(ClassObjectReference)] = &ClassObjectReference_CmdSet;
cmdSetsArray[JDWP_COMMAND_SET(ModuleReference)] = &ModuleReference_CmdSet;
}
void
@ -92,25 +92,27 @@ debugDispatch_reset(void)
}
CommandHandler
debugDispatch_getHandler(int cmdSet, int cmd)
debugDispatch_getHandler(int cmdSetNum, int cmdNum, const char **cmdSetName_p, const char **cmdName_p)
{
void **l2Array;
CommandSet *cmd_set;
*cmdSetName_p = "<Invalid CommandSet>";
*cmdName_p = "<Unkown Command>";
if (cmdSet > JDWP_HIGHEST_COMMAND_SET) {
if (cmdSetNum > JDWP_HIGHEST_COMMAND_SET) {
return NULL;
}
l2Array = (void **)l1Array[cmdSet];
/*
* If there is no such CommandSet or the Command
* is greater than the nummber of commands (the first
* element) in the CommandSet, indicate this is invalid.
*/
/*LINTED*/
if (l2Array == NULL || cmd > (int)(intptr_t)(void*)l2Array[0]) {
return NULL;
cmd_set = cmdSetsArray[cmdSetNum];
if (cmd_set == NULL) {
return NULL;
}
return (CommandHandler)l2Array[cmd];
*cmdSetName_p = cmd_set->cmd_set_name;
if (cmdNum > cmd_set->num_cmds) {
*cmdName_p = "<Invalid Command>";
return NULL;
} else {
*cmdName_p = cmd_set->cmds[cmdNum - 1].cmd_name;
return cmd_set->cmds[cmdNum - 1].cmd_handler;
}
}

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1998, 2003, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1998, 2020, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -26,6 +26,8 @@
#ifndef JDWP_DEBUGDISPATCH_H
#define JDWP_DEBUGDISPATCH_H
#include "vm_interface.h"
/*
* Type of all command handler functions. First argument is the
* input stream. Second argument is the output sent back to the
@ -39,6 +41,25 @@ typedef jboolean (*CommandHandler)(struct PacketInputStream *,
struct PacketOutputStream *);
void debugDispatch_initialize(void);
void debugDispatch_reset(void);
CommandHandler debugDispatch_getHandler(int cmdSet, int cmd) ;
CommandHandler debugDispatch_getHandler(int cmdSetNum, int cmdNum,
const char **cmdSetName_p, const char **cmdName_p);
typedef struct Command {
CommandHandler cmd_handler;
const char *cmd_name;
} Command;
typedef struct CommandSet {
const int num_cmds;
const char *cmd_set_name;
const Command *cmds;
} CommandSet;
#define DEBUG_DISPATCH_DEFINE_CMDSET(_name) \
CommandSet _name##_CmdSet = { \
sizeof(_name##_Commands) / sizeof(Command), \
#_name, \
_name##_Commands \
};
#endif

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1998, 2017, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1998, 2020, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -117,6 +117,8 @@ debugLoop_run(void)
PacketInputStream in;
PacketOutputStream out;
CommandHandler func;
const char *cmdSetName;
const char *cmdName;
/* Should reply be sent to sender.
* For error handling, assume yes, since
@ -137,9 +139,9 @@ debugLoop_run(void)
inStream_init(&in, p);
outStream_initReply(&out, inStream_id(&in));
LOG_MISC(("Command set %d, command %d", cmd->cmdSet, cmd->cmd));
func = debugDispatch_getHandler(cmd->cmdSet,cmd->cmd);
func = debugDispatch_getHandler(cmd->cmdSet, cmd->cmd, &cmdSetName, &cmdName);
LOG_MISC(("Command set %s(%d), command %s(%d)",
cmdSetName, cmd->cmdSet, cmdName, cmd->cmd));
if (func == NULL) {
/* we've never heard of this, so I guess we
* haven't implemented it.
@ -229,9 +231,13 @@ reader(jvmtiEnv* jvmti_env, JNIEnv* jni_env, void* arg)
shouldListen = JNI_FALSE;
notifyTransportError();
} else {
const char *cmdSetName;
const char *cmdName;
cmd = &packet.type.cmd;
LOG_MISC(("Command set %d, command %d", cmd->cmdSet, cmd->cmd));
debugDispatch_getHandler(cmd->cmdSet, cmd->cmd, &cmdSetName, &cmdName);
LOG_MISC(("Command set %s(%d), command %s(%d)",
cmdSetName, cmd->cmdSet, cmdName, cmd->cmd));
/*
* FIXME! We need to deal with high priority