2005-05-24 11:46:25 +00:00
|
|
|
/*
|
|
|
|
* Wine debugger - back-end for an active target
|
|
|
|
*
|
2006-02-24 21:12:59 +00:00
|
|
|
* Copyright 2000-2006 Eric Pouech
|
2005-05-24 11:46:25 +00:00
|
|
|
*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 2.1 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Lesser General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
|
|
|
* License along with this library; if not, write to the Free Software
|
2006-05-18 12:49:52 +00:00
|
|
|
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
2005-05-24 11:46:25 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
#include <stdlib.h>
|
|
|
|
#include <stdio.h>
|
|
|
|
#include <string.h>
|
|
|
|
#include <stdarg.h>
|
|
|
|
|
|
|
|
#include "debugger.h"
|
2006-08-13 18:46:45 +00:00
|
|
|
#include "psapi.h"
|
2008-12-21 21:28:32 +00:00
|
|
|
#include "resource.h"
|
2005-05-24 11:46:25 +00:00
|
|
|
#include "winternl.h"
|
|
|
|
#include "wine/debug.h"
|
|
|
|
|
|
|
|
WINE_DEFAULT_DEBUG_CHANNEL(winedbg);
|
|
|
|
|
2021-12-01 14:30:29 +00:00
|
|
|
static char* dbg_executable;
|
2006-02-24 21:14:05 +00:00
|
|
|
static char* dbg_last_cmd_line;
|
2006-03-01 20:05:31 +00:00
|
|
|
static struct be_process_io be_process_active_io;
|
2006-02-24 21:12:59 +00:00
|
|
|
|
|
|
|
static void dbg_init_current_process(void)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
static void dbg_init_current_thread(void* start)
|
|
|
|
{
|
|
|
|
if (start)
|
|
|
|
{
|
2010-04-12 19:18:37 +00:00
|
|
|
if (list_count(&dbg_curr_process->threads) == 1 /* first thread ? */ &&
|
2008-12-21 21:28:32 +00:00
|
|
|
DBG_IVAR(BreakAllThreadsStartup))
|
2006-02-24 21:12:59 +00:00
|
|
|
{
|
2006-07-26 09:57:27 +00:00
|
|
|
ADDRESS64 addr;
|
2006-02-24 21:12:59 +00:00
|
|
|
|
|
|
|
break_set_xpoints(FALSE);
|
|
|
|
addr.Mode = AddrModeFlat;
|
2009-01-08 16:34:26 +00:00
|
|
|
addr.Offset = (DWORD_PTR)start;
|
2006-02-24 21:12:59 +00:00
|
|
|
break_add_break(&addr, TRUE, TRUE);
|
|
|
|
break_set_xpoints(TRUE);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static unsigned dbg_handle_debug_event(DEBUG_EVENT* de);
|
|
|
|
|
|
|
|
/******************************************************************
|
|
|
|
* dbg_attach_debuggee
|
|
|
|
*
|
|
|
|
* Sets the debuggee to <pid>
|
|
|
|
* cofe instructs winedbg what to do when first exception is received
|
|
|
|
* (break=FALSE, continue=TRUE)
|
|
|
|
* wfe is set to TRUE if dbg_attach_debuggee should also proceed with all debug events
|
|
|
|
* until the first exception is received (aka: attach to an already running process)
|
|
|
|
*/
|
2019-07-02 16:01:13 +00:00
|
|
|
BOOL dbg_attach_debuggee(DWORD pid)
|
2006-02-24 21:12:59 +00:00
|
|
|
{
|
2022-06-29 11:11:40 +00:00
|
|
|
if (pid == GetCurrentProcessId())
|
|
|
|
{
|
|
|
|
dbg_printf("WineDbg can't debug its own process. Please use another process ID.\n");
|
|
|
|
return FALSE;
|
|
|
|
}
|
2006-03-01 20:05:31 +00:00
|
|
|
if (!(dbg_curr_process = dbg_add_process(&be_process_active_io, pid, 0))) return FALSE;
|
2006-02-24 21:12:59 +00:00
|
|
|
|
2022-06-29 11:11:40 +00:00
|
|
|
if (!DebugActiveProcess(pid))
|
2006-02-24 21:12:59 +00:00
|
|
|
{
|
2022-02-07 07:40:49 +00:00
|
|
|
dbg_printf("Can't attach process %04lx: error %lu\n", pid, GetLastError());
|
2006-02-24 21:12:59 +00:00
|
|
|
dbg_del_process(dbg_curr_process);
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
2006-03-18 09:32:33 +00:00
|
|
|
SetEnvironmentVariableA("DBGHELP_NOLIVE", NULL);
|
|
|
|
|
2006-09-25 20:45:24 +00:00
|
|
|
dbg_curr_process->active_debuggee = TRUE;
|
2006-02-24 21:12:59 +00:00
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
static unsigned dbg_fetch_context(void)
|
|
|
|
{
|
2018-06-13 00:01:50 +00:00
|
|
|
if (!dbg_curr_process->be_cpu->get_context(dbg_curr_thread->handle, &dbg_context))
|
2006-02-24 21:12:59 +00:00
|
|
|
{
|
|
|
|
WINE_WARN("Can't get thread's context\n");
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
2019-11-16 11:39:30 +00:00
|
|
|
BOOL dbg_set_curr_thread(DWORD tid)
|
|
|
|
{
|
|
|
|
struct dbg_thread* thread;
|
|
|
|
|
|
|
|
if (!dbg_curr_process)
|
|
|
|
{
|
|
|
|
dbg_printf("No process loaded\n");
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
thread = dbg_get_thread(dbg_curr_process, tid);
|
|
|
|
if (thread)
|
|
|
|
{
|
|
|
|
dbg_curr_thread = thread;
|
|
|
|
dbg_fetch_context();
|
|
|
|
stack_fetch_frames(&dbg_context);
|
|
|
|
dbg_curr_tid = tid;
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
dbg_printf("No such thread\n");
|
|
|
|
return thread != NULL;
|
|
|
|
}
|
|
|
|
|
2007-05-22 16:28:55 +00:00
|
|
|
/***********************************************************************
|
|
|
|
* dbg_exception_prolog
|
|
|
|
*
|
|
|
|
* Examine exception and decide if interactive mode is entered(return TRUE)
|
|
|
|
* or exception is silently continued(return FALSE)
|
|
|
|
* is_debug means the exception is a breakpoint or single step exception
|
|
|
|
*/
|
2013-11-09 10:03:40 +00:00
|
|
|
static BOOL dbg_exception_prolog(BOOL is_debug, const EXCEPTION_RECORD* rec)
|
2006-02-24 21:12:59 +00:00
|
|
|
{
|
2006-07-26 09:57:27 +00:00
|
|
|
ADDRESS64 addr;
|
2006-02-24 21:12:59 +00:00
|
|
|
BOOL is_break;
|
|
|
|
|
|
|
|
memory_get_current_pc(&addr);
|
|
|
|
break_suspend_execution();
|
|
|
|
|
|
|
|
/* this will resynchronize builtin dbghelp's internal ELF module list */
|
|
|
|
SymLoadModule(dbg_curr_process->handle, 0, 0, 0, 0, 0);
|
|
|
|
|
2010-11-21 21:19:40 +00:00
|
|
|
if (is_debug) break_adjust_pc(&addr, rec->ExceptionCode, dbg_curr_thread->first_chance, &is_break);
|
2006-02-24 21:12:59 +00:00
|
|
|
/*
|
|
|
|
* Do a quiet backtrace so that we have an idea of what the situation
|
|
|
|
* is WRT the source files.
|
|
|
|
*/
|
2010-03-30 19:37:01 +00:00
|
|
|
stack_fetch_frames(&dbg_context);
|
2006-12-02 16:43:27 +00:00
|
|
|
|
|
|
|
if (is_debug && !is_break && break_should_continue(&addr, rec->ExceptionCode))
|
2006-02-24 21:12:59 +00:00
|
|
|
return FALSE;
|
|
|
|
|
|
|
|
if (addr.Mode != dbg_curr_thread->addr_mode)
|
|
|
|
{
|
2022-11-13 13:23:01 +00:00
|
|
|
const char* name;
|
2010-04-19 20:33:19 +00:00
|
|
|
|
2006-02-24 21:12:59 +00:00
|
|
|
switch (addr.Mode)
|
|
|
|
{
|
|
|
|
case AddrMode1616: name = "16 bit"; break;
|
2010-04-19 20:33:19 +00:00
|
|
|
case AddrMode1632: name = "segmented 32 bit"; break;
|
2006-02-24 21:12:59 +00:00
|
|
|
case AddrModeReal: name = "vm86"; break;
|
2018-06-12 22:53:16 +00:00
|
|
|
case AddrModeFlat: name = dbg_curr_process->be_cpu->pointer_size == 4
|
|
|
|
? "32 bit" : "64 bit"; break;
|
2022-11-13 13:23:01 +00:00
|
|
|
default: return FALSE;
|
2006-02-24 21:12:59 +00:00
|
|
|
}
|
|
|
|
dbg_printf("In %s mode.\n", name);
|
|
|
|
dbg_curr_thread->addr_mode = addr.Mode;
|
|
|
|
}
|
|
|
|
display_print();
|
|
|
|
|
|
|
|
if (!is_debug)
|
|
|
|
{
|
|
|
|
/* This is a real crash, dump some info */
|
2018-06-12 22:53:16 +00:00
|
|
|
dbg_curr_process->be_cpu->print_context(dbg_curr_thread->handle, &dbg_context, 0);
|
2010-05-24 22:48:36 +00:00
|
|
|
stack_info(-1);
|
2018-06-12 22:53:16 +00:00
|
|
|
dbg_curr_process->be_cpu->print_segment_info(dbg_curr_thread->handle, &dbg_context);
|
2006-02-24 21:12:59 +00:00
|
|
|
stack_backtrace(dbg_curr_tid);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
static char* last_name;
|
|
|
|
static char* last_file;
|
|
|
|
|
|
|
|
char buffer[sizeof(SYMBOL_INFO) + 256];
|
|
|
|
SYMBOL_INFO* si = (SYMBOL_INFO*)buffer;
|
|
|
|
void* lin = memory_to_linear_addr(&addr);
|
|
|
|
DWORD64 disp64;
|
2009-12-12 11:19:44 +00:00
|
|
|
IMAGEHLP_LINE64 il;
|
2006-02-24 21:12:59 +00:00
|
|
|
DWORD disp;
|
|
|
|
|
|
|
|
si->SizeOfStruct = sizeof(*si);
|
|
|
|
si->MaxNameLen = 256;
|
|
|
|
il.SizeOfStruct = sizeof(il);
|
|
|
|
if (SymFromAddr(dbg_curr_process->handle, (DWORD_PTR)lin, &disp64, si) &&
|
2009-12-12 11:19:44 +00:00
|
|
|
SymGetLineFromAddr64(dbg_curr_process->handle, (DWORD_PTR)lin, &disp, &il))
|
2006-02-24 21:12:59 +00:00
|
|
|
{
|
|
|
|
if ((!last_name || strcmp(last_name, si->Name)) ||
|
|
|
|
(!last_file || strcmp(last_file, il.FileName)))
|
|
|
|
{
|
2022-07-20 12:28:42 +00:00
|
|
|
free(last_name);
|
|
|
|
free(last_file);
|
|
|
|
last_name = strdup(si->Name);
|
|
|
|
last_file = strdup(il.FileName);
|
2022-02-07 07:40:49 +00:00
|
|
|
dbg_printf("%s () at %s:%lu\n", last_name, last_file, il.LineNumber);
|
2006-02-24 21:12:59 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (!is_debug || is_break ||
|
|
|
|
dbg_curr_thread->exec_mode == dbg_exec_step_over_insn ||
|
|
|
|
dbg_curr_thread->exec_mode == dbg_exec_step_into_insn)
|
|
|
|
{
|
2006-07-26 09:57:27 +00:00
|
|
|
ADDRESS64 tmp = addr;
|
2006-02-24 21:12:59 +00:00
|
|
|
/* Show where we crashed */
|
|
|
|
memory_disasm_one_insn(&tmp);
|
|
|
|
}
|
|
|
|
source_list_from_addr(&addr, 0);
|
|
|
|
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void dbg_exception_epilog(void)
|
|
|
|
{
|
|
|
|
break_restart_execution(dbg_curr_thread->exec_count);
|
|
|
|
/*
|
|
|
|
* This will have gotten absorbed into the breakpoint info
|
|
|
|
* if it was used. Otherwise it would have been ignored.
|
|
|
|
* In any case, we don't mess with it any more.
|
|
|
|
*/
|
|
|
|
if (dbg_curr_thread->exec_mode == dbg_exec_cont)
|
|
|
|
dbg_curr_thread->exec_count = 0;
|
|
|
|
dbg_curr_thread->in_exception = FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
static DWORD dbg_handle_exception(const EXCEPTION_RECORD* rec, BOOL first_chance)
|
|
|
|
{
|
|
|
|
BOOL is_debug = FALSE;
|
2010-03-28 15:24:36 +00:00
|
|
|
const THREADNAME_INFO* pThreadName;
|
2006-02-24 21:12:59 +00:00
|
|
|
struct dbg_thread* pThread;
|
|
|
|
|
|
|
|
assert(dbg_curr_thread);
|
|
|
|
|
2022-02-07 07:40:49 +00:00
|
|
|
WINE_TRACE("exception=%lx first_chance=%c\n",
|
2006-02-24 21:12:59 +00:00
|
|
|
rec->ExceptionCode, first_chance ? 'Y' : 'N');
|
|
|
|
|
|
|
|
switch (rec->ExceptionCode)
|
|
|
|
{
|
|
|
|
case EXCEPTION_BREAKPOINT:
|
|
|
|
case EXCEPTION_SINGLE_STEP:
|
|
|
|
is_debug = TRUE;
|
|
|
|
break;
|
2021-02-05 09:21:28 +00:00
|
|
|
case EXCEPTION_WINE_NAME_THREAD:
|
2010-03-28 15:24:36 +00:00
|
|
|
pThreadName = (const THREADNAME_INFO*)(rec->ExceptionInformation);
|
2022-02-24 18:34:02 +00:00
|
|
|
|
|
|
|
if (pThreadName->dwType != 0x1000)
|
|
|
|
return DBG_EXCEPTION_NOT_HANDLED;
|
2006-02-24 21:12:59 +00:00
|
|
|
if (pThreadName->dwThreadID == -1)
|
|
|
|
pThread = dbg_curr_thread;
|
|
|
|
else
|
|
|
|
pThread = dbg_get_thread(dbg_curr_process, pThreadName->dwThreadID);
|
2006-09-28 17:50:03 +00:00
|
|
|
if(!pThread)
|
|
|
|
{
|
2022-02-07 07:40:49 +00:00
|
|
|
dbg_printf("Thread ID=%04lx not in our list of threads -> can't rename\n", pThreadName->dwThreadID);
|
2006-09-28 17:50:03 +00:00
|
|
|
return DBG_CONTINUE;
|
|
|
|
}
|
2022-02-24 18:34:03 +00:00
|
|
|
if (dbg_read_memory(pThreadName->szName, pThread->name, sizeof(pThread->name)))
|
|
|
|
{
|
|
|
|
pThread->name[sizeof(pThread->name) - 1] = '\0';
|
|
|
|
dbg_printf("Thread ID=%04lx renamed using MSVC extension (name==\"%s\")\n",
|
2006-02-24 21:12:59 +00:00
|
|
|
pThread->tid, pThread->name);
|
2022-02-24 18:34:03 +00:00
|
|
|
}
|
2006-02-24 21:12:59 +00:00
|
|
|
return DBG_CONTINUE;
|
2018-07-30 19:47:56 +00:00
|
|
|
case EXCEPTION_INVALID_HANDLE:
|
|
|
|
return DBG_CONTINUE;
|
2006-02-24 21:12:59 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
if (first_chance && !is_debug && !DBG_IVAR(BreakOnFirstChance) &&
|
|
|
|
!(rec->ExceptionFlags & EH_STACK_INVALID))
|
|
|
|
{
|
|
|
|
/* pass exception to program except for debug exceptions */
|
|
|
|
return DBG_EXCEPTION_NOT_HANDLED;
|
|
|
|
}
|
|
|
|
|
2010-11-21 21:19:40 +00:00
|
|
|
dbg_curr_thread->excpt_record = *rec;
|
|
|
|
dbg_curr_thread->in_exception = TRUE;
|
|
|
|
dbg_curr_thread->first_chance = first_chance;
|
2006-02-24 21:12:59 +00:00
|
|
|
|
2010-11-21 21:19:40 +00:00
|
|
|
if (!is_debug) info_win32_exception();
|
2006-02-24 21:12:59 +00:00
|
|
|
|
2010-11-21 21:19:40 +00:00
|
|
|
if (rec->ExceptionCode == STATUS_POSSIBLE_DEADLOCK && !DBG_IVAR(BreakOnCritSectTimeOut))
|
|
|
|
{
|
|
|
|
dbg_curr_thread->in_exception = FALSE;
|
|
|
|
return DBG_EXCEPTION_NOT_HANDLED;
|
2006-02-24 21:12:59 +00:00
|
|
|
}
|
|
|
|
|
2010-11-21 21:19:40 +00:00
|
|
|
if (dbg_exception_prolog(is_debug, rec))
|
2006-02-24 21:12:59 +00:00
|
|
|
{
|
|
|
|
dbg_interactiveP = TRUE;
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
dbg_exception_epilog();
|
|
|
|
|
|
|
|
return DBG_CONTINUE;
|
|
|
|
}
|
|
|
|
|
2006-02-27 20:50:43 +00:00
|
|
|
static BOOL tgt_process_active_close_process(struct dbg_process* pcs, BOOL kill);
|
|
|
|
|
2021-04-13 10:29:38 +00:00
|
|
|
void fetch_module_name(void* name_addr, void* mod_addr, WCHAR* buffer, size_t bufsz)
|
2006-08-13 18:46:45 +00:00
|
|
|
{
|
2021-04-13 10:29:38 +00:00
|
|
|
memory_get_string_indirect(dbg_curr_process, name_addr, TRUE, buffer, bufsz);
|
|
|
|
if (!buffer[0] && !GetModuleFileNameExW(dbg_curr_process->handle, mod_addr, buffer, bufsz))
|
2006-08-13 18:46:45 +00:00
|
|
|
{
|
2021-04-13 10:29:38 +00:00
|
|
|
if (GetMappedFileNameW( dbg_curr_process->handle, mod_addr, buffer, bufsz ))
|
|
|
|
{
|
|
|
|
/* FIXME: proper NT->Dos conversion */
|
|
|
|
static const WCHAR nt_prefixW[] = {'\\','?','?','\\'};
|
|
|
|
|
2021-10-04 13:19:20 +00:00
|
|
|
if (!wcsncmp( buffer, nt_prefixW, 4 ))
|
2021-04-13 10:29:38 +00:00
|
|
|
memmove( buffer, buffer + 4, (lstrlenW(buffer + 4) + 1) * sizeof(WCHAR) );
|
|
|
|
}
|
|
|
|
else
|
2021-11-26 16:30:09 +00:00
|
|
|
swprintf(buffer, bufsz, L"DLL_%08lx", (ULONG_PTR)mod_addr);
|
2006-08-13 18:46:45 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2006-02-24 21:12:59 +00:00
|
|
|
static unsigned dbg_handle_debug_event(DEBUG_EVENT* de)
|
|
|
|
{
|
2008-10-18 07:15:10 +00:00
|
|
|
union {
|
|
|
|
char bufferA[256];
|
|
|
|
WCHAR buffer[256];
|
|
|
|
} u;
|
2021-04-13 10:14:15 +00:00
|
|
|
DWORD size, cont = DBG_CONTINUE;
|
2006-02-24 21:12:59 +00:00
|
|
|
|
|
|
|
dbg_curr_pid = de->dwProcessId;
|
|
|
|
dbg_curr_tid = de->dwThreadId;
|
|
|
|
|
|
|
|
if ((dbg_curr_process = dbg_get_process(de->dwProcessId)) != NULL)
|
|
|
|
dbg_curr_thread = dbg_get_thread(dbg_curr_process, de->dwThreadId);
|
|
|
|
else
|
|
|
|
dbg_curr_thread = NULL;
|
|
|
|
|
|
|
|
switch (de->dwDebugEventCode)
|
|
|
|
{
|
|
|
|
case EXCEPTION_DEBUG_EVENT:
|
|
|
|
if (!dbg_curr_thread)
|
|
|
|
{
|
2022-02-07 07:40:49 +00:00
|
|
|
WINE_ERR("%04lx:%04lx: not a registered process or thread (perhaps a 16 bit one ?)\n",
|
2006-02-24 21:12:59 +00:00
|
|
|
de->dwProcessId, de->dwThreadId);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
2022-02-07 07:40:49 +00:00
|
|
|
WINE_TRACE("%04lx:%04lx: exception code=%08lx\n",
|
2006-02-24 21:12:59 +00:00
|
|
|
de->dwProcessId, de->dwThreadId,
|
|
|
|
de->u.Exception.ExceptionRecord.ExceptionCode);
|
|
|
|
|
2019-07-02 16:02:30 +00:00
|
|
|
if (dbg_curr_process->event_on_first_exception)
|
2006-02-24 21:12:59 +00:00
|
|
|
{
|
2019-07-02 16:02:30 +00:00
|
|
|
SetEvent(dbg_curr_process->event_on_first_exception);
|
|
|
|
CloseHandle(dbg_curr_process->event_on_first_exception);
|
|
|
|
dbg_curr_process->event_on_first_exception = NULL;
|
2006-02-24 21:12:59 +00:00
|
|
|
if (!DBG_IVAR(BreakOnAttach)) break;
|
|
|
|
}
|
|
|
|
if (dbg_fetch_context())
|
|
|
|
{
|
|
|
|
cont = dbg_handle_exception(&de->u.Exception.ExceptionRecord,
|
|
|
|
de->u.Exception.dwFirstChance);
|
|
|
|
if (cont && dbg_curr_thread)
|
|
|
|
{
|
2018-06-12 22:53:20 +00:00
|
|
|
dbg_curr_process->be_cpu->set_context(dbg_curr_thread->handle, &dbg_context);
|
2006-02-24 21:12:59 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
case CREATE_PROCESS_DEBUG_EVENT:
|
2006-03-01 20:05:31 +00:00
|
|
|
dbg_curr_process = dbg_add_process(&be_process_active_io, de->dwProcessId,
|
2006-02-24 21:12:59 +00:00
|
|
|
de->u.CreateProcessInfo.hProcess);
|
|
|
|
if (dbg_curr_process == NULL)
|
|
|
|
{
|
|
|
|
WINE_ERR("Couldn't create process\n");
|
|
|
|
break;
|
|
|
|
}
|
2021-04-13 10:14:15 +00:00
|
|
|
size = ARRAY_SIZE(u.buffer);
|
|
|
|
if (!QueryFullProcessImageNameW( dbg_curr_process->handle, 0, u.buffer, &size ))
|
|
|
|
{
|
2021-12-07 17:45:33 +00:00
|
|
|
swprintf(u.buffer, ARRAY_SIZE(u.buffer), L"Process_%08x", dbg_curr_pid);
|
2021-04-13 10:14:15 +00:00
|
|
|
}
|
2006-02-24 21:12:59 +00:00
|
|
|
|
2022-02-07 07:40:49 +00:00
|
|
|
WINE_TRACE("%04lx:%04lx: create process '%s'/%p @%p (%lu<%lu>)\n",
|
2006-02-24 21:12:59 +00:00
|
|
|
de->dwProcessId, de->dwThreadId,
|
2008-10-18 07:15:10 +00:00
|
|
|
wine_dbgstr_w(u.buffer),
|
|
|
|
de->u.CreateProcessInfo.lpImageName,
|
2006-12-20 13:17:27 +00:00
|
|
|
de->u.CreateProcessInfo.lpStartAddress,
|
2006-02-24 21:12:59 +00:00
|
|
|
de->u.CreateProcessInfo.dwDebugInfoFileOffset,
|
|
|
|
de->u.CreateProcessInfo.nDebugInfoSize);
|
2008-10-18 07:15:10 +00:00
|
|
|
dbg_set_process_name(dbg_curr_process, u.buffer);
|
2006-02-24 21:12:59 +00:00
|
|
|
|
2008-10-18 07:15:10 +00:00
|
|
|
if (!dbg_init(dbg_curr_process->handle, u.buffer, FALSE))
|
2006-02-24 21:12:59 +00:00
|
|
|
dbg_printf("Couldn't initiate DbgHelp\n");
|
2008-10-18 07:15:19 +00:00
|
|
|
if (!dbg_load_module(dbg_curr_process->handle, de->u.CreateProcessInfo.hFile, u.buffer,
|
|
|
|
(DWORD_PTR)de->u.CreateProcessInfo.lpBaseOfImage, 0))
|
2022-02-07 07:40:49 +00:00
|
|
|
dbg_printf("couldn't load main module (%lu)\n", GetLastError());
|
2006-02-24 21:12:59 +00:00
|
|
|
|
2022-02-07 07:40:49 +00:00
|
|
|
WINE_TRACE("%04lx:%04lx: create thread I @%p\n",
|
2006-12-20 13:17:27 +00:00
|
|
|
de->dwProcessId, de->dwThreadId, de->u.CreateProcessInfo.lpStartAddress);
|
2006-02-24 21:12:59 +00:00
|
|
|
|
|
|
|
dbg_curr_thread = dbg_add_thread(dbg_curr_process,
|
|
|
|
de->dwThreadId,
|
|
|
|
de->u.CreateProcessInfo.hThread,
|
|
|
|
de->u.CreateProcessInfo.lpThreadLocalBase);
|
|
|
|
if (!dbg_curr_thread)
|
|
|
|
{
|
|
|
|
WINE_ERR("Couldn't create thread\n");
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
dbg_init_current_process();
|
|
|
|
dbg_init_current_thread(de->u.CreateProcessInfo.lpStartAddress);
|
|
|
|
break;
|
|
|
|
|
|
|
|
case EXIT_PROCESS_DEBUG_EVENT:
|
2022-02-07 07:40:49 +00:00
|
|
|
WINE_TRACE("%04lx:%04lx: exit process (%ld)\n",
|
2006-02-24 21:12:59 +00:00
|
|
|
de->dwProcessId, de->dwThreadId, de->u.ExitProcess.dwExitCode);
|
|
|
|
|
|
|
|
if (dbg_curr_process == NULL)
|
|
|
|
{
|
|
|
|
WINE_ERR("Unknown process\n");
|
|
|
|
break;
|
|
|
|
}
|
2006-02-27 20:50:43 +00:00
|
|
|
tgt_process_active_close_process(dbg_curr_process, FALSE);
|
2022-02-07 07:40:49 +00:00
|
|
|
dbg_printf("Process of pid=%04lx has terminated\n", de->dwProcessId);
|
2006-02-24 21:12:59 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
case CREATE_THREAD_DEBUG_EVENT:
|
2022-02-07 07:40:49 +00:00
|
|
|
WINE_TRACE("%04lx:%04lx: create thread D @%p\n",
|
2006-12-20 13:17:27 +00:00
|
|
|
de->dwProcessId, de->dwThreadId, de->u.CreateThread.lpStartAddress);
|
2006-02-24 21:12:59 +00:00
|
|
|
|
|
|
|
if (dbg_curr_process == NULL)
|
|
|
|
{
|
|
|
|
WINE_ERR("Unknown process\n");
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
if (dbg_get_thread(dbg_curr_process, de->dwThreadId) != NULL)
|
|
|
|
{
|
|
|
|
WINE_TRACE("Thread already listed, skipping\n");
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
dbg_curr_thread = dbg_add_thread(dbg_curr_process,
|
|
|
|
de->dwThreadId,
|
|
|
|
de->u.CreateThread.hThread,
|
|
|
|
de->u.CreateThread.lpThreadLocalBase);
|
|
|
|
if (!dbg_curr_thread)
|
|
|
|
{
|
|
|
|
WINE_ERR("Couldn't create thread\n");
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
dbg_init_current_thread(de->u.CreateThread.lpStartAddress);
|
|
|
|
break;
|
|
|
|
|
|
|
|
case EXIT_THREAD_DEBUG_EVENT:
|
2022-02-07 07:40:49 +00:00
|
|
|
WINE_TRACE("%04lx:%04lx: exit thread (%ld)\n",
|
2006-02-24 21:12:59 +00:00
|
|
|
de->dwProcessId, de->dwThreadId, de->u.ExitThread.dwExitCode);
|
|
|
|
|
|
|
|
if (dbg_curr_thread == NULL)
|
|
|
|
{
|
|
|
|
WINE_ERR("Unknown thread\n");
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
/* FIXME: remove break point set on thread startup */
|
|
|
|
dbg_del_thread(dbg_curr_thread);
|
|
|
|
break;
|
|
|
|
|
|
|
|
case LOAD_DLL_DEBUG_EVENT:
|
|
|
|
if (dbg_curr_thread == NULL)
|
|
|
|
{
|
|
|
|
WINE_ERR("Unknown thread\n");
|
|
|
|
break;
|
|
|
|
}
|
2021-04-13 10:29:38 +00:00
|
|
|
fetch_module_name(de->u.LoadDll.lpImageName, de->u.LoadDll.lpBaseOfDll,
|
2021-04-13 10:14:15 +00:00
|
|
|
u.buffer, ARRAY_SIZE(u.buffer));
|
2006-02-24 21:12:59 +00:00
|
|
|
|
2022-02-07 07:40:49 +00:00
|
|
|
WINE_TRACE("%04lx:%04lx: loads DLL %s @%p (%lu<%lu>)\n",
|
2006-02-24 21:12:59 +00:00
|
|
|
de->dwProcessId, de->dwThreadId,
|
2008-10-18 07:15:10 +00:00
|
|
|
wine_dbgstr_w(u.buffer), de->u.LoadDll.lpBaseOfDll,
|
2006-02-24 21:12:59 +00:00
|
|
|
de->u.LoadDll.dwDebugInfoFileOffset,
|
|
|
|
de->u.LoadDll.nDebugInfoSize);
|
2008-10-18 07:15:19 +00:00
|
|
|
dbg_load_module(dbg_curr_process->handle, de->u.LoadDll.hFile, u.buffer,
|
|
|
|
(DWORD_PTR)de->u.LoadDll.lpBaseOfDll, 0);
|
2006-02-24 21:12:59 +00:00
|
|
|
break_set_xpoints(FALSE);
|
|
|
|
break_check_delayed_bp();
|
|
|
|
break_set_xpoints(TRUE);
|
|
|
|
if (DBG_IVAR(BreakOnDllLoad))
|
|
|
|
{
|
2022-03-18 16:25:36 +00:00
|
|
|
dbg_printf("Stopping on DLL %ls loading at %p\n",
|
|
|
|
u.buffer, de->u.LoadDll.lpBaseOfDll);
|
2006-02-24 21:12:59 +00:00
|
|
|
if (dbg_fetch_context()) cont = 0;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
case UNLOAD_DLL_DEBUG_EVENT:
|
2022-02-07 07:40:49 +00:00
|
|
|
WINE_TRACE("%04lx:%04lx: unload DLL @%p\n",
|
2006-02-24 21:12:59 +00:00
|
|
|
de->dwProcessId, de->dwThreadId,
|
2006-12-20 13:17:27 +00:00
|
|
|
de->u.UnloadDll.lpBaseOfDll);
|
2009-12-12 11:19:14 +00:00
|
|
|
break_delete_xpoints_from_module((DWORD_PTR)de->u.UnloadDll.lpBaseOfDll);
|
2023-01-16 17:09:46 +00:00
|
|
|
dbg_unload_module(dbg_curr_process, (DWORD_PTR)de->u.UnloadDll.lpBaseOfDll);
|
2006-02-24 21:12:59 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
case OUTPUT_DEBUG_STRING_EVENT:
|
|
|
|
if (dbg_curr_thread == NULL)
|
|
|
|
{
|
|
|
|
WINE_ERR("Unknown thread\n");
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
memory_get_string(dbg_curr_process,
|
|
|
|
de->u.DebugString.lpDebugStringData, TRUE,
|
2008-10-18 07:15:10 +00:00
|
|
|
de->u.DebugString.fUnicode, u.bufferA, sizeof(u.bufferA));
|
2022-02-07 07:40:49 +00:00
|
|
|
WINE_TRACE("%04lx:%04lx: output debug string (%s)\n",
|
2008-10-18 07:15:10 +00:00
|
|
|
de->dwProcessId, de->dwThreadId, u.bufferA);
|
2006-02-24 21:12:59 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
case RIP_EVENT:
|
2022-02-07 07:40:49 +00:00
|
|
|
WINE_TRACE("%04lx:%04lx: rip error=%lu type=%lu\n",
|
2006-02-24 21:12:59 +00:00
|
|
|
de->dwProcessId, de->dwThreadId, de->u.RipInfo.dwError,
|
|
|
|
de->u.RipInfo.dwType);
|
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
2022-02-07 07:40:49 +00:00
|
|
|
WINE_TRACE("%04lx:%04lx: unknown event (%lx)\n",
|
2006-02-24 21:12:59 +00:00
|
|
|
de->dwProcessId, de->dwThreadId, de->dwDebugEventCode);
|
|
|
|
}
|
|
|
|
if (!cont) return TRUE; /* stop execution */
|
|
|
|
ContinueDebugEvent(de->dwProcessId, de->dwThreadId, cont);
|
|
|
|
return FALSE; /* continue execution */
|
|
|
|
}
|
|
|
|
|
|
|
|
static void dbg_resume_debuggee(DWORD cont)
|
|
|
|
{
|
|
|
|
if (dbg_curr_thread->in_exception)
|
|
|
|
{
|
2006-07-26 09:57:27 +00:00
|
|
|
ADDRESS64 addr;
|
|
|
|
char hexbuf[MAX_OFFSET_TO_STR_LEN];
|
2006-02-24 21:12:59 +00:00
|
|
|
|
|
|
|
dbg_exception_epilog();
|
|
|
|
memory_get_current_pc(&addr);
|
2006-07-26 09:57:27 +00:00
|
|
|
WINE_TRACE("Exiting debugger PC=%s mode=%d count=%d\n",
|
|
|
|
memory_offset_to_string(hexbuf, addr.Offset, 0),
|
|
|
|
dbg_curr_thread->exec_mode,
|
2006-02-24 21:12:59 +00:00
|
|
|
dbg_curr_thread->exec_count);
|
|
|
|
if (dbg_curr_thread)
|
|
|
|
{
|
2018-06-12 22:53:20 +00:00
|
|
|
if (!dbg_curr_process->be_cpu->set_context(dbg_curr_thread->handle, &dbg_context))
|
2022-02-07 07:40:49 +00:00
|
|
|
dbg_printf("Cannot set ctx on %04lx\n", dbg_curr_tid);
|
2006-02-24 21:12:59 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
dbg_interactiveP = FALSE;
|
|
|
|
if (!ContinueDebugEvent(dbg_curr_pid, dbg_curr_tid, cont))
|
2022-02-07 07:40:49 +00:00
|
|
|
dbg_printf("Cannot continue on %04lx (%08lx)\n", dbg_curr_tid, cont);
|
2006-02-24 21:12:59 +00:00
|
|
|
}
|
|
|
|
|
2006-09-25 20:45:24 +00:00
|
|
|
static void wait_exception(void)
|
|
|
|
{
|
|
|
|
DEBUG_EVENT de;
|
|
|
|
|
2007-02-10 09:48:52 +00:00
|
|
|
while (dbg_num_processes() && WaitForDebugEvent(&de, INFINITE))
|
2006-09-25 20:45:24 +00:00
|
|
|
{
|
|
|
|
if (dbg_handle_debug_event(&de)) break;
|
|
|
|
}
|
|
|
|
dbg_interactiveP = TRUE;
|
|
|
|
}
|
|
|
|
|
2006-02-24 21:12:59 +00:00
|
|
|
void dbg_wait_next_exception(DWORD cont, int count, int mode)
|
|
|
|
{
|
2006-07-26 09:57:27 +00:00
|
|
|
ADDRESS64 addr;
|
|
|
|
char hexbuf[MAX_OFFSET_TO_STR_LEN];
|
2006-02-24 21:12:59 +00:00
|
|
|
|
|
|
|
if (cont == DBG_CONTINUE)
|
|
|
|
{
|
|
|
|
dbg_curr_thread->exec_count = count;
|
|
|
|
dbg_curr_thread->exec_mode = mode;
|
|
|
|
}
|
|
|
|
dbg_resume_debuggee(cont);
|
|
|
|
|
2006-09-25 20:45:24 +00:00
|
|
|
wait_exception();
|
2006-02-24 21:12:59 +00:00
|
|
|
if (!dbg_curr_process) return;
|
|
|
|
|
|
|
|
memory_get_current_pc(&addr);
|
2006-07-26 09:57:27 +00:00
|
|
|
WINE_TRACE("Entering debugger PC=%s mode=%d count=%d\n",
|
|
|
|
memory_offset_to_string(hexbuf, addr.Offset, 0),
|
|
|
|
dbg_curr_thread->exec_mode,
|
2006-02-24 21:12:59 +00:00
|
|
|
dbg_curr_thread->exec_count);
|
|
|
|
}
|
|
|
|
|
2006-09-25 20:45:24 +00:00
|
|
|
void dbg_active_wait_for_first_exception(void)
|
2006-02-24 21:12:59 +00:00
|
|
|
{
|
2006-09-25 20:45:24 +00:00
|
|
|
dbg_interactiveP = FALSE;
|
2006-02-24 21:12:59 +00:00
|
|
|
/* wait for first exception */
|
2006-09-25 20:45:24 +00:00
|
|
|
wait_exception();
|
2006-02-24 21:12:59 +00:00
|
|
|
}
|
|
|
|
|
2013-11-09 10:03:40 +00:00
|
|
|
static BOOL dbg_start_debuggee(LPSTR cmdLine)
|
2006-02-24 21:12:59 +00:00
|
|
|
{
|
|
|
|
PROCESS_INFORMATION info;
|
2007-03-05 20:54:35 +00:00
|
|
|
STARTUPINFOA startup, current;
|
2007-02-10 09:48:52 +00:00
|
|
|
DWORD flags;
|
2006-02-24 21:12:59 +00:00
|
|
|
|
2007-03-05 20:54:35 +00:00
|
|
|
GetStartupInfoA(¤t);
|
|
|
|
|
2006-02-24 21:12:59 +00:00
|
|
|
memset(&startup, 0, sizeof(startup));
|
|
|
|
startup.cb = sizeof(startup);
|
|
|
|
startup.dwFlags = STARTF_USESHOWWINDOW;
|
2007-03-05 20:54:35 +00:00
|
|
|
|
|
|
|
startup.wShowWindow = (current.dwFlags & STARTF_USESHOWWINDOW) ?
|
|
|
|
current.wShowWindow : SW_SHOWNORMAL;
|
2006-02-24 21:12:59 +00:00
|
|
|
|
2013-11-20 22:39:28 +00:00
|
|
|
/* FIXME: shouldn't need the CREATE_NEW_CONSOLE, but as usual CUIs need it
|
|
|
|
* while GUIs don't
|
2006-02-24 21:12:59 +00:00
|
|
|
*/
|
2007-02-10 09:48:52 +00:00
|
|
|
flags = DEBUG_PROCESS | CREATE_NEW_CONSOLE;
|
|
|
|
if (!DBG_IVAR(AlsoDebugProcChild)) flags |= DEBUG_ONLY_THIS_PROCESS;
|
|
|
|
|
2009-12-09 17:14:07 +00:00
|
|
|
if (!CreateProcessA(NULL, cmdLine, NULL, NULL, FALSE, flags,
|
|
|
|
NULL, NULL, &startup, &info))
|
2006-02-24 21:12:59 +00:00
|
|
|
{
|
|
|
|
dbg_printf("Couldn't start process '%s'\n", cmdLine);
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
if (!info.dwProcessId)
|
|
|
|
{
|
|
|
|
/* this happens when the program being run is not a Wine binary
|
|
|
|
* (for example, a shell wrapper around a WineLib app)
|
|
|
|
*/
|
|
|
|
/* Current fix: list running processes and let the user attach
|
|
|
|
* to one of them (sic)
|
|
|
|
* FIXME: implement a real fix => grab the process (from the
|
|
|
|
* running processes) from its name
|
|
|
|
*/
|
|
|
|
dbg_printf("Debuggee has been started (%s)\n"
|
|
|
|
"But WineDbg isn't attached to it. Maybe you're trying to debug a winelib wrapper ??\n"
|
|
|
|
"Try to attach to one of those processes:\n", cmdLine);
|
|
|
|
/* FIXME: (HACK) we need some time before the wrapper executes the winelib app */
|
|
|
|
Sleep(100);
|
|
|
|
info_win32_processes();
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
dbg_curr_pid = info.dwProcessId;
|
2006-03-01 20:05:31 +00:00
|
|
|
if (!(dbg_curr_process = dbg_add_process(&be_process_active_io, dbg_curr_pid, 0))) return FALSE;
|
2006-09-25 20:45:24 +00:00
|
|
|
dbg_curr_process->active_debuggee = TRUE;
|
2021-12-01 14:30:29 +00:00
|
|
|
if (cmdLine != dbg_last_cmd_line)
|
|
|
|
{
|
|
|
|
free(dbg_last_cmd_line);
|
|
|
|
dbg_last_cmd_line = cmdLine;
|
|
|
|
}
|
2006-02-24 21:12:59 +00:00
|
|
|
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
2021-12-01 14:30:17 +00:00
|
|
|
/***********************************************************************
|
|
|
|
* dbg_build_command_line
|
|
|
|
*
|
|
|
|
* (converted from dlls/ntdll/unix/env.c)
|
|
|
|
*
|
|
|
|
* Build the command line of a process from the argv array.
|
|
|
|
*
|
|
|
|
* We must quote and escape characters so that the argv array can be rebuilt
|
|
|
|
* from the command line:
|
|
|
|
* - spaces and tabs must be quoted
|
|
|
|
* 'a b' -> '"a b"'
|
|
|
|
* - quotes must be escaped
|
|
|
|
* '"' -> '\"'
|
|
|
|
* - if '\'s are followed by a '"', they must be doubled and followed by '\"',
|
|
|
|
* resulting in an odd number of '\' followed by a '"'
|
|
|
|
* '\"' -> '\\\"'
|
|
|
|
* '\\"' -> '\\\\\"'
|
|
|
|
* - '\'s are followed by the closing '"' must be doubled,
|
|
|
|
* resulting in an even number of '\' followed by a '"'
|
|
|
|
* ' \' -> '" \\"'
|
|
|
|
* ' \\' -> '" \\\\"'
|
|
|
|
* - '\'s that are not followed by a '"' can be left as is
|
|
|
|
* 'a\b' == 'a\b'
|
|
|
|
* 'a\\b' == 'a\\b'
|
|
|
|
*/
|
|
|
|
static char *dbg_build_command_line( char **argv )
|
|
|
|
{
|
|
|
|
int len;
|
|
|
|
char **arg, *ret;
|
|
|
|
LPSTR p;
|
|
|
|
|
|
|
|
len = 1;
|
|
|
|
for (arg = argv; *arg; arg++) len += 3 + 2 * strlen( *arg );
|
|
|
|
if (!(ret = malloc( len ))) return NULL;
|
|
|
|
|
|
|
|
p = ret;
|
|
|
|
for (arg = argv; *arg; arg++)
|
|
|
|
{
|
|
|
|
BOOL has_space, has_quote;
|
|
|
|
int i, bcount;
|
|
|
|
char *a;
|
|
|
|
|
|
|
|
/* check for quotes and spaces in this argument (first arg is always quoted) */
|
|
|
|
has_space = (arg == argv) || !**arg || strchr( *arg, ' ' ) || strchr( *arg, '\t' );
|
|
|
|
has_quote = strchr( *arg, '"' ) != NULL;
|
|
|
|
|
|
|
|
/* now transfer it to the command line */
|
|
|
|
if (has_space) *p++ = '"';
|
|
|
|
if (has_quote || has_space)
|
|
|
|
{
|
|
|
|
bcount = 0;
|
|
|
|
for (a = *arg; *a; a++)
|
|
|
|
{
|
|
|
|
if (*a == '\\') bcount++;
|
|
|
|
else
|
|
|
|
{
|
|
|
|
if (*a == '"') /* double all the '\\' preceding this '"', plus one */
|
|
|
|
for (i = 0; i <= bcount; i++) *p++ = '\\';
|
|
|
|
bcount = 0;
|
|
|
|
}
|
|
|
|
*p++ = *a;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
strcpy( p, *arg );
|
|
|
|
p += strlen( p );
|
|
|
|
}
|
|
|
|
if (has_space)
|
|
|
|
{
|
|
|
|
/* Double all the '\' preceding the closing quote */
|
|
|
|
for (i = 0; i < bcount; i++) *p++ = '\\';
|
|
|
|
*p++ = '"';
|
|
|
|
}
|
|
|
|
*p++ = ' ';
|
|
|
|
}
|
|
|
|
if (p > ret) p--; /* remove last space */
|
|
|
|
*p = 0;
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2021-12-01 14:30:29 +00:00
|
|
|
void dbg_run_debuggee(struct list_string* ls)
|
2006-02-24 21:12:59 +00:00
|
|
|
{
|
2021-12-01 14:30:29 +00:00
|
|
|
if (dbg_curr_process)
|
|
|
|
{
|
|
|
|
dbg_printf("Already attached to a process. Use 'detach' or 'kill' before using 'run'\n");
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
if (!dbg_executable)
|
2006-02-24 21:12:59 +00:00
|
|
|
{
|
2021-12-01 14:30:29 +00:00
|
|
|
dbg_printf("No active target to be restarted\n");
|
2006-02-24 21:12:59 +00:00
|
|
|
return;
|
|
|
|
}
|
2021-12-01 14:30:29 +00:00
|
|
|
if (ls)
|
2006-02-24 21:12:59 +00:00
|
|
|
{
|
2021-12-01 14:30:29 +00:00
|
|
|
char* cl;
|
|
|
|
char** argv;
|
|
|
|
unsigned argc = 2, i;
|
|
|
|
struct list_string* cls;
|
|
|
|
|
|
|
|
for (cls = ls; cls; cls = cls->next) argc++;
|
|
|
|
if (!(argv = malloc(argc * sizeof(argv[0])))) return;
|
|
|
|
argv[0] = dbg_executable;
|
|
|
|
for (i = 1, cls = ls; cls; cls = cls->next, i++) argv[i] = cls->string;
|
|
|
|
argv[i] = NULL;
|
|
|
|
cl = dbg_build_command_line(argv);
|
|
|
|
free(argv);
|
|
|
|
|
|
|
|
if (!cl || !dbg_start_debuggee(cl))
|
2006-02-24 21:12:59 +00:00
|
|
|
{
|
2021-12-01 14:30:29 +00:00
|
|
|
free(cl);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
if (!dbg_last_cmd_line) dbg_last_cmd_line = strdup(dbg_executable);
|
|
|
|
dbg_start_debuggee(dbg_last_cmd_line);
|
2006-02-24 21:12:59 +00:00
|
|
|
}
|
2021-12-01 14:30:29 +00:00
|
|
|
dbg_active_wait_for_first_exception();
|
|
|
|
source_list_from_addr(NULL, 0);
|
2006-02-24 21:12:59 +00:00
|
|
|
}
|
|
|
|
|
2009-12-10 14:23:45 +00:00
|
|
|
static BOOL str2int(const char* str, DWORD_PTR* val)
|
2006-02-24 21:14:05 +00:00
|
|
|
{
|
|
|
|
char* ptr;
|
|
|
|
|
2021-07-01 14:33:44 +00:00
|
|
|
*val = strtol(str, &ptr, 0);
|
2006-02-24 21:14:05 +00:00
|
|
|
return str < ptr && !*ptr;
|
|
|
|
}
|
|
|
|
|
2012-01-16 15:31:47 +00:00
|
|
|
static HANDLE create_temp_file(void)
|
|
|
|
{
|
|
|
|
WCHAR path[MAX_PATH], name[MAX_PATH];
|
|
|
|
|
2021-11-26 16:30:09 +00:00
|
|
|
if (!GetTempPathW( MAX_PATH, path ) || !GetTempFileNameW( path, L"wdb", 0, name ))
|
2012-01-16 15:31:47 +00:00
|
|
|
return INVALID_HANDLE_VALUE;
|
|
|
|
return CreateFileW( name, GENERIC_READ|GENERIC_WRITE|DELETE, FILE_SHARE_DELETE,
|
|
|
|
NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL | FILE_FLAG_DELETE_ON_CLOSE, 0 );
|
|
|
|
}
|
2006-02-24 21:14:05 +00:00
|
|
|
|
2015-12-02 23:20:25 +00:00
|
|
|
static const struct
|
|
|
|
{
|
|
|
|
int type;
|
|
|
|
int platform;
|
|
|
|
int major;
|
|
|
|
int minor;
|
|
|
|
const char *str;
|
|
|
|
}
|
|
|
|
version_table[] =
|
|
|
|
{
|
|
|
|
{ 0, VER_PLATFORM_WIN32s, 2, 0, "2.0" },
|
|
|
|
{ 0, VER_PLATFORM_WIN32s, 3, 0, "3.0" },
|
|
|
|
{ 0, VER_PLATFORM_WIN32s, 3, 10, "3.1" },
|
|
|
|
{ 0, VER_PLATFORM_WIN32_WINDOWS, 4, 0, "95" },
|
|
|
|
{ 0, VER_PLATFORM_WIN32_WINDOWS, 4, 10, "98" },
|
|
|
|
{ 0, VER_PLATFORM_WIN32_WINDOWS, 4, 90, "ME" },
|
|
|
|
{ VER_NT_WORKSTATION, VER_PLATFORM_WIN32_NT, 3, 51, "NT 3.51" },
|
|
|
|
{ VER_NT_WORKSTATION, VER_PLATFORM_WIN32_NT, 4, 0, "NT 4.0" },
|
|
|
|
{ VER_NT_WORKSTATION, VER_PLATFORM_WIN32_NT, 5, 0, "2000" },
|
|
|
|
{ VER_NT_WORKSTATION, VER_PLATFORM_WIN32_NT, 5, 1, "XP" },
|
|
|
|
{ VER_NT_WORKSTATION, VER_PLATFORM_WIN32_NT, 5, 2, "XP" },
|
|
|
|
{ VER_NT_SERVER, VER_PLATFORM_WIN32_NT, 5, 2, "Server 2003" },
|
|
|
|
{ VER_NT_WORKSTATION, VER_PLATFORM_WIN32_NT, 6, 0, "Vista" },
|
|
|
|
{ VER_NT_SERVER, VER_PLATFORM_WIN32_NT, 6, 0, "Server 2008" },
|
|
|
|
{ VER_NT_WORKSTATION, VER_PLATFORM_WIN32_NT, 6, 1, "7" },
|
|
|
|
{ VER_NT_SERVER, VER_PLATFORM_WIN32_NT, 6, 1, "Server 2008 R2" },
|
|
|
|
{ VER_NT_WORKSTATION, VER_PLATFORM_WIN32_NT, 6, 2, "8" },
|
|
|
|
{ VER_NT_SERVER, VER_PLATFORM_WIN32_NT, 6, 2, "Server 2012" },
|
|
|
|
{ VER_NT_WORKSTATION, VER_PLATFORM_WIN32_NT, 6, 3, "8.1" },
|
|
|
|
{ VER_NT_SERVER, VER_PLATFORM_WIN32_NT, 6, 3, "Server 2012 R2" },
|
|
|
|
{ VER_NT_WORKSTATION, VER_PLATFORM_WIN32_NT, 10, 0, "10" },
|
|
|
|
};
|
|
|
|
|
|
|
|
static const char *get_windows_version(void)
|
|
|
|
{
|
2020-04-16 18:13:27 +00:00
|
|
|
RTL_OSVERSIONINFOEXW info = { sizeof(RTL_OSVERSIONINFOEXW) };
|
2015-12-02 23:20:25 +00:00
|
|
|
static char str[64];
|
|
|
|
int i;
|
|
|
|
|
2020-04-16 18:13:27 +00:00
|
|
|
RtlGetVersion( &info );
|
2015-12-02 23:20:25 +00:00
|
|
|
|
2018-06-17 22:09:29 +00:00
|
|
|
for (i = 0; i < ARRAY_SIZE(version_table); i++)
|
2015-12-02 23:20:25 +00:00
|
|
|
{
|
|
|
|
if (version_table[i].type == info.wProductType &&
|
|
|
|
version_table[i].platform == info.dwPlatformId &&
|
|
|
|
version_table[i].major == info.dwMajorVersion &&
|
|
|
|
version_table[i].minor == info.dwMinorVersion)
|
|
|
|
{
|
|
|
|
return version_table[i].str;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-02-07 07:40:49 +00:00
|
|
|
snprintf( str, sizeof(str), "%ld.%ld (%d)", info.dwMajorVersion,
|
2015-12-02 23:20:25 +00:00
|
|
|
info.dwMinorVersion, info.wProductType );
|
|
|
|
return str;
|
|
|
|
}
|
|
|
|
|
2012-01-17 18:11:07 +00:00
|
|
|
static void output_system_info(void)
|
|
|
|
{
|
|
|
|
#ifdef __i386__
|
|
|
|
static const char platform[] = "i386";
|
|
|
|
#elif defined(__x86_64__)
|
|
|
|
static const char platform[] = "x86_64";
|
|
|
|
#elif defined(__arm__)
|
|
|
|
static const char platform[] = "arm";
|
2013-01-15 23:56:51 +00:00
|
|
|
#elif defined(__aarch64__)
|
|
|
|
static const char platform[] = "arm64";
|
2012-01-17 18:11:07 +00:00
|
|
|
#else
|
|
|
|
# error CPU unknown
|
|
|
|
#endif
|
|
|
|
|
|
|
|
const char *(CDECL *wine_get_build_id)(void);
|
|
|
|
void (CDECL *wine_get_host_version)( const char **sysname, const char **release );
|
|
|
|
BOOL is_wow64;
|
|
|
|
|
|
|
|
wine_get_build_id = (void *)GetProcAddress(GetModuleHandleA("ntdll.dll"), "wine_get_build_id");
|
|
|
|
wine_get_host_version = (void *)GetProcAddress(GetModuleHandleA("ntdll.dll"), "wine_get_host_version");
|
|
|
|
if (!IsWow64Process( dbg_curr_process->handle, &is_wow64 )) is_wow64 = FALSE;
|
|
|
|
|
|
|
|
dbg_printf( "System information:\n" );
|
|
|
|
if (wine_get_build_id) dbg_printf( " Wine build: %s\n", wine_get_build_id() );
|
|
|
|
dbg_printf( " Platform: %s%s\n", platform, is_wow64 ? " (WOW64)" : "" );
|
2015-12-02 23:20:25 +00:00
|
|
|
dbg_printf( " Version: Windows %s\n", get_windows_version() );
|
2012-01-17 18:11:07 +00:00
|
|
|
if (wine_get_host_version)
|
|
|
|
{
|
|
|
|
const char *sysname, *release;
|
|
|
|
wine_get_host_version( &sysname, &release );
|
|
|
|
dbg_printf( " Host system: %s\n", sysname );
|
|
|
|
dbg_printf( " Host version: %s\n", release );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2006-02-24 21:14:05 +00:00
|
|
|
/******************************************************************
|
|
|
|
* dbg_active_attach
|
|
|
|
*
|
|
|
|
* Tries to attach to a running process
|
|
|
|
* Handles the <pid> or <pid> <evt> forms
|
|
|
|
*/
|
|
|
|
enum dbg_start dbg_active_attach(int argc, char* argv[])
|
|
|
|
{
|
2009-12-10 14:23:45 +00:00
|
|
|
DWORD_PTR pid, evt;
|
2006-02-24 21:14:05 +00:00
|
|
|
|
|
|
|
/* try the form <myself> pid */
|
|
|
|
if (argc == 1 && str2int(argv[0], &pid) && pid != 0)
|
|
|
|
{
|
2019-07-02 16:01:13 +00:00
|
|
|
if (!dbg_attach_debuggee(pid))
|
2006-03-01 20:05:28 +00:00
|
|
|
return start_error_init;
|
2006-02-24 21:14:05 +00:00
|
|
|
}
|
|
|
|
/* try the form <myself> pid evt (Win32 JIT debugger) */
|
2006-03-01 20:05:28 +00:00
|
|
|
else if (argc == 2 && str2int(argv[0], &pid) && pid != 0 &&
|
|
|
|
str2int(argv[1], &evt) && evt != 0)
|
2006-02-24 21:14:05 +00:00
|
|
|
{
|
2019-07-02 16:01:13 +00:00
|
|
|
if (!dbg_attach_debuggee(pid))
|
2006-02-24 21:14:05 +00:00
|
|
|
{
|
|
|
|
/* don't care about result */
|
|
|
|
SetEvent((HANDLE)evt);
|
|
|
|
return start_error_init;
|
|
|
|
}
|
2019-07-02 16:02:30 +00:00
|
|
|
dbg_curr_process->event_on_first_exception = (HANDLE)evt;
|
2006-02-24 21:14:05 +00:00
|
|
|
}
|
2006-03-01 20:05:28 +00:00
|
|
|
else return start_error_parse;
|
|
|
|
|
|
|
|
dbg_curr_pid = pid;
|
|
|
|
return start_ok;
|
2006-02-24 21:14:05 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/******************************************************************
|
|
|
|
* dbg_active_launch
|
|
|
|
*
|
|
|
|
* Launches a debuggee (with its arguments) from argc/argv
|
|
|
|
*/
|
|
|
|
enum dbg_start dbg_active_launch(int argc, char* argv[])
|
|
|
|
{
|
|
|
|
LPSTR cmd_line;
|
|
|
|
|
|
|
|
if (argc == 0) return start_error_parse;
|
|
|
|
|
2021-12-01 14:30:29 +00:00
|
|
|
dbg_executable = strdup(argv[0]);
|
2021-12-01 14:30:17 +00:00
|
|
|
cmd_line = dbg_build_command_line(argv);
|
2021-12-01 14:30:29 +00:00
|
|
|
|
2006-02-24 21:14:05 +00:00
|
|
|
if (!dbg_start_debuggee(cmd_line))
|
|
|
|
{
|
2021-12-01 14:30:17 +00:00
|
|
|
free(cmd_line);
|
2006-02-24 21:14:05 +00:00
|
|
|
return start_error_init;
|
|
|
|
}
|
2021-12-01 14:30:29 +00:00
|
|
|
|
2006-02-24 21:14:05 +00:00
|
|
|
return start_ok;
|
|
|
|
}
|
2006-02-24 21:15:08 +00:00
|
|
|
|
|
|
|
/******************************************************************
|
|
|
|
* dbg_active_auto
|
|
|
|
*
|
|
|
|
* Starts (<pid> or <pid> <evt>) in automatic mode
|
|
|
|
*/
|
|
|
|
enum dbg_start dbg_active_auto(int argc, char* argv[])
|
|
|
|
{
|
2012-01-18 11:42:02 +00:00
|
|
|
HANDLE thread = 0, event = 0, input, output = INVALID_HANDLE_VALUE;
|
2006-02-27 20:50:36 +00:00
|
|
|
enum dbg_start ds = start_error_parse;
|
|
|
|
|
2012-01-16 13:15:12 +00:00
|
|
|
DBG_IVAR(BreakOnDllLoad) = 0;
|
|
|
|
|
|
|
|
/* auto mode */
|
|
|
|
argc--; argv++;
|
|
|
|
ds = dbg_active_attach(argc, argv);
|
|
|
|
if (ds != start_ok) {
|
|
|
|
msgbox_res_id(NULL, IDS_INVALID_PARAMS, IDS_AUTO_CAPTION, MB_OK);
|
|
|
|
return ds;
|
|
|
|
}
|
2012-01-16 15:31:47 +00:00
|
|
|
|
|
|
|
switch (display_crash_dialog())
|
|
|
|
{
|
|
|
|
case ID_DEBUG:
|
|
|
|
AllocConsole();
|
2012-01-16 13:15:12 +00:00
|
|
|
dbg_init_console();
|
2021-12-01 14:29:52 +00:00
|
|
|
dbg_start_interactive(NULL, INVALID_HANDLE_VALUE);
|
2012-01-16 13:15:12 +00:00
|
|
|
return start_ok;
|
2012-01-16 15:31:47 +00:00
|
|
|
case ID_DETAILS:
|
2012-01-18 11:42:02 +00:00
|
|
|
event = CreateEventW( NULL, TRUE, FALSE, NULL );
|
|
|
|
if (event) thread = display_crash_details( event );
|
|
|
|
if (thread) dbg_houtput = output = create_temp_file();
|
2012-01-16 15:31:47 +00:00
|
|
|
break;
|
2006-02-27 20:50:39 +00:00
|
|
|
}
|
2012-01-16 13:15:12 +00:00
|
|
|
|
2012-01-16 15:31:47 +00:00
|
|
|
input = parser_generate_command_file("echo Modules:", "info share",
|
|
|
|
"echo Threads:", "info threads", NULL);
|
|
|
|
if (input == INVALID_HANDLE_VALUE) return start_error_parse;
|
2012-01-16 13:15:12 +00:00
|
|
|
|
|
|
|
if (dbg_curr_process->active_debuggee)
|
|
|
|
dbg_active_wait_for_first_exception();
|
|
|
|
|
|
|
|
dbg_interactiveP = TRUE;
|
2021-12-01 14:29:52 +00:00
|
|
|
parser_handle(NULL, input);
|
2015-05-29 23:25:47 +00:00
|
|
|
output_system_info();
|
2012-01-16 15:31:47 +00:00
|
|
|
|
|
|
|
if (output != INVALID_HANDLE_VALUE)
|
|
|
|
{
|
2012-01-18 11:42:02 +00:00
|
|
|
SetEvent( event );
|
|
|
|
WaitForSingleObject( thread, INFINITE );
|
2012-01-16 15:31:47 +00:00
|
|
|
CloseHandle( output );
|
2012-01-18 11:42:02 +00:00
|
|
|
CloseHandle( thread );
|
|
|
|
CloseHandle( event );
|
2012-01-16 15:31:47 +00:00
|
|
|
}
|
2012-01-16 13:15:12 +00:00
|
|
|
|
2012-01-16 15:31:47 +00:00
|
|
|
CloseHandle( input );
|
|
|
|
dbg_curr_process->process_io->close_process(dbg_curr_process, TRUE);
|
2012-01-16 13:15:12 +00:00
|
|
|
return start_ok;
|
|
|
|
}
|
|
|
|
|
|
|
|
/******************************************************************
|
|
|
|
* dbg_active_minidump
|
|
|
|
*
|
|
|
|
* Starts (<pid> or <pid> <evt>) in minidump mode
|
|
|
|
*/
|
|
|
|
enum dbg_start dbg_active_minidump(int argc, char* argv[])
|
|
|
|
{
|
|
|
|
HANDLE hFile;
|
|
|
|
enum dbg_start ds = start_error_parse;
|
|
|
|
const char* file = NULL;
|
2012-10-22 17:42:49 +00:00
|
|
|
char tmp[8 + 1 + 2 + MAX_PATH]; /* minidump "<file>" */
|
2012-01-16 13:15:12 +00:00
|
|
|
|
|
|
|
dbg_houtput = GetStdHandle(STD_ERROR_HANDLE);
|
|
|
|
DBG_IVAR(BreakOnDllLoad) = 0;
|
|
|
|
|
|
|
|
argc--; argv++;
|
|
|
|
/* hard stuff now ; we can get things like:
|
|
|
|
* --minidump <pid> 1 arg
|
|
|
|
* --minidump <pid> <evt> 2 args
|
|
|
|
* --minidump <file> <pid> 2 args
|
|
|
|
* --minidump <file> <pid> <evt> 3 args
|
|
|
|
*/
|
|
|
|
switch (argc)
|
2006-02-27 20:50:39 +00:00
|
|
|
{
|
2012-01-16 13:15:12 +00:00
|
|
|
case 1:
|
|
|
|
ds = dbg_active_attach(argc, argv);
|
|
|
|
break;
|
|
|
|
case 2:
|
|
|
|
if ((ds = dbg_active_attach(argc, argv)) != start_ok)
|
2006-02-27 20:50:39 +00:00
|
|
|
{
|
|
|
|
file = argv[0];
|
|
|
|
ds = dbg_active_attach(argc - 1, argv + 1);
|
|
|
|
}
|
2012-01-16 13:15:12 +00:00
|
|
|
break;
|
|
|
|
case 3:
|
|
|
|
file = argv[0];
|
|
|
|
ds = dbg_active_attach(argc - 1, argv + 1);
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
return start_error_parse;
|
|
|
|
}
|
|
|
|
if (ds != start_ok) return ds;
|
|
|
|
memcpy(tmp, "minidump \"", 10);
|
|
|
|
if (!file)
|
|
|
|
{
|
|
|
|
char path[MAX_PATH];
|
2006-02-27 20:50:39 +00:00
|
|
|
|
2012-01-16 13:15:12 +00:00
|
|
|
GetTempPathA(sizeof(path), path);
|
|
|
|
GetTempFileNameA(path, "WD", 0, tmp + 10);
|
2006-02-27 20:50:39 +00:00
|
|
|
}
|
2012-01-16 13:15:12 +00:00
|
|
|
else strcpy(tmp + 10, file);
|
|
|
|
strcat(tmp, "\"");
|
|
|
|
if (!file)
|
|
|
|
{
|
|
|
|
/* FIXME: should generate unix name as well */
|
|
|
|
dbg_printf("Capturing program state in %s\n", tmp + 9);
|
|
|
|
}
|
|
|
|
hFile = parser_generate_command_file(tmp, "detach", NULL);
|
2006-02-27 20:50:39 +00:00
|
|
|
if (hFile == INVALID_HANDLE_VALUE) return start_error_parse;
|
2006-03-01 20:05:28 +00:00
|
|
|
|
2006-10-02 20:30:11 +00:00
|
|
|
if (dbg_curr_process->active_debuggee)
|
|
|
|
dbg_active_wait_for_first_exception();
|
|
|
|
|
2006-03-01 20:05:28 +00:00
|
|
|
dbg_interactiveP = TRUE;
|
2021-12-01 14:29:52 +00:00
|
|
|
parser_handle(NULL, hFile);
|
2006-03-01 20:05:28 +00:00
|
|
|
|
2006-02-27 20:50:36 +00:00
|
|
|
return start_ok;
|
2006-02-24 21:15:08 +00:00
|
|
|
}
|
2006-02-27 20:50:43 +00:00
|
|
|
|
|
|
|
static BOOL tgt_process_active_close_process(struct dbg_process* pcs, BOOL kill)
|
|
|
|
{
|
2012-01-16 13:05:20 +00:00
|
|
|
if (kill)
|
|
|
|
{
|
|
|
|
DWORD exit_code = 0;
|
|
|
|
|
|
|
|
if (pcs == dbg_curr_process && dbg_curr_thread->in_exception)
|
|
|
|
exit_code = dbg_curr_thread->excpt_record.ExceptionCode;
|
|
|
|
|
|
|
|
TerminateProcess(pcs->handle, exit_code);
|
|
|
|
}
|
|
|
|
else if (pcs == dbg_curr_process)
|
2006-02-27 20:50:43 +00:00
|
|
|
{
|
|
|
|
/* remove all set breakpoints in debuggee code */
|
|
|
|
break_set_xpoints(FALSE);
|
|
|
|
/* needed for single stepping (ugly).
|
|
|
|
* should this be handled inside the server ???
|
|
|
|
*/
|
2018-06-12 22:53:16 +00:00
|
|
|
dbg_curr_process->be_cpu->single_step(&dbg_context, FALSE);
|
2006-02-27 20:50:43 +00:00
|
|
|
if (dbg_curr_thread->in_exception)
|
|
|
|
{
|
2018-06-12 22:53:20 +00:00
|
|
|
dbg_curr_process->be_cpu->set_context(dbg_curr_thread->handle, &dbg_context);
|
2006-02-27 20:50:43 +00:00
|
|
|
ContinueDebugEvent(dbg_curr_pid, dbg_curr_tid, DBG_CONTINUE);
|
|
|
|
}
|
2008-10-25 07:12:30 +00:00
|
|
|
}
|
2013-06-14 21:28:35 +00:00
|
|
|
|
|
|
|
if (!kill)
|
2008-10-25 07:12:30 +00:00
|
|
|
{
|
|
|
|
if (!DebugActiveProcessStop(pcs->pid)) return FALSE;
|
2006-02-27 20:50:43 +00:00
|
|
|
}
|
|
|
|
SymCleanup(pcs->handle);
|
|
|
|
dbg_del_process(pcs);
|
|
|
|
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
2009-06-05 13:16:14 +00:00
|
|
|
static BOOL tgt_process_active_read(HANDLE hProcess, const void* addr,
|
|
|
|
void* buffer, SIZE_T len, SIZE_T* rlen)
|
|
|
|
{
|
|
|
|
return ReadProcessMemory( hProcess, addr, buffer, len, rlen );
|
|
|
|
}
|
|
|
|
|
|
|
|
static BOOL tgt_process_active_write(HANDLE hProcess, void* addr,
|
|
|
|
const void* buffer, SIZE_T len, SIZE_T* wlen)
|
|
|
|
{
|
|
|
|
return WriteProcessMemory( hProcess, addr, buffer, len, wlen );
|
|
|
|
}
|
|
|
|
|
|
|
|
static BOOL tgt_process_active_get_selector(HANDLE hThread, DWORD sel, LDT_ENTRY* le)
|
|
|
|
{
|
|
|
|
return GetThreadSelectorEntry( hThread, sel, le );
|
|
|
|
}
|
|
|
|
|
2006-03-01 20:05:31 +00:00
|
|
|
static struct be_process_io be_process_active_io =
|
2006-02-27 20:50:43 +00:00
|
|
|
{
|
|
|
|
tgt_process_active_close_process,
|
2009-06-05 13:16:14 +00:00
|
|
|
tgt_process_active_read,
|
|
|
|
tgt_process_active_write,
|
|
|
|
tgt_process_active_get_selector
|
2006-02-27 20:50:43 +00:00
|
|
|
};
|