[Lldb-commits] [lldb] r224082 - Make sure we print errors for python OperatingSystem plug-ins for when things go wrong. We also dump the dictionary or collection that had errors so the user can see which info was wrong.

Greg Clayton gclayton at apple.com
Thu Dec 11 15:52:05 PST 2014


Author: gclayton
Date: Thu Dec 11 17:52:05 2014
New Revision: 224082

URL: http://llvm.org/viewvc/llvm-project?rev=224082&view=rev
Log:
Make sure we print errors for python OperatingSystem plug-ins for when things go wrong. We also dump the dictionary or collection that had errors so the user can see which info was wrong.


Modified:
    lldb/trunk/source/Plugins/Process/Utility/DynamicRegisterInfo.cpp

Modified: lldb/trunk/source/Plugins/Process/Utility/DynamicRegisterInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/Utility/DynamicRegisterInfo.cpp?rev=224082&r1=224081&r2=224082&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Process/Utility/DynamicRegisterInfo.cpp (original)
+++ lldb/trunk/source/Plugins/Process/Utility/DynamicRegisterInfo.cpp Thu Dec 11 17:52:05 2014
@@ -81,6 +81,7 @@ DynamicRegisterInfo::SetRegisterInfo (co
             else
             {
                 Clear();
+                printf("error: register sets must have valid names\n");
                 return 0;
             }
         }
@@ -121,6 +122,8 @@ DynamicRegisterInfo::SetRegisterInfo (co
                 if (reg_info.name == NULL)
                 {
                     Clear();
+                    printf("error: registers must have valid names\n");
+                    reg_info_dict.Dump();
                     return 0;
                 }
                     
@@ -290,6 +293,7 @@ DynamicRegisterInfo::SetRegisterInfo (co
                     if (!success)
                     {
                         Clear();
+                        reg_info_dict.Dump();
                         return 0;
                     }
                 }
@@ -297,6 +301,8 @@ DynamicRegisterInfo::SetRegisterInfo (co
                 if (bitsize == 0)
                 {
                     Clear();
+                    printf("error: invalid or missing 'bitsize' key/value pair in register dictionary\n");
+                    reg_info_dict.Dump();
                     return 0;
                 }
 
@@ -308,6 +314,8 @@ DynamicRegisterInfo::SetRegisterInfo (co
                     if (Args::StringToFormat(format_cstr, reg_info.format, NULL).Fail())
                     {
                         Clear();
+                        printf("error: invalid 'format' value in register dictionary\n");
+                        reg_info_dict.Dump();
                         return 0;
                     }
                 }
@@ -326,6 +334,8 @@ DynamicRegisterInfo::SetRegisterInfo (co
                 if (static_cast<size_t>(set) >= m_sets.size())
                 {
                     Clear();
+                    printf("error: invalid 'set' value in register dictionary, valid values are 0 - %i\n", (int)set);
+                    reg_info_dict.Dump();
                     return 0;
                 }
 
@@ -409,6 +419,8 @@ DynamicRegisterInfo::SetRegisterInfo (co
             else
             {
                 Clear();
+                printf("error: items in the 'registers' array must be dictionaries\n");
+                regs.Dump();
                 return 0;
             }
         }





More information about the lldb-commits mailing list