[haiku-commits] haiku: hrev45490 - in src/apps/debugger: source_language user_interface/gui/team_window

  • From: anevilyak@xxxxxxxxx
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Sat, 13 Apr 2013 23:26:13 +0200 (CEST)

hrev45490 adds 2 changesets to branch 'master'
old head: 501201761ba2edad1c4a9cc96e79f011978c7463
new head: 692d2db52a75b4fe2713d0f00479c5e324c8c2a8
overview: http://cgit.haiku-os.org/haiku/log/?qt=range&q=692d2db+%5E5012017

----------------------------------------------------------------------------

8598af7: Rework parsing a bit to handle some cases better.
  
  Disable array parsing for now until creating array types works correctly.

692d2db: Notify user if the we fail to parse the type.

                                      [ Rene Gollent <anevilyak@xxxxxxxxx> ]

----------------------------------------------------------------------------

2 files changed, 19 insertions(+), 9 deletions(-)
.../debugger/source_language/CppLanguage.cpp     | 20 +++++++++++---------
.../gui/team_window/VariablesView.cpp            |  8 ++++++++

############################################################################

Commit:      8598af7ec9f645c006deb3d49a91c1221fa51a2f
URL:         http://cgit.haiku-os.org/haiku/commit/?id=8598af7
Author:      Rene Gollent <anevilyak@xxxxxxxxx>
Date:        Sat Apr 13 21:23:13 2013 UTC

Rework parsing a bit to handle some cases better.

Disable array parsing for now until creating array types works correctly.

----------------------------------------------------------------------------

diff --git a/src/apps/debugger/source_language/CppLanguage.cpp 
b/src/apps/debugger/source_language/CppLanguage.cpp
index 249ef91..e67a163 100644
--- a/src/apps/debugger/source_language/CppLanguage.cpp
+++ b/src/apps/debugger/source_language/CppLanguage.cpp
@@ -45,15 +45,15 @@ CppLanguage::ParseTypeExpression(const BString &expression,
        parsedName.RemoveAll(" ");
 
        int32 modifierIndex = -1;
-       for (int32 i = parsedName.Length() - 1; i >= 0; i--) {
-               if (parsedName[i] == '*' || parsedName[i] == '&')
-                       modifierIndex = i;
-       }
-
-       if (modifierIndex >= 0) {
-               parsedName.CopyInto(baseTypeName, 0, modifierIndex);
-               parsedName.Remove(0, modifierIndex);
-       } else
+       modifierIndex = parsedName.FindFirst('*');
+       if (modifierIndex == -1)
+               modifierIndex = parsedName.FindFirst('&');
+       if (modifierIndex == -1)
+               modifierIndex = parsedName.FindFirst('[');
+
+       if (modifierIndex >= 0)
+               parsedName.MoveInto(baseTypeName, 0, modifierIndex);
+       else
                baseTypeName = parsedName;
 
        modifierIndex = parsedName.FindFirst('[');
@@ -111,6 +111,7 @@ CppLanguage::ParseTypeExpression(const BString &expression,
                _resultType = baseType;
 
 
+#if 0
        if (!arraySpecifier.IsEmpty()) {
                ArrayType* arrayType = NULL;
 
@@ -140,6 +141,7 @@ CppLanguage::ParseTypeExpression(const BString &expression,
 
                _resultType = arrayType;
        }
+#endif
 
        typeRef.Detach();
 

############################################################################

Revision:    hrev45490
Commit:      692d2db52a75b4fe2713d0f00479c5e324c8c2a8
URL:         http://cgit.haiku-os.org/haiku/commit/?id=692d2db
Author:      Rene Gollent <anevilyak@xxxxxxxxx>
Date:        Sat Apr 13 21:23:53 2013 UTC

Notify user if the we fail to parse the type.

----------------------------------------------------------------------------

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 17e70f5..3019399 100644
--- a/src/apps/debugger/user_interface/gui/team_window/VariablesView.cpp
+++ b/src/apps/debugger/user_interface/gui/team_window/VariablesView.cpp
@@ -13,6 +13,7 @@
 
 #include <debugger.h>
 
+#include <Alert.h>
 #include <Looper.h>
 #include <PopUpMenu.h>
 #include <ToolTip.h>
@@ -1488,6 +1489,13 @@ VariablesView::MessageReceived(BMessage* message)
 
                        if (language->ParseTypeExpression(typeExpression,
                                fThread->GetTeam()->DebugInfo(), type) != B_OK) 
{
+                               BString errorMessage;
+                               errorMessage.SetToFormat("Failed to resolve 
type %s",
+                                       typeExpression.String(), 
strerror(result));
+                               BAlert* alert = new(std::nothrow) 
BAlert("Error",
+                                       errorMessage.String(), "Close");
+                               if (alert != NULL)
+                                       alert->Go();
                                break;
                        }
 


Other related posts:

  • » [haiku-commits] haiku: hrev45490 - in src/apps/debugger: source_language user_interface/gui/team_window - anevilyak