<html><head><meta http-equiv="Content-Type" content="text/html; charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class=""><br class=""><div><br class=""><blockquote type="cite" class=""><div class="">On Apr 24, 2018, at 2:35 PM, Jim Ingham <<a href="mailto:jingham@apple.com" class="">jingham@apple.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><br style="font-family: Menlo-Regular; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><br style="font-family: Menlo-Regular; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><blockquote type="cite" style="font-family: Menlo-Regular; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;" class="">On Apr 24, 2018, at 9:44 AM, Greg Clayton <<a href="mailto:clayborg@gmail.com" class="">clayborg@gmail.com</a>> wrote:<br class=""><br class=""><br class=""><br class=""><blockquote type="cite" class="">On Apr 24, 2018, at 9:37 AM, Jim Ingham <<a href="mailto:jingham@apple.com" class="">jingham@apple.com</a>> wrote:<br class=""><br class=""><blockquote type="cite" class=""><br class="">On Apr 24, 2018, at 7:43 AM, Greg Clayton via lldb-dev <<a href="mailto:lldb-dev@lists.llvm.org" class="">lldb-dev@lists.llvm.org</a>> wrote:<br class=""><br class="">Welcome Alexander!<br class=""></blockquote><br class="">Yes, welcome!<br class=""><br class=""><blockquote type="cite" class=""><br class="">The title might be more stated as "Reimplement lldb-mi to correctly use the SB API instead of using HandleCommand and regular expressions to parse the command results" as it is already using the SB API, just not using it anywhere close to correctly!<span class="Apple-converted-space"> </span><br class=""><br class="">I look forward to seeing the changes.<span class="Apple-converted-space"> </span><br class=""><br class="">A few things I ran into when playing with lldb-mi:<br class="">- file-exec or exec-file packet might come _after_ some breakpoints are set. We should make sure we create a lldb::SBTarget right away and set the breakpoints on the empty target so that we don't miss these breakpoints if this is still an issue. Then the when we receive the exec-file packet, we set the file on the target<br class=""></blockquote><br class="">Breakpoints set before any target is created are set on the dummy target. Breakpoints on the dummy target are copied into any new targets. So this should not be necessary. If that wasn't working we should figure that out, but it's not the responsibility of the MI to get this right.<br class=""></blockquote><br class="">We are trying not to use the command line and the command line is what uses the dummy target automatically. When using the SB API you use a lldb::SBTarget to set the breakpoint on so you need a target. What do you suggest we use for the target? I would rather the lldb-mi code not rely on the currently selected target or the dummy target.<br class=""></blockquote><br style="font-family: Menlo-Regular; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><span style="font-family: Menlo-Regular; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">lldb-MI models gdb's behavior, which is one debugger with one target. There is no command to add or switch to targets, etc. So it doesn't seem unreasonable for MI to keep track of its one actual target and if that is empty, use SBDebugger::GetDummyTarget. The other option is to make a blank target up front and then add files to it when you see the -file-exec command. But that seems more error-prone than using the mechanism lldb provides for doing things before you have a target. Again, if we were modeling an API that could switch targets we might want to do something more clever. But that isn't how the GDB-MI was set up to work.</span><br style="font-family: Menlo-Regular; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><br style="font-family: Menlo-Regular; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""></div></blockquote><div><br class=""></div></div><div>lldb-mi code may or may not have a target when it needs one. If it doesn't have a target, use the SB API to get the dummy target and use that. </div><div><br class=""></div><div>Jim: is the dummy target good for anything other than adding breakpoints to? What all gets copied from a the dummy target to the new target when one gets created?</div><div><br class=""></div><div><div>Alexander, feel free to ask questions if you didn't understand any of the above information. </div><div><br class=""></div></div><div><br class=""></div><div><br class=""><blockquote type="cite" class=""><div class=""><span style="font-family: Menlo-Regular; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">Jim</span><br style="font-family: Menlo-Regular; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><br style="font-family: Menlo-Regular; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><br style="font-family: Menlo-Regular; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><blockquote type="cite" style="font-family: Menlo-Regular; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;" class=""><br class=""><blockquote type="cite" class=""><br class=""><blockquote type="cite" class="">- remove all uses of HandleCommand and use SB APIs where possible<br class="">- Add any SB API that might be missing and require us to use HandleCommand<br class=""><br class=""></blockquote><br class="">The rest of these seem good guidelines.<br class=""><br class="">Jim<br class=""><br class=""><br class=""><blockquote type="cite" class="">Good luck and let us know if you have any questions,<br class=""><br class="">Greg Clayton<br class=""><br class=""><br class=""><blockquote type="cite" class="">On Apr 23, 2018, at 3:19 PM, Adrian Prantl via lldb-dev <<a href="mailto:lldb-dev@lists.llvm.org" class="">lldb-dev@lists.llvm.org</a>> wrote:<br class=""><br class="">Please join me in welcoming Alexander Polyakov, who will be working on cleaning up and completing LLDB's lldb-mi fronted as part of his Google Summer Of Code project:<br class=""><br class="">Reimplement lldb-mi on top of the LLDB public SB API<br class=""><a href="https://summerofcode.withgoogle.com/projects/#5427847301169152" class="">https://summerofcode.withgoogle.com/projects/#5427847301169152</a><br class=""><br class="">-- adrian<br class="">_______________________________________________<br class="">lldb-dev mailing list<br class="">lldb-dev@lists.llvm.org<br class="">http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-dev<br class=""></blockquote><br class="">_______________________________________________<br class="">lldb-dev mailing list<br class=""><a href="mailto:lldb-dev@lists.llvm.org" class="">lldb-dev@lists.llvm.org</a><br class="">http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-dev</blockquote></blockquote></blockquote></div></blockquote></div><br class=""></body></html>