2002-04-25 10:28:57 +08:00
|
|
|
/* Target-dependent code for OSF/1 on Alpha.
|
2008-01-02 06:53:26 +08:00
|
|
|
Copyright (C) 2002, 2003, 2007, 2008 Free Software Foundation, Inc.
|
2002-04-25 10:28:57 +08:00
|
|
|
|
|
|
|
This file is part of GDB.
|
|
|
|
|
|
|
|
This program is free software; you can redistribute it and/or modify
|
|
|
|
it under the terms of the GNU General Public License as published by
|
2007-08-24 02:08:50 +08:00
|
|
|
the Free Software Foundation; either version 3 of the License, or
|
2002-04-25 10:28:57 +08:00
|
|
|
(at your option) any later version.
|
|
|
|
|
|
|
|
This program is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
GNU General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License
|
2007-08-24 02:08:50 +08:00
|
|
|
along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
2002-04-25 10:28:57 +08:00
|
|
|
|
|
|
|
#include "defs.h"
|
|
|
|
#include "frame.h"
|
2002-04-26 15:05:35 +08:00
|
|
|
#include "gdbcore.h"
|
2002-04-25 10:28:57 +08:00
|
|
|
#include "value.h"
|
2003-01-05 07:38:46 +08:00
|
|
|
#include "osabi.h"
|
2003-03-21 06:09:54 +08:00
|
|
|
#include "gdb_string.h"
|
2003-06-04 07:52:41 +08:00
|
|
|
#include "objfiles.h"
|
2002-04-25 10:28:57 +08:00
|
|
|
|
|
|
|
#include "alpha-tdep.h"
|
|
|
|
|
2002-04-25 13:06:08 +08:00
|
|
|
static int
|
|
|
|
alpha_osf1_pc_in_sigtramp (CORE_ADDR pc, char *func_name)
|
|
|
|
{
|
2003-01-10 02:30:32 +08:00
|
|
|
return (func_name != NULL && strcmp ("__sigtramp", func_name) == 0);
|
2002-04-25 13:06:08 +08:00
|
|
|
}
|
|
|
|
|
2002-04-26 15:05:35 +08:00
|
|
|
static CORE_ADDR
|
2008-05-09 11:58:26 +08:00
|
|
|
alpha_osf1_sigcontext_addr (struct frame_info *this_frame)
|
2002-04-26 15:05:35 +08:00
|
|
|
{
|
2008-05-09 11:58:26 +08:00
|
|
|
struct frame_info *next_frame = get_next_frame (this_frame);
|
|
|
|
struct frame_id next_id = null_frame_id;
|
|
|
|
|
|
|
|
if (next_frame != NULL)
|
|
|
|
next_id = get_frame_id (next_frame);
|
2003-06-04 13:20:55 +08:00
|
|
|
|
2004-12-13 13:07:23 +08:00
|
|
|
return (read_memory_integer (next_id.stack_addr, 8));
|
2002-04-26 15:05:35 +08:00
|
|
|
}
|
|
|
|
|
2002-04-25 10:28:57 +08:00
|
|
|
static void
|
|
|
|
alpha_osf1_init_abi (struct gdbarch_info info,
|
|
|
|
struct gdbarch *gdbarch)
|
|
|
|
{
|
|
|
|
struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
|
|
|
|
|
2003-06-04 13:25:10 +08:00
|
|
|
/* Hook into the MDEBUG frame unwinder. */
|
|
|
|
alpha_mdebug_init_abi (info, gdbarch);
|
|
|
|
|
2002-08-17 14:12:52 +08:00
|
|
|
/* The next/step support via procfs on OSF1 is broken when running
|
|
|
|
on multi-processor machines. We need to use software single stepping
|
|
|
|
instead. */
|
|
|
|
set_gdbarch_software_single_step (gdbarch, alpha_software_single_step);
|
2002-04-25 13:06:08 +08:00
|
|
|
|
2002-04-26 15:05:35 +08:00
|
|
|
tdep->sigcontext_addr = alpha_osf1_sigcontext_addr;
|
2004-05-01 23:34:49 +08:00
|
|
|
tdep->pc_in_sigtramp = alpha_osf1_pc_in_sigtramp;
|
2002-04-26 09:08:19 +08:00
|
|
|
|
|
|
|
tdep->jb_pc = 2;
|
|
|
|
tdep->jb_elt_size = 8;
|
2002-04-25 10:28:57 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
_initialize_alpha_osf1_tdep (void)
|
|
|
|
{
|
2002-12-22 03:58:07 +08:00
|
|
|
gdbarch_register_osabi (bfd_arch_alpha, 0, GDB_OSABI_OSF1,
|
|
|
|
alpha_osf1_init_abi);
|
2002-04-25 10:28:57 +08:00
|
|
|
}
|