public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
* [Bug server/17056] New: gdbserver assumes 32-bit binary if /proc/PID/exe can't be read
@ 2014-06-13 23:42 qartis at gmail dot com
  0 siblings, 0 replies; only message in thread
From: qartis at gmail dot com @ 2014-06-13 23:42 UTC (permalink / raw)
  To: gdb-prs

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.


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2014-06-13 23:42 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-06-13 23:42 [Bug server/17056] New: gdbserver assumes 32-bit binary if /proc/PID/exe can't be read qartis at gmail dot com

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).