A
lgorithmique
N
umérique
D
istribuée
Public GIT Repository
projects
/
simgrid.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
don't use old fashioned simcall when you don't have to
[simgrid.git]
/
src
/
mc
/
mc_unw_vmread.cpp
diff --git
a/src/mc/mc_unw_vmread.cpp
b/src/mc/mc_unw_vmread.cpp
index
7082dd3
..
1e7674c
100644
(file)
--- a/
src/mc/mc_unw_vmread.cpp
+++ b/
src/mc/mc_unw_vmread.cpp
@@
-1,4
+1,4
@@
-/* Copyright (c) 2015. The SimGrid Team.
+/* Copyright (c) 2015
-2019
. The SimGrid Team.
* All rights reserved. */
/* This program is free software; you can redistribute it and/or modify it
* All rights reserved. */
/* This program is free software; you can redistribute it and/or modify it
@@
-11,8
+11,8
@@
#include <libunwind.h>
#include <libunwind-ptrace.h>
#include <libunwind.h>
#include <libunwind-ptrace.h>
-#include "src/mc/
Process
.hpp"
-#include "src/mc/
mc_unw.h
"
+#include "src/mc/
mc_unw
.hpp"
+#include "src/mc/
remote/RemoteClient.hpp
"
/** \file
* Libunwind namespace implementation using process_vm_readv.
/** \file
* Libunwind namespace implementation using process_vm_readv.
@@
-28,7
+28,7
@@
*/
struct _UPT_info {
pid_t pid;
*/
struct _UPT_info {
pid_t pid;
- // Other things
;
+ // Other things
...
};
/** Get the PID of a `libunwind-ptrace` context
};
/** Get the PID of a `libunwind-ptrace` context
@@
-36,7
+36,7
@@
struct _UPT_info {
static inline
pid_t _UPT_getpid(void* arg)
{
static inline
pid_t _UPT_getpid(void* arg)
{
-
struct _UPT_info* info = (_UPT_info*) arg
;
+
_UPT_info* info = static_cast<_UPT_info*>(arg)
;
return info->pid;
}
return info->pid;
}
@@
-78,16
+78,16
@@
static int access_mem(const unw_addr_space_t as,
if (fd < 0)
return - UNW_EINVAL;
while (1) {
if (fd < 0)
return - UNW_EINVAL;
while (1) {
- ssize_t
s
= pread(fd, buf, count, off);
- if (
s
== 0) {
+ ssize_t
nread
= pread(fd, buf, count, off);
+ if (
nread
== 0) {
close(fd);
return - UNW_EINVAL;
}
close(fd);
return - UNW_EINVAL;
}
- if (
s
== -1)
+ if (
nread
== -1)
break;
break;
- count -=
s
;
- buf +=
s
;
- off +=
s
;
+ count -=
nread
;
+ buf +=
nread
;
+ off +=
nread
;
if (count == 0) {
close(fd);
return 0;
if (count == 0) {
close(fd);
return 0;
@@
-109,7
+109,7
@@
namespace unw {
* does not use ptrace() to read the target process memory by
* `process_vm_readv()` or `/dev/${pid}/mem` if possible.
*
* does not use ptrace() to read the target process memory by
* `process_vm_readv()` or `/dev/${pid}/mem` if possible.
*
- * Does not support any MC-specific behaviour (privati
s
ation, snapshots)
+ * Does not support any MC-specific behaviour (privati
z
ation, snapshots)
* and `ucontext_t`.
*
* It works with `void*` contexts allocated with `_UPT_create(pid)`.
* and `ucontext_t`.
*
* It works with `void*` contexts allocated with `_UPT_create(pid)`.
@@
-129,13
+129,13
@@
static unw_accessors_t accessors = {
unw_addr_space_t create_addr_space()
{
unw_addr_space_t create_addr_space()
{
- return unw_create_addr_space(&accessors,
__
BYTE_ORDER);
+ return unw_create_addr_space(&accessors, BYTE_ORDER);
}
}
-void* create_context(unw_addr_space_t
as
, pid_t pid)
+void* create_context(unw_addr_space_t
/*as*/
, pid_t pid)
{
return _UPT_create(pid);
}
}
{
return _UPT_create(pid);
}
}
-}
\ No newline at end of file
+}