mirror of
https://github.com/tobast/libunwind-eh_elf.git
synced 2024-11-23 07:57:38 +01:00
(UNW_LOCAL_ONLY): Remove this macro.
(tab): Add etnry LOC_SIZE. (main): Fix the "generated by ..." string. }(Logical change 1.85)
This commit is contained in:
parent
da6690ecf2
commit
5b3b6f0565
1 changed files with 0 additions and 107 deletions
|
@ -1,107 +0,0 @@
|
|||
/* libunwind - a platform-independent unwind library
|
||||
Copyright (C) 2003 Hewlett-Packard Co
|
||||
Contributed by David Mosberger-Tang <davidm@hpl.hp.com>
|
||||
|
||||
This file is part of libunwind.
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining
|
||||
a copy of this software and associated documentation files (the
|
||||
"Software"), to deal in the Software without restriction, including
|
||||
without limitation the rights to use, copy, modify, merge, publish,
|
||||
distribute, sublicense, and/or sell copies of the Software, and to
|
||||
permit persons to whom the Software is furnished to do so, subject to
|
||||
the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be
|
||||
included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
||||
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
||||
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
||||
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
|
||||
|
||||
/* Utility to generate cursor_i.h. */
|
||||
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
#define UNW_LOCAL_ONLY
|
||||
|
||||
#include "internal.h"
|
||||
#include "tdep.h"
|
||||
|
||||
#ifdef offsetof
|
||||
# undef offsetof
|
||||
#endif
|
||||
|
||||
#define offsetof(type,field) ((char *) &((type *) 0)->field - (char *) 0)
|
||||
|
||||
struct
|
||||
{
|
||||
const char name[256];
|
||||
unsigned long value;
|
||||
}
|
||||
tab[] =
|
||||
{
|
||||
{ "IP_OFF", offsetof (struct cursor, ip) },
|
||||
{ "PR_OFF", offsetof (struct cursor, pr) },
|
||||
{ "BSP_OFF", offsetof (struct cursor, bsp) },
|
||||
{ "PSP_OFF", offsetof (struct cursor, psp) },
|
||||
{ "PFS_LOC_OFF", offsetof (struct cursor, loc[IA64_REG_PFS]) },
|
||||
{ "RNAT_LOC_OFF", offsetof (struct cursor, loc[IA64_REG_RNAT]) },
|
||||
{ "UNAT_LOC_OFF", offsetof (struct cursor, loc[IA64_REG_UNAT]) },
|
||||
{ "LC_LOC_OFF", offsetof (struct cursor, loc[IA64_REG_LC]) },
|
||||
{ "FPSR_LOC_OFF", offsetof (struct cursor, loc[IA64_REG_FPSR]) },
|
||||
{ "B1_LOC_OFF", offsetof (struct cursor, loc[IA64_REG_B1]) },
|
||||
{ "B2_LOC_OFF", offsetof (struct cursor, loc[IA64_REG_B2]) },
|
||||
{ "B3_LOC_OFF", offsetof (struct cursor, loc[IA64_REG_B3]) },
|
||||
{ "B4_LOC_OFF", offsetof (struct cursor, loc[IA64_REG_B4]) },
|
||||
{ "B5_LOC_OFF", offsetof (struct cursor, loc[IA64_REG_B5]) },
|
||||
{ "F2_LOC_OFF", offsetof (struct cursor, loc[IA64_REG_F2]) },
|
||||
{ "F3_LOC_OFF", offsetof (struct cursor, loc[IA64_REG_F3]) },
|
||||
{ "F4_LOC_OFF", offsetof (struct cursor, loc[IA64_REG_F4]) },
|
||||
{ "F5_LOC_OFF", offsetof (struct cursor, loc[IA64_REG_F5]) },
|
||||
{ "FR_LOC_OFF", offsetof (struct cursor, loc[IA64_REG_F16]) },
|
||||
{ "SIGCONTEXT_ADDR_OFF", offsetof (struct cursor, sigcontext_addr) },
|
||||
};
|
||||
|
||||
static const char *tabs = "\t\t\t\t\t\t\t\t\t\t";
|
||||
|
||||
int
|
||||
main (int argc, char **argv)
|
||||
{
|
||||
const char *space;
|
||||
int i, num_tabs;
|
||||
size_t len;
|
||||
|
||||
printf ("#ifndef cursor_i_h\n");
|
||||
printf ("#define cursor_i_h\n\n");
|
||||
|
||||
printf ("/*\n * DO NOT MODIFY\n *\n * This file was generated by "
|
||||
"print_offsets.\n *\n */\n\n");
|
||||
|
||||
for (i = 0; i < (int) (sizeof (tab) / sizeof (tab[0])); ++i)
|
||||
{
|
||||
if (tab[i].name[0] == '\0')
|
||||
printf ("\n");
|
||||
else
|
||||
{
|
||||
len = strlen (tab[i].name);
|
||||
|
||||
num_tabs = (40 - len) / 8;
|
||||
if (num_tabs <= 0)
|
||||
space = " ";
|
||||
else
|
||||
space = strchr(tabs, '\0') - (40 - len) / 8;
|
||||
|
||||
printf ("#define %s%s%lu\t/* 0x%lx */\n",
|
||||
tab[i].name, space, tab[i].value, tab[i].value);
|
||||
}
|
||||
}
|
||||
|
||||
printf ("\n#endif /* cursor_i_h */\n");
|
||||
return 0;
|
||||
}
|
Loading…
Reference in a new issue