This is the mail archive of the gdb-prs@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug server/17056] New: gdbserver assumes 32-bit binary if /proc/PID/exe can't be read


https://sourceware.org/bugzilla/show_bug.cgi?id=17056

            Bug ID: 17056
           Summary: gdbserver assumes 32-bit binary if /proc/PID/exe can't
                    be read
           Product: gdb
           Version: 7.7
            Status: NEW
          Severity: normal
          Priority: P2
         Component: server
          Assignee: unassigned at sourceware dot org
          Reporter: qartis at gmail dot com

Under some circuimstances, executables packed with UPX (prior to version 3.05)
may have an invalid /proc/PID/exe link, which causes gdbserver to assume the
executable is 32-bit. This only happens when gdbserver is attaching to an
existing (64-bit) process -- gdbserver reports the correct target architecture
if it spawns the executable itself.

(gdb) target remote 1.2.3.4:1337
warning: Selected architecture i386:x86-64 is not compatible with reported
target architecture i386

A temporary workaround is to add the following at the top of
linux_pid_exe_is_elf_64_file(), which forces gdbserver to assume the process is
64-bit:

    *machine = EM_X86_64;
    return 1;

-- 
You are receiving this mail because:
You are on the CC list for the bug.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]