1
0
Fork 0
mirror of https://github.com/tobast/libunwind-eh_elf.git synced 2024-11-17 21:47:37 +01:00

(_ULia64_local_addr_space): Move to global scope so GCC doesn't whine if we

end up not using it.
(UNWIND_TBL_32BIT): New macro.
(struct unwind_header): Rename "unknown1" member to "header_version".
(tdep_find_proc_info) [HAVE_DLMODINFO]: Don't forget to initialize di.gp.
	Check unwind-header version and format.

(Logical change 1.87)
This commit is contained in:
mostang.com!davidm 2003-04-24 20:45:07 +00:00
parent 3e4f08bbf0
commit a88af79c95

View file

@ -16,6 +16,8 @@ This file is part of libunwind. */
#include "unwind_i.h" #include "unwind_i.h"
extern unw_addr_space_t _ULia64_local_addr_space;
struct ia64_table_entry struct ia64_table_entry
{ {
uint64_t start_offset; uint64_t start_offset;
@ -52,8 +54,6 @@ is_local_addr_space (unw_addr_space_t as)
#ifdef UNW_REMOTE_ONLY #ifdef UNW_REMOTE_ONLY
return 0; return 0;
#else #else
extern unw_addr_space_t _ULia64_local_addr_space;
return (as == _Uia64_local_addr_space return (as == _Uia64_local_addr_space
# ifndef UNW_GENERIC_ONLY # ifndef UNW_GENERIC_ONLY
|| as == _ULia64_local_addr_space || as == _ULia64_local_addr_space
@ -405,11 +405,12 @@ tdep_find_proc_info (unw_addr_space_t as, unw_word_t ip,
dip = &kernel_table; dip = &kernel_table;
} }
#elif defined(HAVE_DLMODINFO) #elif defined(HAVE_DLMODINFO)
# define UNWIND_TBL_32BIT 0x8000000000000000
struct load_module_desc lmd; struct load_module_desc lmd;
unw_dyn_info_t di, *dip = &di; unw_dyn_info_t di, *dip = &di;
struct unwind_header struct unwind_header
{ {
uint64_t unknown1; uint64_t header_version;
uint64_t start_offset; uint64_t start_offset;
uint64_t end_offset; uint64_t end_offset;
} }
@ -421,10 +422,26 @@ tdep_find_proc_info (unw_addr_space_t as, unw_word_t ip,
di.format = UNW_INFO_FORMAT_TABLE; di.format = UNW_INFO_FORMAT_TABLE;
di.start_ip = lmd.text_base; di.start_ip = lmd.text_base;
di.end_ip = lmd.text_base + lmd.text_size; di.end_ip = lmd.text_base + lmd.text_size;
di.gp = lmd.linkage_ptr;
di.u.ti.name_ptr = 0; /* no obvious table-name available */ di.u.ti.name_ptr = 0; /* no obvious table-name available */
di.u.ti.segbase = lmd.text_base; di.u.ti.segbase = lmd.text_base;
uhdr = (struct unwind_header *) lmd.unwind_base; uhdr = (struct unwind_header *) lmd.unwind_base;
if ((uhdr->header_version & ~UNWIND_TBL_32BIT) != 1
&& (uhdr->header_version & ~UNWIND_TBL_32BIT) != 2)
{
debug (1, "%s: encountered unknown unwind header version %ld\n",
__FUNCTION__, (long) (uhdr->header_version & ~UNWIND_TBL_32BIT));
return -UNW_EBADVERSION;
}
if (uhdr->header_version & UNWIND_TBL_32BIT)
{
debug (1, "%s: 32-bit unwind tables are not supported yet\n",
__FUNCTION__);
return -UNW_EINVAL;
}
di.u.ti.table_data = (unw_word_t *) (di.u.ti.segbase + uhdr->start_offset); di.u.ti.table_data = (unw_word_t *) (di.u.ti.segbase + uhdr->start_offset);
di.u.ti.table_len = ((uhdr->end_offset - uhdr->start_offset) di.u.ti.table_len = ((uhdr->end_offset - uhdr->start_offset)
/ sizeof (unw_word_t)); / sizeof (unw_word_t));