More JDWP functionality: breakpoints, single-stepping.
By-line still needs to be implemented. I've also implemented
VirtualMachine.Dispose so that it disconnects from the caller, as it's
supposed to. This was the cause of a lot of test hangs in otherwise
successful tests.
I've implemented ClassLoaderReference.VisibleClasses, though we don't have
enough information to only return the classes for which the given ClassLoader
was an initiating class loader. We pass the tests with this, but mainly because
the tests aren't very thorough. Sadly, VirtualMachine.CapabilitiesNew doesn't
let us say we don't support this. (Though we could still just return
ERR_NOT_IMPLEMENTED...)
Change-Id: I8d02c2b568a77a4c1725bc737a8ee844f4591e81
diff --git a/src/debugger.h b/src/debugger.h
index dbb99ff..5089995 100644
--- a/src/debugger.h
+++ b/src/debugger.h
@@ -93,6 +93,7 @@
static void Connected();
static void GoActive();
static void Disconnected();
+ static void Disposed();
/*
* Returns "true" if a debugger is connected. Returns "false" if it's
@@ -102,6 +103,8 @@
static bool IsDebuggingEnabled();
+ static bool IsDisposed();
+
/*
* Time, in milliseconds, since the last debugger activity. Does not
* include DDMS activity. Returns -1 if there has been no activity.
@@ -135,11 +138,9 @@
static bool GetAccessFlags(JDWP::RefTypeId id, uint32_t& access_flags);
static bool IsInterface(JDWP::RefTypeId classId, bool& is_interface);
static void GetClassList(std::vector<JDWP::RefTypeId>& classes);
- static void GetVisibleClassList(JDWP::ObjectId classLoaderId, uint32_t* pNumClasses, JDWP::RefTypeId** pClassRefBuf);
static bool GetClassInfo(JDWP::RefTypeId classId, JDWP::JdwpTypeTag* pTypeTag, uint32_t* pStatus, std::string* pDescriptor);
static void FindLoadedClassBySignature(const char* descriptor, std::vector<JDWP::RefTypeId>& ids);
static void GetObjectType(JDWP::ObjectId objectId, JDWP::JdwpTypeTag* pRefTypeTag, JDWP::RefTypeId* pRefTypeId);
- static uint8_t GetClassObjectType(JDWP::RefTypeId refTypeId);
static JDWP::JdwpError GetSignature(JDWP::RefTypeId refTypeId, std::string& signature);
static bool GetSourceFile(JDWP::RefTypeId refTypeId, std::string& source_file);
static uint8_t GetObjectTag(JDWP::ObjectId objectId);
@@ -209,7 +210,7 @@
* Debugger notification
*/
enum {
- kBreakPoint = 0x01,
+ kBreakpoint = 0x01,
kSingleStep = 0x02,
kMethodEntry = 0x04,
kMethodExit = 0x08,
@@ -222,7 +223,7 @@
static void UpdateDebugger(int32_t dex_pc, Thread* self, Method** sp);
- static bool WatchLocation(const JDWP::JdwpLocation* pLoc);
+ static void WatchLocation(const JDWP::JdwpLocation* pLoc);
static void UnwatchLocation(const JDWP::JdwpLocation* pLoc);
static bool ConfigureStep(JDWP::ObjectId threadId, JDWP::JdwpStepSize size, JDWP::JdwpStepDepth depth);
static void UnconfigureStep(JDWP::ObjectId threadId);