0

使用带有文件名和行号的 systemtap 会产生错误,而使用(损坏的)函数名很好。我在这里做错了什么?

// fails with 
// semantic error: no match
// Pass 2: analysis failed.  [man error::pass2]
probe process("a.out").statement("*@hello.cpp:5") {
  printf("in test\n")
}

// succeeds
probe process("a.out").function("_Z4testv").return {
  printf("in test\n")
}

//content of source of a.out 
#include <iostream>

void test() {
  int a = 1;
  std::cout << "Hello World!";
}

int main()
{
  test();
}

//stap command
sudo stap  a.stp -c "./a.out"

linux版本3.10.0-229.el7.x86_64

版本2.8/0.160

目录内容:a.out hello.cpp a.stp

4

1 回答 1

1

如果您的程序缺少 debuginfo 但有一个符号表,这将是预期的行为 - 即,如果它是在没有CFLAGS=-g.

于 2015-04-10T17:46:26.810 回答