<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div class="">I have just gotten a notification that this breaks the Android g++ bot: <a href="http://lab.llvm.org:8011/builders/lldb-x86_64-ubuntu-14.04-buildserver/builds/6443" class="">http://lab.llvm.org:8011/builders/lldb-x86_64-ubuntu-14.04-buildserver/builds/6443</a></div><div class=""><br class=""></div><div class="">The error seems like it’s at this line:</div><div class=""><div style="margin: 0px; font-size: 13px; line-height: normal; font-family: 'CMU Typewriter Text';" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">            </span><span style="font-variant-ligatures: no-common-ligatures; color: #bb2ca2" class="">auto</span><span style="font-variant-ligatures: no-common-ligatures" class="">& </span><span style="font-variant-ligatures: no-common-ligatures; color: #78492a" class="">stdout</span><span style="font-variant-ligatures: no-common-ligatures" class="">(result.</span><span style="font-variant-ligatures: no-common-ligatures; color: #31595d" class="">GetOutputStream</span><span style="font-variant-ligatures: no-common-ligatures" class="">());</span></div></div><div class=""><span style="font-variant-ligatures: no-common-ligatures" class=""><br class=""></span></div><div class=""><span style="font-variant-ligatures: no-common-ligatures" class="">Is this a g++ limitation? It looks to me like that syntax should be supported in C++11. With that said, I suspect giving an explicit type to “stdout” is going to be good enough of a fix, so this is mostly for my own intellectual curiosity</span></div><br class=""><div><blockquote type="cite" class=""><div class="">On Apr 13, 2016, at 5:43 PM, Enrico Granata via lldb-commits <<a href="mailto:lldb-commits@lists.llvm.org" class="">lldb-commits@lists.llvm.org</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div class="">Author: enrico<br class="">Date: Wed Apr 13 19:43:20 2016<br class="">New Revision: 266267<br class=""><br class="">URL: <a href="http://llvm.org/viewvc/llvm-project?rev=266267&view=rev" class="">http://llvm.org/viewvc/llvm-project?rev=266267&view=rev</a><br class="">Log:<br class="">Augment the 'language objc class-table dump' command to take a "-v" option, which makes it print ivar and method information, as well as an optional regex argument which filters out all class names that don't match the regex<br class=""><br class=""><br class="">Modified:<br class="">    lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCDeclVendor.cpp<br class="">    lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp<br class=""><br class="">Modified: lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCDeclVendor.cpp<br class="">URL: <a href="http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCDeclVendor.cpp?rev=266267&r1=266266&r2=266267&view=diff" class="">http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCDeclVendor.cpp?rev=266267&r1=266266&r2=266267&view=diff</a><br class="">==============================================================================<br class="">--- lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCDeclVendor.cpp (original)<br class="">+++ lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCDeclVendor.cpp Wed Apr 13 19:43:20 2016<br class="">@@ -407,6 +407,24 @@ public:<br class=""><br class="">         return ret;<br class="">     }<br class="">+    <br class="">+    explicit operator bool ()<br class="">+    {<br class="">+        return m_is_valid;<br class="">+    }<br class="">+    <br class="">+    size_t<br class="">+    GetNumTypes ()<br class="">+    {<br class="">+        return m_type_vector.size();<br class="">+    }<br class="">+    <br class="">+    const char*<br class="">+    GetTypeAtIndex (size_t idx)<br class="">+    {<br class="">+        return m_type_vector[idx].c_str();<br class="">+    }<br class="">+    <br class=""> private:<br class="">     typedef std::vector <std::string> TypeVector;<br class=""><br class=""><br class="">Modified: lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp<br class="">URL: <a href="http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp?rev=266267&r1=266266&r2=266267&view=diff" class="">http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp?rev=266267&r1=266266&r2=266267&view=diff</a><br class="">==============================================================================<br class="">--- lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp (original)<br class="">+++ lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp Wed Apr 13 19:43:20 2016<br class="">@@ -43,6 +43,7 @@<br class=""> #include "lldb/Interpreter/CommandObject.h"<br class=""> #include "lldb/Interpreter/CommandObjectMultiword.h"<br class=""> #include "lldb/Interpreter/CommandReturnObject.h"<br class="">+#include "lldb/Interpreter/OptionValueBoolean.h"<br class=""> #include "lldb/Symbol/ClangASTContext.h"<br class=""> #include "lldb/Symbol/ObjectFile.h"<br class=""> #include "lldb/Symbol/Symbol.h"<br class="">@@ -483,6 +484,52 @@ AppleObjCRuntimeV2::CreateInstance (Proc<br class=""> class CommandObjectObjC_ClassTable_Dump : public CommandObjectParsed<br class=""> {<br class=""> public:<br class="">+    class CommandOptions : public Options<br class="">+    {<br class="">+    public:<br class="">+        CommandOptions (CommandInterpreter &interpreter) :<br class="">+        Options(interpreter),<br class="">+        m_verbose(false,false)<br class="">+        {}<br class="">+        <br class="">+        ~CommandOptions() override = default;<br class="">+<br class="">+        Error<br class="">+        SetOptionValue(uint32_t option_idx, const char *option_arg) override<br class="">+        {<br class="">+            Error error;<br class="">+            const int short_option = m_getopt_table[option_idx].val;<br class="">+            switch (short_option)<br class="">+            {<br class="">+                case 'v':<br class="">+                    m_verbose.SetCurrentValue(true);<br class="">+                    m_verbose.SetOptionWasSet();<br class="">+                    break;<br class="">+                    <br class="">+                default:<br class="">+                    error.SetErrorStringWithFormat("unrecognized short option '%c'", short_option);<br class="">+                    break;<br class="">+            }<br class="">+            <br class="">+            return error;<br class="">+        }<br class="">+        <br class="">+        void<br class="">+        OptionParsingStarting() override<br class="">+        {<br class="">+            m_verbose.Clear();<br class="">+        }<br class="">+        <br class="">+        const OptionDefinition*<br class="">+        GetDefinitions() override<br class="">+        {<br class="">+            return g_option_table;<br class="">+        }<br class="">+<br class="">+        OptionValueBoolean m_verbose;<br class="">+        static OptionDefinition g_option_table[];<br class="">+    };<br class="">+<br class="">     CommandObjectObjC_ClassTable_Dump (CommandInterpreter &interpreter) :<br class="">     CommandObjectParsed (interpreter,<br class="">                          "dump",<br class="">@@ -490,39 +537,116 @@ public:<br class="">                          "language objc class-table dump",<br class="">                          eCommandRequiresProcess       |<br class="">                          eCommandProcessMustBeLaunched |<br class="">-                         eCommandProcessMustBePaused   )<br class="">+                         eCommandProcessMustBePaused   ),<br class="">+    m_options(interpreter)<br class="">     {<br class="">+        CommandArgumentEntry arg;<br class="">+        CommandArgumentData index_arg;<br class="">+        <br class="">+        // Define the first (and only) variant of this arg.<br class="">+        index_arg.arg_type = eArgTypeRegularExpression;<br class="">+        index_arg.arg_repetition = eArgRepeatOptional;<br class="">+        <br class="">+        // There is only one variant this argument could be; put it into the argument entry.<br class="">+        arg.push_back (index_arg);<br class="">+        <br class="">+        // Push the data for the first argument into the m_arguments vector.<br class="">+        m_arguments.push_back (arg);<br class="">     }<br class=""><br class="">     ~CommandObjectObjC_ClassTable_Dump() override = default;<br class=""><br class="">+    Options *<br class="">+    GetOptions() override<br class="">+    {<br class="">+        return &m_options;<br class="">+    }<br class="">+    <br class=""> protected:<br class="">     bool<br class="">     DoExecute(Args& command, CommandReturnObject &result) override<br class="">     {<br class="">+        std::unique_ptr<RegularExpression> regex_up;<br class="">+        switch(command.GetArgumentCount())<br class="">+        {<br class="">+            case 0:<br class="">+                break;<br class="">+            case 1:<br class="">+            {<br class="">+                regex_up.reset(new RegularExpression());<br class="">+                if (!regex_up->Compile(command.GetArgumentAtIndex(0)))<br class="">+                {<br class="">+                    result.AppendError("invalid argument - please provide a valid regular expression");<br class="">+                    result.SetStatus(lldb::eReturnStatusFailed);<br class="">+                    return false;<br class="">+                }<br class="">+                break;<br class="">+            }<br class="">+            default:<br class="">+            {<br class="">+                result.AppendError("please provide 0 or 1 arguments");<br class="">+                result.SetStatus(lldb::eReturnStatusFailed);<br class="">+                return false;<br class="">+            }<br class="">+        }<br class="">+        <br class="">         Process *process = m_exe_ctx.GetProcessPtr();<br class="">         ObjCLanguageRuntime *objc_runtime = process->GetObjCLanguageRuntime();<br class="">         if (objc_runtime)<br class="">         {<br class="">             auto iterators_pair = objc_runtime->GetDescriptorIteratorPair();<br class="">             auto iterator = iterators_pair.first;<br class="">+            auto& stdout(result.GetOutputStream());<br class="">             for(; iterator != iterators_pair.second; iterator++)<br class="">             {<br class="">-                result.GetOutputStream().Printf("isa = 0x%" PRIx64, iterator->first);<br class="">                 if (iterator->second)<br class="">                 {<br class="">-                    result.GetOutputStream().Printf(" name = %s", iterator->second->GetClassName().AsCString("<unknown>"));<br class="">-                    result.GetOutputStream().Printf(" instance size = %" PRIu64, iterator->second->GetInstanceSize());<br class="">-                    result.GetOutputStream().Printf(" num ivars = %" PRIuPTR, (uintptr_t)iterator->second->GetNumIVars());<br class="">+                    const char* class_name = iterator->second->GetClassName().AsCString("<unknown>");<br class="">+                    if (regex_up && class_name && !regex_up->Execute(class_name))<br class="">+                        continue;<br class="">+                    stdout.Printf("isa = 0x%" PRIx64, iterator->first);<br class="">+                    stdout.Printf(" name = %s", class_name);<br class="">+                    stdout.Printf(" instance size = %" PRIu64, iterator->second->GetInstanceSize());<br class="">+                    stdout.Printf(" num ivars = %" PRIuPTR, (uintptr_t)iterator->second->GetNumIVars());<br class="">                     if (auto superclass = iterator->second->GetSuperclass())<br class="">                     {<br class="">-                        result.GetOutputStream().Printf(" superclass = %s", superclass->GetClassName().AsCString("<unknown>"));<br class="">+                        stdout.Printf(" superclass = %s", superclass->GetClassName().AsCString("<unknown>"));<br class="">+                    }<br class="">+                    stdout.Printf("\n");<br class="">+                    if (m_options.m_verbose)<br class="">+                    {<br class="">+                        for(size_t i = 0;<br class="">+                            i < iterator->second->GetNumIVars();<br class="">+                            i++)<br class="">+                        {<br class="">+                            auto ivar = iterator->second->GetIVarAtIndex(i);<br class="">+                            stdout.Printf("  ivar name = %s type = %s size = %" PRIu64 " offset = %" PRId32 "\n",<br class="">+                                                            ivar.m_name.AsCString("<unknown>"),<br class="">+                                                            ivar.m_type.GetDisplayTypeName().AsCString("<unknown>"),<br class="">+                                                            ivar.m_size,<br class="">+                                                            ivar.m_offset);<br class="">+                        }<br class="">+                        iterator->second->Describe(nullptr,<br class="">+                                                   [objc_runtime, &stdout] (const char* name, const char* type) -> bool {<br class="">+                                                       stdout.Printf("  instance method name = %s type = %s\n",<br class="">+                                                                     name,<br class="">+                                                                     type);<br class="">+                                                       return false;<br class="">+                                                   },<br class="">+                                                   [objc_runtime, &stdout] (const char* name, const char* type) -> bool {<br class="">+                                                       stdout.Printf("  class method name = %s type = %s\n",<br class="">+                                                                     name,<br class="">+                                                                     type);<br class="">+                                                       return false;<br class="">+                                                   },<br class="">+                                                   nullptr);<br class="">                     }<br class="">-                    result.GetOutputStream().Printf("\n");<br class="">                 }<br class="">                 else<br class="">                 {<br class="">-                    result.GetOutputStream().Printf(" has no associated class.\n");<br class="">+                    if (regex_up && !regex_up->Execute(""))<br class="">+                        continue;<br class="">+                    stdout.Printf("isa = 0x%" PRIx64 " has no associated class.\n", iterator->first);<br class="">                 }<br class="">             }<br class="">             result.SetStatus(lldb::eReturnStatusSuccessFinishResult);<br class="">@@ -535,6 +659,15 @@ protected:<br class="">             return false;<br class="">         }<br class="">     }<br class="">+    <br class="">+    CommandOptions m_options;<br class="">+};<br class="">+<br class="">+OptionDefinition<br class="">+CommandObjectObjC_ClassTable_Dump::CommandOptions::g_option_table[] =<br class="">+{<br class="">+    { LLDB_OPT_SET_ALL, false, "verbose"        , 'v', OptionParser::eNoArgument        , nullptr, nullptr, 0, eArgTypeNone,        "Print ivar and method information in detail"},<br class="">+    { 0               , false, nullptr           ,   0, 0                  , nullptr, nullptr, 0, eArgTypeNone,        nullptr }<br class=""> };<br class=""><br class=""> class CommandObjectMultiwordObjC_TaggedPointer_Info : public CommandObjectParsed<br class=""><br class=""><br class="">_______________________________________________<br class="">lldb-commits mailing list<br class=""><a href="mailto:lldb-commits@lists.llvm.org" class="">lldb-commits@lists.llvm.org</a><br class="">http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits<br class=""></div></div></blockquote></div><br class=""><div class="">
<div class="" style="color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><br class="Apple-interchange-newline">Thanks,</div><div class="" style="color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><i class="">- Enrico</i><br class="">📩 egranata@<font color="#ff2600" class=""></font>.com ☎️ 27683</div>
</div>
<br class=""></body></html>