qemu-e2k/linux-user
Ilya Leoshkevich 77ae5761f3 linux-user: Emulate /proc/self/smaps
/proc/self/smaps is an extension of /proc/self/maps: it provides the
same lines, plus additional information about each range.

GDB uses /proc/self/smaps when available, which means that
generate-core-file tries it first before falling back to
/proc/self/maps. This, in turn, causes it to dump the host mappings,
since /proc/self/smaps is not emulated and is just passed through.

Fix by emulating /proc/self/smaps. Provide true values only for
Size, KernelPageSize, MMUPageSize and VmFlags. Leave all other values
at 0, which is a valid conservative estimate.

Signed-off-by: Ilya Leoshkevich <iii@linux.ibm.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20230621203627.1808446-4-iii@linux.ibm.com>
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Message-Id: <20230630180423.558337-34-alex.bennee@linaro.org>
2023-07-03 12:52:34 +01:00
..
aarch64
alpha
arm
cris
generic
hexagon
hppa
i386
include
loongarch64
m68k
microblaze
mips
mips64
nios2
openrisc
ppc
riscv
s390x
sh4
sparc
x86_64
xtensa
cpu_loop-common.h
elfload.c
errnos.c.inc
exit.c
fd-trans.c
fd-trans.h
flat.h
flatload.c
ioctls.h
linux_loop.h
linuxload.c
loader.h
main.c
meson.build
mmap.c
qemu.h
semihost.c
signal-common.h
signal.c
socket.h
strace.c
strace.h
strace.list
syscall_defs.h
syscall_types.h
syscall.c
thunk.c
trace-events
trace.h
uaccess.c
uname.c
uname.h
user-internals.h
user-mmap.h
vm86.c