2016-07-07 149 views
0

我試圖用gdb調試我的二進制文件(稱爲單擊)。不是可執行格式:文件格式無法識別GDB

當我運行

gdb ./click 

我有以下錯誤

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 

的outupt:

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

我有同樣的問題。我在我的主機上編譯我的程序,並將其轉到我的目標。 –

相關問題