@@ -1063,6 +1063,145 @@ std::vector<TTDCallEvent> DebuggerController::GetTTDCallsForSymbols(const std::s
10631063}
10641064
10651065
1066+ std::vector<TTDEvent> DebuggerController::GetTTDEvents (TTDEventType eventType)
1067+ {
1068+ std::vector<TTDEvent> result;
1069+
1070+ size_t count = 0 ;
1071+ BNDebuggerTTDEvent* events = BNDebuggerGetTTDEvents (m_object,
1072+ static_cast <BNDebuggerTTDEventType>(eventType), &count);
1073+
1074+ if (events && count > 0 )
1075+ {
1076+ result.reserve (count);
1077+ for (size_t i = 0 ; i < count; i++)
1078+ {
1079+ TTDEvent event;
1080+ event.type = static_cast <TTDEventType>(events[i].type );
1081+ event.position .sequence = events[i].position .sequence ;
1082+ event.position .step = events[i].position .step ;
1083+
1084+ // Copy optional module details
1085+ if (events[i].module )
1086+ {
1087+ TTDModule module ;
1088+ module .name = events[i].module ->name ? std::string (events[i].module ->name ) : " " ;
1089+ module .address = events[i].module ->address ;
1090+ module .size = events[i].module ->size ;
1091+ module .checksum = events[i].module ->checksum ;
1092+ module .timestamp = events[i].module ->timestamp ;
1093+ event.module = module ;
1094+ }
1095+
1096+ // Copy optional thread details
1097+ if (events[i].thread )
1098+ {
1099+ TTDThread thread;
1100+ thread.uniqueId = events[i].thread ->uniqueId ;
1101+ thread.id = events[i].thread ->id ;
1102+ thread.lifetimeStart .sequence = events[i].thread ->lifetimeStart .sequence ;
1103+ thread.lifetimeStart .step = events[i].thread ->lifetimeStart .step ;
1104+ thread.lifetimeEnd .sequence = events[i].thread ->lifetimeEnd .sequence ;
1105+ thread.lifetimeEnd .step = events[i].thread ->lifetimeEnd .step ;
1106+ thread.activeTimeStart .sequence = events[i].thread ->activeTimeStart .sequence ;
1107+ thread.activeTimeStart .step = events[i].thread ->activeTimeStart .step ;
1108+ thread.activeTimeEnd .sequence = events[i].thread ->activeTimeEnd .sequence ;
1109+ thread.activeTimeEnd .step = events[i].thread ->activeTimeEnd .step ;
1110+ event.thread = thread;
1111+ }
1112+
1113+ // Copy optional exception details
1114+ if (events[i].exception )
1115+ {
1116+ TTDException exception;
1117+ exception.type = static_cast <TTDExceptionType>(events[i].exception ->type );
1118+ exception.programCounter = events[i].exception ->programCounter ;
1119+ exception.code = events[i].exception ->code ;
1120+ exception.flags = events[i].exception ->flags ;
1121+ exception.recordAddress = events[i].exception ->recordAddress ;
1122+ exception.position .sequence = events[i].exception ->position .sequence ;
1123+ exception.position .step = events[i].exception ->position .step ;
1124+ event.exception = exception;
1125+ }
1126+
1127+ result.push_back (event);
1128+ }
1129+ BNDebuggerFreeTTDEvents (events, count);
1130+ }
1131+
1132+ return result;
1133+ }
1134+
1135+
1136+ std::vector<TTDEvent> DebuggerController::GetAllTTDEvents ()
1137+ {
1138+ std::vector<TTDEvent> result;
1139+
1140+ size_t count = 0 ;
1141+ BNDebuggerTTDEvent* events = BNDebuggerGetAllTTDEvents (m_object, &count);
1142+
1143+ if (events && count > 0 )
1144+ {
1145+ result.reserve (count);
1146+ for (size_t i = 0 ; i < count; i++)
1147+ {
1148+ TTDEvent event;
1149+ event.type = static_cast <TTDEventType>(events[i].type );
1150+ event.position .sequence = events[i].position .sequence ;
1151+ event.position .step = events[i].position .step ;
1152+
1153+ // Copy optional module details
1154+ if (events[i].module )
1155+ {
1156+ TTDModule module ;
1157+ module .name = events[i].module ->name ? std::string (events[i].module ->name ) : " " ;
1158+ module .address = events[i].module ->address ;
1159+ module .size = events[i].module ->size ;
1160+ module .checksum = events[i].module ->checksum ;
1161+ module .timestamp = events[i].module ->timestamp ;
1162+ event.module = module ;
1163+ }
1164+
1165+ // Copy optional thread details
1166+ if (events[i].thread )
1167+ {
1168+ TTDThread thread;
1169+ thread.uniqueId = events[i].thread ->uniqueId ;
1170+ thread.id = events[i].thread ->id ;
1171+ thread.lifetimeStart .sequence = events[i].thread ->lifetimeStart .sequence ;
1172+ thread.lifetimeStart .step = events[i].thread ->lifetimeStart .step ;
1173+ thread.lifetimeEnd .sequence = events[i].thread ->lifetimeEnd .sequence ;
1174+ thread.lifetimeEnd .step = events[i].thread ->lifetimeEnd .step ;
1175+ thread.activeTimeStart .sequence = events[i].thread ->activeTimeStart .sequence ;
1176+ thread.activeTimeStart .step = events[i].thread ->activeTimeStart .step ;
1177+ thread.activeTimeEnd .sequence = events[i].thread ->activeTimeEnd .sequence ;
1178+ thread.activeTimeEnd .step = events[i].thread ->activeTimeEnd .step ;
1179+ event.thread = thread;
1180+ }
1181+
1182+ // Copy optional exception details
1183+ if (events[i].exception )
1184+ {
1185+ TTDException exception;
1186+ exception.type = static_cast <TTDExceptionType>(events[i].exception ->type );
1187+ exception.programCounter = events[i].exception ->programCounter ;
1188+ exception.code = events[i].exception ->code ;
1189+ exception.flags = events[i].exception ->flags ;
1190+ exception.recordAddress = events[i].exception ->recordAddress ;
1191+ exception.position .sequence = events[i].exception ->position .sequence ;
1192+ exception.position .step = events[i].exception ->position .step ;
1193+ event.exception = exception;
1194+ }
1195+
1196+ result.push_back (event);
1197+ }
1198+ BNDebuggerFreeTTDEvents (events, count);
1199+ }
1200+
1201+ return result;
1202+ }
1203+
1204+
10661205bool DebuggerController::IsInstructionExecuted (uint64_t address)
10671206{
10681207 return BNDebuggerIsInstructionExecuted (m_object, address);
0 commit comments