return NULL;
}
-bool
-read_size_extra (struct read_ctx *ctx, uint32_t size32, uint64_t *sizep,
- int *offset_sizep, struct where *wh)
-{
- if (size32 == DWARF3_LENGTH_64_BIT)
- {
- if (!read_ctx_read_8ubyte (ctx, sizep))
- {
- wr_error (wh, ": can't read 64bit CU length.\n");
- return false;
- }
-
- *offset_sizep = 8;
- }
- else if (size32 >= DWARF3_LENGTH_MIN_ESCAPE_CODE)
- {
- wr_error (wh, ": unrecognized CU length escape value: "
- "%" PRIx32 ".\n", size32);
- return false;
- }
- else
- {
- *sizep = size32;
- *offset_sizep = 4;
- }
-
- return true;
-}
-
bool
check_zero_padding (struct read_ctx *ctx,
enum message_category category,
/* Pedantic checking of DWARF files.
- Copyright (C) 2008,2009 Red Hat, Inc.
+ Copyright (C) 2008, 2009, 2010 Red Hat, Inc.
This file is part of Red Hat elfutils.
Red Hat elfutils is free software; you can redistribute it and/or modify
extern bool address_aligned (uint64_t addr, uint64_t align);
extern bool necessary_alignment (uint64_t start, uint64_t length,
uint64_t align);
- extern bool read_size_extra (struct read_ctx *ctx, uint32_t size32,
- uint64_t *sizep, int *offset_sizep,
- struct where *wh);
#define PRI_NOT_ENOUGH ": not enough data for %s.\n"
extern bool supported_version (unsigned version,
size_t num_supported, struct where *where, ...);
/* Pedantic checking of DWARF files.
- Copyright (C) 2009 Red Hat, Inc.
+ Copyright (C) 2009, 2010 Red Hat, Inc.
This file is part of Red Hat elfutils.
Written by Petr Machata <pmachata@redhat.com>, 2009.
#include "readctx.h"
#include "low.h"
+#include "../libdw/dwarf.h"
#include <stdlib.h>
#include <assert.h>
#include <byteswap.h>
+#include <inttypes.h>
/* read_Xubyte_* is basically cut'n'paste from memory-access.h. */
union unaligned
{
return !read_ctx_need_data (ctx, 1);
}
+
+bool
+read_size_extra (struct read_ctx *ctx, uint32_t size32, uint64_t *sizep,
+ int *offset_sizep, struct where *wh)
+{
+ if (size32 == DWARF3_LENGTH_64_BIT)
+ {
+ if (!read_ctx_read_8ubyte (ctx, sizep))
+ {
+ wr_error (wh, ": can't read 64bit CU length.\n");
+ return false;
+ }
+
+ *offset_sizep = 8;
+ }
+ else if (size32 >= DWARF3_LENGTH_MIN_ESCAPE_CODE)
+ {
+ wr_error (wh, ": unrecognized CU length escape value: "
+ "%" PRIx32 ".\n", size32);
+ return false;
+ }
+ else
+ {
+ *sizep = size32;
+ *offset_sizep = 4;
+ }
+
+ return true;
+}
/* Pedantic checking of DWARF files
- Copyright (C) 2009,2010 Red Hat, Inc.
+ Copyright (C) 2009, 2010 Red Hat, Inc.
This file is part of Red Hat elfutils.
Red Hat elfutils is free software; you can redistribute it and/or modify
#include <stdbool.h>
#include "../libelf/libelf.h"
+#include "where.h"
#ifdef __cplusplus
extern "C"
bool read_ctx_read_4ubyte (struct read_ctx *ctx, uint32_t *ret);
bool read_ctx_read_8ubyte (struct read_ctx *ctx, uint64_t *ret);
bool read_ctx_read_offset (struct read_ctx *ctx, bool dwarf64,
- uint64_t *ret);
+ uint64_t *ret);
bool read_ctx_read_var (struct read_ctx *ctx, int width, uint64_t *ret);
const char *read_ctx_read_str (struct read_ctx *ctx);
bool read_ctx_skip (struct read_ctx *ctx, uint64_t len);
bool read_ctx_eof (struct read_ctx *ctx);
+/* The following procedures build on the ones above and do their own
+ error reporting. */
+
+bool read_size_extra (struct read_ctx *ctx, uint32_t size32,
+ uint64_t *sizep, int *offset_sizep, struct where *wh);
+
#ifdef __cplusplus
}
#endif