Ignore:
Timestamp:
Sep 26, 2001, 5:31:05 PM (24 years ago)
Author:
phaller
Message:

added calldepth tracing

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/kernel32/thread.cpp

    r6133 r6829  
    1 /* $Id: thread.cpp,v 1.31 2001-06-27 19:09:35 sandervl Exp $ */
     1/* $Id: thread.cpp,v 1.32 2001-09-26 15:29:39 phaller Exp $ */
    22
    33/*
     
    5858    return teb->o.odin.hThread;
    5959}
     60
     61// these two debugging functions allow access to a
     62// calldepth counter inside the TEB block of each thread
     63ULONG WIN32API dbg_GetThreadCallDepth()
     64{
     65#ifdef DEBUG
     66  TEB *teb;
     67
     68  teb = GetThreadTEB();
     69  if(teb == NULL)
     70    return 0;
     71  else
     72    return teb->o.odin.dbgCallDepth;
     73#else
     74  return 0;
     75#endif
     76}
     77
     78
     79void WIN32API dbg_IncThreadCallDepth()
     80{
     81#ifdef DEBUG
     82  TEB *teb;
     83
     84  teb = GetThreadTEB();
     85  if(teb != NULL)
     86    teb->o.odin.dbgCallDepth++;
     87#endif
     88}
     89
     90
     91void WIN32API dbg_DecThreadCallDepth()
     92{
     93#ifdef DEBUG
     94  TEB *teb;
     95
     96  teb = GetThreadTEB();
     97  if(teb != NULL)
     98    --(teb->o.odin.dbgCallDepth);
     99#endif
     100}
     101
     102
    60103//******************************************************************************
    61104//******************************************************************************
Note: See TracChangeset for help on using the changeset viewer.