3

错误信息:evaluation of this expression requires the program to have a function "malloc".

> gdb /Users/jani/.rbenv/versions/2.0.0-p247/bin/ruby  27300
GNU gdb (GDB) 7.6.1
This GDB was configured as "x86_64-apple-darwin13.0.0".
Reading symbols from /Users/jani/.rbenv/versions/2.0.0-p247/bin/ruby...done.
Attaching to program: /Users/jani/.rbenv/versions/2.0.0-p247/bin/ruby, process 27300
[New Thread 0x1703 of process 27300]
0x0000000101fdfacf in ?? ()
(gdb) ruby_eval("puts 1")
evaluation of this expression requires the program to have a function "malloc".

有人有线索吗?

4

1 回答 1

0

从 gdb(ruby_eval("puts 1") 位)调用“劣质函数调用”需要 gdb 在目标进程中分配一些内存,因此它可以在其中放置堆栈帧、参数等。为此,gdb 通常会导致下级进程运行 C 库 malloc(3) 函数。如果 gdb 找不到 malloc,那么您的劣质函数调用将无法进行。

于 2013-10-24T18:44:20.750 回答