gdb调试如何跟踪进入另外一个包含文件的内部函数进行调试?
假定文件: myfunc.c
#include <stdio.h>
int max(int x,int y)
{
return x<y?x:y;
}
主函数文件: test.c
#include <unistd.h>
#include "myfunc.c"
static char buff [256];
static char* string;
int main ()
{
int x,y,z;
printf ("Please input a string: ");
gets (string);
printf ("\nYour string is: %s\n", string);
x = 5;y = 10;
z = max(x,y);
printf("\nmax(%d,%d) = %d",x,y,z) ;
}
在上面的程序中,包含文件myfunc.c的求最大值的函数逻辑是错误的,实际上是求最小值,
因此,需要跟踪进入该函数的内部进行调试,用GDB如何跟踪进入该函数的内部呢?
请问实现该调试功能的调试命令如何写?