lldb可以执行带参数的命令包含不转义的返回字符吗? [英] Can lldb execute a command with argument contain a unescaped return char?

查看:146
本文介绍了lldb可以执行带参数的命令包含不转义的返回字符吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我这样定义一个新的名为jspatch的lldb命令:

I define a new lldb command named jspatch like this:

command regex jspatch 's/(.+)/p (id)[JPEngine evaluateScript:@"%1"]/'

此命令接受字符串作为参数.

This command accept a string as argument.

但是我不能执行这样的命令吗?

But I can't execute a command like this?

jspatch 'var a = 10
var b = 20
a = a + b'

我只是在evaluateScript:中得到了'var a = 10.

但是我不能将包含未转义的返回字符的字符串传递给它,有人对此有解决方案吗?

But I cant pass it a string contain unescaped return char, anyone has a solution for this?

推荐答案

鉴于lldb命令解释器的设置方式,该方法不起作用.当前,未转义的返回总是提交命令进行解析.

That won't work given the way the lldb command interpreter is set up. An unescaped return currently always submits the command for parsing.

LLDB确实具有严格结构化的命令-在获得返回值的情况下,我们大概可以检测到我们位于参数中间而没有终止引号,并继续收集参数.但是,它也支持"expr以及用于处理正则表达式别名命令的命令,这些命令对命令的格式没有要求.除了将返回视为命令终止符之外,后者将使其很难执行任何其他操作.

LLDB does have rigorously structured commands - where we could presumably detect that we're in the middle of an argument w/o a terminating quote when we got the return, and continue collecting the argument. But it also supports "unparsed" commands like expr and the command that handles regex alias commands where there's no requirement on the format of the command. The latter would make it pretty hard to do anything other than treat the return as a command terminator.

这篇关于lldb可以执行带参数的命令包含不转义的返回字符吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆