Skip to content
Permalink
Browse files

8236913: debug agent's jdwp command logging should include the comman…

…d set name and command name

Reviewed-by: amenkov, sspitsyn
  • Loading branch information
plummercj committed Jan 23, 2020
1 parent b1d5bee commit 78ff45ee3382ae319833ec482eb7550a331f4c68
Showing with 324 additions and 210 deletions.
  1. +7 −5 src/jdk.jdwp.agent/share/native/libjdwp/ArrayReferenceImpl.c
  2. +5 −2 src/jdk.jdwp.agent/share/native/libjdwp/ArrayReferenceImpl.h
  3. +6 −3 src/jdk.jdwp.agent/share/native/libjdwp/ArrayTypeImpl.c
  4. +5 −2 src/jdk.jdwp.agent/share/native/libjdwp/ArrayTypeImpl.h
  5. +5 −3 src/jdk.jdwp.agent/share/native/libjdwp/ClassLoaderReferenceImpl.c
  6. +5 −2 src/jdk.jdwp.agent/share/native/libjdwp/ClassLoaderReferenceImpl.h
  7. +5 −3 src/jdk.jdwp.agent/share/native/libjdwp/ClassObjectReferenceImpl.c
  8. +5 −2 src/jdk.jdwp.agent/share/native/libjdwp/ClassObjectReferenceImpl.h
  9. +8 −6 src/jdk.jdwp.agent/share/native/libjdwp/ClassTypeImpl.c
  10. +5 −2 src/jdk.jdwp.agent/share/native/libjdwp/ClassTypeImpl.h
  11. +8 −5 src/jdk.jdwp.agent/share/native/libjdwp/EventRequestImpl.c
  12. +5 −2 src/jdk.jdwp.agent/share/native/libjdwp/EventRequestImpl.h
  13. +4 −2 src/jdk.jdwp.agent/share/native/libjdwp/FieldImpl.c
  14. +5 −2 src/jdk.jdwp.agent/share/native/libjdwp/FieldImpl.h
  15. +5 −3 src/jdk.jdwp.agent/share/native/libjdwp/InterfaceTypeImpl.c
  16. +5 −2 src/jdk.jdwp.agent/share/native/libjdwp/InterfaceTypeImpl.h
  17. +9 −7 src/jdk.jdwp.agent/share/native/libjdwp/MethodImpl.c
  18. +5 −2 src/jdk.jdwp.agent/share/native/libjdwp/MethodImpl.h
  19. +6 −5 src/jdk.jdwp.agent/share/native/libjdwp/ModuleReferenceImpl.c
  20. +5 −2 src/jdk.jdwp.agent/share/native/libjdwp/ModuleReferenceImpl.h
  21. +15 −13 src/jdk.jdwp.agent/share/native/libjdwp/ObjectReferenceImpl.c
  22. +5 −2 src/jdk.jdwp.agent/share/native/libjdwp/ObjectReferenceImpl.h
  23. +24 −23 src/jdk.jdwp.agent/share/native/libjdwp/ReferenceTypeImpl.c
  24. +5 −2 src/jdk.jdwp.agent/share/native/libjdwp/ReferenceTypeImpl.h
  25. +8 −6 src/jdk.jdwp.agent/share/native/libjdwp/StackFrameImpl.c
  26. +5 −2 src/jdk.jdwp.agent/share/native/libjdwp/StackFrameImpl.h
  27. +6 −3 src/jdk.jdwp.agent/share/native/libjdwp/StringReferenceImpl.c
  28. +5 −2 src/jdk.jdwp.agent/share/native/libjdwp/StringReferenceImpl.h
  29. +8 −5 src/jdk.jdwp.agent/share/native/libjdwp/ThreadGroupReferenceImpl.c
  30. +5 −2 src/jdk.jdwp.agent/share/native/libjdwp/ThreadGroupReferenceImpl.h
  31. +19 −18 src/jdk.jdwp.agent/share/native/libjdwp/ThreadReferenceImpl.c
  32. +5 −2 src/jdk.jdwp.agent/share/native/libjdwp/ThreadReferenceImpl.h
  33. +26 −24 src/jdk.jdwp.agent/share/native/libjdwp/VirtualMachineImpl.c
  34. +4 −2 src/jdk.jdwp.agent/share/native/libjdwp/VirtualMachineImpl.h
  35. +37 −35 src/jdk.jdwp.agent/share/native/libjdwp/debugDispatch.c
  36. +23 −2 src/jdk.jdwp.agent/share/native/libjdwp/debugDispatch.h
  37. +11 −5 src/jdk.jdwp.agent/share/native/libjdwp/debugLoop.c
@@ -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)
@@ -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;
@@ -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)
@@ -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;
@@ -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)
@@ -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;
@@ -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)
@@ -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;
@@ -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)
@@ -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;
@@ -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)
@@ -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;
@@ -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
};
@@ -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;
@@ -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)
@@ -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;
@@ -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)
@@ -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;
@@ -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)
@@ -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;
@@ -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)

0 comments on commit 78ff45e

Please sign in to comment.