]> git.ipfire.org Git - thirdparty/qemu.git/commit
linux-user: Emulate /proc/self/smaps
authorIlya Leoshkevich <iii@linux.ibm.com>
Fri, 30 Jun 2023 18:04:18 +0000 (19:04 +0100)
committerAlex Bennée <alex.bennee@linaro.org>
Mon, 3 Jul 2023 11:52:34 +0000 (12:52 +0100)
commit77ae5761f3c9e6b68f8545cff06704f823c3d387
tree1c43cbffc6c03c2f10d824624e4ecac1c63e6bfc
parent35be898e2f019bc63bffd02ab7fbd19287fd3cf4
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>
linux-user/syscall.c