在LLDB中,如何等价于下面GDB中的命令?
(gdb) set {char}0x02ae4=0x12
这里提供的值是任意的示例。在使用GDB时,我可以轻松地编辑给定十六进制地址处的字节码,同时查看终端中的转储。自从我升级到Mavericks后,我一直试图更多地摆弄lldb,但在某些领域我遇到了很大的困难。也许它现在甚至还没有这种功能。
在LLDB中,如何等价于下面GDB中的命令?
(gdb) set {char}0x02ae4=0x12
这里提供的值是任意的示例。在使用GDB时,我可以轻松地编辑给定十六进制地址处的字节码,同时查看终端中的转储。自从我升级到Mavericks后,我一直试图更多地摆弄lldb,但在某些领域我遇到了很大的困难。也许它现在甚至还没有这种功能。
memory write
。(lldb) help memory write
定义了这样一种输入格式:memory write -i <filename> [-s <byte-size>] [-o <offset>] <address> <value> [<value> [...]]
-f <format> ( --format <format> )
Specify a format to be used for display.
-i <filename> ( --infile <filename> )
Write memory using the contents of a file.
-o <offset> ( --offset <offset> )
Start writng bytes from an offset within the input file.
-s <byte-size> ( --size <byte-size> )
The size in bytes to use when displaying with the selected format.
(lldb) memory write 0x02ae4 0x12
这样的内容应该可以直接使用。内存写入
是有效的,但你也可以使用表达式引擎和 C 表达式。
p *(char*)0x2ae4 = 0x12
0x12
来等同于问题的例子。 - ecm
-s
选项:(lldb) memory write 0x02ae4 -s 2 0xFFFF
。 - Picard