]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Implement VG_(apply_ExeContext)().
authorNicholas Nethercote <nnethercote@mozilla.com>
Fri, 19 Oct 2018 05:27:07 +0000 (16:27 +1100)
committerNicholas Nethercote <nnethercote@mozilla.com>
Fri, 19 Oct 2018 05:30:42 +0000 (16:30 +1100)
It's been declared for a long time, but was lacking a definition.

coregrind/m_execontext.c
include/pub_tool_execontext.h

index c5c8599069903bb2dd890a22489f6477fa0a7ec3..43516e97729930edfbbedadb7eb445506ca913f3 100644 (file)
@@ -225,13 +225,19 @@ void VG_(print_ExeContext_stats) ( Bool with_stacktraces )
    );
 }
 
-
 /* Print an ExeContext. */
 void VG_(pp_ExeContext) ( ExeContext* ec )
 {
    VG_(pp_StackTrace)( VG_(get_ExeContext_epoch)(ec), ec->ips, ec->n_ips );
 }
 
+void VG_(apply_ExeContext)(
+   void(*action)(UInt n, DiEpoch ep, Addr ip, void* opaque),
+   void* opaque, ExeContext* ec)
+{
+   VG_(apply_StackTrace)(action, opaque, VG_(get_ExeContext_epoch)(ec),
+                         ec->ips, ec->n_ips);
+}
 
 void VG_(archive_ExeContext_in_range) (DiEpoch last_epoch,
                                        Addr text_avma, SizeT length )
index 5dbbb67810ec2bc742d305bb5777970041ba25df..369f2c68b24934689ab82e21490ade3bfb008015 100644 (file)
@@ -80,11 +80,9 @@ ExeContext* VG_(record_depth_1_ExeContext)(ThreadId tid, Word first_ip_delta);
 // Apply a function to every element in the ExeContext.  The parameter 'n'
 // gives the index of the passed ip.  Doesn't go below main() unless
 // --show-below-main=yes is set.
-// Currently, the below function is unused. If ever it is used one day,
-// we should add epoch args similarly to function VG_(apply_StackTrace)
-// in pub_tool_stacktrace.h.
-extern void VG_(apply_ExeContext)( void(*action)(UInt n, Addr ip),
-                                   ExeContext* ec, UInt n_ips );
+extern void VG_(apply_ExeContext)(
+   void(*action)(UInt n, DiEpoch ep, Addr ip, void* opaque),
+   void* opaque, ExeContext* ec);
 
 // Compare two ExeContexts.  Number of callers considered depends on `res':
 //   Vg_LowRes:  2