2016-07-07 101 views
0

gdbでバイナリファイル(クリックと呼ばれる)をデバッグしようとしています。実行形式ではありません:ファイル形式が認識されませんGDB

私は実行すると

gdb ./click 

I持つのoutupt

GNU gdb (Ubuntu 7.10-1ubuntu2) 7.10 
Copyright (C) 2015 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-linux-gnu". 
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"... 
"/home/student/Desktop/./click": not in executable format: File format not recognized 

次のエラー:

uname -a 

Linux student 4.2.0-36-lowlatency #42-Ubuntu SMP PREEMPT Thu May 12 23:39:42 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux 
です

そして、私は

file click 

を実行する場合、私はこの出力を得る:

click: ERROR: ELF 64-bit LSB executable, x86-64, version 1 (GNU/Linux), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2 error reading (Invalid argument) 

任意のアイデア?

+1

プログラムをコンパイルするために使用しているコマンドを共有してください。 –

+0

私はeclipseでプログラムをコンパイルして、別のコンピュータでバイナリファイルを実行しようとしました。 – Elisabetta

+1

プログラムをコンパイルするコンピュータで 'uname -a'という出力は何ですか? – CristiFati

答えて

3

click: ERROR: ELF 64-bit LSB executable, x86-64, version 1 (GNU/Linux), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2 error reading (Invalid argument)

あなたのファイルだけで破損しています。

おそらく、切り詰められています(リンク時にディスク領域が足りなくなってしまったのでしょうか?)か、ASCIIモードで別のマシンからFTP経由で転送しました(バイナリモードを使用します)。

+0

ありがとう!あなたが正しい。私は新しいファイルを転送し、それは動作します! – Elisabetta

+0

私は同じ問題があります。ホスト上でプログラムをコンパイルし、ターゲットにtftpします。 –

関連する問題