proccontrol: make computeAddrWidth independent of endianness
authorJosh Stone <jistone@redhat.com>
Tue, 9 Aug 2016 21:11:11 +0000 (14:11 -0700)
committerJosh Stone <jistone@redhat.com>
Tue, 9 Aug 2016 23:34:35 +0000 (16:34 -0700)
commitb8596ad4023ec40ac07e669ff8ea3ec06e262703
treec11cbb616f574755ed2308b109e291fe4ba98b9c
parent4131cc518568ba7921428d801aa7e15876b1e03e
proccontrol: make computeAddrWidth independent of endianness

In linux_process::computeAddrWidth(), it's trying to guess the address
size without disk access, but commit c8d7481 started opening the exe to
figure out its endianness.  This is especially a problem if a process
was attached without specifying its executable.

We can modify the auxv scan to look at *both* little-endian and big-
endian words.  If either are all zero, we know this is a 64-bit process.
We could even report which endian it is from this, although we still
wouldn't know that for 32-bit processes.
proccontrol/src/linux.C