From 4158ae13d6d30b58eebedb84c6534759a84621df Mon Sep 17 00:00:00 2001 From: Petr Machata Date: Fri, 25 Feb 2011 19:14:13 +0100 Subject: [PATCH] Get rid of pri::locexpr_opcode --- dwarflint/check_debug_loc_range.cc | 18 +++++++++--------- dwarflint/pri.cc | 4 ---- dwarflint/pri.hh | 6 ------ 3 files changed, 9 insertions(+), 19 deletions(-) diff --git a/dwarflint/check_debug_loc_range.cc b/dwarflint/check_debug_loc_range.cc index e64b07c91..af89c31df 100644 --- a/dwarflint/check_debug_loc_range.cc +++ b/dwarflint/check_debug_loc_range.cc @@ -35,7 +35,7 @@ #include #include #include -#include "../libdw/dwarf.h" +#include "../libdw/c++/dwarf" #include "elf_file.hh" #include "check_debug_loc_range.hh" @@ -767,7 +767,7 @@ namespace }; std::cout << "XXX don't know how to handle opcode=" - << pri::locexpr_opcode (opcode) << std::endl; + << elfutils::dwarf::ops::name (opcode) << std::endl; return rel_value; } @@ -795,7 +795,7 @@ namespace where, valuep, NULL)) { wr_error (*where) - << "opcode \"" << pri::locexpr_opcode (opcode) + << "opcode \"" << elfutils::dwarf::ops::name (opcode) << "\": can't read " << str << " (form \"" << *form << "\")." << std::endl; return false; @@ -870,7 +870,7 @@ check_location_expression (dwarf_version const *ver, { wr_error (where) << "can't decode opcode \"" - << pri::locexpr_opcode (opcode) << "\"." << std::endl; + << elfutils::dwarf::ops::name (opcode) << "\"." << std::endl; break; } @@ -890,16 +890,16 @@ check_location_expression (dwarf_version const *ver, if (skip == 0) wr_message (where, cat (mc_loc, mc_acc_bloat, mc_impact_3)) - << pri::locexpr_opcode (opcode) + << elfutils::dwarf::ops::name (opcode) << " with skip 0." << std::endl; else if (skip > 0 && !read_ctx_need_data (&ctx, (size_t)skip)) wr_error (where) - << pri::locexpr_opcode (opcode) + << elfutils::dwarf::ops::name (opcode) << " branches out of location expression." << std::endl; /* Compare with the offset after the two-byte skip value. */ else if (skip < 0 && ((uint64_t)-skip) > read_ctx_get_offset (&ctx)) wr_error (where) - << pri::locexpr_opcode (opcode) + << elfutils::dwarf::ops::name (opcode) << " branches before the beginning of location expression." << std::endl; else @@ -915,7 +915,7 @@ check_location_expression (dwarf_version const *ver, case DW_OP_const8s: if (cu->head->address_size == 4) wr_error (where) - << pri::locexpr_opcode (opcode) << " on 32-bit machine." + << elfutils::dwarf::ops::name (opcode) << " on 32-bit machine." << std::endl; break; @@ -927,7 +927,7 @@ check_location_expression (dwarf_version const *ver, || opcode == DW_OP_plus_uconst) && (value1 > (uint64_t)(uint32_t)-1)) wr_message (where, cat (mc_loc, mc_acc_bloat, mc_impact_3)) - << pri::locexpr_opcode (opcode) + << elfutils::dwarf::ops::name (opcode) << " with operand " << pri::hex (value1) << " on a 32-bit machine." << std::endl; } diff --git a/dwarflint/pri.cc b/dwarflint/pri.cc index ef8bd31a8..c246be55b 100644 --- a/dwarflint/pri.cc +++ b/dwarflint/pri.cc @@ -38,10 +38,6 @@ pri::operator << (std::ostream &os, pri::pribase const &obj) return os << obj.m_s; } -pri::locexpr_opcode::locexpr_opcode (int opcode) - : pribase (dwarf_locexpr_opcode_string (opcode)) -{} - std::ostream & pri::operator << (std::ostream &os, pri::ref const &obj) { diff --git a/dwarflint/pri.hh b/dwarflint/pri.hh index fe61af663..67705f40c 100644 --- a/dwarflint/pri.hh +++ b/dwarflint/pri.hh @@ -66,12 +66,6 @@ namespace pri {} }; - struct locexpr_opcode - : public pribase - { - locexpr_opcode (int opcode); - }; - class ref { Dwarf_Off off; -- 2.47.2