<div dir="ltr"><div dir="ltr">Jim,<div>filed here: FB7587703 (better late than never I guess)</div><div><br></div><div>thanks :)<br clear="all"><div><div dir="ltr" class="gmail_signature"><div dir="ltr"><br>--<br>Fernando<br><div><br></div></div></div></div><br></div></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Jul 22, 2019 at 6:18 PM Jim Ingham <<a href="mailto:jingham@apple.com">jingham@apple.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex">I already filed both of these issues with Apple. If you want to file them too, feel free. I'll dup them to the ones I filed but that way you will get notification when they get fixed. These are also general lldb issues, so it would be good to file something with <a href="http://bugs.llvm.org" rel="noreferrer" target="_blank">http://bugs.llvm.org</a>.<br>
<br>
Jim<br>
<br>
<br>
> On Jul 19, 2019, at 3:20 AM, Fernando Bunn <<a href="mailto:fcbunn@gmail.com" target="_blank">fcbunn@gmail.com</a>> wrote:<br>
> <br>
> Jim,<br>
> you're right, I was getting a false positive with -Q, sorry for the confusion.<br>
> <br>
> So it seems I'm having 2 issues on Xcode, right?<br>
> A - No rejection of illegal options (-Q)<br>
> B - "-q" with the correct queue name is not working.<br>
> <br>
> Here's what I'm doing for B:<br>
> <br>
> 1 - (lldb) thread info<br>
> thread #1: tid = 0xfc5f, 0x00000001070418f4 ThreadTest`ViewController.viewDidLoad(self=0x00007f940610d270) at ViewController.swift:16:9, queue = 'com.apple.main-thread', stop reason = breakpoint 1.1<br>
> <br>
> 2 - (lldb) breakpoint set --file ViewController.swift --line 26 -q com.apple.main-thread<br>
> Breakpoint 2: where = ThreadTest`ThreadTest.ViewController.viewDidLoad() -> () + 942 at ViewController.swift:26:15, address = 0x0000000107041c0e<br>
> <br>
> 3 - (lldb) breakpoint list 2<br>
> 2: file = 'ViewController.swift', line = 26, exact_match = 0, locations = 1, resolved = 1, hit count = 0 Options: enabled queue name: "com.apple.main-thread" <br>
> 2.1: where = ThreadTest`ThreadTest.ViewController.viewDidLoad() -> () + 942 at ViewController.swift:26:15, address = 0x0000000107041c0e, resolved, hit count = 0 <br>
> <br>
> On #1 I just make sure the queue name is correct, com.apple.main-thread, then on #2 I set the breakpoint with "-q", and on #3 I make sure that the parameter was set correctly, and I do see the enabled queue name: "com.apple.main-thread" in there, but the breakpoint is never executed.<br>
> <br>
> But if I set breakpoint set --file ViewController.swift --line 26, without -q, the breakpoint is executed normally. <br>
> And to check that the queue name is "com.apple.main-thread" when this breakpoint is executed I did the following:<br>
> <br>
> 1 - (lldb) breakpoint set --file ViewController.swift --line 26<br>
> Breakpoint 3: where = ThreadTest`ThreadTest.ViewController.viewDidLoad() -> () + 942 at ViewController.swift:26:15, address = 0x0000000104a01c0e<br>
> 2 - (lldb) c<br>
> Process 1242 resuming<br>
> 3 - (lldb) thread info<br>
> thread #1: tid = 0x11cd2, 0x0000000104a01c0e ThreadTest`ViewController.viewDidLoad(self=0x00007fcb15d09d50) at ViewController.swift:26:15, queue = 'com.apple.main-thread', stop reason = breakpoint 3.1<br>
> <br>
> I can verify that on #3 the queue name is in fact com.apple.main-thread but if I add -q com.apple.main-thread, it doesn't work.<br>
> <br>
> At this point, I'm not sure what to do next, maybe file a radar with Apple?<br>
> Thanks for your help, I really appreciate it :)<br>
> <br>
> --<br>
> Fernando<br>
> <br>
> <br>
> <br>
> On Fri, Jul 19, 2019 at 1:27 AM Jim Ingham <<a href="mailto:jingham@apple.com" target="_blank">jingham@apple.com</a>> wrote:<br>
> Fernando, I don't see quite what you do. For me, -Q never sets the queue. Rather, the current Xcode version of lldb seems to have a bug where it doesn't reject illegal options, so the -Q argument is silently discarded. That would cause the breakpoint to "work" but it won't only stop on one queue. So I see:<br>
> <br>
> <br>
> (lldb) break set -f main.c -l 10 -q whatever<br>
> Breakpoint 1: where = SomeTool`main + 22 at main.c:13:3, address = 0x0000000100000f66<br>
> (lldb) break list 1<br>
> 1: file = 'main.c', line = 10, exact_match = 0, locations = 1, resolved = 1, hit count = 0 Options: enabled queue name: "whatever" <br>
> 1.1: where = SomeTool`main + 22 at main.c:13:3, address = 0x0000000100000f66, resolved, hit count = 0 <br>
> <br>
> That's right, it got the queue name and should match against it. But:<br>
> <br>
> (lldb) break set -f main.c -l 10 -Q whatever<br>
> Breakpoint 2: where = SomeTool`main + 22 at main.c:13:3, address = 0x0000000100000f66<br>
> (lldb) break list 2<br>
> 2: file = 'main.c', line = 10, exact_match = 0, locations = 1, resolved = 1, hit count = 0<br>
> 2.1: where = SomeTool`main + 22 at main.c:13:3, address = 0x0000000100000f66, resolved, hit count = 0 <br>
> <br>
> That one didn't get a queue name at all. So it will always stop, but OTOH that's not really what you wanted.<br>
> <br>
> It sounds like what is really going on is that the queue matching isn't working as you expected, so when you actually DID set a queue name - using the "-q" option, the breakpoint wasn't stopping, but when you didn't set a queue name (with the bogus -Q option) it did stop. So there might be something going wrong with the queue name matching?<br>
> <br>
> Note, this bug doesn't exist in current llvm TOT. If you try with that lldb:<br>
> <br>
> (lldb) break set -f foo.c -l 10 -Q foo<br>
> error: unknown or ambiguous option<br>
> <br>
> That's right, there is no -Q option...<br>
> <br>
> I'm surprised we have no tests for rejecting illegal options in the command interpreter, but I couldn't find any...<br>
> <br>
> Jim<br>
> <br>
> <br>
> <br>
> > On Jul 18, 2019, at 4:23 PM, Fernando Bunn via lldb-dev <<a href="mailto:lldb-dev@lists.llvm.org" target="_blank">lldb-dev@lists.llvm.org</a>> wrote:<br>
> > <br>
> > Hi, everyone.<br>
> > I'm seeing an issue when using the -q parameter on a breakpoint using Xcode.<br>
> > <br>
> > when I run:<br>
> > (lldb) help breakpoint modify<br>
> > I see this:<br>
> > <br>
> > -q <queue-name> ( --queue-name <queue-name> )<br>
> > The breakpoint stops only for threads in the queue whose name is<br>
> > given by this argument.<br>
> > <br>
> > So far, so good.<br>
> > Then I try to set a breakpoint with -q on it like so:<br>
> > (lldb) breakpoint set --file ViewController.swift --line 27 -q com.apple.main-thread<br>
> > <br>
> > This doesn't seem to work, but if I use -Q (uppercase), it works just fine.<br>
> > <br>
> > I thought that there was a typo somewhere and even had a patch ready to submit changing the CommandObjectBreakpoint.cpp file <br>
> > from this:<br>
> > { LLDB_OPT_SET_1, false, "queue-name", 'q', OptionParser::eRequiredArgument, nullptr, {}, 0, eArgTypeQueueName, "The breakpoint stops only for threads in the queue whose name is given by this argument." },<br>
> > <br>
> > to this:<br>
> > { LLDB_OPT_SET_1, false, "queue-name", 'Q', OptionParser::eRequiredArgument, nullptr, {}, 0, eArgTypeQueueName, "The breakpoint stops only for threads in the queue whose name is given by this argument." },<br>
> > <br>
> > but it looks the correct value is being used to switch the parameters:<br>
> > case 'q':<br>
> > m_bp_opts.GetThreadSpec()->SetQueueName(option_arg.str().c_str());<br>
> > break;<br>
> > <br>
> > My question is: why Xcode's version is not respecting the 'q' case?<br>
> > I tested on both:<br>
> > lldb-1100.0.28.6 and lldb-1001.0.13.3 and the same thing happens.<br>
> > <br>
> > Apologies if this is not the best place to ask questions like this, I'd appreciate some directions to the correct place If that's the case. Maybe file a radar directly on Apple?<br>
> > <br>
> > Thanks for your attention<br>
> > --<br>
> > Fernando<br>
> > <br>
> > _______________________________________________<br>
> > lldb-dev mailing list<br>
> > <a href="mailto:lldb-dev@lists.llvm.org" target="_blank">lldb-dev@lists.llvm.org</a><br>
> > <a href="https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-dev" rel="noreferrer" target="_blank">https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-dev</a><br>
> <br>
<br>
</blockquote></div>