gpt4 book ai didi

c - 运行 'finish' 命令时 GDB 退出

转载 作者:太空宇宙 更新时间:2023-11-03 23:38:58 24 4
gpt4 key购买 nike

我下载了 mingw-w64,这样我就可以编写程序并在家用笔记本电脑上对其进行调试,但是无论出于何种原因,每当我使用 gdb 调试程序并且我希望使用“完成”命令退出函数时, gdb 一直运行直到它从函数返回并退出,然后我返回到 shell 的提示符。我不知道是什么导致了这个错误,它特别烦人并且使调试变得非常困难,因为它迫使我在退出之前检查函数中的每一行(上帝禁止有循环)。有人以前遇到过这个错误吗?有解决办法吗?

PS C:\Users\gamef\OneDrive\Desktop\CPE453\program4_tinyfs> gdb .\a.exe
GNU gdb (GDB) 8.1
Copyright (C) 2018 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-w64-mingw32".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from .\a.exe...done.
(gdb) br writeData
Breakpoint 1 at 0x402e44: file TinyFS.c, line 299.
(gdb) run
Starting program: C:\Users\gamef\OneDrive\Desktop\CPE453\program4_tinyfs\a.exe
[New Thread 40396.0x1cc8]
[New Thread 40396.0x6e30]
[New Thread 40396.0x3090]
[New Thread 40396.0x9e38]

Thread 1 hit Breakpoint 1, writeData (begBlock=0, data=0x61fab2 "\001_", 'ÿ' <repeats 31 times>, size=254,
type=DIRECTORY) at TinyFS.c:299
299 Byte buff[BLOCKSIZE] = {0};
(gdb) s
300 buff[MAGIC_OFFSET] = MAGIC_NUMBER;
(gdb) finish
Run till exit from #0 writeData (begBlock=0, data=0x61fab2 "\001_", 'ÿ' <repeats 31 times>, size=254, type=DIRECTORY)
at TinyFS.c:300
PS C:\Users\gamef\OneDrive\Desktop\CPE453\program4_tinyfs>

最佳答案

看来这个问题是GDB 8.1版本内部的一个bug引起的。所以我又回到了 GDB 8.0,它似乎工作得很好。

关于c - 运行 'finish' 命令时 GDB 退出,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50654681/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com