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 eat the errno of when dlopen fails (but still remove the copied binary)
[simgrid.git]
/
src
/
mc
/
LocationList.cpp
diff --git
a/src/mc/LocationList.cpp
b/src/mc/LocationList.cpp
index
7ce1b1e
..
8bb4661
100644
(file)
--- a/
src/mc/LocationList.cpp
+++ b/
src/mc/LocationList.cpp
@@
-1,9
+1,17
@@
-/* Copyright (c) 2004-2015. The SimGrid Team.
- * All rights reserved. */
+/* Copyright (c) 2004-2017. The SimGrid Team. All rights reserved. */
/* This program is free software; you can redistribute it and/or modify it
* under the terms of the license (GNU LGPL) which comes with this package. */
/* This program is free software; you can redistribute it and/or modify it
* under the terms of the license (GNU LGPL) which comes with this package. */
+#include <cstddef>
+#include <cstdint>
+#include <utility>
+
+#include "xbt/asserts.h"
+#include "xbt/sysdep.h"
+
+#include <libunwind.h>
+
#include "src/mc/mc_dwarf.hpp"
#include "src/mc/ObjectInformation.hpp"
#include "src/mc/LocationList.hpp"
#include "src/mc/mc_dwarf.hpp"
#include "src/mc/ObjectInformation.hpp"
#include "src/mc/LocationList.hpp"
@@
-26,13
+34,9
@@
Location resolve(
context.object_info = object_info;
context.process_index = process_index;
context.object_info = object_info;
context.process_index = process_index;
- if (!expression.empty()
- && expression[0].atom >= DW_OP_reg0
- && expression[0].atom <= DW_OP_reg31) {
+ if (not expression.empty() && expression[0].atom >= DW_OP_reg0 && expression[0].atom <= DW_OP_reg31) {
int dwarf_register = expression[0].atom - DW_OP_reg0;
int dwarf_register = expression[0].atom - DW_OP_reg0;
- xbt_assert(c,
- "Missing frame context for register operation DW_OP_reg%i",
- dwarf_register);
+ xbt_assert(c, "Missing frame context for register operation DW_OP_reg%i", dwarf_register);
return Location(dwarf_register_to_libunwind(dwarf_register));
}
return Location(dwarf_register_to_libunwind(dwarf_register));
}
@@
-64,7
+68,7
@@
Location resolve(
xbt_die("Could not resolve IP");
simgrid::dwarf::DwarfExpression const* expression =
find_expression(locations, ip);
xbt_die("Could not resolve IP");
simgrid::dwarf::DwarfExpression const* expression =
find_expression(locations, ip);
- if (
!
expression)
+ if (
not
expression)
xbt_die("Could not resolve location");
return simgrid::dwarf::resolve(
*expression, object_info, c,
xbt_die("Could not resolve location");
return simgrid::dwarf::resolve(
*expression, object_info, c,
@@
-78,13
+82,13
@@
LocationList location_list(
LocationList locations;
std::ptrdiff_t offset = 0;
while (1) {
LocationList locations;
std::ptrdiff_t offset = 0;
while (1) {
-
- Dwarf_Addr base, start, end;
+ Dwarf_Addr base;
+ Dwarf_Addr start;
+ Dwarf_Addr end;
Dwarf_Op *ops;
std::size_t len;
Dwarf_Op *ops;
std::size_t len;
- offset = dwarf_getlocations(
- &attr, offset, &base, &start, &end, &ops, &len);
+ offset = dwarf_getlocations(&attr, offset, &base, &start, &end, &ops, &len);
if (offset == 0)
break;
if (offset == 0)
break;
@@
-96,16
+100,14
@@
LocationList location_list(
LocationListEntry::range_type range;
if (start == 0)
// If start == 0, this is not a location list:
LocationListEntry::range_type range;
if (start == 0)
// If start == 0, this is not a location list:
- range = {
0, 0
};
+ range = {
0, UINT64_MAX
};
else
range = { base_address + start, base_address + end };
locations.push_back({ DwarfExpression(ops, ops+len), range });
}
else
range = { base_address + start, base_address + end };
locations.push_back({ DwarfExpression(ops, ops+len), range });
}
- return std::move(locations);
+ return locations;
+}
}
}
-
-
}
}
-}
\ No newline at end of file