Skip to content

Commit

Permalink
Merge pull request #4 from airbus-cert/issue_3
Browse files Browse the repository at this point in the history
Check m_cursor before using it (fix #3)
  • Loading branch information
citronneur authored Jul 1, 2022
2 parents e34667f + d981cfb commit e586047
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
7 changes: 4 additions & 3 deletions ttddbg/src/ttddbg_debugger_manager.cc
Original file line number Diff line number Diff line change
Expand Up @@ -498,9 +498,10 @@ namespace ttddbg

/**********************************************************************/
void DebuggerManager::populatePositionChooser() {
// TODO: use m_engine methods to add timeline positions for each:
// - Thread creation / exit
// - Module load / unload
if (m_cursor == NULL) {
warning("The Timeline is only available while debugging.");
return;
}

if (m_positionChooser->get_count() > 0) {
// If the position count is > 0 even before populating, it means that
Expand Down
5 changes: 5 additions & 0 deletions ttddbg/src/ttddbg_position_chooser.cc
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,11 @@ namespace ttddbg {

/**********************************************************************/
chooser_t::cbret_t PositionChooser::ins(ssize_t n) {
if (m_cursor == NULL) {
warning("Cannot insert a new position when not in debug mode");
return NOTHING_CHANGED;
}

qstring res;
bool ok = ask_str(&res, 0, "Name of the new position");

Expand Down

0 comments on commit e586047

Please sign in to comment.