@@ -400,6 +400,12 @@ DebugStackWidget::DebugStackWidget(const QString& name, ViewFrame* view, BinaryV
400400 m_table->setHorizontalScrollMode (QAbstractItemView::ScrollPerPixel);
401401 m_table->setVerticalScrollMode (QAbstractItemView::ScrollPerPixel);
402402
403+ // Set column resize modes for better display of the improved hints
404+ m_table->horizontalHeader ()->setSectionResizeMode (DebugStackListModel::OffsetColumn, QHeaderView::ResizeToContents);
405+ m_table->horizontalHeader ()->setSectionResizeMode (DebugStackListModel::AddressColumn, QHeaderView::ResizeToContents);
406+ m_table->horizontalHeader ()->setSectionResizeMode (DebugStackListModel::ValueColumn, QHeaderView::ResizeToContents);
407+ m_table->horizontalHeader ()->setSectionResizeMode (DebugStackListModel::HintColumn, QHeaderView::Stretch);
408+
403409 m_table->resizeColumnsToContents ();
404410 m_table->resizeRowsToContents ();
405411
@@ -416,8 +422,7 @@ DebugStackWidget::DebugStackWidget(const QString& name, ViewFrame* view, BinaryV
416422void DebugStackWidget::notifyStackChanged (std::vector<DebugStackItem> stackItems)
417423{
418424 m_model->updateRows (stackItems);
419- // TODO: we could also set the columns' ResizeMode to ResizeToContents
420- m_table->resizeColumnsToContents ();
425+ // Column resize modes are now properly configured in constructor
421426}
422427
423428
@@ -479,32 +484,9 @@ void DebugStackWidget::updateContent()
479484 std::string hint {};
480485 if (m_controller)
481486 {
482- const DataBuffer memory = m_controller->ReadMemory (value, 128 );
483- std::string reg_string;
484- if (memory.GetLength () > 0 )
485- reg_string = std::string ((const char *)memory.GetData (), memory.GetLength ());
486- else
487- reg_string = " x" ;
488- const auto can_print = std::all_of (reg_string.begin (), reg_string.end (), [](unsigned char c) {
489- return c == ' \n ' || std::isprint (c);
490- });
491-
492- if (!reg_string.empty () && reg_string.size () > 3 && can_print)
493- {
494- hint = fmt::format (" \" {}\" " , reg_string);
495- }
496- else
497- {
498- DataBuffer buffer = m_controller->ReadMemory (value, addressSize);
499- if (buffer.GetLength () > 0 )
500- {
501- hint = fmt::format (" {:x}" , *reinterpret_cast <std::uintptr_t *>(buffer.GetData ()));
502- }
503- else
504- {
505- hint = " " ;
506- }
507- }
487+ // Use the existing GetAddressInformation API for better hint generation
488+ // This provides comprehensive symbol resolution, function names, strings, etc.
489+ hint = m_controller->GetAddressInformation (value);
508490 }
509491
510492 stackItems.emplace_back (offset, address, value, hint);
0 commit comments