<div dir="ltr"><div class="gmail_default" style="font-family:verdana,sans-serif;font-size:small">Thanks for your build Deepak, it starts without any crashes.<br>However, the implementation is lacking, and I suspect that making it work with any existing IDE that uses GDB/MI will take a lot of effort.<br>

<br></div><div class="gmail_default" style="font-family:verdana,sans-serif;font-size:small">Few comments:<br></div><div class="gmail_default" style="font-family:verdana,sans-serif;font-size:small">On Windows, I use some extra normal commands that have no counter part in the MI, such as "set new-console on" (which creates a new CMD.EXE and redirects all the application's std[in|err|out]), ofc, this does not work<br>

<br></div><div class="gmail_default" style="font-family:verdana,sans-serif;font-size:small">The replies from lldb-mi, are a bit different from gdb, for example, consider this interaction between codelite (the IDE) and lldb-mi:<br>

<br><span style="font-family:courier new,monospace">Using gdbinit file: C:\Users\PC\AppData\Local\Temp\codelite_gdbinit.txt<br>Current working dir: D:\src\TestArea\wxCrafterTester<br>Launching gdb from : ./Debug<br>Starting debugger  : C:\Users\PC\Desktop\MinSizeRel\lldb-mi.exe --command="C:\Users\PC\AppData\Local\Temp\codelite_gdbinit.txt" --interpreter=mi "./wxCrafterTester"<br>

DEBUG>>00000001-break-insert -f -t main<br>DEBUG>>00000002-enable-pretty-printing<br>Debug session started successfully!<br>DEBUG>>00000003-exec-arguments <br>DEBUG>>00000004-exec-run <br>lldb-mi>>1^error,msg="Command 'break-insert'. Breakpoint 'main' invalid"<br>

1^error,msg="Command 'break-insert'. Breakpoint 'main' invalid"</span><br><br><br></div><div class="gmail_default" style="font-family:verdana,sans-serif;font-size:small">Command: 00000001: -break-insert <br>

</div><div class="gmail_default" style="font-family:verdana,sans-serif;font-size:small">According to the docs, it can accept function name (its sole purpose here is to place a temporary breakpoint at 'main' (hence, the "-t") ). It seems like lldb-mi does not expect a function name but rather a location? (did not try that)<br>

</div><div class="gmail_default" style="font-family:verdana,sans-serif;font-size:small">Also, the reply from lldb-mi is different:<br></div><div class="gmail_default" style="font-family:verdana,sans-serif;font-size:small">

codelite prepends a transaction ID (8 digits number with fixed length) for each command it sends over to gdb, it is  expecting gdb/lldb-mi to reply with these exact 8 digits (including all padding zeros)<br></div><div class="gmail_default" style="font-family:verdana,sans-serif;font-size:small">

this is not the case here (lldb-mi replied with '1' instead of '00000001')<br><br></div><div class="gmail_default" style="font-family:verdana,sans-serif;font-size:small">After changing codelite's gdb settings (i.e. disabled the option to temporarily break at main) I hit another obstacle: I can not place a breakpoint:<br>

<br><span style="font-family:courier new,monospace">DEBUG>>00000005-break-insert -f "\"D:/src/TestArea/wxCrafterTester/MainFrame.cpp:15\""</span><br>...<br>and lldb-mi replied with:<br><br><span style="font-family:courier new,monospace">lldb-mi>>MI: Error: Command Args. Validation failed. Not all arguments or options were recognized: "\"D:/src/TestArea/wxCrafterTester/MainFrame.cpp:15\""<br>

MI: Error: Command Args. Validation failed. Not all arguments or options were recognized: "\"D:/src/TestArea/wxCrafterTester/MainFrame.cpp:15\""<br>lldb-mi>>5^error,msg="Command 'break-insert'. Command Args. Validation failed. Not all arguments or options were recognized: "\"D:/src/TestArea/wxCrafterTester/MainFrame.cpp:15\"""<br>

5^error,msg="Command 'break-insert'. Command Args. Validation failed. Not all arguments or options were recognized: "\"D:/src/TestArea/wxCrafterTester/MainFrame.cpp:15\"""</span><br>
<br>
</div><div class="gmail_default" style="font-family:verdana,sans-serif;font-size:small">At first I thought its because of the volume ("D:") part of the file name, so I changed the settings to send file name without full path, same error occured ...<br>

</div><div class="gmail_default" style="font-family:verdana,sans-serif;font-size:small">Also, it seems that when lldb-mi hits the first error it simply hangs ( I don't see my application being launched )<br></div><div class="gmail_default" style="font-family:verdana,sans-serif;font-size:small">

<br></div><div class="gmail_default" style="font-family:verdana,sans-serif;font-size:small">Some more observations:<br></div><div class="gmail_default" style="font-family:verdana,sans-serif;font-size:small">Commands that are not supported (and used by codelite IDE):<br>

<br></div><div class="gmail_default" style="font-family:verdana,sans-serif;font-size:small">// -exec-arguments<br></div><div class="gmail_default" style="font-family:verdana,sans-serif;font-size:small"><span style="font-family:courier new,monospace">DEBUG>>00000010-exec-arguments 1<br>

lldb-mi>>11^error,msg="Driver. Received command '00000011-exec-arguments'. It was not handled. Command 'exec-arguments' not in Command Factory"<br><br></span></div><div class="gmail_default" style="font-family:verdana,sans-serif;font-size:small">

<span style="font-family:courier new,monospace">// -enable-pretty-printing<br></span></div><div class="gmail_default" style="font-family:verdana,sans-serif;font-size:small"><span style="font-family:courier new,monospace">DEBUG>>00000010-enable-pretty-printing<br>

lldb-mi>>10^done,supported="0"</span><br><br></div><div class="gmail_default" style="font-family:verdana,sans-serif;font-size:small">This was all tested on Windows 7, 64bit.<br></div><div class="gmail_default" style="font-family:verdana,sans-serif;font-size:small">

Trying to debug an executable built with g++-4.8.1 32bit, (MinGW, no MSYS)<br><br></div><div class="gmail_default" style="font-family:verdana,sans-serif;font-size:small">Thanks for you work,<br>Eran<br><br></div></div><div class="gmail_extra">

<br><br><div class="gmail_quote">On Mon, May 19, 2014 at 2:26 PM, Deepak Panickal <span dir="ltr"><<a href="mailto:deepak@codeplay.com" target="_blank">deepak@codeplay.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">


  
    
  
  <div bgcolor="#FFFFFF" text="#000000">
    Hi Eran,<br>
    <br>
    Here's the link to download the MinSizeRel build.<br>
    <a href="https://db.tt/CdvFKVcN" target="_blank">https://db.tt/CdvFKVcN</a><br>
    <br>
    Thanks,<br>
    Deepak<div><div class="h5"><br>
    <br>
    <br>
    <div>On 16/05/2014 21:01, Eran Ifrah wrote:<br>
    </div>
    <blockquote type="cite">
      <div dir="ltr">
        <div class="gmail_default" style="font-family:verdana,sans-serif;font-size:small"><br>
        </div>
        <div class="gmail_extra"><br>
          <br>
          <div class="gmail_quote">On Fri, May 16, 2014 at 9:55 PM, Eran
            Ifrah <span dir="ltr"><<a href="mailto:eran.ifrah@gmail.com" target="_blank">eran.ifrah@gmail.com</a>></span>
            wrote:<br>
            <blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
              <div dir="ltr">
                <div style="font-family:verdana,sans-serif;font-size:small"><br>
                </div>
                <div class="gmail_extra">
                  <br>
                  <br>
                  <div class="gmail_quote">
                    <div>On Fri, May 16, 2014 at 8:23 PM,
                      Deepak Panickal <span dir="ltr"><<a href="mailto:deepak@codeplay.com" target="_blank">deepak@codeplay.com</a>></span>
                      wrote:<br>
                      <blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
                        <div bgcolor="#FFFFFF" text="#000000"> Hi Eran,<br>
                          <br>
                          I tried it here with a Debug build and a
                          MinSizeRel build, but no crashes.<br>
                          <br>
                          Did you try to launch it from an IDE or simply
                          ran it?<br>
                        </div>
                      </blockquote>
                    </div>
                    <div>
                      <div style="font-family:verdana,sans-serif;font-size:small;display:inline">​
                        I tried it from the command line<br>
                        <br>
                      </div>
                      <div style="font-family:verdana,sans-serif;font-size:small;display:inline">FYI:<br>
                      </div>
                      <div style="font-family:verdana,sans-serif;font-size:small;display:inline">I
                        am using Windows 7 (64), Visual Studio 2013
                        (express edition)<br>
                      </div>
                      <div style="font-family:verdana,sans-serif;font-size:small;display:inline">Can
                        you upload your lldb-mi.exe / liblldb.dll
                        somewhere so I could try it here and see if its
                        a problem with my build?<br>
                        <br>
                      </div>
                      <div style="font-family:verdana,sans-serif;font-size:small;display:inline">​</div>
                       </div>
                    <div>
                      <blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
                        <div bgcolor="#FFFFFF" text="#000000"> Could you
                          please try a debug build?<br>
                        </div>
                      </blockquote>
                    </div>
                    <div>
                      <div style="font-family:verdana,sans-serif;font-size:small;display:inline">​
                        Will do<br>
                        <br>
                      </div>
                    </div>
                  </div>
                </div>
              </div>
            </blockquote>
            <div>
              <div class="gmail_default" style="font-family:verdana,sans-serif;font-size:small;display:inline">
                here is the backtrace from the crash (it crashes on a
                va_copy() call... arg) :<br>
                <br>
                     msvcr120d.dll!5ccefb53()    Unknown<br>
                     [Frames below may be incorrect and/or missing, no
                symbols loaded for msvcr120d.dll]    <br>
                     [External Code]    <br>
                >    lldb-mi.exe!CMIUtilString::FormatPriv(const
                CMIUtilString & vrFormat, char * vArgs) Line 114   
                C++<br>
                     lldb-mi.exe!CMIUtilString::Format(const
                CMIUtilString & vrFormating, ...) Line 139    C++<br>
                     lldb-mi.exe!CMIDriverMgr::GetAppVersion() Line
                577    C++<br>
                     lldb-mi.exe!CMICmnLog::Initialize() Line 83    C++<br>
                     lldb-mi.exe!MI::ModuleInit<CMICmnLog>(const
                int vErrorResrcId, bool & vwrbOk, CMIUtilString
                & vwrErrMsg) Line 50    C++<br>
                     lldb-mi.exe!CMIDriverMgr::Initialize() Line 82   
                C++<br>
                     lldb-mi.exe!DriverSystemInit() Line 199    C++<br>
                     lldb-mi.exe!main(int argc, const char * * argv)
                Line 317    C++<br>
                     [External Code]    <br>
                <br>
              </div>
              <div class="gmail_default" style="font-family:verdana,sans-serif;font-size:small;display:inline">And
                for your convenience, here is the "Locals" view during
                the crash:<br>
                vrFormat    "%s\n%s\n%s"    const CMIUtilString &<br>
                vArgs    0x00bdf334 "ÌÌÌÌ| \x15"    char *<br>
                argsCpy    0x00bdf334 "ÌÌÌÌ| \x15"    char *<br>
                nFinal    0    int<br>
                pFormatted    unique_ptr 37 '%'   
                std::unique_ptr<char [0],std::default_delete<char
                [0]> ><br>
                n    16    int<br>
                strResult    ""    CMIUtilString<br>
                <br>
              </div>
              <div class="gmail_default" style="font-family:verdana,sans-serif;font-size:small;display:inline">Hope
                it will give you a hint<br>
              </div>
              <div class="gmail_default" style="font-family:verdana,sans-serif;font-size:small;display:inline">
                ​</div>
               </div>
            <blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
              <div dir="ltr">
                <div class="gmail_extra">
                  <div class="gmail_quote">
                    <div>
                      <div style="font-family:verdana,sans-serif;font-size:small;display:inline">
                      </div>
                    </div>
                    <div>
                      <div>
                        <blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
                          <div bgcolor="#FFFFFF" text="#000000"> <br>
                            We'll look into it more to see if we can
                            find something.<br>
                            <br>
                            Thanks,<br>
                            Deepak
                            <div>
                              <div><br>
                                <br>
                                <div>On 16/05/2014 17:04, Eran Ifrah
                                  wrote:<br>
                                </div>
                                <blockquote type="cite">
                                  <div dir="ltr">
                                    <div style="font-family:verdana,sans-serif;font-size:small">Hi

                                      Deepak,<br>
                                      <br>
                                    </div>
                                    <div style="font-family:verdana,sans-serif;font-size:small">I
                                      have just updated and rebuilt the
                                      tree on Windows<br>
                                    </div>
                                    <div style="font-family:verdana,sans-serif;font-size:small">Starting

                                      lldb-mi.exe -> instantly
                                      crashes<br>
                                    </div>
                                    <div style="font-family:verdana,sans-serif;font-size:small">
                                      for comparison, starting lldb.exe
                                      it starts normally without any
                                      crash<br>
                                      <br>
                                    </div>
                                    <div style="font-family:verdana,sans-serif;font-size:small">I
                                      built it using VS2013, I selected
                                      the 'MinSizeRel' build
                                      configuration <br>
                                    </div>
                                    <div style="font-family:verdana,sans-serif;font-size:small">Unfortunately,

                                      running it under VS, gives a
                                      useless backtrace (only addresses)<br>
                                      <br>
                                    </div>
                                    <div style="font-family:verdana,sans-serif;font-size:small">
                                      I could try and build it with
                                      debug info, but it just takes too
                                      much time :D<br>
                                      <br>
                                    </div>
                                    <div style="font-family:verdana,sans-serif;font-size:small">Eran<br>
                                    </div>
                                    <div style="font-family:verdana,sans-serif;font-size:small">
                                      <br>
                                      <br>
                                    </div>
                                  </div>
                                  <div class="gmail_extra"><br>
                                    <br>
                                    <div class="gmail_quote">On Fri, May
                                      16, 2014 at 6:50 PM, <span dir="ltr"><<a href="mailto:jingham@apple.com" target="_blank">jingham@apple.com</a>></span>
                                      wrote:<br>
                                      <blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Excellent!

                                         Again, thanks for working on
                                        this.<br>
                                        <span><font color="#888888"><br>
                                            Jim<br>
                                          </font></span>
                                        <div>
                                          <div><br>
                                            On May 16, 2014, at 4:15 AM,
                                            Deepak Panickal <<a href="mailto:deepak@codeplay.com" target="_blank">deepak@codeplay.com</a>>

                                            wrote:<br>
                                            <br>
                                            > Thanks Jim, have just
                                            committed it. Yeah, it works
                                            with the GDB/MI interface.<br>
                                            ><br>
                                            > There's no GPL code,
                                            it's all written from
                                            scratch.<br>
                                            > Not all MI commands
                                            have been implemented yet,
                                            however it should be enough
                                            to set breakpoints, view
                                            locals.<br>
                                            > We're working on adding
                                            more commands for
                                            viewing/modifying registers,
                                            memory etc.<br>
                                            ><br>
                                            > It'll be great if more
                                            people from the community
                                            can use and test it with
                                            other GUIs!<br>
                                            ><br>
                                            > Thanks,<br>
                                            > Deepak<br>
                                            ><br>
                                            ><br>
                                            > On 15/05/2014 18:57, <a href="mailto:jingham@apple.com" target="_blank">jingham@apple.com</a>
                                            wrote:<br>
                                            >> First off, thanks
                                            for doing this, that is
                                            great!  If this also works
                                            with the gdb-mi mode, you
                                            will make our emacs friends
                                            happy as well.<br>
                                            >><br>
                                            >> If this is just an
                                            independent tool that
                                            doesn't touch the core lldb
                                            sources (and doesn't use
                                            anything directly from the
                                            gdb MI implementation, since
                                            we don't want to mix GPL'ed
                                            code in with lldb), I see no
                                            reason not to just check it
                                            in now, and then iterate on
                                            it in situ.  That is much
                                            easier than handing around
                                            patch files, and since
                                            there's no chance it will
                                            interfere with anybody
                                            working on parts of lldb
                                            that existed before the
                                            patch, can't do any harm.  I
                                            spoke to GregC and he agrees
                                            this is a reasonable course.<br>
                                            >><br>
                                            >> Again, thanks for
                                            working on this.<br>
                                            >><br>
                                            >> Jim<br>
                                            >><br>
                                            >><br>
                                            >> On May 15, 2014, at
                                            10:17 AM, Deepak Panickal
                                            <<a href="mailto:deepak@codeplay.com" target="_blank">deepak@codeplay.com</a>>

                                            wrote:<br>
                                            >><br>
                                            >>> Hi Abid,<br>
                                            >>><br>
                                            >>> Thank you, I
                                            have attached the zipped
                                            patch.<br>
                                            >>> You might have
                                            to the change the triple in
                                            tools/lldb-mi/MICmnConfig.h
                                            for your target.<br>
                                            >>><br>
                                            >>> Please let me
                                            know if you have any
                                            comments/suggestions.<br>
                                            >>><br>
                                            >>> Thanks,<br>
                                            >>> Deepak<br>
                                            >>><br>
                                            >>> On 15/05/2014
                                            17:10, Abid, Hafiz wrote:<br>
                                            >>>> Hi Deepak,<br>
                                            >>>> I can help
                                            review/test it when you post
                                            the patch.<br>
                                            >>>><br>
                                            >>>> Thanks,<br>
                                            >>>> Abid<br>
                                            >>>><br>
                                            >>>>>
                                            -----Original Message-----<br>
                                            >>>>> From: <a href="mailto:lldb-dev-bounces@cs.uiuc.edu" target="_blank">lldb-dev-bounces@cs.uiuc.edu</a>
                                            [mailto:<a href="mailto:lldb-dev-bounces@cs.uiuc.edu" target="_blank">lldb-dev-bounces@cs.uiuc.edu</a>]<br>
                                            >>>>> On
                                            Behalf Of Deepak Panickal<br>
                                            >>>>> Sent:
                                            15 May 2014 12:14<br>
                                            >>>>> To: <a href="mailto:lldb-dev@cs.uiuc.edu" target="_blank">lldb-dev@cs.uiuc.edu</a><br>
                                            >>>>>
                                            Subject: [lldb-dev] LLDB
                                            Machine Interface Frontend<br>
                                            >>>>><br>
                                            >>>>> Hi,<br>
                                            >>>>><br>
                                            >>>>> We have
                                            an MI (Machine Interface)
                                            frontend to LLDB which works
                                            out of the<br>
                                            >>>>> box
                                            with Eclipse, and likely
                                            will work with other GUI's
                                            based on the GDB/MI<br>
                                            >>>>>
                                            interface. It's been tested
                                            on Linux and Windows.<br>
                                            >>>>><br>
                                            >>>>> It's
                                            ready to upstream and has
                                            been developed as an
                                            independent tool<br>
                                            >>>>>
                                            residing in the LLDB tools
                                            folder. It's based on the
                                            LLDB public API without<br>
                                            >>>>> any
                                            changes to LLDB internals.<br>
                                            >>>>><br>
                                            >>>>> The
                                            patch is quite large as
                                            there are many new files.<br>
                                            >>>>> How
                                            should we go about
                                            upstreaming? Should I create
                                            a diff review as<br>
                                            >>>>> usual?<br>
                                            >>>>><br>
                                            >>>>> Thanks,<br>
                                            >>>>> Deepak<br>
                                            >>>>>
                                            _______________________________________________<br>
                                            >>>>>
                                            lldb-dev mailing list<br>
                                            >>>>> <a href="mailto:lldb-dev@cs.uiuc.edu" target="_blank">lldb-dev@cs.uiuc.edu</a><br>
                                            >>>>> <a href="http://lists.cs.uiuc.edu/mailman/listinfo/lldb-dev" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/lldb-dev</a><br>
                                            >>>
<lldb-mi-driver.patch.bz2>_______________________________________________<br>
                                            >>> lldb-dev
                                            mailing list<br>
                                            >>> <a href="mailto:lldb-dev@cs.uiuc.edu" target="_blank">lldb-dev@cs.uiuc.edu</a><br>
                                            >>> <a href="http://lists.cs.uiuc.edu/mailman/listinfo/lldb-dev" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/lldb-dev</a><br>
                                            ><br>
                                            <br>
_______________________________________________<br>
                                            lldb-dev mailing list<br>
                                            <a href="mailto:lldb-dev@cs.uiuc.edu" target="_blank">lldb-dev@cs.uiuc.edu</a><br>
                                            <a href="http://lists.cs.uiuc.edu/mailman/listinfo/lldb-dev" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/lldb-dev</a><br>
                                          </div>
                                        </div>
                                      </blockquote>
                                    </div>
                                    <br>
                                    <br clear="all">
                                    <br>
                                    -- <br>
                                    <div dir="ltr"><font face="verdana,
                                        sans-serif">Eran Ifrah<br>
                                        Author of codelite, a cross
                                        platform open source C/C++ IDE:
                                        <a href="http://www.codelite.org" target="_blank">http://www.codelite.org</a><br>
                                      </font>
                                      <div><font face="verdana,
                                          sans-serif">wxCrafter, a
                                          wxWidgets RAD: <a>http://</a><a href="http://wxcrafter.codelite.org" target="_blank">wxcrafter.codelite.org</a></font></div>
                                    </div>
                                  </div>
                                </blockquote>
                                <br>
                              </div>
                            </div>
                          </div>
                        </blockquote>
                      </div>
                    </div>
                  </div>
                  <div>
                    <div><br>
                      <br clear="all">
                      <br>
                      -- <br>
                      <div dir="ltr"><font face="verdana, sans-serif">Eran
                          Ifrah<br>
                          Author of codelite, a cross platform open
                          source C/C++ IDE: <a href="http://www.codelite.org" target="_blank">http://www.codelite.org</a><br>
                        </font>
                        <div><font face="verdana, sans-serif">wxCrafter,
                            a wxWidgets RAD: <a>http://</a><a href="http://wxcrafter.codelite.org" target="_blank">wxcrafter.codelite.org</a></font></div>
                      </div>
                    </div>
                  </div>
                </div>
              </div>
            </blockquote>
          </div>
          <br>
          <br clear="all">
          <br>
          -- <br>
          <div dir="ltr"><font face="verdana, sans-serif">Eran Ifrah<br>
              Author of codelite, a cross platform open source C/C++
              IDE: <a href="http://www.codelite.org" target="_blank">http://www.codelite.org</a><br>
            </font>
            <div><font face="verdana, sans-serif">wxCrafter, a wxWidgets
                RAD: <a>http://</a><a href="http://wxcrafter.codelite.org" target="_blank">wxcrafter.codelite.org</a></font></div>
          </div>
        </div>
      </div>
    </blockquote>
    <br>
  </div></div></div>

</blockquote></div><br><br clear="all"><br>-- <br><div dir="ltr"><font face="verdana, sans-serif">Eran Ifrah<br>Author of codelite, a cross platform open source C/C++ IDE: <a href="http://www.codelite.org" target="_blank">http://www.codelite.org</a><br>

</font><div><font face="verdana, sans-serif">wxCrafter, a wxWidgets RAD: http://<a href="http://wxcrafter.codelite.org" target="_blank">wxcrafter.codelite.org</a></font></div></div>
</div>