From 9187efd1a9be8115b5c57a0b6d045d6a27b19317 Mon Sep 17 00:00:00 2001 From: Rene Gollent Date: Sat, 4 May 2013 20:28:46 -0400 Subject: [PATCH] Clean up context menu building. Even if the inspect action is unavailable, continue building the rest of the actions, since they can apply regardless of the value location. --- .../gui/team_window/VariablesView.cpp | 22 +++++++++---------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/src/apps/debugger/user_interface/gui/team_window/VariablesView.cpp b/src/apps/debugger/user_interface/gui/team_window/VariablesView.cpp index d86684706c..1e1483d08a 100644 --- a/src/apps/debugger/user_interface/gui/team_window/VariablesView.cpp +++ b/src/apps/debugger/user_interface/gui/team_window/VariablesView.cpp @@ -1953,19 +1953,19 @@ VariablesView::_GetContextActionsForNode(ModelNode* node, ContextActionList* actions) { ValueLocation* location = node->NodeChild()->Location(); - - // if the location's stored somewhere other than in memory, - // then we won't be able to inspect it this way. - if (location->PieceAt(0).type != VALUE_PIECE_LOCATION_MEMORY) - return B_OK; - + status_t result = B_OK; BMessage* message = NULL; - status_t result = _AddContextAction("Inspect", MSG_SHOW_INSPECTOR_WINDOW, - actions, message); - if (result != B_OK) - return result; - message->AddUInt64("address", location->PieceAt(0).address); + // only show the Inspect option if the value is in fact located + // in memory. + if (location->PieceAt(0).type == VALUE_PIECE_LOCATION_MEMORY) { + result = _AddContextAction("Inspect", MSG_SHOW_INSPECTOR_WINDOW, + actions, message); + if (result != B_OK) + return result; + message->AddUInt64("address", location->PieceAt(0).address); + } + result = _AddContextAction("Cast as" B_UTF8_ELLIPSIS, MSG_SHOW_TYPECAST_NODE_PROMPT, actions, message);