jimingham wrote:

Ah, I thought you were echoing something and pointing into that, I missed that 
you were pointing into the original command line.  Does this also work if I 
have an alias that scrambles the command arguments compared to how they are in 
the command that eventually got invoked.

If we're going to do errors this way, we should change the argument/option 
value setting to recognize which slot a bad option argument/option value came 
from (or unrecognized option flag for that matter) and point at those as well...

Jim

 
> On Aug 30, 2024, at 6:39 PM, Adrian Prantl ***@***.***> wrote:
> 
> 
> @adrian-prantl commented on this pull request.
> 
> In lldb/source/Interpreter/CommandInterpreter.cpp 
> <https://github.com/llvm/llvm-project/pull/106470#discussion_r1739574753>:
> 
> > @@ -2076,7 +2077,11 @@ bool CommandInterpreter::HandleCommand(const char 
> > *command_line,
>      }
>  
>      ElapsedTime elapsed(execute_time);
> -    cmd_obj->Execute(remainder.c_str(), result);
> +    size_t nchar = real_original_command_string.find(remainder);
> +    std::optional<uint16_t> pos_in_cmd;
> +    if (nchar != std::string::npos)
> +      pos_in_cmd = nchar + GetDebugger().GetPrompt().size();
> +    cmd_obj->Execute(remainder.c_str(), pos_in_cmd, result);
> @jimingham <https://github.com/jimingham> @medismailben 
> <https://github.com/medismailben> I hopefully have resolved both of your 
> concerns by storing the original command string as a member in CommandObject. 
> This way the expr -i 0 -u 0 -- not a valid expression works.
> 
> (lldb) expr -i 0 -u 0 -- not a valid expression
>                          ^
>                          ╰─ error: use of undeclared identifier 'not'
> —
> Reply to this email directly, view it on GitHub 
> <https://github.com/llvm/llvm-project/pull/106470#discussion_r1739574753>, or 
> unsubscribe 
> <https://github.com/notifications/unsubscribe-auth/ADUPVW5GTQTALYWMAUC3ZITZUENEJAVCNFSM6AAAAABNJIEXUGVHI2DSMVQWIX3LMV43YUDVNRWFEZLROVSXG5CSMV3GSZLXHMZDENZTG4YTCNBUGY>.
> You are receiving this because you were mentioned.
> 



https://github.com/llvm/llvm-project/pull/106470
_______________________________________________
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to