Changeset 6829 for trunk/src


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

added calldepth tracing

Location:
trunk/src/kernel32
Files:
2 edited

Legend:

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

    r6555 r6829  
    1 /* $Id: misc.cpp,v 1.41 2001-08-17 11:18:37 sandervl Exp $ */
     1/* $Id: misc.cpp,v 1.42 2001-09-26 15:31:05 phaller Exp $ */
    22
    33/*
     
    336336  {
    337337    va_start(argptr, tekst);
    338     if(teb) {
    339         teb->o.odin.logfile = (DWORD)flog;
     338    if(teb)
     339    {
     340      ULONG ulCallDepth;
     341#ifdef DEBUG
     342      ulCallDepth = teb->o.odin.dbgCallDepth;
     343#else
     344      ulCallDepth = 0;
     345#endif
     346     
     347      teb->o.odin.logfile = (DWORD)flog;
     348     
    340349#ifdef LOG_TIME
    341         if(sel == 0x150b && !fIsOS2Image) {
    342              fprintf(flog, "t%d: (%x) (FS=150B) ", teb->o.odin.threadId, GetTickCount());
    343         }
    344         else fprintf(flog, "t%d: (%x) ", teb->o.odin.threadId, GetTickCount());
    345 #else
    346         if(sel == 0x150b && !fIsOS2Image) {
    347              fprintf(flog, "t%d: (FS=150B) ", teb->o.odin.threadId);
    348         }
    349         else fprintf(flog, "t%d: ", teb->o.odin.threadId);
     350      if(sel == 0x150b && !fIsOS2Image)
     351        fprintf(flog,
     352                "t%02d (%3d): (%x) (FS=150B) ",
     353                teb->o.odin.threadId,
     354                ulCallDepth,
     355                GetTickCount());
     356      else
     357        fprintf(flog,
     358                "t%02d (%3d): (%x) ",
     359                teb->o.odin.threadId,
     360                ulCallDepth,
     361                GetTickCount());
     362#else
     363      if(sel == 0x150b && !fIsOS2Image)
     364        fprintf(flog,
     365                "t%02d (%3d): (FS=150B) ",
     366                teb->o.odin.threadId,
     367                ulCallDepth);
     368      else
     369        fprintf(flog,
     370                "t%02d (%3d): ",
     371                teb->o.odin.threadId,
     372                ulCallDepth);
    350373#endif
    351374    }
  • 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.