drgn/libdrgn/dwarf_constants.c
Omar Sandoval 4a67d34fcb libdrgn: dwarf_info: expand unknown DWARF expression opcode
Include the opcode name if known, and add the bug report link like we do
for unknown relocation types. This might give us some idea of how to
prioritize #321.

Signed-off-by: Omar Sandoval <osandov@osandov.com>
2023-09-28 11:56:11 -07:00

26 lines
614 B
C

// Copyright (c) Meta Platforms, Inc. and affiliates.
// SPDX-License-Identifier: LGPL-2.1-or-later
// Generated by scripts/gen_dwarf_constants.py.
#include <stdio.h>
#include "dwarf_constants.h"
#define X(name, _) if (value == name) return #name;
const char *dw_op_str(int value, char buf[static DW_OP_STR_BUF_LEN])
{
DW_OP_DEFINITIONS
snprintf(buf, DW_OP_STR_BUF_LEN, DW_OP_STR_UNKNOWN_FORMAT, value);
return buf;
}
const char *dw_tag_str(int value, char buf[static DW_TAG_STR_BUF_LEN])
{
DW_TAG_DEFINITIONS
snprintf(buf, DW_TAG_STR_BUF_LEN, DW_TAG_STR_UNKNOWN_FORMAT, value);
return buf;
}
#undef X