]> sourceware.org Git - valgrind.git/commitdiff
core: Pass stack change user requests on to tools
authorBart Van Assche <bvanassche@acm.org>
Mon, 15 Feb 2021 04:08:52 +0000 (20:08 -0800)
committerBart Van Assche <bvanassche@acm.org>
Sat, 20 Feb 2021 16:43:23 +0000 (08:43 -0800)
Since DRD tracks the lowest and highest stack address that has been used,
it needs to know about stack registration events. Hence pass on stack
registration events to tools.

coregrind/m_scheduler/scheduler.c
coregrind/m_tooliface.c
coregrind/pub_core_tooliface.h
include/pub_tool_tooliface.h

index 77f78ebbc7c2600f3e652285d10726d792fe15ae..dc22dca1765aab46acc74dee08c68c56834a9f3e 100644 (file)
@@ -2050,6 +2050,7 @@ void do_client_request ( ThreadId tid )
       case VG_USERREQ__STACK_REGISTER: {
          UWord sid = VG_(register_stack)((Addr)arg[1], (Addr)arg[2]);
          SET_CLREQ_RETVAL( tid, sid );
+         VG_TRACK(register_stack, (Addr)arg[1], (Addr)arg[2]);
          break; }
 
       case VG_USERREQ__STACK_DEREGISTER: {
index efa991debf5e932046b44c562b1867a5f3ed5c1e..cbafe47c5290d84b46aa01f9beea93db00fa980a 100644 (file)
@@ -438,6 +438,8 @@ DEF0(track_die_mem_stack,         Addr, SizeT)
 
 DEF0(track_ban_mem_stack,         Addr, SizeT)
 
+DEF0(track_register_stack,        Addr, Addr)
+
 DEF0(track_pre_mem_read,          CorePart, ThreadId, const HChar*, Addr, SizeT)
 DEF0(track_pre_mem_read_asciiz,   CorePart, ThreadId, const HChar*, Addr)
 DEF0(track_pre_mem_write,         CorePart, ThreadId, const HChar*, Addr, SizeT)
index 4da8cd29e9af36b1b4ca36805ec4bafe738676b8..5f75d499728967fe7c8da1b6c86e6886beca5cf1 100644 (file)
@@ -226,6 +226,8 @@ typedef struct {
 
    void (*track_ban_mem_stack)(Addr, SizeT);
 
+   void (*track_register_stack)(Addr, Addr);
+
    void (*track_pre_mem_read)       (CorePart, ThreadId, const HChar*, Addr, SizeT);
    void (*track_pre_mem_read_asciiz)(CorePart, ThreadId, const HChar*, Addr);
    void (*track_pre_mem_write)      (CorePart, ThreadId, const HChar*, Addr, SizeT);
index c7eef06eb1abbd3592adcbdf238bdf5a1d807752..62c99696129eade009b0be59237e5fbfcc6eadb7 100644 (file)
@@ -609,6 +609,9 @@ void VG_(track_die_mem_stack)                  (void(*f)(Addr a, SizeT len));
 /* Used for redzone at end of thread stacks */
 void VG_(track_ban_mem_stack)      (void(*f)(Addr a, SizeT len));
 
+/* Used to report VG_USERREQ__STACK_REGISTER client requests */
+void VG_(track_register_stack)     (void(*f)(Addr start, Addr end));
+
 /* These ones occur around syscalls, signal handling, etc */
 void VG_(track_pre_mem_read)       (void(*f)(CorePart part, ThreadId tid,
                                              const HChar* s, Addr a, SizeT size));
This page took 0.036405 seconds and 5 git commands to generate.