<div dir="ltr"><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;font-size:small;color:#000000">I don't completely understand how it possible to add breakpoint before choosing a file(did you mean -file-exec-and-symbols cmd?).<br>And another important thing: could you explain me what is target in terms of lldb?<br><br>Thanks in advance.</div></div><div class="gmail_extra"><br clear="all"><div><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div><span style="color:rgb(0,0,0);font-family:arial,helvetica,sans-serif;font-size:12.8px">Regards,</span><br></div><div><font face="arial, helvetica, sans-serif" color="#000000">Alexander Polyakov<br></font></div></div></div></div></div></div></div></div></div></div></div></div></div></div>
<br><div class="gmail_quote">2018-04-25 1:32 GMT+03:00 Ted Woodward <span dir="ltr"><<a href="mailto:ted.woodward@codeaurora.org" target="_blank">ted.woodward@codeaurora.org</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>
You'll still need HandleCommand for pass through commands. lldb commands send to lldb-mi are handled normally, so something like "file a.out" would set up a target using a.out. "-interpreter exec console <cmd>" does the same thing. Other than that, I'm all for cleaning up lldb-mi. There were some funky decisions made when it was first developed.<br>
<br>
Ted<br>
<br>
--<br>
Qualcomm Innovation Center, Inc.<br>
The Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a Linux Foundation Collaborative Project<br>
<span class="im HOEnZb"><br>
> -----Original Message-----<br>
> From: lldb-dev [mailto:<a href="mailto:lldb-dev-bounces@lists.llvm.org">lldb-dev-bounces@<wbr>lists.llvm.org</a>] On Behalf Of Jim<br>
> Ingham via lldb-dev<br>
> Sent: Tuesday, April 24, 2018 5:19 PM<br>
> To: Greg Clayton <<a href="mailto:clayborg@gmail.com">clayborg@gmail.com</a>><br>
> Cc: LLDB <<a href="mailto:lldb-dev@lists.llvm.org">lldb-dev@lists.llvm.org</a>><br>
> Subject: Re: [lldb-dev] Welcome Alexander!<br>
> <br>
> <br>
> <br>
</span><div class="HOEnZb"><div class="h5">> > On Apr 24, 2018, at 3:08 PM, Greg Clayton <<a href="mailto:clayborg@gmail.com">clayborg@gmail.com</a>> wrote:<br>
> ><br>
> ><br>
> ><br>
> >> On Apr 24, 2018, at 3:00 PM, Jim Ingham <<a href="mailto:jingham@apple.com">jingham@apple.com</a>> wrote:<br>
> >><br>
> >><br>
> >><br>
> >>> On Apr 24, 2018, at 2:46 PM, Greg Clayton <<a href="mailto:clayborg@gmail.com">clayborg@gmail.com</a>> wrote:<br>
> >>><br>
> >>><br>
> >>><br>
> >>>> On Apr 24, 2018, at 2:35 PM, Jim Ingham <<a href="mailto:jingham@apple.com">jingham@apple.com</a>> wrote:<br>
> >>>><br>
> >>>><br>
> >>>><br>
> >>>>> On Apr 24, 2018, at 9:44 AM, Greg Clayton <<a href="mailto:clayborg@gmail.com">clayborg@gmail.com</a>><br>
> wrote:<br>
> >>>>><br>
> >>>>><br>
> >>>>><br>
> >>>>>> On Apr 24, 2018, at 9:37 AM, Jim Ingham <<a href="mailto:jingham@apple.com">jingham@apple.com</a>><br>
> wrote:<br>
> >>>>>><br>
> >>>>>>><br>
> >>>>>>> On Apr 24, 2018, at 7:43 AM, Greg Clayton via lldb-dev <lldb-<br>
> <a href="mailto:dev@lists.llvm.org">dev@lists.llvm.org</a>> wrote:<br>
> >>>>>>><br>
> >>>>>>> Welcome Alexander!<br>
> >>>>>><br>
> >>>>>> Yes, welcome!<br>
> >>>>>><br>
> >>>>>>><br>
> >>>>>>> The title might be more stated as "Reimplement lldb-mi to correctly<br>
> use the SB API instead of using HandleCommand and regular expressions to<br>
> parse the command results" as it is already using the SB API, just not using it<br>
> anywhere close to correctly!<br>
> >>>>>>><br>
> >>>>>>> I look forward to seeing the changes.<br>
> >>>>>>><br>
> >>>>>>> A few things I ran into when playing with lldb-mi:<br>
> >>>>>>> - file-exec or exec-file packet might come _after_ some breakpoints<br>
> are set. We should make sure we create a lldb::SBTarget right away and set the<br>
> breakpoints on the empty target so that we don't miss these breakpoints if this<br>
> is still an issue. Then the when we receive the exec-file packet, we set the file<br>
> on the target<br>
> >>>>>><br>
> >>>>>> Breakpoints set before any target is created are set on the dummy<br>
> target.  Breakpoints on the dummy target are copied into any new targets.  So<br>
> this should not be necessary.  If that wasn't working we should figure that out,<br>
> but it's not the responsibility of the MI to get this right.<br>
> >>>>><br>
> >>>>> We are trying not to use the command line and the command line is<br>
> what uses the dummy target automatically. When using the SB API you use a<br>
> lldb::SBTarget to set the breakpoint on so you need a target. What do you<br>
> suggest we use for the target? I would rather the lldb-mi code not rely on the<br>
> currently selected target or the dummy target.<br>
> >>>><br>
> >>>> lldb-MI models gdb's behavior, which is one debugger with one target.<br>
> There is no command to add or switch to targets, etc.  So it doesn't seem<br>
> unreasonable for MI to keep track of its one actual target and if that is empty,<br>
> use SBDebugger::GetDummyTarget.  The other option is to make a blank target<br>
> up front and then add files to it when you see the -file-exec command. But that<br>
> seems more error-prone than using the mechanism lldb provides for doing<br>
> things before you have a target.  Again, if we were modeling an API that could<br>
> switch targets we might want to do something more clever.  But that isn't how<br>
> the GDB-MI was set up to work.<br>
> >>>><br>
> >>><br>
> >>> lldb-mi code may or may not have a target when it needs one. If it doesn't<br>
> have a target, use the SB API to get the dummy target and use that.<br>
> >>><br>
> >>> Jim: is the dummy target good for anything other than adding breakpoints<br>
> to? What all gets copied from a the dummy target to the new target when one<br>
> gets created?<br>
> >><br>
> >> At present it only does breakpoints and stop hooks (see<br>
> Target::PrimeFromDummyTarget.)  I didn't do watchpoints since those are<br>
> seldom things you want to set generically, but you could probably add that.<br>
> Was there anything else you were thinking of?<br>
> >><br>
> ><br>
> > No, just mostly trying to let Alexander know what he should use the Dummy<br>
> target for and also for my own knowledge. If there are MI clients that do other<br>
> things, we will need to know if we need to create an empty real target if they<br>
> aren't breakpoints or stop hooks.<br>
> <br>
> I can't think of any other things you add to a target like this.  The settings get<br>
> inherited, and once you've started adding modules, I think you should create a<br>
> new target to hold them.  But for anything interesting that's missing, as long as<br>
> they are copiable it would be easy to add them.  Just call<br>
> GetSelectedOrDummyTarget when you go to set them, and then put the copy in<br>
> PrimeFromDummyTarget.<br>
> <br>
> ><br>
> > Greg<br>
> ><br>
> >> Jim<br>
> >><br>
> >>><br>
> >>> Alexander, feel free to ask questions if you didn't understand any of the<br>
> above information.<br>
> >>><br>
> >>><br>
> >>><br>
> >>>> Jim<br>
> >>>><br>
> >>>><br>
> >>>>><br>
> >>>>>><br>
> >>>>>>> - remove all uses of HandleCommand and use SB APIs where possible<br>
> >>>>>>> - Add any SB API that might be missing and require us to use<br>
> HandleCommand<br>
> >>>>>>><br>
> >>>>>><br>
> >>>>>> The rest of these seem good guidelines.<br>
> >>>>>><br>
> >>>>>> Jim<br>
> >>>>>><br>
> >>>>>><br>
> >>>>>>> Good luck and let us know if you have any questions,<br>
> >>>>>>><br>
> >>>>>>> Greg Clayton<br>
> >>>>>>><br>
> >>>>>>><br>
> >>>>>>>> On Apr 23, 2018, at 3:19 PM, Adrian Prantl via lldb-dev <lldb-<br>
> <a href="mailto:dev@lists.llvm.org">dev@lists.llvm.org</a>> wrote:<br>
> >>>>>>>><br>
> >>>>>>>> Please join me in welcoming Alexander Polyakov, who will be<br>
> working on cleaning up and completing LLDB's lldb-mi fronted as part of his<br>
> Google Summer Of Code project:<br>
> >>>>>>>><br>
> >>>>>>>> Reimplement lldb-mi on top of the LLDB public SB API<br>
> >>>>>>>><br>
> <a href="https://summerofcode.withgoogle.com/projects/#5427847301169152" rel="noreferrer" target="_blank">https://summerofcode.<wbr>withgoogle.com/projects/#<wbr>5427847301169152</a><br>
> >>>>>>>><br>
> >>>>>>>> -- adrian<br>
> >>>>>>>> ______________________________<wbr>_________________<br>
> >>>>>>>> lldb-dev mailing list<br>
> >>>>>>>> <a href="mailto:lldb-dev@lists.llvm.org">lldb-dev@lists.llvm.org</a><br>
> >>>>>>>> <a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-dev" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/<wbr>mailman/listinfo/lldb-dev</a><br>
> >>>>>>><br>
> >>>>>>> ______________________________<wbr>_________________<br>
> >>>>>>> lldb-dev mailing list<br>
> >>>>>>> <a href="mailto:lldb-dev@lists.llvm.org">lldb-dev@lists.llvm.org</a><br>
> >>>>>>> <a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-dev" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/<wbr>mailman/listinfo/lldb-dev</a><br>
> ><br>
> <br>
> ______________________________<wbr>_________________<br>
> lldb-dev mailing list<br>
> <a href="mailto:lldb-dev@lists.llvm.org">lldb-dev@lists.llvm.org</a><br>
> <a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-dev" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/<wbr>mailman/listinfo/lldb-dev</a><br>
<br>
</div></div></blockquote></div><br></div>