2002-04-25 02:28:57 +00:00
|
|
|
/* Target-dependent code for OSF/1 on Alpha.
|
2009-01-03 05:58:08 +00:00
|
|
|
Copyright (C) 2002, 2003, 2007, 2008, 2009 Free Software Foundation, Inc.
|
2002-04-25 02:28:57 +00: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-23 18:08:50 +00:00
|
|
|
the Free Software Foundation; either version 3 of the License, or
|
2002-04-25 02:28:57 +00: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-23 18:08:50 +00:00
|
|
|
along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
2002-04-25 02:28:57 +00:00
|
|
|
|
|
|
|
#include "defs.h"
|
|
|
|
#include "frame.h"
|
2002-04-26 07:05:35 +00:00
|
|
|
#include "gdbcore.h"
|
2002-04-25 02:28:57 +00:00
|
|
|
#include "value.h"
|
2003-01-04 23:38:46 +00:00
|
|
|
#include "osabi.h"
|
2003-03-20 22:09:54 +00:00
|
|
|
#include "gdb_string.h"
|
2003-06-03 23:52:41 +00:00
|
|
|
#include "objfiles.h"
|
2002-04-25 02:28:57 +00:00
|
|
|
|
|
|
|
#include "alpha-tdep.h"
|
|
|
|
|
2002-04-25 05:06:08 +00:00
|
|
|
static int
|
|
|
|
alpha_osf1_pc_in_sigtramp (CORE_ADDR pc, char *func_name)
|
|
|
|
{
|
2003-01-09 18:30:32 +00:00
|
|
|
return (func_name != NULL && strcmp ("__sigtramp", func_name) == 0);
|
2002-04-25 05:06:08 +00:00
|
|
|
}
|
|
|
|
|
2002-04-26 07:05:35 +00:00
|
|
|
static CORE_ADDR
|
2008-05-09 03:58:26 +00:00
|
|
|
alpha_osf1_sigcontext_addr (struct frame_info *this_frame)
|
2002-04-26 07:05:35 +00:00
|
|
|
{
|
2008-05-09 03:58:26 +00: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 05:20:55 +00:00
|
|
|
|
2004-12-13 05:07:23 +00:00
|
|
|
return (read_memory_integer (next_id.stack_addr, 8));
|
2002-04-26 07:05:35 +00:00
|
|
|
}
|
|
|
|
|
2002-04-25 02:28:57 +00:00
|
|
|
static void
|
|
|
|
alpha_osf1_init_abi (struct gdbarch_info info,
|
|
|
|
struct gdbarch *gdbarch)
|
|
|
|
{
|
|
|
|
struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
|
|
|
|
|
2003-06-04 05:25:10 +00:00
|
|
|
/* Hook into the MDEBUG frame unwinder. */
|
|
|
|
alpha_mdebug_init_abi (info, gdbarch);
|
|
|
|
|
2002-08-17 06:12:52 +00: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 05:06:08 +00:00
|
|
|
|
2002-04-26 07:05:35 +00:00
|
|
|
tdep->sigcontext_addr = alpha_osf1_sigcontext_addr;
|
2004-05-01 15:34:49 +00:00
|
|
|
tdep->pc_in_sigtramp = alpha_osf1_pc_in_sigtramp;
|
2002-04-26 01:08:19 +00:00
|
|
|
|
|
|
|
tdep->jb_pc = 2;
|
|
|
|
tdep->jb_elt_size = 8;
|
2002-04-25 02:28:57 +00:00
|
|
|
}
|
|
|
|
|
2009-02-22 01:02:20 +00:00
|
|
|
/* Provide a prototype to silence -Wmissing-prototypes. */
|
|
|
|
extern initialize_file_ftype _initialize_alpha_osf1_tdep;
|
|
|
|
|
2002-04-25 02:28:57 +00:00
|
|
|
void
|
|
|
|
_initialize_alpha_osf1_tdep (void)
|
|
|
|
{
|
2002-12-21 19:58:07 +00:00
|
|
|
gdbarch_register_osabi (bfd_arch_alpha, 0, GDB_OSABI_OSF1,
|
|
|
|
alpha_osf1_init_abi);
|
2002-04-25 02:28:57 +00:00
|
|
|
}
|