This is the mail archive of the
frysk@sources.redhat.com
mailing list for the frysk project.
patches to frysk-imports/lib/dw
- From: Adam Jocksch <ajocksch at redhat dot com>
- To: frysk <frysk at sources dot redhat dot com>
- Date: Sun, 17 Sep 2006 13:16:15 -0600
- Subject: patches to frysk-imports/lib/dw
I've wrapped the necessary functionality needed to find inlined function
calls in the libdw wrapper (see attached patch). I'm not 100% certain
where this code should be called from though. Ideally while libunwind is
unwinding (i.e. in one of the callbacks so we open as few Dwfl objects
as possible), but for a first implementation maybe it would be worth
doing it after libunwind has created the stack trace.
Adam
? Dwarf_DIE_is_inlined.patch
Index: frysk-imports/lib/dw/DwarfDie.java
===================================================================
RCS file: /cvs/frysk/frysk-imports/lib/dw/DwarfDie.java,v
retrieving revision 1.5
diff -u -r1.5 DwarfDie.java
--- frysk-imports/lib/dw/DwarfDie.java 12 Sep 2006 16:32:01 -0000 1.5
+++ frysk-imports/lib/dw/DwarfDie.java 17 Sep 2006 17:49:04 -0000
@@ -159,6 +159,14 @@
return get_framebase(this.getPointer(), scope, pc);
}
+ /**
+ *
+ * @return True if this is an inlined instance of a function, false otherwise
+ */
+ public boolean isInlinedFunction ()
+ {
+ return is_inline_func();
+ }
// protected native long dwarf_diecu();
private native long get_lowpc ();
@@ -182,4 +190,6 @@
private native long fbreg_variable (long addr);
private native long get_framebase (long addr, long scope, long pc);
+
+ private native boolean is_inline_func ();
}
Index: frysk-imports/lib/dw/cni/DwarfDie.cxx
===================================================================
RCS file: /cvs/frysk/frysk-imports/lib/dw/cni/DwarfDie.cxx,v
retrieving revision 1.4
diff -u -r1.4 DwarfDie.cxx
--- frysk-imports/lib/dw/cni/DwarfDie.cxx 12 Sep 2006 16:32:01 -0000 1.4
+++ frysk-imports/lib/dw/cni/DwarfDie.cxx 17 Sep 2006 17:49:04 -0000
@@ -224,3 +224,11 @@
return 0;
}
+/*
+ * Returns true if this die has the DW_TAG_inlined_subroutine tag
+ */
+jboolean
+lib::dw::DwarfDie::is_inline_func ()
+{
+ return dwarf_tag(DWARF_DIE_POINTER) == DW_TAG_inlined_subroutine;
+}