Thread: Exec format error

  1. #1
    Registered User
    Join Date
    Nov 2011
    Posts
    1

    Exec format error

    I'm using the Llinux operating system for a class, trying to use the gdb debugger to debug a program, but when I try to run the program in gdb (using the r, and s commands) I am getting an error message saying that there is an exec format error. Wrong Architecture and that my program exited with error code 1. Any help would be appriciated, thanks

  2. #2
    Registered User
    Join Date
    Nov 2010
    Location
    Long Beach, CA
    Posts
    5,909
    I've never come across that error before, but it sounds like the executable you're debugging is built for a different architecture/processor than the one you are using to debug. Since you're on Linux, use the file command:
    Code:
    $ file /usr/bin/gdb
    /usr/bin/gdb: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.18, stripped
    $ file /path/to/file/you/are/debugging
    If those two commands return different results you may have problems. Are you doing embedded work? Perhaps GDB is 32-bit and the other file is 64-bit. More details would be necessary, like copy-pasting a transcript of your GDB session.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. error message: too few arguments for format
    By livram79 in forum C Programming
    Replies: 2
    Last Post: 06-08-2011, 08:08 PM
  2. Error converting to same format?
    By FlyingIsFun1217 in forum C++ Programming
    Replies: 19
    Last Post: 07-07-2010, 12:39 PM
  3. error in oengl pixel format.
    By Darkinyuasha1 in forum Windows Programming
    Replies: 1
    Last Post: 01-22-2007, 07:06 PM
  4. Error inserting './hello.ko': -1 Invalid module format
    By Nishant in forum Linux Programming
    Replies: 3
    Last Post: 11-30-2006, 11:28 PM
  5. Data Format Error Detection.
    By Ti22 in forum C Programming
    Replies: 2
    Last Post: 01-03-2004, 11:52 AM