From 5e34685f1847c7b616bee0055176231ef5012d37 Mon Sep 17 00:00:00 2001 From: "mostang.com!davidm" Date: Thu, 28 Feb 2002 16:24:48 +0000 Subject: [PATCH] (Logical change 1.8) --- src/ia64/Linit.c | 4 ++ src/ia64/Lparser.c | 4 ++ src/ia64/Lregs.c | 4 ++ src/ia64/Lregs.c~ | 0 src/ia64/Lscript.c | 4 ++ src/ia64/Lscript.c~ | 2 + src/ia64/Lunw_get_reg.c | 4 ++ src/ia64/Lunw_get_reg.c~ | 0 src/ia64/Lunw_init_local.c | 4 ++ src/ia64/Lunw_init_remote.c | 4 ++ src/ia64/Lunw_resume.c | 4 ++ src/ia64/Lunw_set_reg.c | 4 ++ src/ia64/Lunw_step.c | 4 ++ src/ia64/init.h | 112 ++++++++++++++++++++++++++++++++++++ src/ia64/shared.c | 92 +++++++++++++++++++++++++++++ 15 files changed, 246 insertions(+) create mode 100644 src/ia64/Linit.c create mode 100644 src/ia64/Lparser.c create mode 100644 src/ia64/Lregs.c create mode 100644 src/ia64/Lregs.c~ create mode 100644 src/ia64/Lscript.c create mode 100644 src/ia64/Lscript.c~ create mode 100644 src/ia64/Lunw_get_reg.c create mode 100644 src/ia64/Lunw_get_reg.c~ create mode 100644 src/ia64/Lunw_init_local.c create mode 100644 src/ia64/Lunw_init_remote.c create mode 100644 src/ia64/Lunw_resume.c create mode 100644 src/ia64/Lunw_set_reg.c create mode 100644 src/ia64/Lunw_step.c create mode 100644 src/ia64/init.h create mode 100644 src/ia64/shared.c diff --git a/src/ia64/Linit.c b/src/ia64/Linit.c new file mode 100644 index 00000000..3152f9d8 --- /dev/null +++ b/src/ia64/Linit.c @@ -0,0 +1,4 @@ +#ifndef UNW_REMOTE_ONLY +#define UNW_LOCAL_ONLY +#include "init.c" +#endif diff --git a/src/ia64/Lparser.c b/src/ia64/Lparser.c new file mode 100644 index 00000000..70d99994 --- /dev/null +++ b/src/ia64/Lparser.c @@ -0,0 +1,4 @@ +#ifndef UNW_REMOTE_ONLY +#define UNW_LOCAL_ONLY +#include "parser.c" +#endif diff --git a/src/ia64/Lregs.c b/src/ia64/Lregs.c new file mode 100644 index 00000000..8c5fe096 --- /dev/null +++ b/src/ia64/Lregs.c @@ -0,0 +1,4 @@ +#ifndef UNW_REMOTE_ONLY +#define UNW_LOCAL_ONLY +#include "regs.c" +#endif diff --git a/src/ia64/Lregs.c~ b/src/ia64/Lregs.c~ new file mode 100644 index 00000000..e69de29b diff --git a/src/ia64/Lscript.c b/src/ia64/Lscript.c new file mode 100644 index 00000000..1f7e8cdd --- /dev/null +++ b/src/ia64/Lscript.c @@ -0,0 +1,4 @@ +#ifndef UNW_REMOTE_ONLY +#define UNW_LOCAL_ONLY +#include "script.c" +#endif diff --git a/src/ia64/Lscript.c~ b/src/ia64/Lscript.c~ new file mode 100644 index 00000000..6f17a281 --- /dev/null +++ b/src/ia64/Lscript.c~ @@ -0,0 +1,2 @@ +#define UNW_LOCAL_ONLY +#include "script.c" diff --git a/src/ia64/Lunw_get_reg.c b/src/ia64/Lunw_get_reg.c new file mode 100644 index 00000000..0605f58e --- /dev/null +++ b/src/ia64/Lunw_get_reg.c @@ -0,0 +1,4 @@ +#ifndef UNW_REMOTE_ONLY +#define UNW_LOCAL_ONLY +#include "unw_get_reg.c" +#endif diff --git a/src/ia64/Lunw_get_reg.c~ b/src/ia64/Lunw_get_reg.c~ new file mode 100644 index 00000000..e69de29b diff --git a/src/ia64/Lunw_init_local.c b/src/ia64/Lunw_init_local.c new file mode 100644 index 00000000..a93a0e71 --- /dev/null +++ b/src/ia64/Lunw_init_local.c @@ -0,0 +1,4 @@ +#ifndef UNW_REMOTE_ONLY +#define UNW_LOCAL_ONLY +#include "unw_init_local.c" +#endif diff --git a/src/ia64/Lunw_init_remote.c b/src/ia64/Lunw_init_remote.c new file mode 100644 index 00000000..c6e09a22 --- /dev/null +++ b/src/ia64/Lunw_init_remote.c @@ -0,0 +1,4 @@ +#ifndef UNW_REMOTE_ONLY +#define UNW_LOCAL_ONLY +#include "unw_init_remote.c" +#endif diff --git a/src/ia64/Lunw_resume.c b/src/ia64/Lunw_resume.c new file mode 100644 index 00000000..5dbb36c0 --- /dev/null +++ b/src/ia64/Lunw_resume.c @@ -0,0 +1,4 @@ +#ifndef UNW_REMOTE_ONLY +#define UNW_LOCAL_ONLY +#include "unw_resume.c" +#endif diff --git a/src/ia64/Lunw_set_reg.c b/src/ia64/Lunw_set_reg.c new file mode 100644 index 00000000..50ceef9e --- /dev/null +++ b/src/ia64/Lunw_set_reg.c @@ -0,0 +1,4 @@ +#ifndef UNW_REMOTE_ONLY +#define UNW_LOCAL_ONLY +#include "unw_set_reg.c" +#endif diff --git a/src/ia64/Lunw_step.c b/src/ia64/Lunw_step.c new file mode 100644 index 00000000..5497fa7a --- /dev/null +++ b/src/ia64/Lunw_step.c @@ -0,0 +1,4 @@ +#ifndef UNW_REMOTE_ONLY +#define UNW_LOCAL_ONLY +#include "unw_step.c" +#endif diff --git a/src/ia64/init.h b/src/ia64/init.h new file mode 100644 index 00000000..34c42177 --- /dev/null +++ b/src/ia64/init.h @@ -0,0 +1,112 @@ +/* libunwind - a platform-independent unwind library + Copyright (C) 2002 Hewlett-Packard Co + Contributed by David Mosberger-Tang + +This file is part of libunwind. + +libunwind 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, or (at your option) +any later version. + +libunwind 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. + +As a special exception, if you link this library with other files to +produce an executable, this library does not by itself cause the +resulting executable to be covered by the GNU General Public License. +This exception does not however invalidate any other reasons why the +executable file might be covered by the GNU General Public +License. */ + +#include "unwind_i.h" + +static inline +common_init (struct ia64_cursor *c) +{ + int i, ret; + + c->cfm_loc = IA64_REG_LOC (c, UNW_IA64_CFM); + c->top_rnat_loc = IA64_REG_LOC (c, UNW_IA64_AR_RNAT); + c->bsp_loc = IA64_REG_LOC (c, UNW_IA64_AR_BSP); + c->bspstore_loc = IA64_REG_LOC (c, UNW_IA64_AR_BSPSTORE); + c->pfs_loc = IA64_REG_LOC (c, UNW_IA64_AR_PFS); + c->rnat_loc = IA64_REG_LOC (c, UNW_IA64_AR_RNAT); + c->ip_loc = IA64_REG_LOC (c, UNW_IA64_IP); + c->pri_unat_loc = 0; /* no primary UNaT location */ + c->unat_loc = IA64_REG_LOC (c, UNW_IA64_AR_UNAT); + c->pr_loc = IA64_REG_LOC (c, UNW_IA64_PR); + c->lc_loc = IA64_REG_LOC (c, UNW_IA64_AR_LC); + c->fpsr_loc = IA64_REG_LOC (c, UNW_IA64_AR_FPSR); + + c->r4_loc = IA64_REG_LOC (c, UNW_IA64_GR + 4); + c->r5_loc = IA64_REG_LOC (c, UNW_IA64_GR + 5); + c->r6_loc = IA64_REG_LOC (c, UNW_IA64_GR + 6); + c->r7_loc = IA64_REG_LOC (c, UNW_IA64_GR + 7); + + /* This says that each NaT bit is stored along with the + corresponding preserved register: */ + c->nat4_loc = IA64_LOC (4, 0); + c->nat5_loc = IA64_LOC (5, 0); + c->nat6_loc = IA64_LOC (6, 0); + c->nat7_loc = IA64_LOC (7, 0); + + c->b1_loc = IA64_REG_LOC (c, UNW_IA64_BR + 1); + c->b2_loc = IA64_REG_LOC (c, UNW_IA64_BR + 2); + c->b3_loc = IA64_REG_LOC (c, UNW_IA64_BR + 3); + c->b4_loc = IA64_REG_LOC (c, UNW_IA64_BR + 4); + c->b5_loc = IA64_REG_LOC (c, UNW_IA64_BR + 5); + + c->f2_loc = IA64_FPREG_LOC (c, UNW_IA64_FR + 2); + c->f3_loc = IA64_FPREG_LOC (c, UNW_IA64_FR + 3); + c->f4_loc = IA64_FPREG_LOC (c, UNW_IA64_FR + 4); + c->f5_loc = IA64_FPREG_LOC (c, UNW_IA64_FR + 5); + for (i = 16; i <= 31; ++i) + c->fr_loc[i - 16] = IA64_FPREG_LOC (c, UNW_IA64_FR + i); + + ret = ia64_get (c, c->pr_loc, &c->pr); + if (ret < 0) + return ret; + + ret = ia64_get (c, c->ip_loc, &c->ip); + if (ret < 0) + return ret; + + ret = ia64_get (c, IA64_REG_LOC (c, UNW_IA64_SP), &c->sp); + if (ret < 0) + return ret; + + c->psp = c->sp; + + ret = ia64_get (c, c->bsp_loc, &c->bsp); + if (ret < 0) + return ret; + + c->rbs_top = c->bsp; + c->pi.flags = 0; + +#ifdef UNW_LOCAL_ONLY + c->eh_args[0] = c->eh_args[1] = c->eh_args[2] = c->eh_args[3] = 0; +#else + for (i = 0; i < 4; ++i) + { + ret = ia64_get (c, IA64_REG_LOC (c, UNW_IA64_GR + 15 + i), + &c->eh_args[i]); + if (ret < 0) + { + if (ret == -UNW_EBADREG) + c->eh_args[i] = 0; + else + return ret; + } + } +#endif + +#ifdef IA64_UNW_SCRIPT_CACHE + c->hint = 0; + c->prev_script = 0; +#endif + return ia64_get_proc_info (c); +} diff --git a/src/ia64/shared.c b/src/ia64/shared.c new file mode 100644 index 00000000..91c944f4 --- /dev/null +++ b/src/ia64/shared.c @@ -0,0 +1,92 @@ +#include "unwind_i.h" + +#ifdef IA64_UNW_DEBUG + +static const char *regname[] = { + "", + "", + "", + "", + "", + "", + "", + "r0", "gp", "r2", "r3", "r4", "r5", "r6", "r7", + "r8", "r9", "r10", "r11", "sp", "tp", "r14", "r15", + "r16", "r17", "r18", "r19", "r20", "r21", "r22", "r23", + "r24", "r25", "r26", "r27", "r28", "r29", "r30", "r31", + "r32", "r33", "r34", "r35", "r36", "r37", "r38", "r39", + "r40", "r41", "r42", "r43", "r44", "r45", "r46", "r47", + "r48", "r49", "r50", "r51", "r52", "r53", "r54", "r55", + "r56", "r57", "r58", "r59", "r60", "r61", "r62", "r63", + "r64", "r65", "r66", "r67", "r68", "r69", "r70", "r71", + "r72", "r73", "r74", "r75", "r76", "r77", "r78", "r79", + "r80", "r81", "r82", "r83", "r84", "r85", "r86", "r87", + "r88", "r89", "r90", "r91", "r92", "r93", "r94", "r95", + "r96", "r97", "r98", "r99", "r100", "r101", "r102", "r103", + "r104", "r105", "r106", "r107", "r108", "r109", "r110", "r111", + "r112", "r113", "r114", "r115", "r116", "r117", "r118", "r119", + "r120", "r121", "r122", "r123", "r124", "r125", "r126", "r127", + "nat0", "nat1", "nat2", "nat3", "nat4", "nat5", "nat6", "nat7", + "nat8", "nat9", "nat10", "nat11", "nat12", "nat13", "nat14", "nat15", + "nat16", "nat17", "nat18", "nat19", "nat20", "nat21", "nat22", "nat23", + "nat24", "nat25", "nat26", "nat27", "nat28", "nat29", "nat30", "nat31", + "nat32", "nat33", "nat34", "nat35", "nat36", "nat37", "nat38", "nat39", + "nat40", "nat41", "nat42", "nat43", "nat44", "nat45", "nat46", "nat47", + "nat48", "nat49", "nat50", "nat51", "nat52", "nat53", "nat54", "nat55", + "nat56", "nat57", "nat58", "nat59", "nat60", "nat61", "nat62", "nat63", + "nat64", "nat65", "nat66", "nat67", "nat68", "nat69", "nat70", "nat71", + "nat72", "nat73", "nat74", "nat75", "nat76", "nat77", "nat78", "nat79", + "nat80", "nat81", "nat82", "nat83", "nat84", "nat85", "nat86", "nat87", + "nat88", "nat89", "nat90", "nat91", "nat92", "nat93", "nat94", "nat95", + "nat96", "nat97", "nat98", "nat99", "nat100", "nat101", "nat102", "nat103", + "nat104","nat105","nat106", "nat107", "nat108", "nat109", "nat110", "nat111", + "nat112","nat113","nat114", "nat115", "nat116", "nat117", "nat118", "nat119", + "nat120","nat121","nat122", "nat123", "nat124", "nat125", "nat126", "nat127", + "f0", "f1", "f2", "f3", "f4", "f5", "f6", "f7", + "f8", "f9", "f10", "f11", "f12", "f13", "f14", "f15", + "f16", "f17", "f18", "f19", "f20", "f21", "f22", "f23", + "f24", "f25", "f26", "f27", "f28", "f29", "f30", "f31", + "f32", "f33", "f34", "f35", "f36", "f37", "f38", "f39", + "f40", "f41", "f42", "f43", "f44", "f45", "f46", "f47", + "f48", "f49", "f50", "f51", "f52", "f53", "f54", "f55", + "f56", "f57", "f58", "f59", "f60", "f61", "f62", "f63", + "f64", "f65", "f66", "f67", "f68", "f69", "f70", "f71", + "f72", "f73", "f74", "f75", "f76", "f77", "f78", "f79", + "f80", "f81", "f82", "f83", "f84", "f85", "f86", "f87", + "f88", "f89", "f90", "f91", "f92", "f93", "f94", "f95", + "f96", "f97", "f98", "f99", "f100", "f101", "f102", "f103", + "f104", "f105", "f106", "f107", "f108", "f109", "f110", "f111", + "f112", "f113", "f114", "f115", "f116", "f117", "f118", "f119", + "f120", "f121", "f122", "f123", "f124", "f125", "f126", "f127", + "ar0", "ar1", "ar2", "ar3", "ar4", "ar5", "ar6", "ar7", + "ar8", "ar9", "ar10", "ar11", "ar12", "ar13", "ar14", "ar15", + "rsc", "bsp", "bspstore", "rnat", "ar20", "ar21", "ar22", "ar23", + "ar24", "ar25", "ar26", "ar27", "ar28", "ar29", "ar30", "ar31", + "ccv", "ar33", "ar34", "ar35", "unat", "ar37", "ar38", "ar39", + "fpsr", "ar41", "ar42", "ar43", "ar44", "ar45", "ar46", "ar47", + "ar48", "ar49", "ar50", "ar51", "ar52", "ar53", "ar54", "ar55", + "ar56", "ar57", "ar58", "ar59", "ar60", "ar61", "ar62", "ar63", + "pfs", "lc", "ec", "ar67", "ar68", "ar69", "ar70", "ar71", + "ar72", "ar73", "ar74", "ar75", "ar76", "ar77", "ar78", "ar79", + "ar80", "ar81", "ar82", "ar83", "ar84", "ar85", "ar86", "ar87", + "ar88", "ar89", "ar90", "ar91", "ar92", "ar93", "ar94", "ar95", + "ar96", "ar97", "ar98", "ar99", "ar100", "ar101", "ar102", "ar103", + "ar104", "ar105", "ar106", "ar107", "ar108", "ar109", "ar110", "ar111", + "ar112", "ar113", "ar114", "ar115", "ar116", "ar117", "ar118", "ar119", + "ar120", "ar121", "ar122", "ar123", "ar124", "ar125", "ar126", "ar127", + "rp", "b1", "b2", "b3", "b4", "b5", "b6", "b7", + "pr", + "cfm", + "current-bsp" +}; + +const char * +_U_ia64_regname (unw_regnum_t reg) +{ + if ((unsigned) (reg + 7) < sizeof (regname) / sizeof (regname[0])) + return regname[reg + 7]; + else + return "???"; +} + +#endif /* IA64_UNW_DEBUG */