前提・実現したいこと
cygwinのterminalにおいて、gdbコマンドを用いてデバッグを行いたいです。コンパイルで実行ファイルは作成されるものの、次のような結果が出力されます。
発生している問題・エラーメッセージ
not in executable format: File format not recognized
gdbコマンドを実行した後、最後にこの一文が出力されます。コンパイルの流れを下に載せました。
該当のコンパイル状況
$ gcc test03-1.c -ggdb -o a.exe $ gdb a.exe GNU gdb (GDB) 7.6.1 Copyright (C) 2013 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 "mingw32". For bug reporting instructions, please see: <http://www.gnu.org/software/gdb/bugs/>... (gdb) "C:\cygwin64\home\Simulation\Sample01/a.exe": not in executable format: File format not recognized
疑問点
通常のWindowsにあるコマンドプロンプトを使うと成功するのですが、なぜcygwinを使うと実行ファイルがあるのにないと認識されてしまうかがわからないです。
補足及び試したこと
以下に、Windowsのコマンドプロンプトを用いてgdbコマンドに成功した様子を載せます。
$ gcc apple.c -ggdb -o a.exe $ gdb a.exe GNU gdb (GDB) 7.6.1 Copyright (C) 2013 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 "mingw32". For bug reporting instructions, please see: <http://www.gnu.org/software/gdb/bugs/>... Reading symbols from C:\Users\NAME\Documents\simulation\a.exe...done.
補足情報(FW/ツールのバージョンなど)
windows10

回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2018/12/08 10:23