Changeset 2280 for trunk/src


Ignore:
Timestamp:
Dec 31, 1999, 11:47:12 AM (26 years ago)
Author:
sandervl
Message:

EB's debug support added

Location:
trunk/src/kernel32
Files:
3 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/kernel32/makefile

    r2253 r2280  
    1 # $Id: makefile,v 1.75 1999-12-29 18:49:50 sandervl Exp $
     1# $Id: makefile,v 1.76 1999-12-31 10:47:11 sandervl Exp $
    22
    33#
     
    4747atom.obj disk.obj directory.obj cvtbitmap.obj hmmmap.obj winfakepeldr.obj \
    4848cvtaccel.obj cvticon.obj cvticongrp.obj oslibexcept.obj cpu.obj process.obj \
    49 cvtcursor.obj cvtcursorgrp.obj stubs.obj interlock.obj toolhelp.obj codepage.obj
     49cvtcursor.obj cvtcursorgrp.obj stubs.obj interlock.obj toolhelp.obj codepage.obj \
     50debug.obj oslibdebug.obj
    5051
    5152
     
    211212    $(PDWIN32_INCLUDE)\wprocess.h \
    212213    $(PDWIN32_INCLUDE)\win\thread.h \
     214    oslibdebug.h \
    213215    console2.h \
    214216    mmap.h \
     
    413415codepage.obj: codepage.cpp oslibdos.h profile.h $(PDWIN32_INCLUDE)\codepage.h
    414416
     417debug.obj:      debug.cpp oslibdebug.h
     418oslibdebug.obj: oslibdebug.cpp oslibdebug.h
     419
    415420clean:
    416421        $(RM) *.OBJ *.LIB *.dll *.lrf *.res *.map *.pch kernelrsrc.asm
  • trunk/src/kernel32/stubs.cpp

    r2229 r2280  
    1 /* $Id: stubs.cpp,v 1.16 1999-12-28 19:16:35 sandervl Exp $ */
     1/* $Id: stubs.cpp,v 1.17 1999-12-31 10:47:11 sandervl Exp $ */
    22
    33/*
     
    607607
    608608
    609 /*****************************************************************************
    610  * Name      : BOOL WIN32API ContinueDebugEvent
    611  * Purpose   : The ContinueDebugEvent function enables a debugger to continue
    612  *             a thread that previously reported a debugging event.
    613  * Parameters: DWORD dwProcessId       process to continue
    614                DWORD dwThreadId        thread to continue
    615                DWORD dwContinueStatus  continuation status
    616  * Variables :
    617  * Result    : If the function succeeds, the return value is nonzero.
    618  *             If the function fails, the return value is zero.
    619  *             To get extended error information, call GetLastError.
    620  * Remark    : Only the thread that created dwProcessId with the CreateProcess
    621  *             function can call ContinueDebugEvent.
    622  *             After the ContinueDebugEvent function succeeds, the specified
    623  *             thread continues. Depending on the debugging event previously
    624  *             reported by the thread, different actions occur. If the continued
    625  *             thread previously reported an EXIT_THREAD_DEBUG_EVENT
    626  *             debugging event, ContinueDebugEvent closes the handle the
    627  *             debugger has to the thread. If the continued thread previously
    628  *             reported an EXIT_PROCESS_DEBUG_EVENT debugging event,
    629  *             ContinueDebugEvent closes the handles the debugger has to the
    630  *             process and to the thread.
    631  * Status    : UNTESTED STUB
    632  *
    633  * Author    : Markus Montkowski [Thu, 1998/05/19 11:46]
    634  *****************************************************************************/
    635 
    636 BOOL WIN32API ContinueDebugEvent( DWORD dwProcessId, DWORD dwThreadId,
    637                                           DWORD dwContinueStatus)
    638 {
    639 
    640   dprintf(("KERNEL32:  ContinueDebugEvent(%08x,%08x,%08x)not implemented\n",
    641            dwProcessId, dwThreadId, dwContinueStatus
    642           ));
    643 
    644   return (FALSE);
    645 }
    646609
    647610/*****************************************************************************
     
    28702833}
    28712834
    2872 
    2873 /*****************************************************************************
    2874  * Name      : BOOL WaitForDebugEvent
    2875  * Purpose   : The WaitForDebugEvent function waits for a debugging event to
    2876  *             occur in a process being debugged.
    2877  * Parameters: LPDEBUG_EVENT lpde      address of structure for event information
    2878  *             DWORD         dwTimeout number of milliseconds to wait for event
    2879  * Variables :
    2880  * Result    : TRUE / FALSE
    2881  * Remark    :
    2882  * Status    : UNTESTED STUB
    2883  *
    2884  * Author    : Patrick Haller [Mon, 1998/06/15 08:00]
    2885  *****************************************************************************/
    2886 
    2887 BOOL WIN32API WaitForDebugEvent(LPDEBUG_EVENT lpde,
    2888                                 DWORD         dwTimeout)
    2889 {
    2890   dprintf(("KERNEL32: WaitForDebugEvent(%08xh,%08xh) not implemented.\n",
    2891            lpde,
    2892            dwTimeout));
    2893 
    2894   return (FALSE);
    2895 }
    2896 
    2897 
    28982835/*****************************************************************************
    28992836 * Name      : BOOL WaitNamedPipeA
  • trunk/src/kernel32/wprocess.cpp

    r2264 r2280  
    1 /* $Id: wprocess.cpp,v 1.62 1999-12-30 11:19:54 sandervl Exp $ */
     1/* $Id: wprocess.cpp,v 1.63 1999-12-31 10:47:12 sandervl Exp $ */
    22
    33/*
     
    3232#include "exceptutil.h"
    3333#include "oslibmisc.h"
     34#include "oslibdebug.h"
    3435
    3536#include "console.h"
     
    707708                            LPPROCESS_INFORMATION lpProcessInfo )
    708709{
     710 THDB *pThreadDB = (THDB*)GetThreadTHDB();
     711 char *cmdline = NULL;
    709712 BOOL  rc;
    710  char *cmdline = NULL;
    711713
    712714    dprintf(("KERNEL32: CreateProcessA %s cline:%s inherit:%d cFlags:%x Env:%x CurDir:%s StartupFlags:%x\n",
     
    722724                         lpEnvironment, lpCurrentDirectory, lpStartupInfo,
    723725                         lpProcessInfo) == TRUE)
    724         return(TRUE);
    725 
     726    {
     727      if (dwCreationFlags & DEBUG_PROCESS && pThreadDB != NULL)
     728      {
     729        if(pThreadDB->pidDebuggee != 0)
     730        {
     731          // TODO: handle this
     732          dprintf(("KERNEL32: CreateProcess ERROR: This thread is already a debugger\n"));
     733        }
     734        else
     735        {
     736          pThreadDB->pidDebuggee = lpProcessInfo->dwProcessId;
     737          OSLibStartDebugger((ULONG*)&pThreadDB->pidDebuggee);
     738        }
     739      }
     740      else pThreadDB->pidDebuggee = 0;
     741
     742      return(TRUE);
     743    }
    726744    //probably a win32 exe, so run it in the pe loader
    727745    if(lpApplicationName) {
     
    751769                         lpEnvironment, lpCurrentDirectory, lpStartupInfo,
    752770                         lpProcessInfo);
     771    if(rc == TRUE) {
     772      if (dwCreationFlags & DEBUG_PROCESS && pThreadDB != NULL)
     773      {
     774        if(pThreadDB->pidDebuggee != 0)
     775        {
     776          // TODO: handle this
     777          dprintf(("KERNEL32: CreateProcess ERROR: This thread is already a debugger\n"));
     778        }
     779        else
     780        {
     781          pThreadDB->pidDebuggee = lpProcessInfo->dwProcessId;
     782          OSLibStartDebugger((ULONG*)&pThreadDB->pidDebuggee);
     783        }
     784      }
     785      else
     786        pThreadDB->pidDebuggee = 0;
     787    }
    753788    if(cmdline)
    754789        free(cmdline);
Note: See TracChangeset for help on using the changeset viewer.