}
if (sc == NULL) {
- VG_(record_free_error) ( (Addr)ptrV );
+ VG_(record_free_error) ( tst, (Addr)ptrV );
VGP_POPCC;
return;
}
/* check if its a matching free() / delete / delete [] */
if (kind != sc->allockind)
- VG_(record_freemismatch_error) ( (Addr) ptrV );
+ VG_(record_freemismatch_error) ( tst, (Addr) ptrV );
/* Remove the shadow chunk from the mallocd list. */
remove_from_malloclist ( ml_no, sc );
}
if (sc == NULL) {
- VG_(record_free_error) ( (Addr)ptrV );
+ VG_(record_free_error) ( tst, (Addr)ptrV );
/* Perhaps we should keep going regardless. */
VGP_POPCC;
return NULL;
if (sc->allockind != Vg_AllocMalloc) {
/* can not realloc a range that was allocated with new or new [] */
- VG_(record_freemismatch_error) ( (Addr)ptrV );
+ VG_(record_freemismatch_error) ( tst, (Addr)ptrV );
/* but keep going anyway */
}
/*--- Exported fns ---*/
/*------------------------------------------------------------*/
-/* These are all called from generated code, so that the %EIP/%EBP
+/* These two are called from generated code, so that the %EIP/%EBP
values that we need in order to create proper error messages are
picked up out of VG_(baseBlock) rather than from the thread table
(vg_threads in vg_scheduler.c). */
VG_(maybe_add_context) ( &ec );
}
-void VG_(record_free_error) ( Addr a )
+
+/* These five are called not from generated code but in response to
+ requests passed back to the scheduler. So we pick up %EIP/%EBP
+ values from the stored thread state, not from VG_(baseBlock). */
+
+void VG_(record_free_error) ( ThreadState* tst, Addr a )
{
ErrContext ec;
clear_ErrContext( &ec );
ec.count = 1;
ec.next = NULL;
- ec.where = VG_(get_ExeContext)( True, VG_(baseBlock)[VGOFF_(m_eip)],
- VG_(baseBlock)[VGOFF_(m_ebp)] );
+ ec.where = VG_(get_ExeContext)( True, tst->m_eip, tst->m_ebp );
ec.ekind = FreeErr;
ec.addr = a;
- ec.tid = VG_(get_current_tid)();
+ ec.tid = tst->tid;
VG_(describe_addr) ( a, &ec.addrinfo );
VG_(maybe_add_context) ( &ec );
}
-void VG_(record_freemismatch_error) ( Addr a )
+void VG_(record_freemismatch_error) ( ThreadState* tst, Addr a )
{
ErrContext ec;
clear_ErrContext( &ec );
ec.count = 1;
ec.next = NULL;
- ec.where = VG_(get_ExeContext)( True, VG_(baseBlock)[VGOFF_(m_eip)],
- VG_(baseBlock)[VGOFF_(m_ebp)] );
+ ec.where = VG_(get_ExeContext)( True, tst->m_eip, tst->m_ebp );
ec.ekind = FreeMismatchErr;
ec.addr = a;
- ec.tid = VG_(get_current_tid)();
+ ec.tid = tst->tid;
VG_(describe_addr) ( a, &ec.addrinfo );
VG_(maybe_add_context) ( &ec );
}
-
-/* These three are called not from generated code but in response to
- requests passed back to the scheduler. So we pick up %EIP/%EBP
- values from the stored thread state, not from VG_(baseBlock). */
-
void VG_(record_jump_error) ( ThreadState* tst, Addr a )
{
ErrContext ec;
extern void VG_(load_suppressions) ( void );
extern void VG_(show_all_errors) ( void );
extern void VG_(record_value_error) ( Int size );
-extern void VG_(record_free_error) ( Addr a );
-extern void VG_(record_freemismatch_error) ( Addr a );
+extern void VG_(record_free_error) ( ThreadState* tst, Addr a );
+extern void VG_(record_freemismatch_error) ( ThreadState* tst, Addr a );
extern void VG_(record_address_error) ( Addr a, Int size,
Bool isWrite );
}
if (sc == NULL) {
- VG_(record_free_error) ( (Addr)ptrV );
+ VG_(record_free_error) ( tst, (Addr)ptrV );
VGP_POPCC;
return;
}
/* check if its a matching free() / delete / delete [] */
if (kind != sc->allockind)
- VG_(record_freemismatch_error) ( (Addr) ptrV );
+ VG_(record_freemismatch_error) ( tst, (Addr) ptrV );
/* Remove the shadow chunk from the mallocd list. */
remove_from_malloclist ( ml_no, sc );
}
if (sc == NULL) {
- VG_(record_free_error) ( (Addr)ptrV );
+ VG_(record_free_error) ( tst, (Addr)ptrV );
/* Perhaps we should keep going regardless. */
VGP_POPCC;
return NULL;
if (sc->allockind != Vg_AllocMalloc) {
/* can not realloc a range that was allocated with new or new [] */
- VG_(record_freemismatch_error) ( (Addr)ptrV );
+ VG_(record_freemismatch_error) ( tst, (Addr)ptrV );
/* but keep going anyway */
}
/*--- Exported fns ---*/
/*------------------------------------------------------------*/
-/* These are all called from generated code, so that the %EIP/%EBP
+/* These two are called from generated code, so that the %EIP/%EBP
values that we need in order to create proper error messages are
picked up out of VG_(baseBlock) rather than from the thread table
(vg_threads in vg_scheduler.c). */
VG_(maybe_add_context) ( &ec );
}
-void VG_(record_free_error) ( Addr a )
+
+/* These five are called not from generated code but in response to
+ requests passed back to the scheduler. So we pick up %EIP/%EBP
+ values from the stored thread state, not from VG_(baseBlock). */
+
+void VG_(record_free_error) ( ThreadState* tst, Addr a )
{
ErrContext ec;
clear_ErrContext( &ec );
ec.count = 1;
ec.next = NULL;
- ec.where = VG_(get_ExeContext)( True, VG_(baseBlock)[VGOFF_(m_eip)],
- VG_(baseBlock)[VGOFF_(m_ebp)] );
+ ec.where = VG_(get_ExeContext)( True, tst->m_eip, tst->m_ebp );
ec.ekind = FreeErr;
ec.addr = a;
- ec.tid = VG_(get_current_tid)();
+ ec.tid = tst->tid;
VG_(describe_addr) ( a, &ec.addrinfo );
VG_(maybe_add_context) ( &ec );
}
-void VG_(record_freemismatch_error) ( Addr a )
+void VG_(record_freemismatch_error) ( ThreadState* tst, Addr a )
{
ErrContext ec;
clear_ErrContext( &ec );
ec.count = 1;
ec.next = NULL;
- ec.where = VG_(get_ExeContext)( True, VG_(baseBlock)[VGOFF_(m_eip)],
- VG_(baseBlock)[VGOFF_(m_ebp)] );
+ ec.where = VG_(get_ExeContext)( True, tst->m_eip, tst->m_ebp );
ec.ekind = FreeMismatchErr;
ec.addr = a;
- ec.tid = VG_(get_current_tid)();
+ ec.tid = tst->tid;
VG_(describe_addr) ( a, &ec.addrinfo );
VG_(maybe_add_context) ( &ec );
}
-
-/* These three are called not from generated code but in response to
- requests passed back to the scheduler. So we pick up %EIP/%EBP
- values from the stored thread state, not from VG_(baseBlock). */
-
void VG_(record_jump_error) ( ThreadState* tst, Addr a )
{
ErrContext ec;
extern void VG_(load_suppressions) ( void );
extern void VG_(show_all_errors) ( void );
extern void VG_(record_value_error) ( Int size );
-extern void VG_(record_free_error) ( Addr a );
-extern void VG_(record_freemismatch_error) ( Addr a );
+extern void VG_(record_free_error) ( ThreadState* tst, Addr a );
+extern void VG_(record_freemismatch_error) ( ThreadState* tst, Addr a );
extern void VG_(record_address_error) ( Addr a, Int size,
Bool isWrite );