2002-04-25 02:28:57 +00:00
|
|
|
/* Target-dependent code for OSF/1 on Alpha.
|
2003-01-04 23:38:46 +00:00
|
|
|
Copyright 2002, 2003 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
|
|
|
|
the Free Software Foundation; either version 2 of the License, or
|
|
|
|
(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
|
|
|
|
along with this program; if not, write to the Free Software
|
|
|
|
Foundation, Inc., 59 Temple Place - Suite 330,
|
|
|
|
Boston, MA 02111-1307, USA. */
|
|
|
|
|
|
|
|
#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
|
|
|
|
alpha_osf1_sigcontext_addr (struct frame_info *frame)
|
|
|
|
{
|
2003-06-04 05:20:55 +00:00
|
|
|
struct frame_info *next_frame = get_next_frame (frame);
|
|
|
|
|
|
|
|
if (next_frame != NULL)
|
|
|
|
return (read_memory_integer (get_frame_base (next_frame), 8));
|
|
|
|
else
|
|
|
|
return (read_memory_integer (get_frame_base (frame), 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-04-25 05:06:08 +00:00
|
|
|
set_gdbarch_pc_in_sigtramp (gdbarch, alpha_osf1_pc_in_sigtramp);
|
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;
|
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
|
|
|
}
|
|
|
|
|
|
|
|
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
|
|
|
}
|