c - dbx:警告:使用 srcline 信息进入函数

标签 c fork solaris dbx

在巨大的遗留 C 代码中跟踪 dbx 中的子进程时,我遇到了一些问题。我在下面展示正在调查的代码部分:

#include<stdio.h>
#include<stdlib.h>
#include<unistd.h>
int main()
{
    if(fork()) exit(0);
    return 0;
}

当我在 Solaris 10 中运行 dbx 时,我得到以下输出:

Running: a.out
(process id 28193)
stopped in main at line 5 in file "a.c"
    5           if(fork()) exit(0);
(dbx) next
dbx: detected a fork(). Do you want to follow parent, child or stop to investigate?
> child
Following child ...
detaching from process 28193
Attached to process 28197
stopped in __fork1 at 0xfeefc6b7
0xfeefc6b7: __fork1+0x0007:     jb       __cerror       [ 0xfee70a40, .-0x8bc77 ]
Current function is main
    5           if(fork()) exit(0);
dbx: warning: stepping up to a function with srcline info

为什么我收到此警告 dbx: warning: stepping up to a function with srcline info?

谁能帮我解决这个问题?我被困在这一点上。

最佳答案

dbx 试图跟踪的函数是 __fork1(),这是提供的 通过 libc 给你。 Oracle 不提供使用 -g 构建的 libc,这正是您 需要在调试器中获得源代码行信息。

关于c - dbx:警告:使用 srcline 信息进入函数,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32382488/

相关文章:

c - 在 C 中用 fork 搜索

linux - 着色 echo 在 Solaris 中有效,但在 Linux 中无效

c - (C) 调用函数时,将多个值存储在数组中

检查路径是绝对路径还是相对路径

c - 如何使用 C 发送和捕获发送到 PID 的信号

c++ - 检测 fork() 中的子进程创建

c++ - 子串搜索面试题

c - 这段代码中fork和pid(if(pid!= 0))如何工作?

c++ - GCC 中的宏有效但在 Solaris 中编译器失败?