1 /* Copyright (c) 2007-2020. The SimGrid Team.
2 * All rights reserved. */
4 /* This program is free software; you can redistribute it and/or modify it
5 * under the terms of the license (GNU LGPL) which comes with this package. */
9 #include "xbt/sysdep.h"
11 #include "src/mc/inspect/Frame.hpp"
16 void* Frame::frame_base(unw_cursor_t& unw_cursor) const
18 simgrid::dwarf::Location location =
19 simgrid::dwarf::resolve(frame_base_location, object_info, &unw_cursor, nullptr, nullptr);
20 if (location.in_memory())
21 return location.address();
22 else if (location.in_register()) {
23 // This is a special case.
24 // The register is not the location of the frame base
25 // (a frame base cannot be located in a register).
26 // Instead, DWARF defines this to mean that the register
27 // contains the address of the frame base.
29 unw_get_reg(&unw_cursor, location.register_id(), &word);
32 xbt_die("Unexpected location type");
36 } // namespace simgrid