From 5f2e051a9bb2b088d3b3543982d3a244b7b7b1c4 Mon Sep 17 00:00:00 2001 From: Martin Quinson Date: Sun, 7 Aug 2022 23:52:11 +0200 Subject: [PATCH] Useless cosmetics while trying to understand that code --- src/mc/inspect/mc_unw_vmread.cpp | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/src/mc/inspect/mc_unw_vmread.cpp b/src/mc/inspect/mc_unw_vmread.cpp index 4515ea6ec5..671fccd1dd 100644 --- a/src/mc/inspect/mc_unw_vmread.cpp +++ b/src/mc/inspect/mc_unw_vmread.cpp @@ -1,3 +1,5 @@ +/** \file Libunwind namespace implementation using process_vm_readv. */ + /* Copyright (c) 2015-2022. The SimGrid Team. All rights reserved. */ /* This program is free software; you can redistribute it and/or modify it @@ -13,9 +15,6 @@ #include #include -/** \file - * Libunwind namespace implementation using process_vm_readv. - */ /** Partial structure of libunwind-ptrace context in order to get the PID * @@ -28,21 +27,13 @@ struct _UPT_info { // Other things... }; -/** Get the PID of a `libunwind-ptrace` context - */ -static inline pid_t _UPT_getpid(void* arg) -{ - const _UPT_info* info = static_cast<_UPT_info*>(arg); - return info->pid; -} - /** Read from the memory, avoid using `ptrace` (libunwind method) */ static int access_mem(const unw_addr_space_t as, const unw_word_t addr, unw_word_t* const valp, const int write, void* const arg) { if (write) return -UNW_EINVAL; - pid_t pid = _UPT_getpid(arg); + pid_t pid = static_cast<_UPT_info*>(arg)->pid; size_t size = sizeof(unw_word_t); #if HAVE_PROCESS_VM_READV /* linux but not freebsd */ -- 2.20.1