| 441 | } |
| 442 | |
| 443 | ResultCode Debugger::GetDatabaseContents(uint32_t databaseId) |
| 444 | { |
| 445 | auto & dbs = (*globals_.Databases)->Db; |
| 446 | if (databaseId == 0 || databaseId > dbs.Size) |
| 447 | { |
| 448 | Debug("Debugger::GetDatabaseContents(): Invalid database ID %d", databaseId); |
| 449 | return ResultCode::InvalidDatabaseId; |
| 450 | } |
| 451 | |
| 452 | if (!isPaused_) { |
| 453 | // Technically we can read rows anytime, but its not thread-safe and there |
| 454 | // is a slight chance of crashing. |
| 455 | Debug("Debugger::GetDatabaseContents(): Cannot read rows while story is running!"); |
| 456 | return ResultCode::NotInPause; |
| 457 | } |
| 458 | |
| 459 | auto & db = dbs.Start[databaseId - 1]; |
| 460 | auto const & facts = db->Facts(); |
| 461 | auto head = facts.Head; |
| 462 | auto current = head->Next; |
| 463 | |
| 464 | messageHandler_.SendBeginDatabaseContents(databaseId); |
| 465 | while (current != head) { |
| 466 | messageHandler_.SendDatabaseRow(databaseId, ¤t->Item); |
| 467 | current = current->Next; |
| 468 | } |
| 469 | |
| 470 | messageHandler_.SendEndDatabaseContents(databaseId); |
| 471 | |
| 472 | return ResultCode::Success; |
| 473 | } |
| 474 | |
| 475 | ResultCode Debugger::ContinueExecution(DbgContinue_Action action, uint32_t breakpointMask, uint32_t flags) |
| 476 | { |
no test coverage detected