|
Packit Service |
97d2fb |
/* Get return address register value for frame.
|
|
Packit Service |
97d2fb |
Copyright (C) 2013 Red Hat, Inc.
|
|
Packit Service |
97d2fb |
This file is part of elfutils.
|
|
Packit Service |
97d2fb |
|
|
Packit Service |
97d2fb |
This file is free software; you can redistribute it and/or modify
|
|
Packit Service |
97d2fb |
it under the terms of either
|
|
Packit Service |
97d2fb |
|
|
Packit Service |
97d2fb |
* the GNU Lesser General Public License as published by the Free
|
|
Packit Service |
97d2fb |
Software Foundation; either version 3 of the License, or (at
|
|
Packit Service |
97d2fb |
your option) any later version
|
|
Packit Service |
97d2fb |
|
|
Packit Service |
97d2fb |
or
|
|
Packit Service |
97d2fb |
|
|
Packit Service |
97d2fb |
* the GNU General Public License as published by the Free
|
|
Packit Service |
97d2fb |
Software Foundation; either version 2 of the License, or (at
|
|
Packit Service |
97d2fb |
your option) any later version
|
|
Packit Service |
97d2fb |
|
|
Packit Service |
97d2fb |
or both in parallel, as here.
|
|
Packit Service |
97d2fb |
|
|
Packit Service |
97d2fb |
elfutils is distributed in the hope that it will be useful, but
|
|
Packit Service |
97d2fb |
WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
Packit Service |
97d2fb |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
Packit Service |
97d2fb |
General Public License for more details.
|
|
Packit Service |
97d2fb |
|
|
Packit Service |
97d2fb |
You should have received copies of the GNU General Public License and
|
|
Packit Service |
97d2fb |
the GNU Lesser General Public License along with this program. If
|
|
Packit Service |
97d2fb |
not, see <http://www.gnu.org/licenses/>. */
|
|
Packit Service |
97d2fb |
|
|
Packit Service |
97d2fb |
#ifdef HAVE_CONFIG_H
|
|
Packit Service |
97d2fb |
# include <config.h>
|
|
Packit Service |
97d2fb |
#endif
|
|
Packit Service |
97d2fb |
|
|
Packit Service |
97d2fb |
#include "libdwflP.h"
|
|
Packit Service |
97d2fb |
|
|
Packit Service |
97d2fb |
bool
|
|
Packit Service |
97d2fb |
dwfl_frame_pc (Dwfl_Frame *state, Dwarf_Addr *pc, bool *isactivation)
|
|
Packit Service |
97d2fb |
{
|
|
Packit Service |
97d2fb |
assert (state->pc_state == DWFL_FRAME_STATE_PC_SET);
|
|
Packit Service |
97d2fb |
*pc = state->pc;
|
|
Packit Service |
97d2fb |
ebl_normalize_pc (state->thread->process->ebl, pc);
|
|
Packit Service |
97d2fb |
if (isactivation)
|
|
Packit Service |
97d2fb |
{
|
|
Packit Service |
97d2fb |
/* Bottom frame? */
|
|
Packit Service |
97d2fb |
if (state->initial_frame)
|
|
Packit Service |
97d2fb |
*isactivation = true;
|
|
Packit Service |
97d2fb |
/* *ISACTIVATION is logical union of whether current or previous frame
|
|
Packit Service |
97d2fb |
state is SIGNAL_FRAME. */
|
|
Packit Service |
97d2fb |
else if (state->signal_frame)
|
|
Packit Service |
97d2fb |
*isactivation = true;
|
|
Packit Service |
97d2fb |
else
|
|
Packit Service |
97d2fb |
{
|
|
Packit Service |
97d2fb |
/* If the previous frame has unwound unsuccessfully just silently do
|
|
Packit Service |
97d2fb |
not consider it could be a SIGNAL_FRAME. */
|
|
Packit Service |
97d2fb |
__libdwfl_frame_unwind (state);
|
|
Packit Service |
97d2fb |
if (state->unwound == NULL
|
|
Packit Service |
97d2fb |
|| state->unwound->pc_state != DWFL_FRAME_STATE_PC_SET)
|
|
Packit Service |
97d2fb |
*isactivation = false;
|
|
Packit Service |
97d2fb |
else
|
|
Packit Service |
97d2fb |
*isactivation = state->unwound->signal_frame;
|
|
Packit Service |
97d2fb |
}
|
|
Packit Service |
97d2fb |
}
|
|
Packit Service |
97d2fb |
return true;
|
|
Packit Service |
97d2fb |
}
|
|
Packit Service |
97d2fb |
INTDEF (dwfl_frame_pc)
|