From ae1418f00b0bd242fbf169813be5800609d36892 Mon Sep 17 00:00:00 2001 From: "Frank Ch. Eigler" Date: Wed, 19 Jan 2011 08:20:22 -0500 Subject: [PATCH] PR12411 cont'd: use enum type decl * tapsets.cxx (sdt_uprobe_var_expanding_visitor): Make regwidths an enum type decl, not an anonymous-enum-typed variable. Move DRI macro #define/#undef just around its use. --- tapsets.cxx | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/tapsets.cxx b/tapsets.cxx index fa80de486..b141921ec 100644 --- a/tapsets.cxx +++ b/tapsets.cxx @@ -4648,11 +4648,9 @@ struct sdt_kprobe_var_expanding_visitor: public var_expanding_visitor }; -#define DRI(name,num,width) dwarf_regs[name]=make_pair(num,width) - struct sdt_uprobe_var_expanding_visitor: public var_expanding_visitor { - enum {QI, QIh, HI, SI, DI} regwidths; + enum regwidths {QI, QIh, HI, SI, DI}; sdt_uprobe_var_expanding_visitor(systemtap_session& s, int elf_machine, const string & process_name, @@ -4668,6 +4666,8 @@ struct sdt_uprobe_var_expanding_visitor: public var_expanding_visitor /* Register name mapping table depends on the elf machine of this particular probe target process/file, not upon the host. So we can't just #ifdef _i686_ etc. */ + +#define DRI(name,num,width) dwarf_regs[name]=make_pair(num,width) if (elf_machine == EM_X86_64) { DRI ("%rax", 0, DI); DRI ("%eax", 0, SI); DRI ("%ax", 0, HI); DRI ("%al", 0, QI); DRI ("%ah", 0, QIh); @@ -4798,6 +4798,7 @@ struct sdt_uprobe_var_expanding_visitor: public var_expanding_visitor } else if (arg_count) { /* permit this case; just fall back to dwarf */ } +#undef DRI need_debug_info = false; tokenize(arg_string, arg_tokens, " "); -- 2.43.5