* *
* C Implementation File *
* *
- * Copyright (C) 2000-2003 Ada Core Technologies, Inc *
+ * Copyright (C) 2000-2005, AdaCore *
* *
* GNAT is free software; you can redistribute it and/or modify it under *
* terms of the GNU General Public License as published by the Free Soft- *
* 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 distributed with GNAT; see file COPYING. If not, write *
- * to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, *
- * MA 02111-1307, USA. *
+ * to the Free Software Foundation, 51 Franklin Street, Fifth Floor, *
+ * Boston, MA 02110-1301, USA. *
* *
* As a special exception, if you link this file with other files to *
* produce an executable, this file does not by itself cause the resulting *
#include <limits.h>
#include <string.h>
-extern void kerTaskEntry();
+extern void kerTaskEntry(void);
/* We still use a number of macros similar to the ones for the generic
__gnat_backtrace implementation. */
struct alloc_chain *trace_alloc_chain;
static void *
-trace_alloc (n)
- unsigned int n;
+trace_alloc (unsigned int n)
{
struct alloc_chain * result = malloc (n + sizeof(struct alloc_chain));
}
static void
-free_trace_alloc ()
+free_trace_alloc (void)
{
while (trace_alloc_chain != 0)
{
otherwise. */
static int
-read_memory_safe4 (addr, dest)
- CORE_ADDR addr;
- unsigned int *dest;
+read_memory_safe4 (CORE_ADDR addr, unsigned int *dest)
{
*dest = *((unsigned int*) addr);
return 0;
otherwise. */
static int
-read_memory_safe8 (addr, dest)
- CORE_ADDR addr;
- CORE_ADDR *dest;
+read_memory_safe8 (CORE_ADDR addr, CORE_ADDR *dest)
{
*dest = *((CORE_ADDR*) addr);
return 0;
}
static CORE_ADDR
-read_register (regno)
- int regno;
+read_register (int regno)
{
if (regno >= 0 && regno < 31)
return theRegisters[regno];
}
static void
-frame_saved_regs_zalloc (fi)
- struct frame_info *fi;
+frame_saved_regs_zalloc (struct frame_info *fi)
{
fi->saved_regs = (CORE_ADDR *) trace_alloc (SIZEOF_FRAME_SAVED_REGS);
memset (fi->saved_regs, 0, SIZEOF_FRAME_SAVED_REGS);
}
static void *
-frame_obstack_alloc (size)
- unsigned long size;
+frame_obstack_alloc (unsigned long size)
{
return (void *) trace_alloc (size);
}
static int
-inside_entry_file (addr)
- CORE_ADDR addr;
+inside_entry_file (CORE_ADDR addr)
{
if (addr == 0)
return 1;
}
static CORE_ADDR
-alpha_saved_pc_after_call (frame)
- struct frame_info *frame;
+alpha_saved_pc_after_call (struct frame_info *frame)
{
CORE_ADDR pc = frame->pc;
alpha_extra_func_info_t proc_desc;
NULL). */
static void
-alpha_find_saved_regs (frame)
- struct frame_info *frame;
+alpha_find_saved_regs (struct frame_info *frame)
{
int ireg;
CORE_ADDR reg_position;
}
static CORE_ADDR
-read_next_frame_reg (fi, regno)
- struct frame_info *fi;
- int regno;
+read_next_frame_reg (struct frame_info *fi, int regno)
{
CORE_ADDR result;
for (; fi; fi = fi->next)
}
static CORE_ADDR
-alpha_frame_saved_pc (frame)
- struct frame_info *frame;
+alpha_frame_saved_pc (struct frame_info *frame)
{
return read_next_frame_reg (frame, frame->pc_reg);
}
$zero,($ra),1" on alpha. */
static int
-alpha_about_to_return (pc)
- CORE_ADDR pc;
+alpha_about_to_return (CORE_ADDR pc)
{
int inst;
containing address PC. Returns 0 if none detected. */
static CORE_ADDR
-heuristic_proc_start (pc)
- CORE_ADDR pc;
+heuristic_proc_start (CORE_ADDR pc)
{
CORE_ADDR start_pc = pc;
CORE_ADDR fence = start_pc - heuristic_fence_post;
}
static alpha_extra_func_info_t
-heuristic_proc_desc (start_pc, limit_pc, next_frame, saved_regs_p)
- CORE_ADDR start_pc;
- CORE_ADDR limit_pc;
- struct frame_info *next_frame;
- struct frame_saved_regs *saved_regs_p;
+heuristic_proc_desc (CORE_ADDR start_pc,
+ CORE_ADDR limit_pc,
+ struct frame_info *next_frame,
+ struct frame_saved_regs *saved_regs_p)
{
CORE_ADDR sp = read_next_frame_reg (next_frame, SP_REGNUM);
CORE_ADDR cur_pc;
}
static alpha_extra_func_info_t
-find_proc_desc (pc, next_frame, saved_regs)
- CORE_ADDR pc;
- struct frame_info *next_frame;
- struct frame_saved_regs *saved_regs;
+find_proc_desc (CORE_ADDR pc,
+ struct frame_info *next_frame,
+ struct frame_saved_regs *saved_regs)
{
CORE_ADDR startaddr;
- /* If heuristic_fence_post is non-zero, determine the procedure
+ /* If heuristic_fence_post is nonzero, determine the procedure
start address by examining the instructions.
This allows us to find the start address of static functions which
have no symbolic information, as startaddr would have been set to
}
static CORE_ADDR
-alpha_frame_chain (frame)
- struct frame_info *frame;
+alpha_frame_chain (struct frame_info *frame)
{
alpha_extra_func_info_t proc_desc;
CORE_ADDR saved_pc = FRAME_SAVED_PC (frame);
}
static void
-init_extra_frame_info (frame)
- struct frame_info *frame;
+init_extra_frame_info (struct frame_info *frame)
{
struct frame_saved_regs temp_saved_regs;
alpha_extra_func_info_t proc_desc =
Always returns a non-NULL value. */
static struct frame_info *
-create_new_frame (addr, pc)
- CORE_ADDR addr;
- CORE_ADDR pc;
+create_new_frame (CORE_ADDR addr, CORE_ADDR pc)
{
struct frame_info *fi;
static CORE_ADDR current_pc;
static void
-set_current_pc ()
+set_current_pc (void)
{
current_pc = (CORE_ADDR) __builtin_return_address (0);
}
static CORE_ADDR
-read_pc ()
+read_pc (void)
{
return current_pc;
}
static struct frame_info *
-get_current_frame ()
+get_current_frame (void)
{
return create_new_frame (0, read_pc ());
}
If FI is the original frame (it has no caller), return 0. */
static struct frame_info *
-get_prev_frame (next_frame)
- struct frame_info *next_frame;
+get_prev_frame (struct frame_info *next_frame)
{
CORE_ADDR address = 0;
struct frame_info *prev;
"stq $" #regno ", " #disp "(%0)\n"
int
-__gnat_backtrace (array, size, exclude_min, exclude_max, skip_frames)
- void **array;
- int size;
- void *exclude_min;
- void *exclude_max;
- int skip_frames;
+__gnat_backtrace (void **array,
+ int size,
+ void *exclude_min,
+ void *exclude_max,
+ int skip_frames)
{
struct frame_info* top;
struct frame_info* current;