Commit
1c525b0e037 ("[gdb/tui] Fix assert in
tui_source_window_base::refresh_window") added an early return in
tui_source_window_base::refresh_window.
Assert after the early return that "m_pad != nullptr", and clean up the
following asserts that allow for m_pad == nullptr.
Tested on x86_64-linux.
Reported-By: Andrew Burgess <aburgess@redhat.com>
Co-Authored-By: Andrew Burgess <aburgess@redhat.com>
Approved-By: Andrew Burgess <aburgess@redhat.com>
if (m_content.empty ())
return;
+ gdb_assert (m_pad != nullptr);
int pad_width = getmaxx (m_pad.get ());
int left_margin = this->left_margin ();
should only occur during the initial startup. In this case the first
condition in the following asserts will not be true, but the nullptr
check will. */
- gdb_assert (pad_width > 0 || m_pad.get () == nullptr);
- gdb_assert (pad_x + view_width <= pad_width || m_pad.get () == nullptr);
+ gdb_assert (pad_width > 0);
+ gdb_assert (pad_x + view_width <= pad_width);
int sminrow = y + box_width ();
int smincol = x + box_width () + left_margin;