From da8e6028a3178309a56db8bbf5e10f84f3791140 Mon Sep 17 00:00:00 2001 From: Matthieu Volat Date: Thu, 17 Nov 2016 13:03:32 +0100 Subject: [PATCH 1/1] In FreeBSD map backend, mark stack same as in Linux --- src/xbt/memory_map.cpp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/xbt/memory_map.cpp b/src/xbt/memory_map.cpp index 61355f491c..fed4b2c572 100644 --- a/src/xbt/memory_map.cpp +++ b/src/xbt/memory_map.cpp @@ -235,16 +235,20 @@ XBT_PRIVATE std::vector get_memory_map(pid_t pid) /* Inode */ memreg.inode = vmentries[i].kve_vn_fileid; - /* - * Path. Linuxize result by giving an anonymous mapping a path from - * the previous mapping... provided previous is vnode and has a path. - */ + /* + * Path. Linuxize result by giving an anonymous mapping a path from + * the previous mapping, provided previous is vnode and has a path, + * and mark the stack. + */ if (vmentries[i].kve_path[0] != '\0') memreg.pathname = vmentries[i].kve_path; else if (vmentries[i].kve_type == KVME_TYPE_DEFAULT && vmentries[i-1].kve_type == KVME_TYPE_VNODE && vmentries[i-1].kve_path[0] != '\0') memreg.pathname = vmentries[i-1].kve_path; + else if (vmentries[i].kve_type == KVME_TYPE_DEFAULT + && vmentries[i].kve_flags & KVME_FLAG_GROWS_DOWN) + memreg.pathname = "[stack]"; ret.push_back(std::move(memreg)); } -- 2.20.1