* i386_parse.y: Add sanity check for NMNES macro value.
* Makefile.am (i386_parse.o): Fix target in dependency rule.
+ (i386_parse.h): New target with empty commands.
+ (i386_lex.o): Depend on it in place of i386_parse.c.
2008-01-21 Ulrich Drepper <drepper@redhat.com>
i386_lex_CFLAGS = -Wno-unused-label -Wno-unused-function -Wno-sign-compare
i386_parse.o: i386_parse.c i386.mnemonics
i386_parse_CFLAGS = -DNMNES=$$(wc -l < i386.mnemonics)
-i386_lex.o: i386_parse.c
+i386_lex.o: i386_parse.h
i386_gendis_LDADD = $(libeu) -lm $(libmudflap)
+i386_parse.h: i386_parse.c ;
+
noinst_HEADERS = memory-access.h i386_parse.h i386_data.h
EXTRA_DIST = defs/i386
mem[cnt].cu_offset = read_8ubyte_unaligned (dbg, readp + 2);
/* Determine the size of the CU header. */
- if (dbg->sectiondata[IDX_debug_info] == NULL
- || dbg->sectiondata[IDX_debug_info]->d_buf == NULL
- || mem[cnt].cu_offset + 3 >= dbg->sectiondata[IDX_debug_info]->d_size)
- {
- __libdw_seterrno (DWARF_E_INVALID_DWARF);
- goto err_return;
- }
+ assert (dbg->sectiondata[IDX_debug_info] != NULL);
+ assert (dbg->sectiondata[IDX_debug_info]->d_buf != NULL);
+ assert (mem[cnt].cu_offset + 3
+ < dbg->sectiondata[IDX_debug_info]->d_size);
unsigned char *infop
= ((unsigned char *) dbg->sectiondata[IDX_debug_info]->d_buf
+ mem[cnt].cu_offset);
#include <dwarf.h>
#include <string.h>
+
int
dwarf_siblingof (die, result)
Dwarf_Die *die;
/* This abbreviation has children. */
++level;
+
while (1)
{
/* Make sure we are still in range. Some producers might skip
if (unlikely (dwarf_formaddr (attrp, &addr) != 0))
{
attrval_out:
- error (0, 0, gettext ("offset: %" PRIx64 " cannot get attribute value: %s"),
- attrp->valp - (unsigned char *) attrp->cu->dbg->sectiondata[IDX_debug_info]->d_buf,
+ error (0, 0, gettext ("cannot get attribute value: %s"),
dwarf_errmsg (-1));
return DWARF_CB_ABORT;
}
int tag = dwarf_tag (&dies[level]);
if (unlikely (tag == DW_TAG_invalid))
{
- error (0, 0, gettext ("cannot get tag of DIE at offset %" PRIx64
+ error (0, 0, gettext ("cannot get tag of DIE at offset %" PRIu64
" in section '%s': %s"),
(uint64_t) offset, ".debug_info", dwarf_errmsg (-1));
goto do_return;
if (res > 0)
{
while ((res = dwarf_siblingof (&dies[level], &dies[level])) == 1)
- {
- if (level-- == 0)
- break;
- }
+ if (level-- == 0)
+ break;
if (unlikely (res == -1))
{