-/* $OpenBSD: dw.c,v 1.5 2021/10/25 19:54:29 kn Exp $ */
+/* $OpenBSD: dw.c,v 1.6 2024/02/21 13:16:14 claudio Exp $ */
/*
* Copyright (c) 2016 Martin Pieuchot
#include <errno.h>
#include <stdint.h>
+#include <stdio.h>
#include <stdlib.h>
#include <string.h>
dw_at2name(uint64_t at)
{
static const char *dw_attrs[] = { DW_AT_NAMES };
+ static char buf[64];
if (at <= nitems(dw_attrs))
return dw_attrs[at - 1];
if (at == DW_AT_hi_user)
return "DW_AT_hi_user";
- return NULL;
+ snprintf(buf, sizeof(buf), "#%llu", at);
+ return buf;
}
const char *
-/* $OpenBSD: dwarf.h,v 1.2 2017/08/11 14:58:56 jasper Exp $ */
+/* $OpenBSD: dwarf.h,v 1.3 2024/02/21 13:16:14 claudio Exp $ */
/*
* Copyright (c) 2016 Martin Pieuchot <mpi@openbsd.org>
#define DW_AT_const_expr 0x6c
#define DW_AT_enum_class 0x6d
#define DW_AT_linkage_name 0x6e
+#define DW_AT_noreturn 0x87
#define DW_AT_lo_user 0x2000
#define DW_AT_hi_user 0x3fff
"DW_AT_const_expr", \
"DW_AT_enum_class", \
"DW_AT_linkage_name", \
+ [0x87 - 1] = "DW_AT_noreturn", \
#define DW_FORM_addr 0x01
#define DW_FORM_block2 0x03