pthread_create 中遇到的错误
a mistake met in pthread_create
我在运行代码一步一步,在Linux中使用gdb
时出现了错误,发生了这种情况。 (gdb) s
之后,
我收到了这些消息:
__pthread_create_2_1 (newthread=0x7fffffffdcc0, attr=0x0,
start_routine=0x400cdf <sendMessage>, arg=0x7fffffffdcd0)
at pthread_create.c:472
472 pthread_create.c: No such file or directory.
我使用“gcc -pthread -Wall -o
”构建和link我的 C 源文件,除了一些警告外没有发生任何错误。
我不知道如何处理它。
我看这里没问题。
您启动了您的程序,并在调用 pthread_create
之前设置了一个断点,因此调试器在那里暂停。
然后你试图进入pthread_create
。调试器对此没有问题。
调试器知道 pthread_create
是在 pthread_create.c
的第 472 行定义的 - 然而,它实际上并没有 pthread_create.c
的副本。所以它让你知道它不能显示源代码,这就是这条消息的意思:
472 pthread_create.c: No such file or directory.
您可能希望使用 n
(next
) 而不是 s
(step
) 来跳过 pthread_create
调用。
我在运行代码一步一步,在Linux中使用gdb
时出现了错误,发生了这种情况。 (gdb) s
之后,
我收到了这些消息:
__pthread_create_2_1 (newthread=0x7fffffffdcc0, attr=0x0,
start_routine=0x400cdf <sendMessage>, arg=0x7fffffffdcd0)
at pthread_create.c:472
472 pthread_create.c: No such file or directory.
我使用“gcc -pthread -Wall -o
”构建和link我的 C 源文件,除了一些警告外没有发生任何错误。
我不知道如何处理它。
我看这里没问题。
您启动了您的程序,并在调用 pthread_create
之前设置了一个断点,因此调试器在那里暂停。
然后你试图进入pthread_create
。调试器对此没有问题。
调试器知道 pthread_create
是在 pthread_create.c
的第 472 行定义的 - 然而,它实际上并没有 pthread_create.c
的副本。所以它让你知道它不能显示源代码,这就是这条消息的意思:
472 pthread_create.c: No such file or directory.
您可能希望使用 n
(next
) 而不是 s
(step
) 来跳过 pthread_create
调用。