diff --git a/external/bsd/libdwarf/dist/_libdwarf.h b/external/bsd/libdwarf/dist/_libdwarf.h index f40c3ce49864..b574265cc08c 100644 --- a/external/bsd/libdwarf/dist/_libdwarf.h +++ b/external/bsd/libdwarf/dist/_libdwarf.h @@ -1,4 +1,4 @@ -/* $NetBSD: _libdwarf.h,v 1.2 2009/12/23 00:11:30 darran Exp $ */ +/* $NetBSD: _libdwarf.h,v 1.3 2013/01/17 22:06:58 christos Exp $ */ /*- * Copyright (c) 2007 John Birrell (jb@freebsd.org) @@ -25,7 +25,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $FreeBSD: src/lib/libdwarf/_libdwarf.h,v 1.1.4.1 2009/08/03 08:13:06 kensmith Exp $ + * $FreeBSD: src/lib/libdwarf/_libdwarf.h,v 1.3 2012/11/17 01:49:48 svnexp Exp $ */ #ifndef __LIBDWARF_H_ @@ -165,6 +165,37 @@ struct _Dwarf_Debug { dbg_cu; /* List of compilation units. */ Dwarf_CU dbg_cu_current; /* Ptr to the current compilation unit. */ + + STAILQ_HEAD(, _Dwarf_Func) dbg_func; /* List of functions */ }; +struct _Dwarf_Func { + Dwarf_Die func_die; + const char *func_name; + Dwarf_Addr func_low_pc; + Dwarf_Addr func_high_pc; + int func_is_inlined; + /* inlined instance */ + STAILQ_HEAD(, _Dwarf_Inlined_Func) func_inlined_instances; + STAILQ_ENTRY(_Dwarf_Func) func_next; +}; + +struct _Dwarf_Inlined_Func { + struct _Dwarf_Func *ifunc_origin; + Dwarf_Die ifunc_abstract; + Dwarf_Die ifunc_concrete; + Dwarf_Addr ifunc_low_pc; + Dwarf_Addr ifunc_high_pc; + STAILQ_ENTRY(_Dwarf_Inlined_Func) ifunc_next; +}; + +void dwarf_build_function_table(Dwarf_Debug dbg); + +#ifdef DWARF_DEBUG +#include +#define DWARF_ASSERT(x) assert(x) +#else +#define DWARF_ASSERT(x) +#endif + #endif /* !__LIBDWARF_H_ */ diff --git a/external/bsd/libdwarf/dist/dwarf_abbrev.c b/external/bsd/libdwarf/dist/dwarf_abbrev.c index 4ae77f90a855..d788a36d703a 100644 --- a/external/bsd/libdwarf/dist/dwarf_abbrev.c +++ b/external/bsd/libdwarf/dist/dwarf_abbrev.c @@ -1,4 +1,4 @@ -/* $NetBSD: dwarf_abbrev.c,v 1.2 2010/02/22 11:01:29 darran Exp $ */ +/* $NetBSD: dwarf_abbrev.c,v 1.3 2013/01/17 22:06:58 christos Exp $ */ /*- * Copyright (c) 2007 John Birrell (jb@freebsd.org) @@ -25,7 +25,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $FreeBSD: src/lib/libdwarf/dwarf_abbrev.c,v 1.1.4.1 2009/08/03 08:13:06 kensmith Exp $ + * $FreeBSD: src/lib/libdwarf/dwarf_abbrev.c,v 1.2 2012/11/17 01:49:48 svnexp Exp $ */ #if HAVE_NBTOOL_CONFIG_H diff --git a/external/bsd/libdwarf/dist/dwarf_attr.c b/external/bsd/libdwarf/dist/dwarf_attr.c index 384d3b2df14a..907bce233f73 100644 --- a/external/bsd/libdwarf/dist/dwarf_attr.c +++ b/external/bsd/libdwarf/dist/dwarf_attr.c @@ -1,4 +1,4 @@ -/* $NetBSD: dwarf_attr.c,v 1.2 2010/02/22 11:01:29 darran Exp $ */ +/* $NetBSD: dwarf_attr.c,v 1.3 2013/01/17 22:06:58 christos Exp $ */ /*- * Copyright (c) 2007 John Birrell (jb@freebsd.org) @@ -25,7 +25,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $FreeBSD: src/lib/libdwarf/dwarf_attr.c,v 1.1.4.1 2009/08/03 08:13:06 kensmith Exp $ + * $FreeBSD: src/lib/libdwarf/dwarf_attr.c,v 1.2 2012/11/17 01:49:48 svnexp Exp $ */ #if HAVE_NBTOOL_CONFIG_H diff --git a/external/bsd/libdwarf/dist/dwarf_attrval.c b/external/bsd/libdwarf/dist/dwarf_attrval.c index 1164c31c2691..4227ecce2f17 100644 --- a/external/bsd/libdwarf/dist/dwarf_attrval.c +++ b/external/bsd/libdwarf/dist/dwarf_attrval.c @@ -1,4 +1,4 @@ -/* $NetBSD: dwarf_attrval.c,v 1.2 2010/02/22 11:01:29 darran Exp $ */ +/* $NetBSD: dwarf_attrval.c,v 1.3 2013/01/17 22:06:58 christos Exp $ */ /*- * Copyright (c) 2007 John Birrell (jb@freebsd.org) @@ -25,7 +25,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $FreeBSD: src/lib/libdwarf/dwarf_attrval.c,v 1.1.4.1 2009/08/03 08:13:06 kensmith Exp $ + * $FreeBSD: src/lib/libdwarf/dwarf_attrval.c,v 1.3 2012/11/17 01:49:48 svnexp Exp $ */ #if HAVE_NBTOOL_CONFIG_H @@ -107,6 +107,7 @@ dwarf_attrval_flag(Dwarf_Die die, uint64_t attr, Dwarf_Bool *valp, Dwarf_Error * } else { switch (av->av_form) { case DW_FORM_flag: + case DW_FORM_flag_present: *valp = (Dwarf_Bool) av->u[0].u64; break; default: diff --git a/external/bsd/libdwarf/dist/dwarf_cu.c b/external/bsd/libdwarf/dist/dwarf_cu.c index d87096bf0a34..df38dbfc9b60 100644 --- a/external/bsd/libdwarf/dist/dwarf_cu.c +++ b/external/bsd/libdwarf/dist/dwarf_cu.c @@ -1,4 +1,4 @@ -/* $NetBSD: dwarf_cu.c,v 1.2 2010/02/22 11:01:29 darran Exp $ */ +/* $NetBSD: dwarf_cu.c,v 1.3 2013/01/17 22:06:58 christos Exp $ */ /*- * Copyright (c) 2007 John Birrell (jb@freebsd.org) @@ -25,7 +25,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $FreeBSD: src/lib/libdwarf/dwarf_cu.c,v 1.1.4.1 2009/08/03 08:13:06 kensmith Exp $ + * $FreeBSD: src/lib/libdwarf/dwarf_cu.c,v 1.2 2012/11/17 01:49:48 svnexp Exp $ */ #if HAVE_NBTOOL_CONFIG_H diff --git a/external/bsd/libdwarf/dist/dwarf_dealloc.c b/external/bsd/libdwarf/dist/dwarf_dealloc.c index aecc0ffc1778..10fbc515ce7a 100644 --- a/external/bsd/libdwarf/dist/dwarf_dealloc.c +++ b/external/bsd/libdwarf/dist/dwarf_dealloc.c @@ -1,4 +1,4 @@ -/* $NetBSD: dwarf_dealloc.c,v 1.2 2010/02/22 11:01:29 darran Exp $ */ +/* $NetBSD: dwarf_dealloc.c,v 1.3 2013/01/17 22:06:58 christos Exp $ */ /*- * Copyright (c) 2007 John Birrell (jb@freebsd.org) @@ -25,7 +25,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $FreeBSD: src/lib/libdwarf/dwarf_dealloc.c,v 1.1.4.1 2009/08/03 08:13:06 kensmith Exp $ + * $FreeBSD: src/lib/libdwarf/dwarf_dealloc.c,v 1.2 2012/11/17 01:49:48 svnexp Exp $ */ #if HAVE_NBTOOL_CONFIG_H diff --git a/external/bsd/libdwarf/dist/dwarf_die.c b/external/bsd/libdwarf/dist/dwarf_die.c index 89129e84bfc8..c79a55c6a52c 100644 --- a/external/bsd/libdwarf/dist/dwarf_die.c +++ b/external/bsd/libdwarf/dist/dwarf_die.c @@ -1,4 +1,4 @@ -/* $NetBSD: dwarf_die.c,v 1.2 2010/02/22 11:01:29 darran Exp $ */ +/* $NetBSD: dwarf_die.c,v 1.3 2013/01/17 22:06:58 christos Exp $ */ /*- * Copyright (c) 2007 John Birrell (jb@freebsd.org) @@ -25,7 +25,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $FreeBSD: src/lib/libdwarf/dwarf_die.c,v 1.1.4.1 2009/08/03 08:13:06 kensmith Exp $ + * $FreeBSD: src/lib/libdwarf/dwarf_die.c,v 1.2 2012/11/17 01:49:48 svnexp Exp $ */ #if HAVE_NBTOOL_CONFIG_H diff --git a/external/bsd/libdwarf/dist/dwarf_dump.c b/external/bsd/libdwarf/dist/dwarf_dump.c index 155096001369..52d8cf64de6f 100644 --- a/external/bsd/libdwarf/dist/dwarf_dump.c +++ b/external/bsd/libdwarf/dist/dwarf_dump.c @@ -1,4 +1,4 @@ -/* $NetBSD: dwarf_dump.c,v 1.2 2010/02/22 11:01:29 darran Exp $ */ +/* $NetBSD: dwarf_dump.c,v 1.3 2013/01/17 22:06:58 christos Exp $ */ /*- * Copyright (c) 2007 John Birrell (jb@freebsd.org) @@ -25,7 +25,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $FreeBSD: src/lib/libdwarf/dwarf_dump.c,v 1.1.4.1 2009/08/03 08:13:06 kensmith Exp $ + * $FreeBSD: src/lib/libdwarf/dwarf_dump.c,v 1.3 2012/11/17 01:49:48 svnexp Exp $ */ #if HAVE_NBTOOL_CONFIG_H @@ -246,6 +246,8 @@ get_form_desc(uint32_t form) return "DW_FORM_data8"; case DW_FORM_flag: return "DW_FORM_flag"; + case DW_FORM_flag_present: + return "DW_FORM_flag_present"; case DW_FORM_indirect: return "DW_FORM_indirect"; case DW_FORM_ref1: @@ -654,6 +656,7 @@ dwarf_dump_av(Dwarf_Die die, Dwarf_AttrValue av) case DW_FORM_data4: case DW_FORM_data8: case DW_FORM_flag: + case DW_FORM_flag_present: printf("%llu", (unsigned long long) av->u[0].u64); break; case DW_FORM_ref1: diff --git a/external/bsd/libdwarf/dist/dwarf_errmsg.c b/external/bsd/libdwarf/dist/dwarf_errmsg.c index db08c3fce71d..fea0b87b144a 100644 --- a/external/bsd/libdwarf/dist/dwarf_errmsg.c +++ b/external/bsd/libdwarf/dist/dwarf_errmsg.c @@ -1,4 +1,4 @@ -/* $NetBSD: dwarf_errmsg.c,v 1.2 2010/02/22 11:01:29 darran Exp $ */ +/* $NetBSD: dwarf_errmsg.c,v 1.3 2013/01/17 22:06:58 christos Exp $ */ /*- * Copyright (c) 2007 John Birrell (jb@freebsd.org) @@ -25,7 +25,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $FreeBSD: src/lib/libdwarf/dwarf_errmsg.c,v 1.1.4.1 2009/08/03 08:13:06 kensmith Exp $ + * $FreeBSD: src/lib/libdwarf/dwarf_errmsg.c,v 1.3 2012/11/17 01:49:48 svnexp Exp $ */ #if HAVE_NBTOOL_CONFIG_H @@ -35,7 +35,7 @@ #include #include "_libdwarf.h" -const char *_libdwarf_errors[] = { +static const char *_libdwarf_errors[] = { #define DEFINE_ERROR(N,S) [DWARF_E_##N] = S DEFINE_ERROR(NONE, "No Error"), DEFINE_ERROR(ERROR, "An error"), diff --git a/external/bsd/libdwarf/dist/dwarf_errno.c b/external/bsd/libdwarf/dist/dwarf_errno.c index 7358b2b66919..34b2791feeab 100644 --- a/external/bsd/libdwarf/dist/dwarf_errno.c +++ b/external/bsd/libdwarf/dist/dwarf_errno.c @@ -1,4 +1,4 @@ -/* $NetBSD: dwarf_errno.c,v 1.2 2010/02/22 11:01:29 darran Exp $ */ +/* $NetBSD: dwarf_errno.c,v 1.3 2013/01/17 22:06:58 christos Exp $ */ /*- * Copyright (c) 2007 John Birrell (jb@freebsd.org) @@ -25,7 +25,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $FreeBSD: src/lib/libdwarf/dwarf_errno.c,v 1.1.4.1 2009/08/03 08:13:06 kensmith Exp $ + * $FreeBSD: src/lib/libdwarf/dwarf_errno.c,v 1.2 2012/11/17 01:49:48 svnexp Exp $ */ #if HAVE_NBTOOL_CONFIG_H diff --git a/external/bsd/libdwarf/dist/dwarf_finish.c b/external/bsd/libdwarf/dist/dwarf_finish.c index 080181a814c4..1851e54cbb60 100644 --- a/external/bsd/libdwarf/dist/dwarf_finish.c +++ b/external/bsd/libdwarf/dist/dwarf_finish.c @@ -1,4 +1,4 @@ -/* $NetBSD: dwarf_finish.c,v 1.2 2010/02/22 11:01:29 darran Exp $ */ +/* $NetBSD: dwarf_finish.c,v 1.3 2013/01/17 22:06:58 christos Exp $ */ /*- * Copyright (c) 2007 John Birrell (jb@freebsd.org) @@ -25,7 +25,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $FreeBSD: src/lib/libdwarf/dwarf_finish.c,v 1.1.4.1 2009/08/03 08:13:06 kensmith Exp $ + * $FreeBSD: src/lib/libdwarf/dwarf_finish.c,v 1.2 2012/11/17 01:49:48 svnexp Exp $ */ #if HAVE_NBTOOL_CONFIG_H diff --git a/external/bsd/libdwarf/dist/dwarf_form.c b/external/bsd/libdwarf/dist/dwarf_form.c index eec95cd30195..d5cd8310a2c5 100644 --- a/external/bsd/libdwarf/dist/dwarf_form.c +++ b/external/bsd/libdwarf/dist/dwarf_form.c @@ -1,4 +1,4 @@ -/* $NetBSD: dwarf_form.c,v 1.2 2010/02/22 11:01:29 darran Exp $ */ +/* $NetBSD: dwarf_form.c,v 1.3 2013/01/17 22:06:58 christos Exp $ */ /*- * Copyright (c) 2007 John Birrell (jb@freebsd.org) @@ -25,7 +25,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $FreeBSD: src/lib/libdwarf/dwarf_form.c,v 1.1.4.1 2009/08/03 08:13:06 kensmith Exp $ + * $FreeBSD: src/lib/libdwarf/dwarf_form.c,v 1.2 2012/11/17 01:49:48 svnexp Exp $ */ #if HAVE_NBTOOL_CONFIG_H diff --git a/external/bsd/libdwarf/dist/dwarf_init.c b/external/bsd/libdwarf/dist/dwarf_init.c index c9435c843098..7d28778a7073 100644 --- a/external/bsd/libdwarf/dist/dwarf_init.c +++ b/external/bsd/libdwarf/dist/dwarf_init.c @@ -1,4 +1,4 @@ -/* $NetBSD: dwarf_init.c,v 1.3 2010/02/22 11:01:29 darran Exp $ */ +/* $NetBSD: dwarf_init.c,v 1.4 2013/01/17 22:06:58 christos Exp $ */ /*- * Copyright (c) 2007 John Birrell (jb@freebsd.org) @@ -25,7 +25,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $FreeBSD: src/lib/libdwarf/dwarf_init.c,v 1.1.4.1 2009/08/03 08:13:06 kensmith Exp $ + * $FreeBSD: src/lib/libdwarf/dwarf_init.c,v 1.5 2012/11/17 01:49:48 svnexp Exp $ */ #if HAVE_NBTOOL_CONFIG_H @@ -402,6 +402,10 @@ dwarf_init_attr(Dwarf_Debug dbg, Elf_Data **dp, uint64_t *offsetp, avref.u[1].s = elf_strptr(dbg->dbg_elf, dbg->dbg_s[DWARF_debug_str].s_shnum, avref.u[0].u64); break; + case DW_FORM_flag_present: + /* This form has no value encoded in the DIE. */ + avref.u[0].u64 = 1; + break; default: DWARF_SET_ERROR(error, DWARF_E_NOT_IMPLEMENTED); ret = DWARF_E_NOT_IMPLEMENTED; @@ -553,7 +557,7 @@ dwarf_init_info(Dwarf_Debug dbg, Dwarf_Error *error) Dwarf_Attribute at; Dwarf_Die die; uint64_t abnum; - uint64_t die_offset = offset;; + uint64_t die_offset = offset; abnum = dwarf_read_uleb128(&d, &offset); @@ -584,6 +588,9 @@ dwarf_init_info(Dwarf_Debug dbg, Dwarf_Error *error) offset = next_offset; } + /* Build the function table. */ + dwarf_build_function_table(dbg); + return ret; } @@ -692,6 +699,7 @@ dwarf_elf_init(Elf *elf, int mode, Dwarf_Debug *ret_dbg, Dwarf_Error *error) dbg->dbg_mode = mode; STAILQ_INIT(&dbg->dbg_cu); + STAILQ_INIT(&dbg->dbg_func); *ret_dbg = dbg; diff --git a/external/bsd/libdwarf/dist/dwarf_loc.c b/external/bsd/libdwarf/dist/dwarf_loc.c index b0d91501e989..401480186973 100644 --- a/external/bsd/libdwarf/dist/dwarf_loc.c +++ b/external/bsd/libdwarf/dist/dwarf_loc.c @@ -1,4 +1,4 @@ -/* $NetBSD: dwarf_loc.c,v 1.2 2010/02/22 11:01:29 darran Exp $ */ +/* $NetBSD: dwarf_loc.c,v 1.3 2013/01/17 22:06:58 christos Exp $ */ /*- * Copyright (c) 2007 John Birrell (jb@freebsd.org) @@ -25,7 +25,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $FreeBSD: src/lib/libdwarf/dwarf_loc.c,v 1.2.2.1 2009/08/03 08:13:06 kensmith Exp $ + * $FreeBSD: src/lib/libdwarf/dwarf_loc.c,v 1.3 2012/11/17 01:49:48 svnexp Exp $ */ #if HAVE_NBTOOL_CONFIG_H diff --git a/external/bsd/libdwarf/lib/shlib_version b/external/bsd/libdwarf/lib/shlib_version index 1aef29f6992c..828a63ffb0d9 100644 --- a/external/bsd/libdwarf/lib/shlib_version +++ b/external/bsd/libdwarf/lib/shlib_version @@ -1,6 +1,6 @@ -# $NetBSD: shlib_version,v 1.1 2009/12/23 00:10:15 darran Exp $ +# $NetBSD: shlib_version,v 1.2 2013/01/17 22:06:58 christos Exp $ # Remember to update distrib/sets/lists/base/shl.* when changing # major=0 -minor=0 +minor=1