[Lldb-commits] [PATCH] D62948: lit/Register: Avoid stdio in register write tests

Pavel Labath via lldb-commits lldb-commits at lists.llvm.org
Wed Jun 19 00:26:01 PDT 2019


On 19/06/2019 01:05, Jim Ingham wrote:
> 
> 
>> On Jun 7, 2019, at 2:47 AM, Pavel Labath via Phabricator via lldb-commits <lldb-commits at lists.llvm.org> wrote:
>>
>> labath planned changes to this revision.
>> labath added a comment.
>>
>> It looks like this problem is more widespread than we originally thought (a bunch of other tests are affected too). I'll need to think whether we can come up with a more general solution.
>>
>> In D62948#1533088 <https://reviews.llvm.org/D62948#1533088>, @jgorbe wrote:
>>
>>> About %T not working for "process launch", what about something like `RUN: %lldb -b --one-line-before-file "process launch --stdout %T/x86-zmm-write.out" -s %s %t` and then FileCheck-ing?
>>
>>
>> There are two issues with that. The first one is that with --one-line, lldb stops processing commands after hitting the int3 instruction. I think this is related to the fact that lldb aborts the script if the inferior crashes, and it considers an unexpected int3 instruction to be a "crash". However, it's not clear to me why should the behavior depend on whether the command is in the script or on the command line, so this may be a bug actually.
> 
> You are running lldb with the -b option.  The -b option tells lldb to exit after all commands are read UNLESS the process crashes.  An unexplained int3 (i.e. not one of our breakpoints) is considered a crash and lldb should return control to the user in that case.

Ah, interesting. I was not aware of this aspect of the -b option 
(specifically, that we don't abort the script on a crash if -b was *not* 
specified). Thanks.

>  All the commands from the -o and -s options get glommed together in order and then run through, so it shouldn't matter which of those you specified the launch for.It's good to know what the intention was. However the behavior (between 
specifying "-o" and embedding the command in the script file) does seem 
to differ for some reason. I guess that has something to do with the 
fact that "-s" gets turned into a "command source" command, and the 
abort_on_crash flag is not passed down into the nested interpreter loop.


>  Note, however, that you are putting the process launch in the -O not the -o option, which seems odd to me.
> 
> When I try something like that in lldb on the command-line:
> 
>> lldb --one-line-before-file "process launch /bin/ls" /bin/ls
> (lldb) process launch /bin/ls
> error: invalid target, create a target using the 'target create' command
> (lldb) target create "/bin/ls"
> Current executable set to '/bin/ls' (x86_64).
> 
> Which makes sense, you told lldb to launch a process before creating a target for it from the filename argument you also passed to lldb.  So lldb could either
> 
> (a) make a target up on the fly, make /bin/ls the executable and launch using that target.
>       Note that if we did this, then the file specified by the %t would create a SECOND target - which would be the selected one - and which would not be the one that is running
> (b) give an error because you were trying to launch a process w/o having made a target first.
> 
> Neither of these seem to me  something you want to do.
> 
> You seem to be seeing different behavior from this, however, so I'm not sure why b isn't behaving as expected.

No, I am seeing exactly what you described here. I have just silently 
replaced --one-line-before-file from Jorge's suggestion with --one-line 
and did not mention that anywhere. Sorry for sending you off on a tangent.

pl


More information about the lldb-commits mailing list