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