Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
文字列を渡して実行するC++プログラムがあります。
g++ -o a main.cpp -lpthread
そしてそれを実行します./a "Good nice"
./a "Good nice"
しかし、どうすればgdbでデバッグできますか? main.cpp は、それに含まれる他のファイルから関数を呼び出します。
gdb ./a "Good nice"
「--」をファイルとして取り、そのようなファイルはないと言います!
行単位でデバッグしたい!
葯の選択は、後に引数を提供することですrun
run
$gdb ./a run "Good nice"