WEB开发网
开发学院操作系统Linux/Unix 使用 ProbeVue 调试 C++ 应用程序 阅读

使用 ProbeVue 调试 C++ 应用程序

 2010-05-04 00:00:00 来源:WEB开发网   
核心提示: 清单 3 中的 Vue 脚本执行以下功能:探查 space 类的 func1 函数,探查 space 类的 func2 函数,使用 ProbeVue 调试 C++ 应用程序(4),探查非类函数 func3,探查函数 main

清单 3 中的 Vue 脚本执行以下功能:

探查 space 类的 func1 函数。

探查 space 类的 func2 函数。

探查非类函数 func3。

探查函数 main。

清单 3. Vue 脚本:class.e

 
# Asking ProbeVue to put probe at func1 of class space 
@@uftxlc++:$__CPID:*:"space::func1":entry 
{ 
 # And take this action once the function func1 is called 
    printf("Function : func1 called\n"); 
} 
 
#Asking ProbeVue to put probe on func2 of class space 
@@uftxlc++:$__CPID:*:"space::func2":entry 
{ 
 # And take this action once the function func2 is called 
    printf("Function : func2 called\n"); 
} 
 
#Asking ProbeVue to put probe on func3 
@@uftxlc++:$__CPID:*:"func3":entry 
{ 
 # And take this action once the function func3 is called 
    printf("Function : func3 called\n"); 
} 
 
#Asking ProbeVue to put probe on main function as well 
@@uft:$__CPID:*:main:entry 
{ 
 # And take this action once the function main is called 
    printf("Function : main called\n "); 
} 
 
#To terminate ProbeVue session once the executable exits we do the following 
#Asking ProbeVue to put probe on exit system call of the process 
@@syscall:$__CPID:exit:entry 
{ 
 # And exit once the exit system call is called 
    printf("Process called exit system call\n"); 
    printf("Process exiting hence, Probevue also exiting\n"); 
    exit(); 
} 
 
Output: 
# probevue -X ./class ./class.e 
In space public func1 <-- Following this the output is from executable 
In space private func2 
Return value of space private func2: 1 
In func3 
Function : main called <-- Following this the output is from Probevue 
 Function : func1 called 
Function : func2 called 
Function : func3 called 
Process called exit system call 
Process exiting hence, Probevue also exiting 

上一页  1 2 3 4 5 6 7 8 9  下一页

Tags:使用 ProbeVue 调试

编辑录入:爽爽 [复制链接] [打 印]
赞助商链接