* Why gdb may not terminate in batch mode?
@ 2021-01-25 0:07 Peng Yu
0 siblings, 0 replies; only message in thread
From: Peng Yu @ 2021-01-25 0:07 UTC (permalink / raw)
To: gdb
Hi,
I see that gdb sometimes hangs with --batch enabled. Does anybody know
how to fix the problem? Thanks.
$ cat main.c
#include <stdio.h>
int main() {
printf("Hello World!");
}
$ cat > gdb_cmd.txt <<EOF
run
quit
EOF
$ gcc -o main.exe main.c
$ gdb --batch --command=gdb_cmd.txt --args main.exe # Sometimes, this
command hangs
[New Thread 0x2b03 of process 97381]
$ gdb --version
GNU gdb (GDB) 10.1
Copyright (C) 2020 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.
$ gcc --version
Configured with:
--prefix=/Applications/Xcode.app/Contents/Developer/usr
--with-gxx-include-dir=/usr/include/c++/4.2.1
Apple clang version 12.0.0 (clang-1200.0.32.28)
Target: x86_64-apple-darwin19.6.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
--
Regards,
Peng
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2021-01-25 0:07 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-25 0:07 Why gdb may not terminate in batch mode? Peng Yu
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).