Improve VariableView's tooltip handling.
- Make GetToolTipInfo() sensitive to the column being hovered over. If hovering over the variable name, we display its value location information as before. However, if hovering over the value column, the tooltip now displays the full value of the variable, if available.
This commit is contained in:
@@ -1248,22 +1248,26 @@ VariablesView::VariableTableModel::GetToolTipForTablePath(
|
|||||||
if (node->NodeChild()->LocationResolutionState() != B_OK)
|
if (node->NodeChild()->LocationResolutionState() != B_OK)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
ValueLocation* location = node->NodeChild()->Location();
|
|
||||||
BString tipData;
|
BString tipData;
|
||||||
|
switch (columnIndex) {
|
||||||
|
case 0:
|
||||||
|
{
|
||||||
|
ValueLocation* location = node->NodeChild()->Location();
|
||||||
for (int32 i = 0; i < location->CountPieces(); i++) {
|
for (int32 i = 0; i < location->CountPieces(); i++) {
|
||||||
ValuePieceLocation piece = location->PieceAt(i);
|
ValuePieceLocation piece = location->PieceAt(i);
|
||||||
BString pieceData;
|
BString pieceData;
|
||||||
switch (piece.type) {
|
switch (piece.type) {
|
||||||
case VALUE_PIECE_LOCATION_MEMORY:
|
case VALUE_PIECE_LOCATION_MEMORY:
|
||||||
pieceData.SetToFormat("(%" B_PRId32 "): Address: %#" B_PRIx64
|
pieceData.SetToFormat("(%" B_PRId32 "): Address: %#"
|
||||||
", Size: %" B_PRId64 " bytes", i, piece.address, piece.size);
|
B_PRIx64 ", Size: %" B_PRId64 " bytes", i,
|
||||||
|
piece.address, piece.size);
|
||||||
break;
|
break;
|
||||||
case VALUE_PIECE_LOCATION_REGISTER:
|
case VALUE_PIECE_LOCATION_REGISTER:
|
||||||
{
|
{
|
||||||
Architecture* architecture = fThread->GetTeam()->GetArchitecture();
|
Architecture* architecture = fThread->GetTeam()
|
||||||
|
->GetArchitecture();
|
||||||
pieceData.SetToFormat("(%" B_PRId32 "): Register (%s)",
|
pieceData.SetToFormat("(%" B_PRId32 "): Register (%s)",
|
||||||
i, architecture->Registers()[piece.reg].Name());
|
i, architecture->Registers()[piece.reg].Name());
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
default:
|
default:
|
||||||
@@ -1274,6 +1278,19 @@ VariablesView::VariableTableModel::GetToolTipForTablePath(
|
|||||||
if (i < location->CountPieces() - 1)
|
if (i < location->CountPieces() - 1)
|
||||||
tipData += "\n";
|
tipData += "\n";
|
||||||
}
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case 1:
|
||||||
|
{
|
||||||
|
Value* value = node->GetValue();
|
||||||
|
if (value != NULL)
|
||||||
|
value->ToString(tipData);
|
||||||
|
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
if (tipData.IsEmpty())
|
if (tipData.IsEmpty())
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
Reference in New Issue
Block a user