(gdb) l main
...
4614 if (do_daemonize)
4615 save_pid(getpid(), pid_file);
(gdb) l save_pid
Function "save_pid" not defined.
and there's its definition in source file:
static void save_pid(const pid_t pid, const char *pid_file) {
FILE *fp;
...
}
save_pid
and main
are in the same source file,but only main
has debug symbol,why??
UPDATE
Another test case with a really simple static function:
#include <stdio.h>
static int test()
{
return 0;
}
int main(void)
{
//int i = 6;
printf("%f",6.4);
return 0;
}
gcc -Wall -g test.c test
But the symbol test
is there!