public inbox for systemtap@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] Fix compilation error related to DW_OP_* using old elfutils
@ 2009-09-18  3:35 Wenji Huang
  2009-09-18  3:57 ` Roland McGrath
  0 siblings, 1 reply; 2+ messages in thread
From: Wenji Huang @ 2009-09-18  3:35 UTC (permalink / raw)
  To: SystemTAP

Hi,

There will be compilation error in latest source repository since
some codes those may be specific to high elfutils were merged.

The proposed patch can fix them and works fine on elfutils 0.141/0.142.
Please take a look at it.

diff --git a/dwflpp.cxx b/dwflpp.cxx
index f3015fc..512460c 100644
--- a/dwflpp.cxx
+++ b/dwflpp.cxx
@@ -1737,7 +1737,7 @@ dwflpp::translate_location(struct obstack *pool,
        if (dwarf_formudata (attr, &offset_loc.number) == 0)
          return c_translate_location (pool, &loc2c_error, this,
                                       &loc2c_emit_address, 1, 0, pc,
-                                     &offset_loc, 1, NULL, NULL, NULL);
+                                     attr, &offset_loc, 1, NULL, NULL, 
NULL);
      }
  #endif

diff --git a/loc2c.c b/loc2c.c
index ce5979b..e6ac58d 100644
--- a/loc2c.c
+++ b/loc2c.c
@@ -152,7 +152,8 @@ lose (struct location *loc,

  static const char *
  translate (struct obstack *pool, int indent, Dwarf_Addr addrbias,
-          Dwarf_Attribute *attr, const Dwarf_Op *expr, const size_t len,
+          Dwarf_Attribute *attr __attribute__ ((unused)), const 
Dwarf_Op *expr,
+          const size_t len,
            struct location *input,
            bool *need_fb, size_t *loser,
            struct location *loc)
@@ -558,6 +559,7 @@ translate (struct obstack *pool, int indent, 
Dwarf_Addr addrbias,
             }
           break;

+#if _ELFUTILS_PREREQ (0, 142)
         case DW_OP_stack_value:
           if (stack_depth > 1)
             DIE ("DW_OP_stack_value left multiple values on stack");
@@ -593,6 +595,7 @@ translate (struct obstack *pool, int indent, 
Dwarf_Addr addrbias,

           DIE ("DW_OP_implicit_value not supported");
           break;
+#endif

         case DW_OP_call_frame_cfa:
           // We pick this out when processing DW_AT_frame_base in

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] Fix compilation error related to DW_OP_* using old elfutils
  2009-09-18  3:35 [PATCH] Fix compilation error related to DW_OP_* using old elfutils Wenji Huang
@ 2009-09-18  3:57 ` Roland McGrath
  0 siblings, 0 replies; 2+ messages in thread
From: Roland McGrath @ 2009-09-18  3:57 UTC (permalink / raw)
  To: wenji.huang; +Cc: SystemTAP

Good catch, thanks Wenji!  Those are two separate problems and I fixed them
with two separate commits, the second one different from yours.  It should
now give a coherent "not supported" diagnosis for DW_OP_implicit_value
rather than "unrecognized operation", and will support DW_OP_stack_value
fully even with older elfutils.


Thanks,
Roland

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2009-09-18  3:57 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-09-18  3:35 [PATCH] Fix compilation error related to DW_OP_* using old elfutils Wenji Huang
2009-09-18  3:57 ` Roland McGrath

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).