]> granicus.if.org Git - strace/commit
mmap_cache: move code for searching a mmap cache from unwind
authorMasatake YAMATO <yamato@redhat.com>
Fri, 16 Feb 2018 19:37:10 +0000 (04:37 +0900)
committerDmitry V. Levin <ldv@altlinux.org>
Mon, 26 Feb 2018 23:22:24 +0000 (23:22 +0000)
commit2bb35360c268717a5437d4d69a58dca3c929a9cd
tree543c29dd49c8389805182a90fc01b7e30f497873
parent8fd4ef9bef08720fbac1cd062aa378fc147b937c
mmap_cache: move code for searching a mmap cache from unwind

print_stack_frame function in unwind.c searches a mmap entry in mmap
cache.  The found entry is then used for unwinding.  However, a function
searching for a mmap entry may be useful for other purposes than
unwinding.

This change re-factors the function; code for searching an entry is
now defined as a stand-alone function named mmap_cache_search.

* defs.h (mmap_cache_search): New function prototype.
print_stack_frame.
* mmap_cached.c (mmap_cache_search): New function derived from
print_stack_frame.
* unwind.c (print_stack_frame): Use it.

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
defs.h
mmap_cache.c
unwind.c