• Home
  • Raw
  • Download

Lines Matching refs:JDWP

303 static JDWP::JdwpOptions gJdwpOptions;
306 static JDWP::JdwpState* gJdwpState = nullptr;
416 static ObjPtr<mirror::Array> DecodeNonNullArray(JDWP::RefTypeId id, JDWP::JdwpError* error) in DecodeNonNullArray()
420 *error = JDWP::ERR_INVALID_OBJECT; in DecodeNonNullArray()
424 *error = JDWP::ERR_INVALID_ARRAY; in DecodeNonNullArray()
427 *error = JDWP::ERR_NONE; in DecodeNonNullArray()
431 static ObjPtr<mirror::Class> DecodeClass(JDWP::RefTypeId id, JDWP::JdwpError* error) in DecodeClass()
435 *error = JDWP::ERR_INVALID_OBJECT; in DecodeClass()
439 *error = JDWP::ERR_INVALID_CLASS; in DecodeClass()
442 *error = JDWP::ERR_NONE; in DecodeClass()
446 static Thread* DecodeThread(ScopedObjectAccessUnchecked& soa, JDWP::ObjectId thread_id, in DecodeThread()
447 JDWP::JdwpError* error) in DecodeThread()
454 *error = JDWP::ERR_INVALID_OBJECT; in DecodeThread()
462 *error = JDWP::ERR_INVALID_THREAD; in DecodeThread()
470 *error = (thread == nullptr) ? JDWP::ERR_THREAD_NOT_ALIVE : JDWP::ERR_NONE; in DecodeThread()
474 static JDWP::JdwpTag BasicTagFromDescriptor(const char* descriptor) { in BasicTagFromDescriptor()
477 return static_cast<JDWP::JdwpTag>(descriptor[0]); in BasicTagFromDescriptor()
480 static JDWP::JdwpTag BasicTagFromClass(ObjPtr<mirror::Class> klass) in BasicTagFromClass()
487 static JDWP::JdwpTag TagFromClass(const ScopedObjectAccessUnchecked& soa, mirror::Class* c) in TagFromClass()
491 return JDWP::JT_ARRAY; in TagFromClass()
494 return JDWP::JT_STRING; in TagFromClass()
497 return JDWP::JT_CLASS_OBJECT; in TagFromClass()
503 return JDWP::JT_THREAD; in TagFromClass()
510 return JDWP::JT_THREAD_GROUP; in TagFromClass()
517 return JDWP::JT_CLASS_LOADER; in TagFromClass()
520 return JDWP::JT_OBJECT; in TagFromClass()
531 JDWP::JdwpTag Dbg::TagFromObject(const ScopedObjectAccessUnchecked& soa, ObjPtr<mirror::Object> o) { in TagFromObject()
532 return (o == nullptr) ? JDWP::JT_OBJECT : TagFromClass(soa, o->GetClass()); in TagFromObject()
535 static bool IsPrimitiveTag(JDWP::JdwpTag tag) { in IsPrimitiveTag()
537 case JDWP::JT_BOOLEAN: in IsPrimitiveTag()
538 case JDWP::JT_BYTE: in IsPrimitiveTag()
539 case JDWP::JT_CHAR: in IsPrimitiveTag()
540 case JDWP::JT_FLOAT: in IsPrimitiveTag()
541 case JDWP::JT_DOUBLE: in IsPrimitiveTag()
542 case JDWP::JT_INT: in IsPrimitiveTag()
543 case JDWP::JT_LONG: in IsPrimitiveTag()
544 case JDWP::JT_SHORT: in IsPrimitiveTag()
545 case JDWP::JT_VOID: in IsPrimitiveTag()
570 gJdwpState = JDWP::JdwpState::Create(&gJdwpOptions); in StartJdwp()
748 void Dbg::ConfigureJdwp(const JDWP::JdwpOptions& jdwp_options) { in ConfigureJdwp()
749 CHECK_NE(jdwp_options.transport, JDWP::kJdwpTransportUnknown); in ConfigureJdwp()
767 std::string Dbg::GetClassName(JDWP::RefTypeId class_id) { in GetClassName()
768 JDWP::JdwpError error; in GetClassName()
771 if (error == JDWP::ERR_NONE) { in GetClassName()
791 JDWP::JdwpError Dbg::GetClassObject(JDWP::RefTypeId id, JDWP::ObjectId* class_object_id) { in GetClassObject()
792 JDWP::JdwpError status; in GetClassObject()
799 return JDWP::ERR_NONE; in GetClassObject()
802 JDWP::JdwpError Dbg::GetSuperclass(JDWP::RefTypeId id, JDWP::RefTypeId* superclass_id) { in GetSuperclass()
803 JDWP::JdwpError status; in GetSuperclass()
815 return JDWP::ERR_NONE; in GetSuperclass()
818 JDWP::JdwpError Dbg::GetClassLoader(JDWP::RefTypeId id, JDWP::ExpandBuf* pReply) { in GetClassLoader()
819 JDWP::JdwpError error; in GetClassLoader()
825 return JDWP::ERR_NONE; in GetClassLoader()
828 JDWP::JdwpError Dbg::GetModifiers(JDWP::RefTypeId id, JDWP::ExpandBuf* pReply) { in GetModifiers()
829 JDWP::JdwpError error; in GetModifiers()
846 return JDWP::ERR_NONE; in GetModifiers()
849 JDWP::JdwpError Dbg::GetMonitorInfo(JDWP::ObjectId object_id, JDWP::ExpandBuf* reply) { in GetMonitorInfo()
850 JDWP::JdwpError error; in GetMonitorInfo()
855 return JDWP::ERR_INVALID_OBJECT; in GetMonitorInfo()
877 return JDWP::ERR_NONE; in GetMonitorInfo()
880 JDWP::JdwpError Dbg::GetOwnedMonitors(JDWP::ObjectId thread_id, in GetOwnedMonitors()
881 std::vector<JDWP::ObjectId>* monitors, in GetOwnedMonitors()
885 std::vector<JDWP::ObjectId>* monitor_vector, in GetOwnedMonitors()
911 std::vector<JDWP::ObjectId>* const monitors; in GetOwnedMonitors()
916 JDWP::JdwpError error; in GetOwnedMonitors()
922 return JDWP::ERR_THREAD_NOT_SUSPENDED; in GetOwnedMonitors()
927 return JDWP::ERR_NONE; in GetOwnedMonitors()
930 JDWP::JdwpError Dbg::GetContendedMonitor(JDWP::ObjectId thread_id, in GetContendedMonitor()
931 JDWP::ObjectId* contended_monitor) { in GetContendedMonitor()
934 JDWP::JdwpError error; in GetContendedMonitor()
940 return JDWP::ERR_THREAD_NOT_SUSPENDED; in GetContendedMonitor()
946 return JDWP::ERR_NONE; in GetContendedMonitor()
949 JDWP::JdwpError Dbg::GetInstanceCounts(const std::vector<JDWP::RefTypeId>& class_ids, in GetInstanceCounts()
957 JDWP::JdwpError error; in GetInstanceCounts()
966 return JDWP::ERR_NONE; in GetInstanceCounts()
969 JDWP::JdwpError Dbg::GetInstances(JDWP::RefTypeId class_id, int32_t max_count, in GetInstances()
970 std::vector<JDWP::ObjectId>* instances) { in GetInstances()
974 JDWP::JdwpError error; in GetInstances()
989 return JDWP::ERR_NONE; in GetInstances()
992 JDWP::JdwpError Dbg::GetReferringObjects(JDWP::ObjectId object_id, int32_t max_count, in GetReferringObjects()
993 std::vector<JDWP::ObjectId>* referring_objects) { in GetReferringObjects()
996 JDWP::JdwpError error; in GetReferringObjects()
999 return JDWP::ERR_INVALID_OBJECT; in GetReferringObjects()
1007 return JDWP::ERR_NONE; in GetReferringObjects()
1010 JDWP::JdwpError Dbg::DisableCollection(JDWP::ObjectId object_id) { in DisableCollection()
1011 JDWP::JdwpError error; in DisableCollection()
1014 return JDWP::ERR_INVALID_OBJECT; in DisableCollection()
1017 return JDWP::ERR_NONE; in DisableCollection()
1020 JDWP::JdwpError Dbg::EnableCollection(JDWP::ObjectId object_id) { in EnableCollection()
1021 JDWP::JdwpError error; in EnableCollection()
1028 return JDWP::ERR_INVALID_OBJECT; in EnableCollection()
1031 return JDWP::ERR_NONE; in EnableCollection()
1034 JDWP::JdwpError Dbg::IsCollected(JDWP::ObjectId object_id, bool* is_collected) { in IsCollected()
1038 return JDWP::ERR_INVALID_OBJECT; in IsCollected()
1042 JDWP::JdwpError error; in IsCollected()
1047 return JDWP::ERR_NONE; in IsCollected()
1050 void Dbg::DisposeObject(JDWP::ObjectId object_id, uint32_t reference_count) { in DisposeObject()
1054 JDWP::JdwpTypeTag Dbg::GetTypeTag(ObjPtr<mirror::Class> klass) { in GetTypeTag()
1057 return JDWP::TT_ARRAY; in GetTypeTag()
1059 return JDWP::TT_INTERFACE; in GetTypeTag()
1061 return JDWP::TT_CLASS; in GetTypeTag()
1065 JDWP::JdwpError Dbg::GetReflectedType(JDWP::RefTypeId class_id, JDWP::ExpandBuf* pReply) { in GetReflectedType()
1066 JDWP::JdwpError error; in GetReflectedType()
1072 JDWP::JdwpTypeTag type_tag = GetTypeTag(c); in GetReflectedType()
1075 return JDWP::ERR_NONE; in GetReflectedType()
1083 explicit ClassListCreator(std::vector<JDWP::RefTypeId>* classes) : classes_(classes) {} in ClassListCreator()
1093 std::vector<JDWP::RefTypeId>* const classes_;
1096 void Dbg::GetClassList(std::vector<JDWP::RefTypeId>* classes) { in GetClassList()
1101 JDWP::JdwpError Dbg::GetClassInfo(JDWP::RefTypeId class_id, JDWP::JdwpTypeTag* pTypeTag, in GetClassInfo()
1103 JDWP::JdwpError error; in GetClassInfo()
1110 *pStatus = JDWP::CS_VERIFIED | JDWP::CS_PREPARED; in GetClassInfo()
1111 *pTypeTag = JDWP::TT_ARRAY; in GetClassInfo()
1114 *pStatus = JDWP::CS_ERROR; in GetClassInfo()
1116 *pStatus = JDWP::CS_VERIFIED | JDWP::CS_PREPARED | JDWP::CS_INITIALIZED; in GetClassInfo()
1118 *pTypeTag = c->IsInterface() ? JDWP::TT_INTERFACE : JDWP::TT_CLASS; in GetClassInfo()
1125 return JDWP::ERR_NONE; in GetClassInfo()
1128 void Dbg::FindLoadedClassBySignature(const char* descriptor, std::vector<JDWP::RefTypeId>* ids) { in FindLoadedClassBySignature()
1137 JDWP::JdwpError Dbg::GetReferenceType(JDWP::ObjectId object_id, JDWP::ExpandBuf* pReply) { in GetReferenceType()
1138 JDWP::JdwpError error; in GetReferenceType()
1141 return JDWP::ERR_INVALID_OBJECT; in GetReferenceType()
1144 JDWP::JdwpTypeTag type_tag = GetTypeTag(o->GetClass()); in GetReferenceType()
1145 JDWP::RefTypeId type_id = gRegistry->AddRefType(o->GetClass()); in GetReferenceType()
1150 return JDWP::ERR_NONE; in GetReferenceType()
1153 JDWP::JdwpError Dbg::GetSignature(JDWP::RefTypeId class_id, std::string* signature) { in GetSignature()
1154 JDWP::JdwpError error; in GetSignature()
1161 return JDWP::ERR_NONE; in GetSignature()
1164 JDWP::JdwpError Dbg::GetSourceDebugExtension(JDWP::RefTypeId class_id, in GetSourceDebugExtension()
1166 JDWP::JdwpError error; in GetSourceDebugExtension()
1175 return JDWP::ERR_ABSENT_INFORMATION; in GetSourceDebugExtension()
1178 return JDWP::ERR_NONE; in GetSourceDebugExtension()
1181 JDWP::JdwpError Dbg::GetSourceFile(JDWP::RefTypeId class_id, std::string* result) { in GetSourceFile()
1182 JDWP::JdwpError error; in GetSourceFile()
1189 return JDWP::ERR_ABSENT_INFORMATION; in GetSourceFile()
1192 return JDWP::ERR_NONE; in GetSourceFile()
1195 JDWP::JdwpError Dbg::GetObjectTag(JDWP::ObjectId object_id, uint8_t* tag) { in GetObjectTag()
1197 JDWP::JdwpError error; in GetObjectTag()
1199 if (error != JDWP::ERR_NONE) { in GetObjectTag()
1200 *tag = JDWP::JT_VOID; in GetObjectTag()
1204 return JDWP::ERR_NONE; in GetObjectTag()
1207 size_t Dbg::GetTagWidth(JDWP::JdwpTag tag) { in GetTagWidth()
1209 case JDWP::JT_VOID: in GetTagWidth()
1211 case JDWP::JT_BYTE: in GetTagWidth()
1212 case JDWP::JT_BOOLEAN: in GetTagWidth()
1214 case JDWP::JT_CHAR: in GetTagWidth()
1215 case JDWP::JT_SHORT: in GetTagWidth()
1217 case JDWP::JT_FLOAT: in GetTagWidth()
1218 case JDWP::JT_INT: in GetTagWidth()
1220 case JDWP::JT_ARRAY: in GetTagWidth()
1221 case JDWP::JT_OBJECT: in GetTagWidth()
1222 case JDWP::JT_STRING: in GetTagWidth()
1223 case JDWP::JT_THREAD: in GetTagWidth()
1224 case JDWP::JT_THREAD_GROUP: in GetTagWidth()
1225 case JDWP::JT_CLASS_LOADER: in GetTagWidth()
1226 case JDWP::JT_CLASS_OBJECT: in GetTagWidth()
1227 return sizeof(JDWP::ObjectId); in GetTagWidth()
1228 case JDWP::JT_DOUBLE: in GetTagWidth()
1229 case JDWP::JT_LONG: in GetTagWidth()
1237 JDWP::JdwpError Dbg::GetArrayLength(JDWP::ObjectId array_id, int32_t* length) { in GetArrayLength()
1238 JDWP::JdwpError error; in GetArrayLength()
1244 return JDWP::ERR_NONE; in GetArrayLength()
1247 JDWP::JdwpError Dbg::OutputArray(JDWP::ObjectId array_id, in OutputArray()
1250 JDWP::ExpandBuf* pReply) { in OutputArray()
1251 JDWP::JdwpError error; in OutputArray()
1259 return JDWP::ERR_INVALID_LENGTH; in OutputArray()
1261 JDWP::JdwpTag element_tag = BasicTagFromClass(a->GetClass()->GetComponentType()); in OutputArray()
1270 for (int i = 0; i < count; ++i) JDWP::Write8BE(&dst, src8[offset + i]); in OutputArray()
1273 for (int i = 0; i < count; ++i) JDWP::Write4BE(&dst, src4[offset + i]); in OutputArray()
1276 for (int i = 0; i < count; ++i) JDWP::Write2BE(&dst, src2[offset + i]); in OutputArray()
1286 JDWP::JdwpTag specific_tag = (element != nullptr) ? TagFromObject(soa, element) in OutputArray()
1293 return JDWP::ERR_NONE; in OutputArray()
1297 static void CopyArrayData(ObjPtr<mirror::Array> a, JDWP::Request* src, int offset, int count) in CopyArrayData()
1308 JDWP::JdwpError Dbg::SetArrayElements(JDWP::ObjectId array_id, int offset, int count, in SetArrayElements()
1309 JDWP::Request* request) { in SetArrayElements()
1310 JDWP::JdwpError error; in SetArrayElements()
1318 return JDWP::ERR_INVALID_LENGTH; in SetArrayElements()
1320 JDWP::JdwpTag element_tag = BasicTagFromClass(dst->GetClass()->GetComponentType()); in SetArrayElements()
1336 JDWP::ObjectId id = request->ReadObjectId(); in SetArrayElements()
1338 if (error != JDWP::ERR_NONE) { in SetArrayElements()
1343 return JDWP::ERR_TYPE_MISMATCH; in SetArrayElements()
1349 return JDWP::ERR_NONE; in SetArrayElements()
1352 JDWP::JdwpError Dbg::CreateString(const std::string& str, JDWP::ObjectId* new_string_id) { in CreateString()
1360 return JDWP::ERR_OUT_OF_MEMORY; in CreateString()
1363 return JDWP::ERR_NONE; in CreateString()
1366 JDWP::JdwpError Dbg::CreateObject(JDWP::RefTypeId class_id, JDWP::ObjectId* new_object_id) { in CreateObject()
1367 JDWP::JdwpError error; in CreateObject()
1387 return JDWP::ERR_OUT_OF_MEMORY; in CreateObject()
1390 return JDWP::ERR_NONE; in CreateObject()
1396 JDWP::JdwpError Dbg::CreateArrayObject(JDWP::RefTypeId array_class_id, uint32_t length, in CreateArrayObject()
1397 JDWP::ObjectId* new_array_id) { in CreateArrayObject()
1398 JDWP::JdwpError error; in CreateArrayObject()
1413 return JDWP::ERR_OUT_OF_MEMORY; in CreateArrayObject()
1416 return JDWP::ERR_NONE; in CreateArrayObject()
1419 JDWP::FieldId Dbg::ToFieldId(const ArtField* f) { in ToFieldId()
1420 return static_cast<JDWP::FieldId>(reinterpret_cast<uintptr_t>(f)); in ToFieldId()
1423 static JDWP::MethodId ToMethodId(ArtMethod* m) in ToMethodId()
1425 return static_cast<JDWP::MethodId>( in ToMethodId()
1429 static ArtField* FromFieldId(JDWP::FieldId fid) in FromFieldId()
1434 static ArtMethod* FromMethodId(JDWP::MethodId mid) in FromMethodId()
1439 bool Dbg::MatchThread(JDWP::ObjectId expected_thread_id, Thread* event_thread) { in MatchThread()
1441 JDWP::JdwpError error; in MatchThread()
1447 bool Dbg::MatchLocation(const JDWP::JdwpLocation& expected_location, in MatchLocation()
1448 const JDWP::EventLocation& event_location) { in MatchLocation()
1456 bool Dbg::MatchType(ObjPtr<mirror::Class> event_class, JDWP::RefTypeId class_id) { in MatchType()
1460 JDWP::JdwpError error; in MatchType()
1466 bool Dbg::MatchField(JDWP::RefTypeId expected_type_id, JDWP::FieldId expected_field_id, in MatchField()
1475 bool Dbg::MatchInstance(JDWP::ObjectId expected_instance_id, mirror::Object* event_instance) { in MatchInstance()
1476 JDWP::JdwpError error; in MatchInstance()
1481 void Dbg::SetJdwpLocation(JDWP::JdwpLocation* location, ArtMethod* m, uint32_t dex_pc) { in SetJdwpLocation()
1494 std::string Dbg::GetMethodName(JDWP::MethodId method_id) { in GetMethodName()
1502 bool Dbg::IsMethodObsolete(JDWP::MethodId method_id) { in IsMethodObsolete()
1511 std::string Dbg::GetFieldName(JDWP::FieldId field_id) { in GetFieldName()
1568 static uint16_t DemangleSlot(uint16_t slot, ArtMethod* m, JDWP::JdwpError* error) in DemangleSlot()
1578 *error = JDWP::ERR_NONE; in DemangleSlot()
1585 *error = JDWP::ERR_NONE; in DemangleSlot()
1592 *error = JDWP::ERR_INVALID_SLOT; in DemangleSlot()
1596 JDWP::JdwpError Dbg::OutputDeclaredFields(JDWP::RefTypeId class_id, bool with_generic, in OutputDeclaredFields()
1597 JDWP::ExpandBuf* pReply) { in OutputDeclaredFields()
1598 JDWP::JdwpError error; in OutputDeclaredFields()
1621 return JDWP::ERR_NONE; in OutputDeclaredFields()
1624 JDWP::JdwpError Dbg::OutputDeclaredMethods(JDWP::RefTypeId class_id, bool with_generic, in OutputDeclaredMethods()
1625 JDWP::ExpandBuf* pReply) { in OutputDeclaredMethods()
1626 JDWP::JdwpError error; in OutputDeclaredMethods()
1647 return JDWP::ERR_NONE; in OutputDeclaredMethods()
1650 JDWP::JdwpError Dbg::OutputDeclaredInterfaces(JDWP::RefTypeId class_id, JDWP::ExpandBuf* pReply) { in OutputDeclaredInterfaces()
1651 JDWP::JdwpError error; in OutputDeclaredInterfaces()
1664 return JDWP::ERR_NONE; in OutputDeclaredInterfaces()
1667 void Dbg::OutputLineTable(JDWP::RefTypeId, JDWP::MethodId method_id, JDWP::ExpandBuf* pReply) { in OutputLineTable()
1696 JDWP::Set4BE(expandBufGetBuffer(pReply) + numLinesOffset, numItems); in OutputLineTable()
1699 void Dbg::OutputVariableTable(JDWP::RefTypeId, JDWP::MethodId method_id, bool with_generic, in OutputVariableTable()
1700 JDWP::ExpandBuf* pReply) { in OutputVariableTable()
1744 JDWP::Set4BE(expandBufGetBuffer(pReply) + variable_count_offset, variable_count); in OutputVariableTable()
1747 void Dbg::OutputMethodReturnValue(JDWP::MethodId method_id, const JValue* return_value, in OutputMethodReturnValue()
1748 JDWP::ExpandBuf* pReply) { in OutputMethodReturnValue()
1750 JDWP::JdwpTag tag = BasicTagFromDescriptor(m->GetShorty()); in OutputMethodReturnValue()
1754 void Dbg::OutputFieldValue(JDWP::FieldId field_id, const JValue* field_value, in OutputFieldValue()
1755 JDWP::ExpandBuf* pReply) { in OutputFieldValue()
1757 JDWP::JdwpTag tag = BasicTagFromDescriptor(f->GetTypeDescriptor()); in OutputFieldValue()
1761 JDWP::JdwpError Dbg::GetBytecodes(JDWP::RefTypeId, JDWP::MethodId method_id, in GetBytecodes()
1765 return JDWP::ERR_INVALID_METHODID; in GetBytecodes()
1774 return JDWP::ERR_NONE; in GetBytecodes()
1777 JDWP::JdwpTag Dbg::GetFieldBasicTag(JDWP::FieldId field_id) { in GetFieldBasicTag()
1781 JDWP::JdwpTag Dbg::GetStaticFieldBasicTag(JDWP::FieldId field_id) { in GetStaticFieldBasicTag()
1830 static JDWP::JdwpError GetFieldValueImpl(JDWP::RefTypeId ref_type_id, JDWP::ObjectId object_id, in GetFieldValueImpl()
1831 JDWP::FieldId field_id, JDWP::ExpandBuf* pReply, in GetFieldValueImpl()
1834 JDWP::JdwpError error; in GetFieldValueImpl()
1844 if ((!is_static && o == nullptr) || error != JDWP::ERR_NONE) { in GetFieldValueImpl()
1845 return JDWP::ERR_INVALID_OBJECT; in GetFieldValueImpl()
1858 return JDWP::ERR_INVALID_FIELDID; in GetFieldValueImpl()
1872 return JDWP::ERR_INVALID_FIELDID; in GetFieldValueImpl()
1885 JDWP::JdwpTag tag = BasicTagFromDescriptor(f->GetTypeDescriptor()); in GetFieldValueImpl()
1887 return JDWP::ERR_NONE; in GetFieldValueImpl()
1890 JDWP::JdwpError Dbg::GetFieldValue(JDWP::ObjectId object_id, JDWP::FieldId field_id, in GetFieldValue()
1891 JDWP::ExpandBuf* pReply) { in GetFieldValue()
1895 JDWP::JdwpError Dbg::GetStaticFieldValue(JDWP::RefTypeId ref_type_id, JDWP::FieldId field_id, in GetStaticFieldValue()
1896 JDWP::ExpandBuf* pReply) { in GetStaticFieldValue()
1900 static JDWP::JdwpError SetArtFieldValue(ArtField* f, mirror::Object* o, uint64_t value, int width) in SetArtFieldValue()
1909 return JDWP::ERR_NONE; in SetArtFieldValue()
1914 return JDWP::ERR_NONE; in SetArtFieldValue()
1919 return JDWP::ERR_NONE; in SetArtFieldValue()
1924 return JDWP::ERR_NONE; in SetArtFieldValue()
1931 return JDWP::ERR_NONE; in SetArtFieldValue()
1938 return JDWP::ERR_NONE; in SetArtFieldValue()
1941 JDWP::JdwpError error; in SetArtFieldValue()
1943 if (error != JDWP::ERR_NONE) { in SetArtFieldValue()
1944 return JDWP::ERR_INVALID_OBJECT; in SetArtFieldValue()
1955 return JDWP::ERR_INVALID_OBJECT; in SetArtFieldValue()
1959 return JDWP::ERR_NONE; in SetArtFieldValue()
1970 static JDWP::JdwpError SetFieldValueImpl(JDWP::ObjectId object_id, JDWP::FieldId field_id, in SetFieldValueImpl()
1973 JDWP::JdwpError error; in SetFieldValueImpl()
1978 if ((!is_static && o == nullptr) || error != JDWP::ERR_NONE) { in SetFieldValueImpl()
1979 return JDWP::ERR_INVALID_OBJECT; in SetFieldValueImpl()
1994 return JDWP::ERR_INVALID_FIELDID; in SetFieldValueImpl()
2008 JDWP::JdwpError Dbg::SetFieldValue(JDWP::ObjectId object_id, JDWP::FieldId field_id, uint64_t value, in SetFieldValue()
2013 JDWP::JdwpError Dbg::SetStaticFieldValue(JDWP::FieldId field_id, uint64_t value, int width) { in SetStaticFieldValue()
2017 JDWP::JdwpError Dbg::StringToUtf8(JDWP::ObjectId string_id, std::string* str) { in StringToUtf8()
2018 JDWP::JdwpError error; in StringToUtf8()
2020 if (error != JDWP::ERR_NONE) { in StringToUtf8()
2024 return JDWP::ERR_INVALID_OBJECT; in StringToUtf8()
2032 return JDWP::ERR_INVALID_STRING; in StringToUtf8()
2036 return JDWP::ERR_NONE; in StringToUtf8()
2039 void Dbg::OutputJValue(JDWP::JdwpTag tag, const JValue* return_value, JDWP::ExpandBuf* pReply) { in OutputJValue()
2042 if (tag == JDWP::JT_BOOLEAN || tag == JDWP::JT_BYTE) { in OutputJValue()
2044 } else if (tag == JDWP::JT_CHAR || tag == JDWP::JT_SHORT) { in OutputJValue()
2046 } else if (tag == JDWP::JT_FLOAT || tag == JDWP::JT_INT) { in OutputJValue()
2048 } else if (tag == JDWP::JT_DOUBLE || tag == JDWP::JT_LONG) { in OutputJValue()
2051 CHECK_EQ(tag, JDWP::JT_VOID); in OutputJValue()
2061 JDWP::JdwpError Dbg::GetThreadName(JDWP::ObjectId thread_id, std::string* name) { in GetThreadName()
2063 JDWP::JdwpError error; in GetThreadName()
2065 if (error != JDWP::ERR_NONE && error != JDWP::ERR_THREAD_NOT_ALIVE) { in GetThreadName()
2078 return JDWP::ERR_NONE; in GetThreadName()
2081 JDWP::JdwpError Dbg::GetThreadGroup(JDWP::ObjectId thread_id, JDWP::ExpandBuf* pReply) { in GetThreadGroup()
2083 JDWP::JdwpError error; in GetThreadGroup()
2085 if (error != JDWP::ERR_NONE) { in GetThreadGroup()
2086 return JDWP::ERR_INVALID_OBJECT; in GetThreadGroup()
2091 if (error == JDWP::ERR_THREAD_NOT_ALIVE) { in GetThreadGroup()
2093 expandBufAddObjectId(pReply, JDWP::ObjectId(0)); in GetThreadGroup()
2094 error = JDWP::ERR_NONE; in GetThreadGroup()
2095 } else if (error == JDWP::ERR_NONE) { in GetThreadGroup()
2102 JDWP::ObjectId thread_group_id = gRegistry->Add(group); in GetThreadGroup()
2109 JDWP::ObjectId thread_group_id, JDWP::JdwpError* error) in DecodeThreadGroup()
2113 if (*error != JDWP::ERR_NONE) { in DecodeThreadGroup()
2117 *error = JDWP::ERR_INVALID_OBJECT; in DecodeThreadGroup()
2125 *error = JDWP::ERR_INVALID_THREAD_GROUP; in DecodeThreadGroup()
2128 *error = JDWP::ERR_NONE; in DecodeThreadGroup()
2132 JDWP::JdwpError Dbg::GetThreadGroupName(JDWP::ObjectId thread_group_id, JDWP::ExpandBuf* pReply) { in GetThreadGroupName()
2134 JDWP::JdwpError error; in GetThreadGroupName()
2136 if (error != JDWP::ERR_NONE) { in GetThreadGroupName()
2146 return JDWP::ERR_NONE; in GetThreadGroupName()
2149 JDWP::JdwpError Dbg::GetThreadGroupParent(JDWP::ObjectId thread_group_id, JDWP::ExpandBuf* pReply) { in GetThreadGroupParent()
2151 JDWP::JdwpError error; in GetThreadGroupParent()
2153 if (error != JDWP::ERR_NONE) { in GetThreadGroupParent()
2163 JDWP::ObjectId parent_group_id = gRegistry->Add(parent); in GetThreadGroupParent()
2165 return JDWP::ERR_NONE; in GetThreadGroupParent()
2169 std::vector<JDWP::ObjectId>* child_thread_group_ids) in GetChildThreadGroups()
2198 JDWP::JdwpError Dbg::GetThreadGroupChildren(JDWP::ObjectId thread_group_id, in GetThreadGroupChildren()
2199 JDWP::ExpandBuf* pReply) { in GetThreadGroupChildren()
2201 JDWP::JdwpError error; in GetThreadGroupChildren()
2203 if (error != JDWP::ERR_NONE) { in GetThreadGroupChildren()
2209 std::vector<JDWP::ObjectId> child_thread_ids; in GetThreadGroupChildren()
2212 for (JDWP::ObjectId child_thread_id : child_thread_ids) { in GetThreadGroupChildren()
2219 std::vector<JDWP::ObjectId> child_thread_groups_ids; in GetThreadGroupChildren()
2222 for (JDWP::ObjectId child_thread_group_id : child_thread_groups_ids) { in GetThreadGroupChildren()
2227 return JDWP::ERR_NONE; in GetThreadGroupChildren()
2230 JDWP::ObjectId Dbg::GetSystemThreadGroupId() { in GetSystemThreadGroupId()
2237 JDWP::JdwpThreadStatus Dbg::ToJdwpThreadStatus(ThreadState state) { in ToJdwpThreadStatus()
2240 return JDWP::TS_MONITOR; in ToJdwpThreadStatus()
2244 return JDWP::TS_RUNNING; in ToJdwpThreadStatus()
2246 return JDWP::TS_SLEEPING; in ToJdwpThreadStatus()
2249 return JDWP::TS_ZOMBIE; in ToJdwpThreadStatus()
2271 return JDWP::TS_WAIT; in ToJdwpThreadStatus()
2278 JDWP::JdwpError Dbg::GetThreadStatus(JDWP::ObjectId thread_id, JDWP::JdwpThreadStatus* pThreadStatu… in GetThreadStatus()
2279 JDWP::JdwpSuspendStatus* pSuspendStatus) { in GetThreadStatus()
2282 *pSuspendStatus = JDWP::SUSPEND_STATUS_NOT_SUSPENDED; in GetThreadStatus()
2284 JDWP::JdwpError error; in GetThreadStatus()
2286 if (error != JDWP::ERR_NONE) { in GetThreadStatus()
2287 if (error == JDWP::ERR_THREAD_NOT_ALIVE) { in GetThreadStatus()
2288 *pThreadStatus = JDWP::TS_ZOMBIE; in GetThreadStatus()
2289 return JDWP::ERR_NONE; in GetThreadStatus()
2295 *pSuspendStatus = JDWP::SUSPEND_STATUS_SUSPENDED; in GetThreadStatus()
2299 return JDWP::ERR_NONE; in GetThreadStatus()
2302 JDWP::JdwpError Dbg::GetThreadDebugSuspendCount(JDWP::ObjectId thread_id, JDWP::ExpandBuf* pReply) { in GetThreadDebugSuspendCount()
2304 JDWP::JdwpError error; in GetThreadDebugSuspendCount()
2306 if (error != JDWP::ERR_NONE) { in GetThreadDebugSuspendCount()
2311 return JDWP::ERR_NONE; in GetThreadDebugSuspendCount()
2314 JDWP::JdwpError Dbg::Interrupt(JDWP::ObjectId thread_id) { in Interrupt()
2316 JDWP::JdwpError error; in Interrupt()
2318 if (error != JDWP::ERR_NONE) { in Interrupt()
2322 return JDWP::ERR_NONE; in Interrupt()
2337 void Dbg::GetThreads(mirror::Object* thread_group, std::vector<JDWP::ObjectId>* thread_ids) { in GetThreads()
2385 JDWP::JdwpError Dbg::GetThreadFrameCount(JDWP::ObjectId thread_id, size_t* result) { in GetThreadFrameCount()
2387 JDWP::JdwpError error; in GetThreadFrameCount()
2390 if (error != JDWP::ERR_NONE) { in GetThreadFrameCount()
2394 return JDWP::ERR_THREAD_NOT_SUSPENDED; in GetThreadFrameCount()
2397 return JDWP::ERR_NONE; in GetThreadFrameCount()
2400 JDWP::JdwpError Dbg::GetThreadFrames(JDWP::ObjectId thread_id, in GetThreadFrames()
2403 JDWP::ExpandBuf* buf) { in GetThreadFrames()
2405 JDWP::JdwpError error; in GetThreadFrames()
2407 if (error != JDWP::ERR_NONE) { in GetThreadFrames()
2411 return JDWP::ERR_THREAD_NOT_SUSPENDED; in GetThreadFrames()
2426 JDWP::FrameId frame_id(visitor->GetFrameId()); in GetThreadFrames()
2427 JDWP::JdwpLocation location; in GetThreadFrames()
2441 return JDWP::ERR_NONE; in GetThreadFrames()
2444 JDWP::ObjectId Dbg::GetThreadSelfId() { in GetThreadSelfId()
2448 JDWP::ObjectId Dbg::GetThreadId(Thread* thread) { in GetThreadId()
2465 JDWP::JdwpError Dbg::SuspendThread(JDWP::ObjectId thread_id, bool request_suspension) { in SuspendThread()
2470 JDWP::JdwpError error; in SuspendThread()
2474 return JDWP::ERR_THREAD_NOT_ALIVE; in SuspendThread()
2484 return JDWP::ERR_NONE; in SuspendThread()
2486 return JDWP::ERR_INTERNAL; in SuspendThread()
2488 return JDWP::ERR_THREAD_NOT_ALIVE; in SuspendThread()
2492 void Dbg::ResumeThread(JDWP::ObjectId thread_id) { in ResumeThread()
2494 JDWP::JdwpError error; in ResumeThread()
2521 JDWP::JdwpError Dbg::GetThisObject(JDWP::ObjectId thread_id, JDWP::FrameId frame_id, in GetThisObject()
2522 JDWP::ObjectId* result) { in GetThisObject()
2524 JDWP::JdwpError error; in GetThisObject()
2526 if (error != JDWP::ERR_NONE) { in GetThisObject()
2530 return JDWP::ERR_THREAD_NOT_SUSPENDED; in GetThisObject()
2547 return JDWP::ERR_NONE; in GetThisObject()
2551 static JDWP::JdwpError FindAndHandleNonNativeFrame(Thread* thread, in FindAndHandleNonNativeFrame()
2552 JDWP::FrameId frame_id, in FindAndHandleNonNativeFrame()
2555 JDWP::JdwpError result = JDWP::ERR_INVALID_FRAMEID; in FindAndHandleNonNativeFrame()
2565 result = JDWP::ERR_OPAQUE_FRAME; in FindAndHandleNonNativeFrame()
2578 JDWP::JdwpError Dbg::GetLocalValues(JDWP::Request* request, JDWP::ExpandBuf* pReply) { in GetLocalValues()
2579 JDWP::ObjectId thread_id = request->ReadThreadId(); in GetLocalValues()
2580 JDWP::FrameId frame_id = request->ReadFrameId(); in GetLocalValues()
2583 JDWP::JdwpError error; in GetLocalValues()
2585 if (error != JDWP::ERR_NONE) { in GetLocalValues()
2589 return JDWP::ERR_THREAD_NOT_SUSPENDED; in GetLocalValues()
2601 JDWP::JdwpTag reqSigByte = request->ReadTag(); in GetLocalValues()
2608 if (error != JDWP::ERR_NONE) { in GetLocalValues()
2612 return JDWP::ERR_NONE; in GetLocalValues()
2616 constexpr JDWP::JdwpError kStackFrameLocalAccessError = JDWP::ERR_ABSENT_INFORMATION;
2624 static JDWP::JdwpError FailGetLocalValue(const StackVisitor& visitor, uint16_t vreg, in FailGetLocalValue()
2625 JDWP::JdwpTag tag) in FailGetLocalValue()
2632 JDWP::JdwpError Dbg::GetLocalValue(const StackVisitor& visitor, ScopedObjectAccessUnchecked& soa, in GetLocalValue()
2633 int slot, JDWP::JdwpTag tag, uint8_t* buf, size_t width) { in GetLocalValue()
2635 JDWP::JdwpError error = JDWP::ERR_NONE; in GetLocalValue()
2637 if (error != JDWP::ERR_NONE) { in GetLocalValue()
2642 case JDWP::JT_BOOLEAN: { in GetLocalValue()
2649 JDWP::Set1(buf + 1, intVal != 0); in GetLocalValue()
2652 case JDWP::JT_BYTE: { in GetLocalValue()
2659 JDWP::Set1(buf + 1, intVal); in GetLocalValue()
2662 case JDWP::JT_SHORT: in GetLocalValue()
2663 case JDWP::JT_CHAR: { in GetLocalValue()
2670 JDWP::Set2BE(buf + 1, intVal); in GetLocalValue()
2673 case JDWP::JT_INT: { in GetLocalValue()
2680 JDWP::Set4BE(buf + 1, intVal); in GetLocalValue()
2683 case JDWP::JT_FLOAT: { in GetLocalValue()
2690 JDWP::Set4BE(buf + 1, intVal); in GetLocalValue()
2693 case JDWP::JT_ARRAY: in GetLocalValue()
2694 case JDWP::JT_CLASS_LOADER: in GetLocalValue()
2695 case JDWP::JT_CLASS_OBJECT: in GetLocalValue()
2696 case JDWP::JT_OBJECT: in GetLocalValue()
2697 case JDWP::JT_STRING: in GetLocalValue()
2698 case JDWP::JT_THREAD: in GetLocalValue()
2699 case JDWP::JT_THREAD_GROUP: { in GetLocalValue()
2700 CHECK_EQ(width, sizeof(JDWP::ObjectId)); in GetLocalValue()
2714 JDWP::SetObjectId(buf + 1, gRegistry->Add(o)); in GetLocalValue()
2717 case JDWP::JT_DOUBLE: { in GetLocalValue()
2724 JDWP::Set8BE(buf + 1, longVal); in GetLocalValue()
2727 case JDWP::JT_LONG: { in GetLocalValue()
2734 JDWP::Set8BE(buf + 1, longVal); in GetLocalValue()
2743 JDWP::Set1(buf, tag); in GetLocalValue()
2744 return JDWP::ERR_NONE; in GetLocalValue()
2747 JDWP::JdwpError Dbg::SetLocalValues(JDWP::Request* request) { in SetLocalValues()
2748 JDWP::ObjectId thread_id = request->ReadThreadId(); in SetLocalValues()
2749 JDWP::FrameId frame_id = request->ReadFrameId(); in SetLocalValues()
2752 JDWP::JdwpError error; in SetLocalValues()
2754 if (error != JDWP::ERR_NONE) { in SetLocalValues()
2758 return JDWP::ERR_THREAD_NOT_SUSPENDED; in SetLocalValues()
2769 JDWP::JdwpTag sigByte = request->ReadTag(); in SetLocalValues()
2775 if (error != JDWP::ERR_NONE) { in SetLocalValues()
2779 return JDWP::ERR_NONE; in SetLocalValues()
2784 static JDWP::JdwpError FailSetLocalValue(const StackVisitor& visitor, uint16_t vreg, in FailSetLocalValue()
2785 JDWP::JdwpTag tag, T value) in FailSetLocalValue()
2793 JDWP::JdwpError Dbg::SetLocalValue(Thread* thread, StackVisitor& visitor, int slot, in SetLocalValue()
2794 JDWP::JdwpTag tag, uint64_t value, size_t width) { in SetLocalValue()
2796 JDWP::JdwpError error = JDWP::ERR_NONE; in SetLocalValue()
2798 if (error != JDWP::ERR_NONE) { in SetLocalValue()
2803 case JDWP::JT_BOOLEAN: in SetLocalValue()
2804 case JDWP::JT_BYTE: in SetLocalValue()
2810 case JDWP::JT_SHORT: in SetLocalValue()
2811 case JDWP::JT_CHAR: in SetLocalValue()
2817 case JDWP::JT_INT: in SetLocalValue()
2823 case JDWP::JT_FLOAT: in SetLocalValue()
2829 case JDWP::JT_ARRAY: in SetLocalValue()
2830 case JDWP::JT_CLASS_LOADER: in SetLocalValue()
2831 case JDWP::JT_CLASS_OBJECT: in SetLocalValue()
2832 case JDWP::JT_OBJECT: in SetLocalValue()
2833 case JDWP::JT_STRING: in SetLocalValue()
2834 case JDWP::JT_THREAD: in SetLocalValue()
2835 case JDWP::JT_THREAD_GROUP: { in SetLocalValue()
2836 CHECK_EQ(width, sizeof(JDWP::ObjectId)); in SetLocalValue()
2837 mirror::Object* o = gRegistry->Get<mirror::Object*>(static_cast<JDWP::ObjectId>(value), in SetLocalValue()
2839 if (error != JDWP::ERR_NONE) { in SetLocalValue()
2841 return JDWP::ERR_INVALID_OBJECT; in SetLocalValue()
2849 case JDWP::JT_DOUBLE: { in SetLocalValue()
2856 case JDWP::JT_LONG: { in SetLocalValue()
2876 return JDWP::ERR_NONE; in SetLocalValue()
2879 static void SetEventLocation(JDWP::EventLocation* location, ArtMethod* m, uint32_t dex_pc) in SetEventLocation()
2897 JDWP::EventLocation location; in PostLocationEvent()
2930 JDWP::EventLocation location; in PostFieldAccessEvent()
2946 JDWP::EventLocation location; in PostFieldModificationEvent()
3008 JDWP::EventLocation exception_throw_location; in PostException()
3010 JDWP::EventLocation exception_catch_location; in PostException()
3042 if (single_step_control->GetStepDepth() == JDWP::SD_INTO) { in UpdateDebugger()
3049 } else if (single_step_control->GetStepSize() == JDWP::SS_MIN) { in UpdateDebugger()
3056 } else if (single_step_control->GetStepDepth() == JDWP::SD_OVER) { in UpdateDebugger()
3071 if (single_step_control->GetStepSize() == JDWP::SS_MIN) { in UpdateDebugger()
3080 CHECK_EQ(single_step_control->GetStepDepth(), JDWP::SD_OUT); in UpdateDebugger()
3378 void Dbg::WatchLocation(const JDWP::JdwpLocation* location, DeoptimizationRequest* req) { in WatchLocation()
3413 void Dbg::UnwatchLocation(const JDWP::JdwpLocation* location, DeoptimizationRequest* req) { in UnwatchLocation()
3468 if (ssc->GetStepDepth() == JDWP::SD_INTO) { in IsForcedInterpreterNeededForCallingImpl()
3489 if (ssc->GetStepDepth() == JDWP::SD_INTO) { in IsForcedInterpreterNeededForResolutionImpl()
3497 if (ssc->GetStepDepth() != JDWP::SD_OUT && in IsForcedInterpreterNeededForResolutionImpl()
3531 if (ssc->GetStepDepth() == JDWP::SD_OUT && in IsForcedInstrumentationNeededForResolutionImpl()
3634 ScopedDebuggerThreadSuspension(Thread* self, JDWP::ObjectId thread_id) in ScopedDebuggerThreadSuspension()
3638 error_(JDWP::ERR_NONE), in ScopedDebuggerThreadSuspension()
3643 if (error_ == JDWP::ERR_NONE) { in ScopedDebuggerThreadSuspension()
3660 error_ = JDWP::ERR_INVALID_THREAD; in ScopedDebuggerThreadSuspension()
3673 JDWP::JdwpError GetError() const { in GetError()
3687 JDWP::JdwpError error_;
3692 JDWP::JdwpError Dbg::ConfigureStep(JDWP::ObjectId thread_id, JDWP::JdwpStepSize step_size, in ConfigureStep()
3693 JDWP::JdwpStepDepth step_depth) { in ConfigureStep()
3696 if (sts.GetError() != JDWP::ERR_NONE) { in ConfigureStep()
3741 return JDWP::ERR_OUT_OF_MEMORY; in ConfigureStep()
3796 return JDWP::ERR_NONE; in ConfigureStep()
3799 void Dbg::UnconfigureStep(JDWP::ObjectId thread_id) { in UnconfigureStep()
3801 JDWP::JdwpError error; in UnconfigureStep()
3803 if (error == JDWP::ERR_NONE) { in UnconfigureStep()
3808 static char JdwpTagToShortyChar(JDWP::JdwpTag tag) { in JdwpTagToShortyChar()
3815 case JDWP::JT_BYTE: return 'B'; in JdwpTagToShortyChar()
3816 case JDWP::JT_CHAR: return 'C'; in JdwpTagToShortyChar()
3817 case JDWP::JT_FLOAT: return 'F'; in JdwpTagToShortyChar()
3818 case JDWP::JT_DOUBLE: return 'D'; in JdwpTagToShortyChar()
3819 case JDWP::JT_INT: return 'I'; in JdwpTagToShortyChar()
3820 case JDWP::JT_LONG: return 'J'; in JdwpTagToShortyChar()
3821 case JDWP::JT_SHORT: return 'S'; in JdwpTagToShortyChar()
3822 case JDWP::JT_VOID: return 'V'; in JdwpTagToShortyChar()
3823 case JDWP::JT_BOOLEAN: return 'Z'; in JdwpTagToShortyChar()
3826 case JDWP::JT_ARRAY: in JdwpTagToShortyChar()
3827 case JDWP::JT_OBJECT: in JdwpTagToShortyChar()
3828 case JDWP::JT_STRING: in JdwpTagToShortyChar()
3829 case JDWP::JT_THREAD: in JdwpTagToShortyChar()
3830 case JDWP::JT_THREAD_GROUP: in JdwpTagToShortyChar()
3831 case JDWP::JT_CLASS_LOADER: in JdwpTagToShortyChar()
3832 case JDWP::JT_CLASS_OBJECT: in JdwpTagToShortyChar()
3837 JDWP::JdwpError Dbg::PrepareInvokeMethod(uint32_t request_id, JDWP::ObjectId thread_id, in PrepareInvokeMethod()
3838 JDWP::ObjectId object_id, JDWP::RefTypeId class_id, in PrepareInvokeMethod()
3839 JDWP::MethodId method_id, uint32_t arg_count, in PrepareInvokeMethod()
3840 uint64_t arg_values[], JDWP::JdwpTag* arg_types, in PrepareInvokeMethod()
3844 const bool resume_all_threads = ((options & JDWP::INVOKE_SINGLE_THREADED) == 0); in PrepareInvokeMethod()
3850 JDWP::JdwpError error; in PrepareInvokeMethod()
3852 if (error != JDWP::ERR_NONE) { in PrepareInvokeMethod()
3859 return JDWP::ERR_ALREADY_INVOKING; in PrepareInvokeMethod()
3864 return JDWP::ERR_INVALID_THREAD; in PrepareInvokeMethod()
3897 if (error != JDWP::ERR_NONE) { in PrepareInvokeMethod()
3898 return JDWP::ERR_INVALID_OBJECT; in PrepareInvokeMethod()
3902 if (error != JDWP::ERR_NONE) { in PrepareInvokeMethod()
3903 return JDWP::ERR_INVALID_OBJECT; in PrepareInvokeMethod()
3913 return JDWP::ERR_INVALID_METHODID; in PrepareInvokeMethod()
3917 return JDWP::ERR_INVALID_METHODID; in PrepareInvokeMethod()
3921 return JDWP::ERR_INVALID_METHODID; in PrepareInvokeMethod()
3929 return JDWP::ERR_ILLEGAL_ARGUMENT; in PrepareInvokeMethod()
3939 return JDWP::ERR_ILLEGAL_ARGUMENT; in PrepareInvokeMethod()
3947 if (error != JDWP::ERR_NONE) { in PrepareInvokeMethod()
3948 return JDWP::ERR_INVALID_OBJECT; in PrepareInvokeMethod()
3951 return JDWP::ERR_ILLEGAL_ARGUMENT; in PrepareInvokeMethod()
3966 return JDWP::ERR_OUT_OF_MEMORY; in PrepareInvokeMethod()
3987 return JDWP::ERR_NONE; in PrepareInvokeMethod()
4012 static void WriteValue(JDWP::ExpandBuf* pReply, int width, uint64_t value) { in WriteValue()
4038 if ((pReq->options & JDWP::INVOKE_NONVIRTUAL) == 0 && pReq->receiver.Read() != nullptr) { in ExecuteMethodWithoutPendingException()
4060 JDWP::JdwpTag result_tag = BasicTagFromDescriptor(m->GetShorty()); in ExecuteMethodWithoutPendingException()
4061 const bool is_object_result = (result_tag == JDWP::JT_OBJECT); in ExecuteMethodWithoutPendingException()
4073 JDWP::ObjectId exceptionObjectId = gRegistry->Add(exception); in ExecuteMethodWithoutPendingException()
4081 JDWP::JdwpTag new_tag = TagFromObject(soa, object_result.Get()); in ExecuteMethodWithoutPendingException()
4099 DCHECK_EQ(JDWP::JT_VOID, result_tag); in ExecuteMethodWithoutPendingException()
4114 result_tag = JDWP::JT_OBJECT; in ExecuteMethodWithoutPendingException()
4119 if ((pReq->options & JDWP::INVOKE_SINGLE_THREADED) == 0) { in ExecuteMethodWithoutPendingException()
4132 if (result_tag == JDWP::JT_STRING && exceptionObjectId == 0) { in ExecuteMethodWithoutPendingException()
4136 JDWP::JdwpError error = Dbg::StringToUtf8(result_value, &result_string); in ExecuteMethodWithoutPendingException()
4137 CHECK_EQ(error, JDWP::ERR_NONE); in ExecuteMethodWithoutPendingException()
4150 void Dbg::BuildInvokeReply(JDWP::ExpandBuf* pReply, uint32_t request_id, JDWP::JdwpTag result_tag, in BuildInvokeReply()
4151 uint64_t result_value, JDWP::ObjectId exception) { in BuildInvokeReply()
4153 JDWP::expandBufAddSpace(pReply, kJDWPHeaderLen); in BuildInvokeReply()
4156 JDWP::expandBufAdd1(pReply, result_tag); in BuildInvokeReply()
4160 JDWP::expandBufAdd1(pReply, JDWP::JT_OBJECT); in BuildInvokeReply()
4161 JDWP::expandBufAddObjectId(pReply, exception); in BuildInvokeReply()
4165 JDWP::Set4BE(buf + kJDWPHeaderSizeOffset, expandBufGetLength(pReply)); in BuildInvokeReply()
4166 JDWP::Set4BE(buf + kJDWPHeaderIdOffset, request_id); in BuildInvokeReply()
4167 JDWP::Set1(buf + kJDWPHeaderFlagsOffset, kJDWPFlagReply); // flags in BuildInvokeReply()
4168 JDWP::Set2BE(buf + kJDWPHeaderErrorCodeOffset, JDWP::ERR_NONE); in BuildInvokeReply()
4174 JDWP::ExpandBuf* const pReply = pReq->reply; in FinishInvokeMethod()
4287 bool Dbg::DdmHandlePacket(JDWP::Request* request, uint8_t** pReplyBuf, int* pReplyLen) { in DdmHandlePacket()
4313 JDWP::Set4BE(*pReplyBuf, out_type); in DdmHandlePacket()
4314 JDWP::Set4BE((*pReplyBuf) + 4, static_cast<uint32_t>(out_data.size())); in DdmHandlePacket()
4366 JDWP::Set4BE(&buf[0], t->GetThreadId()); in DdmSendThreadNotification()
4378 JDWP::Append4BE(bytes, t->GetThreadId()); in DdmSendThreadNotification()
4381 JDWP::AppendUtf16CompressedBE(bytes, chars_compressed, char_count); in DdmSendThreadNotification()
4383 JDWP::AppendUtf16BE(bytes, chars, char_count); in DdmSendThreadNotification()
4429 JDWP::JdwpState* Dbg::GetJdwpState() { in GetJdwpState()
4497 JDWP::Append4BE(bytes, heap_count); in DdmSendHeapInfo()
4498 JDWP::Append4BE(bytes, 1); // Heap id (bogus; we only have one heap). in DdmSendHeapInfo()
4499 JDWP::Append8BE(bytes, MilliTime()); in DdmSendHeapInfo()
4500 JDWP::Append1BE(bytes, reason); in DdmSendHeapInfo()
4501 JDWP::Append4BE(bytes, heap->GetMaxMemory()); // Max allowed heap size in bytes. in DdmSendHeapInfo()
4502 JDWP::Append4BE(bytes, heap->GetTotalMemory()); // Current heap size in bytes. in DdmSendHeapInfo()
4503 JDWP::Append4BE(bytes, heap->GetBytesAllocated()); in DdmSendHeapInfo()
4504 JDWP::Append4BE(bytes, heap->GetObjectsAllocated()); in DdmSendHeapInfo()
4570 JDWP::Write4BE(&p_, 1); // Heap id (bogus; we only have one heap). in EnsureHeader()
4571 JDWP::Write1BE(&p_, 8); // Size of allocation unit, in bytes. in EnsureHeader()
4573JDWP::Write4BE(&p_, reinterpret_cast<uintptr_t>(chunk_ptr)); // virtual address of segment start. in EnsureHeader()
4574 JDWP::Write4BE(&p_, 0); // offset of this piece (relative to the virtual address). in EnsureHeader()
4578 JDWP::Write4BE(&p_, 0x55555555); in EnsureHeader()
4591 JDWP::Set4BE(pieceLenField_, totalAllocationUnits_); in Flush()
4783 JDWP::Set4BE(&heap_id[0], 1); // Heap id (bogus; we only have one heap). in DdmSendHeapSegments()
4978 JDWP::AppendUtf16BE(bytes, s_utf16.get(), s_len); in WriteTo()
5115 JDWP::Append1BE(bytes, kMessageHeaderLen); in GetRecentAllocations()
5116 JDWP::Append1BE(bytes, kEntryHeaderLen); in GetRecentAllocations()
5117 JDWP::Append1BE(bytes, kStackFrameLen); in GetRecentAllocations()
5124 JDWP::Append2BE(bytes, capped_count); in GetRecentAllocations()
5126 JDWP::Append4BE(bytes, 0); // We'll patch this later... in GetRecentAllocations()
5127 JDWP::Append2BE(bytes, class_names.Size()); in GetRecentAllocations()
5128 JDWP::Append2BE(bytes, method_names.Size()); in GetRecentAllocations()
5129 JDWP::Append2BE(bytes, filenames.Size()); in GetRecentAllocations()
5152 JDWP::Append4BE(bytes, record->ByteCount()); in GetRecentAllocations()
5153 JDWP::Append2BE(bytes, static_cast<uint16_t>(record->GetTid())); in GetRecentAllocations()
5154 JDWP::Append2BE(bytes, allocated_object_class_name_index); in GetRecentAllocations()
5155 JDWP::Append1BE(bytes, stack_depth); in GetRecentAllocations()
5167 JDWP::Append2BE(bytes, class_name_index); in GetRecentAllocations()
5168 JDWP::Append2BE(bytes, method_name_index); in GetRecentAllocations()
5169 JDWP::Append2BE(bytes, file_name_index); in GetRecentAllocations()
5170 JDWP::Append2BE(bytes, record->StackElement(stack_frame).ComputeLineNumber()); in GetRecentAllocations()
5180 JDWP::Set4BE(&bytes[string_table_offset], bytes.size()); in GetRecentAllocations()