Commit 48f97983 authored by Eric Pouech's avatar Eric Pouech Committed by Alexandre Julliard

- get rid of winedbg internal channels for output

- move all standard (old MESG channel) output to stdout - move all other outputs (TRACE, WARN...) to a new wine debugging channel (winedbg) - replaced quite a few #ifdef:ed out output to new channels (mainly in symbol management area...) - added a new maintenance commands to ease up debugging - updated documentation accordingly
parent 6bbba607
......@@ -1147,66 +1147,6 @@ set $BreakAllThreadsStartup = 1
</sect3>
<sect3>
<title>Output handling</title>
<variablelist>
<varlistentry>
<term><varname>ConChannelMask</varname></term>
<listitem>
<para>
Mask of active debugger output channels on console
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><varname>StdChannelMask</varname></term>
<listitem>
<para>
Mask of active debugger output channels on <filename>stderr</filename>
</para>
</listitem>
</varlistentry>
</variablelist>
<para>
Those last 2 variables are jointly used in two generic ways:
</para>
<orderedlist>
<listitem>
<para>
default
</para>
<programlisting>
ConChannelMask = DBG_CHN_MESG (1)
StdChannelMask = 0
</programlisting>
<para>
In this case, all input/output goes into the
debugger's console (either the standard unix console
if winedbg is started from the command line, or a
specific windowed-console if the debugger is started
upon an exception in a running program. All debug
messages <function>TRACE</function>,
<function>WARN</function>... still goes to tty where
wine is run from).
</para>
</listitem>
<listitem>
<para>
To have all input/output go into the tty where Wine
was started from (to be used in a X11-free
environment)
</para>
<screen>
ConChannelMask = 0
StdChannelMask = DBG_CHN_MESG (1)
</screen>
</listitem>
</orderedlist>
</sect3>
<sect3>
<title>Context information</title>
<variablelist>
......
......@@ -60,7 +60,7 @@ int yyerror(const char *);
%token <string> tPATH
%token <string> tIDENTIFIER tSTRING tDEBUGSTR tINTVAR
%token <integer> tNUM tFORMAT
%token tSYMBOLFILE tRUN tATTACH tDETACH tNOPROCESS
%token tSYMBOLFILE tRUN tATTACH tDETACH tNOPROCESS tMAINTENANCE tTYPE
%token tCHAR tSHORT tINT tLONG tFLOAT tDOUBLE tUNSIGNED tSIGNED
%token tSTRUCT tUNION tENUM
......@@ -152,6 +152,7 @@ command:
| info_command
| walk_command
| run_command
| maintenance_command
| noprocess_state
;
......@@ -266,9 +267,13 @@ run_command:
| tRUN tSTRING tEOL { DEBUG_Run($2); }
;
maintenance_command:
tMAINTENANCE tTYPE { DEBUG_DumpTypes(); }
;
noprocess_state:
tNOPROCESS tEOL {} /* <CR> shall not barf anything */
| tNOPROCESS tSTRING tEOL { DEBUG_Printf(DBG_CHN_MESG, "No process loaded, cannot execute '%s'\n", $2); }
| tNOPROCESS tSTRING tEOL { DEBUG_Printf("No process loaded, cannot execute '%s'\n", $2); }
;
type_expr:
......@@ -385,7 +390,7 @@ static void mode_command(int newmode)
{
case 16: DEBUG_CurrThread->dbg_mode = MODE_16; break;
case 32: DEBUG_CurrThread->dbg_mode = MODE_32; break;
default: DEBUG_Printf(DBG_CHN_MESG,"Invalid mode (use 16, 32 or vm86)\n");
default: DEBUG_Printf("Invalid mode (use 16, 32 or vm86)\n");
}
}
......@@ -398,37 +403,37 @@ static WINE_EXCEPTION_FILTER(wine_dbg_cmd)
{
if (DBG_IVAR(ExtDbgOnInternalException))
DEBUG_ExternalDebugger();
DEBUG_Printf(DBG_CHN_MESG, "\nwine_dbg_cmd: ");
DEBUG_Printf("\nwine_dbg_cmd: ");
switch (GetExceptionCode()) {
case DEBUG_STATUS_INTERNAL_ERROR:
DEBUG_Printf(DBG_CHN_MESG, "WineDbg internal error\n");
DEBUG_Printf("WineDbg internal error\n");
if (DBG_IVAR(ExtDbgOnInternalException))
DEBUG_ExternalDebugger();
break;
case DEBUG_STATUS_NO_SYMBOL:
DEBUG_Printf(DBG_CHN_MESG, "Undefined symbol\n");
DEBUG_Printf("Undefined symbol\n");
break;
case DEBUG_STATUS_DIV_BY_ZERO:
DEBUG_Printf(DBG_CHN_MESG, "Division by zero\n");
DEBUG_Printf("Division by zero\n");
break;
case DEBUG_STATUS_BAD_TYPE:
DEBUG_Printf(DBG_CHN_MESG, "No type or type mismatch\n");
DEBUG_Printf("No type or type mismatch\n");
break;
case DEBUG_STATUS_NO_FIELD:
DEBUG_Printf(DBG_CHN_MESG, "No such field in structure or union\n");
DEBUG_Printf("No such field in structure or union\n");
break;
case DEBUG_STATUS_ABORT:
break;
case CONTROL_C_EXIT:
/* this is generally sent by a ctrl-c when we run winedbg outside of wineconsole */
DEBUG_Printf(DBG_CHN_MESG, "Ctrl-C\n");
DEBUG_Printf("Ctrl-C\n");
/* stop the debuggee, and continue debugger execution, we will be reintered by the
* debug events generated by stopping
*/
DEBUG_InterruptDebuggee();
return EXCEPTION_CONTINUE_EXECUTION;
default:
DEBUG_Printf(DBG_CHN_MESG, "Exception %lx\n", GetExceptionCode());
DEBUG_Printf("Exception %lx\n", GetExceptionCode());
DEBUG_ExternalDebugger();
break;
}
......@@ -491,6 +496,6 @@ void DEBUG_Parser(LPCSTR filename)
int yyerror(const char* s)
{
DEBUG_Printf(DBG_CHN_MESG, "%s\n", s);
DEBUG_Printf("%s\n", s);
return 0;
}
......@@ -62,6 +62,7 @@ STRING \"[^\n"]+\"
%s WALK_CMD
%s SHOW_CMD
%s MODE_CMD
%s MAINT_CMD
%s NOCMD
%x ASTRING_EXPECTED
......@@ -145,6 +146,7 @@ STRING \"[^\n"]+\"
<INITIAL>whatis|whati|what { BEGIN(NOCMD); return tWHATIS; }
<INITIAL,NOPROCESS>run|ru|r { BEGIN(ASTRING_EXPECTED); return tRUN;}
<INITIAL>detach|detac|deta|det { BEGIN(NOCMD); return tDETACH; }
<INITIAL>maintenance|maint { BEGIN(MAINT_CMD); return tMAINTENANCE; }
<NOPROCESS>attach|attac|atta|att { BEGIN(NOCMD); return tATTACH; }
<INFO_CMD>share|shar|sha { return tSHARE; }
<INFO_CMD>locals|local|loca|loc { return tLOCAL; }
......@@ -156,11 +158,12 @@ STRING \"[^\n"]+\"
<INFO_CMD>registers|regs|reg|re { return tREGS; }
<INFO_CMD>segments|segment|segm|seg|se { return tSEGMENTS; }
<INFO_CMD>stack|stac|sta|st { return tSTACK; }
<INFO_CMD>symbol|sym { BEGIN(ASTRING_EXPECTED); return tSYMBOL; }
<INFO_CMD>symbol|symbo|symb|sym { BEGIN(ASTRING_EXPECTED); return tSYMBOL; }
<WALK_CMD>maps|map { return tMAPS; }
<INFO_CMD,WALK_CMD>window|windo|wind|win|wnd { return tWND; }
<HELP_CMD>info|inf|in { return tINFO; }
<MODE_CMD>vm86 { return tVM86; }
<MAINT_CMD>type { return tTYPE; }
<INITIAL,SHOW_CMD>directories|directorie|directori|director|directo|direct|direc|direc|dir {
BEGIN(PATH_EXPECTED); return tDIR; }
......@@ -187,7 +190,7 @@ enum { return tENUM; }
<NOPROCESS>. { BEGIN(ASTRING_EXPECTED); yyless(0); return tNOPROCESS;}
<*>. { if (syntax_error == 0) {
syntax_error++;
DEBUG_Printf(DBG_CHN_MESG, "Syntax Error (%s)\n", yytext); }
DEBUG_Printf("Syntax Error (%s)\n", yytext); }
}
%%
......@@ -241,7 +244,10 @@ static int DEBUG_FetchEntireLine(const char* pfx, char** line, size_t* allo
/* store stuff at the end of last_line */
if (len + nread + 1 > *alloc)
{
*line = HeapReAlloc(GetProcessHeap(), 0, *line, *alloc += nread + 1);
if (*line)
*line = HeapReAlloc(GetProcessHeap(), 0, *line, *alloc += nread + 1);
else
*line = HeapAlloc(GetProcessHeap(), 0, *alloc += nread + 1);
}
strcpy(*line + len, buf_line);
len += nread;
......
......@@ -428,8 +428,8 @@ extern enum dbg_mode DEBUG_GetSelectorType( WORD sel );
extern void DEBUG_FixAddress( DBG_ADDR *address, DWORD def );
extern int DEBUG_IsSelectorSystem( WORD sel );
#endif
extern int DEBUG_PrintStringA( int chnl, const DBG_ADDR* address, int len );
extern int DEBUG_PrintStringW( int chnl, const DBG_ADDR* address, int len );
extern int DEBUG_PrintStringA(const DBG_ADDR* address, int len);
extern int DEBUG_PrintStringW(const DBG_ADDR* address, int len);
/* debugger/module.c */
extern int DEBUG_LoadEntryPoints( const char * prefix );
......@@ -512,22 +512,17 @@ extern const char* DEBUG_GetName(struct datatype * dt);
extern enum debug_type DEBUG_GetType(struct datatype * dt);
extern struct datatype * DEBUG_TypeCast(enum debug_type, const char *);
extern int DEBUG_PrintTypeCast(const struct datatype *);
extern int DEBUG_PrintType( const DBG_VALUE* addr );
extern int DEBUG_PrintType(const DBG_VALUE* addr);
extern struct datatype * DEBUG_GetBasicType(enum debug_type_basic);
extern int DEBUG_DumpTypes(void);
/* debugger/winedbg.c */
#define DBG_CHN_MESG 1
#define DBG_CHN_ERR 2
#define DBG_CHN_WARN 4
#define DBG_CHN_FIXME 8
#define DBG_CHN_TRACE 16
extern void DEBUG_OutputA(int chn, const char* buffer, int len);
extern void DEBUG_OutputW(int chn, const WCHAR* buffer, int len);
extern void DEBUG_OutputA(const char* buffer, int len);
extern void DEBUG_OutputW(const WCHAR* buffer, int len);
#ifdef __GNUC__
extern int DEBUG_Printf(int chn, const char* format, ...) __attribute__((format (printf,2,3)));
extern int DEBUG_Printf(const char* format, ...) __attribute__((format (printf,1,2)));
#else
extern int DEBUG_Printf(int chn, const char* format, ...);
extern int DEBUG_Printf(const char* format, ...);
#endif
extern DBG_INTVAR* DEBUG_GetIntVar(const char*);
extern BOOL DEBUG_Attach(DWORD pid, BOOL cofe, BOOL wfe);
......
......@@ -85,7 +85,7 @@ int DEBUG_InfoDisplay(void)
continue;
if (displaypoints[i].function_name)
DEBUG_Printf(DBG_CHN_MESG, "%d in %s%s : ", i + 1,
DEBUG_Printf("%d in %s%s : ", i + 1,
DEBUG_GetSymbolName(displaypoints[i].function_name),
(displaypoints[i].enabled ?
(displaypoints[i].function_name != DEBUG_GetCurrentFrameFunctionName() ?
......@@ -93,10 +93,10 @@ int DEBUG_InfoDisplay(void)
: " (disabled)")
);
else
DEBUG_Printf(DBG_CHN_MESG, "%d%s : ", i + 1,
(displaypoints[i].enabled ? "" : " (disabled)"));
DEBUG_Printf("%d%s : ", i + 1,
(displaypoints[i].enabled ? "" : " (disabled)"));
DEBUG_DisplayExpr(displaypoints[i].exp);
DEBUG_Printf(DBG_CHN_MESG, "\n");
DEBUG_Printf("\n");
}
return TRUE;
......@@ -109,19 +109,19 @@ void DEBUG_PrintOneDisplay(int i)
if (displaypoints[i].enabled) {
value = DEBUG_EvalExpr(displaypoints[i].exp);
if (value.type == NULL) {
DEBUG_Printf(DBG_CHN_MESG, "Unable to evaluate expression ");
DEBUG_Printf("Unable to evaluate expression ");
DEBUG_DisplayExpr(displaypoints[i].exp);
DEBUG_Printf(DBG_CHN_MESG, "\nDisabling display %d ...\n", i + 1);
DEBUG_Printf("\nDisabling display %d ...\n", i + 1);
displaypoints[i].enabled = FALSE;
return;
}
}
DEBUG_Printf(DBG_CHN_MESG, "%d : ", i + 1);
DEBUG_Printf("%d : ", i + 1);
DEBUG_DisplayExpr(displaypoints[i].exp);
DEBUG_Printf(DBG_CHN_MESG, " = ");
DEBUG_Printf(" = ");
if (!displaypoints[i].enabled)
DEBUG_Printf(DBG_CHN_MESG, "(disabled)\n");
DEBUG_Printf("(disabled)\n");
else
if (displaypoints[i].format == 'i')
DEBUG_ExamineMemory(&value, displaypoints[i].count, displaypoints[i].format);
......@@ -152,7 +152,7 @@ int DEBUG_DelDisplay(int displaynum)
if (displaynum > ndisplays || displaynum == 0 || displaynum < -1
|| displaypoints[displaynum - 1].exp == NULL) {
DEBUG_Printf(DBG_CHN_MESG, "Invalid display number\n");
DEBUG_Printf("Invalid display number\n");
return TRUE;
}
......@@ -185,7 +185,7 @@ int DEBUG_EnableDisplay(int displaynum, int enable)
{
--displaynum;
if (displaynum >= ndisplays || displaynum < 0 || displaypoints[displaynum].exp == NULL) {
DEBUG_Printf(DBG_CHN_MESG, "Invalid display number\n");
DEBUG_Printf("Invalid display number\n");
return TRUE;
}
......
......@@ -325,7 +325,7 @@ DBG_VALUE DEBUG_EvalExpr(struct expr * exp)
case EXPR_TYPE_CAST:
if (!exp->un.cast.cast)
{
DEBUG_Printf(DBG_CHN_MESG, "Can't cast to unknown type\n");
DEBUG_Printf("Can't cast to unknown type\n");
RaiseException(DEBUG_STATUS_BAD_TYPE, 0, 0, NULL);
}
rtn = DEBUG_EvalExpr(exp->un.cast.expr);
......@@ -377,7 +377,7 @@ DBG_VALUE DEBUG_EvalExpr(struct expr * exp)
if (!DEBUG_FindStructElement(&rtn, exp->un.structure.element_name,
&exp->un.structure.result))
{
DEBUG_Printf(DBG_CHN_MESG, "%s\n", exp->un.structure.element_name);
DEBUG_Printf("%s\n", exp->un.structure.element_name);
RaiseException(DEBUG_STATUS_NO_FIELD, 0, 0, NULL);
}
......@@ -392,7 +392,7 @@ DBG_VALUE DEBUG_EvalExpr(struct expr * exp)
if (!DEBUG_FindStructElement(&rtn, exp->un.structure.element_name,
&exp->un.structure.result))
{
DEBUG_Printf(DBG_CHN_MESG, "%s\n", exp->un.structure.element_name);
DEBUG_Printf("%s\n", exp->un.structure.element_name);
RaiseException(DEBUG_STATUS_NO_FIELD, 0, 0, NULL);
}
break;
......@@ -456,7 +456,7 @@ DBG_VALUE DEBUG_EvalExpr(struct expr * exp)
break;
}
#else
DEBUG_Printf(DBG_CHN_MESG, "Function call no longer implemented\n");
DEBUG_Printf("Function call no longer implemented\n");
/* would need to set up a call to this function, and then restore the current
* context afterwards...
*/
......@@ -685,7 +685,7 @@ DBG_VALUE DEBUG_EvalExpr(struct expr * exp)
}
break;
default:
DEBUG_Printf(DBG_CHN_MESG,"Unexpected expression (%d).\n", exp->type);
DEBUG_Printf("Unexpected expression (%d).\n", exp->type);
RaiseException(DEBUG_STATUS_INTERNAL_ERROR, 0, 0, NULL);
break;
}
......@@ -704,111 +704,111 @@ DEBUG_DisplayExpr(const struct expr * exp)
switch(exp->type)
{
case EXPR_TYPE_CAST:
DEBUG_Printf(DBG_CHN_MESG, "((");
DEBUG_Printf("((");
DEBUG_PrintTypeCast(exp->un.cast.cast);
DEBUG_Printf(DBG_CHN_MESG, ")");
DEBUG_Printf(")");
DEBUG_DisplayExpr(exp->un.cast.expr);
DEBUG_Printf(DBG_CHN_MESG, ")");
DEBUG_Printf(")");
break;
case EXPR_TYPE_INTVAR:
DEBUG_Printf(DBG_CHN_MESG, "$%s", exp->un.intvar.name);
DEBUG_Printf("$%s", exp->un.intvar.name);
break;
case EXPR_TYPE_US_CONST:
DEBUG_Printf(DBG_CHN_MESG, "%ud", exp->un.u_const.value);
DEBUG_Printf("%ud", exp->un.u_const.value);
break;
case EXPR_TYPE_CONST:
DEBUG_Printf(DBG_CHN_MESG, "%d", exp->un.u_const.value);
DEBUG_Printf("%d", exp->un.u_const.value);
break;
case EXPR_TYPE_STRING:
DEBUG_Printf(DBG_CHN_MESG, "\"%s\"", exp->un.string.str);
DEBUG_Printf("\"%s\"", exp->un.string.str);
break;
case EXPR_TYPE_SYMBOL:
DEBUG_Printf(DBG_CHN_MESG, "%s" , exp->un.symbol.name);
DEBUG_Printf("%s" , exp->un.symbol.name);
break;
case EXPR_TYPE_PSTRUCT:
DEBUG_DisplayExpr(exp->un.structure.exp1);
DEBUG_Printf(DBG_CHN_MESG, "->%s", exp->un.structure.element_name);
DEBUG_Printf("->%s", exp->un.structure.element_name);
break;
case EXPR_TYPE_STRUCT:
DEBUG_DisplayExpr(exp->un.structure.exp1);
DEBUG_Printf(DBG_CHN_MESG, ".%s", exp->un.structure.element_name);
DEBUG_Printf(".%s", exp->un.structure.element_name);
break;
case EXPR_TYPE_CALL:
DEBUG_Printf(DBG_CHN_MESG, "%s(",exp->un.call.funcname);
DEBUG_Printf("%s(",exp->un.call.funcname);
for(i=0; i < exp->un.call.nargs; i++)
{
DEBUG_DisplayExpr(exp->un.call.arg[i]);
if( i != exp->un.call.nargs - 1 )
{
DEBUG_Printf(DBG_CHN_MESG, ", ");
DEBUG_Printf(", ");
}
}
DEBUG_Printf(DBG_CHN_MESG, ")");
DEBUG_Printf(")");
break;
case EXPR_TYPE_BINOP:
DEBUG_Printf(DBG_CHN_MESG, "( ");
DEBUG_Printf("( ");
DEBUG_DisplayExpr(exp->un.binop.exp1);
switch(exp->un.binop.binop_type)
{
case EXP_OP_ADD:
DEBUG_Printf(DBG_CHN_MESG, " + ");
DEBUG_Printf(" + ");
break;
case EXP_OP_SUB:
DEBUG_Printf(DBG_CHN_MESG, " - ");
DEBUG_Printf(" - ");
break;
case EXP_OP_SEG:
DEBUG_Printf(DBG_CHN_MESG, ":");
DEBUG_Printf(":");
break;
case EXP_OP_LOR:
DEBUG_Printf(DBG_CHN_MESG, " || ");
DEBUG_Printf(" || ");
break;
case EXP_OP_LAND:
DEBUG_Printf(DBG_CHN_MESG, " && ");
DEBUG_Printf(" && ");
break;
case EXP_OP_OR:
DEBUG_Printf(DBG_CHN_MESG, " | ");
DEBUG_Printf(" | ");
break;
case EXP_OP_AND:
DEBUG_Printf(DBG_CHN_MESG, " & ");
DEBUG_Printf(" & ");
break;
case EXP_OP_XOR:
DEBUG_Printf(DBG_CHN_MESG, " ^ ");
DEBUG_Printf(" ^ ");
break;
case EXP_OP_EQ:
DEBUG_Printf(DBG_CHN_MESG, " == ");
DEBUG_Printf(" == ");
break;
case EXP_OP_GT:
DEBUG_Printf(DBG_CHN_MESG, " > ");
DEBUG_Printf(" > ");
break;
case EXP_OP_LT:
DEBUG_Printf(DBG_CHN_MESG, " < ");
DEBUG_Printf(" < ");
break;
case EXP_OP_GE:
DEBUG_Printf(DBG_CHN_MESG, " >= ");
DEBUG_Printf(" >= ");
break;
case EXP_OP_LE:
DEBUG_Printf(DBG_CHN_MESG, " <= ");
DEBUG_Printf(" <= ");
break;
case EXP_OP_NE:
DEBUG_Printf(DBG_CHN_MESG, " != ");
DEBUG_Printf(" != ");
break;
case EXP_OP_SHL:
DEBUG_Printf(DBG_CHN_MESG, " << ");
DEBUG_Printf(" << ");
break;
case EXP_OP_SHR:
DEBUG_Printf(DBG_CHN_MESG, " >> ");
DEBUG_Printf(" >> ");
break;
case EXP_OP_MUL:
DEBUG_Printf(DBG_CHN_MESG, " * ");
DEBUG_Printf(" * ");
break;
case EXP_OP_DIV:
DEBUG_Printf(DBG_CHN_MESG, " / ");
DEBUG_Printf(" / ");
break;
case EXP_OP_REM:
DEBUG_Printf(DBG_CHN_MESG, " %% ");
DEBUG_Printf(" %% ");
break;
case EXP_OP_ARR:
DEBUG_Printf(DBG_CHN_MESG, "[");
DEBUG_Printf("[");
break;
default:
break;
......@@ -816,33 +816,33 @@ DEBUG_DisplayExpr(const struct expr * exp)
DEBUG_DisplayExpr(exp->un.binop.exp2);
if( exp->un.binop.binop_type == EXP_OP_ARR )
{
DEBUG_Printf(DBG_CHN_MESG, "]");
DEBUG_Printf("]");
}
DEBUG_Printf(DBG_CHN_MESG, " )");
DEBUG_Printf(" )");
break;
case EXPR_TYPE_UNOP:
switch(exp->un.unop.unop_type)
{
case EXP_OP_NEG:
DEBUG_Printf(DBG_CHN_MESG, "-");
DEBUG_Printf("-");
break;
case EXP_OP_NOT:
DEBUG_Printf(DBG_CHN_MESG, "!");
DEBUG_Printf("!");
break;
case EXP_OP_LNOT:
DEBUG_Printf(DBG_CHN_MESG, "~");
DEBUG_Printf("~");
break;
case EXP_OP_DEREF:
DEBUG_Printf(DBG_CHN_MESG, "*");
DEBUG_Printf("*");
break;
case EXP_OP_ADDR:
DEBUG_Printf(DBG_CHN_MESG, "&");
DEBUG_Printf("&");
break;
}
DEBUG_DisplayExpr(exp->un.unop.exp1);
break;
default:
DEBUG_Printf(DBG_CHN_MESG,"Unexpected expression.\n");
DEBUG_Printf("Unexpected expression.\n");
RaiseException(DEBUG_STATUS_INTERNAL_ERROR, 0, 0, NULL);
break;
}
......@@ -901,7 +901,7 @@ DEBUG_CloneExpr(const struct expr * exp)
rtn->un.unop.exp1 = DEBUG_CloneExpr(exp->un.unop.exp1);
break;
default:
DEBUG_Printf(DBG_CHN_MESG,"Unexpected expression.\n");
DEBUG_Printf("Unexpected expression.\n");
RaiseException(DEBUG_STATUS_INTERNAL_ERROR, 0, 0, NULL);
break;
}
......@@ -956,7 +956,7 @@ DEBUG_FreeExpr(struct expr * exp)
DEBUG_FreeExpr(exp->un.unop.exp1);
break;
default:
DEBUG_Printf(DBG_CHN_MESG,"Unexpected expression.\n");
DEBUG_Printf("Unexpected expression.\n");
RaiseException(DEBUG_STATUS_INTERNAL_ERROR, 0, 0, NULL);
break;
}
......
......@@ -665,7 +665,7 @@ static void handle_debug_event(struct gdb_context* gdbctx, DEBUG_EVENT* de)
DEBUG_CheckDelayedBP();
if (DBG_IVAR(BreakOnDllLoad))
{
DEBUG_Printf(DBG_CHN_MESG, "Stopping on DLL %s loading at %08lx\n",
DEBUG_Printf("Stopping on DLL %s loading at %08lx\n",
buffer, (unsigned long)de->u.LoadDll.lpBaseOfDll);
DEBUG_Parser();
}
......
......@@ -27,10 +27,6 @@ INTERNAL_VAR(BreakOnFirstChance, TRUE, NULL, DT_BASIC_CONST_INT)
INTERNAL_VAR(BreakOnDllLoad, FALSE, NULL, DT_BASIC_CONST_INT)
INTERNAL_VAR(CanDeferOnBPByAddr, FALSE, NULL, DT_BASIC_CONST_INT)
/* console handling */
INTERNAL_VAR(ConChannelMask, DBG_CHN_MESG, NULL, DT_BASIC_CONST_INT)
INTERNAL_VAR(StdChannelMask, 0, NULL, DT_BASIC_CONST_INT)
/* debugging debugger */
INTERNAL_VAR(ExtDbgOnInvalidAddress, FALSE, NULL, DT_BASIC_CONST_INT)
INTERNAL_VAR(ExtDbgOnInternalException, FALSE, NULL, DT_BASIC_CONST_INT)
......
......@@ -35,7 +35,7 @@
static void DEBUG_Die(const char* msg)
{
DEBUG_Printf(DBG_CHN_MESG, msg);
DEBUG_Printf(msg);
exit(1);
}
......@@ -139,9 +139,9 @@ void DEBUG_GetCurrentAddress( DBG_ADDR *addr )
void DEBUG_InvalAddr( const DBG_ADDR* addr )
{
DEBUG_Printf(DBG_CHN_MESG,"*** Invalid address ");
DEBUG_Printf("*** Invalid address ");
DEBUG_PrintAddress(addr, DEBUG_CurrThread->dbg_mode, FALSE);
DEBUG_Printf(DBG_CHN_MESG,"\n");
DEBUG_Printf("\n");
if (DBG_IVAR(ExtDbgOnInvalidAddress)) DEBUG_ExternalDebugger();
}
......@@ -255,7 +255,7 @@ BOOL DEBUG_GrabAddress( DBG_VALUE* value, BOOL fromCode )
value->addr.off = DEBUG_GetExprValue(value, NULL);
}
} else if (!value->addr.seg && !value->addr.off) {
DEBUG_Printf(DBG_CHN_MESG,"Invalid expression\n");
DEBUG_Printf("Invalid expression\n");
return FALSE;
}
return TRUE;
......@@ -277,7 +277,7 @@ void DEBUG_ExamineMemory( const DBG_VALUE *_value, int count, char format )
if (format != 'i' && count > 1)
{
DEBUG_PrintAddress( &value.addr, DEBUG_CurrThread->dbg_mode, FALSE );
DEBUG_Printf(DBG_CHN_MESG,": ");
DEBUG_Printf(": ");
}
pnt = (void*)DEBUG_ToLinear( &value.addr );
......@@ -286,13 +286,13 @@ void DEBUG_ExamineMemory( const DBG_VALUE *_value, int count, char format )
{
case 'u':
if (count == 1) count = 256;
DEBUG_nchar += DEBUG_PrintStringW(DBG_CHN_MESG, &value.addr, count);
DEBUG_Printf(DBG_CHN_MESG, "\n");
DEBUG_nchar += DEBUG_PrintStringW(&value.addr, count);
DEBUG_Printf("\n");
return;
case 's':
if (count == 1) count = 256;
DEBUG_nchar += DEBUG_PrintStringA(DBG_CHN_MESG, &value.addr, count);
DEBUG_Printf(DBG_CHN_MESG, "\n");
DEBUG_nchar += DEBUG_PrintStringA(&value.addr, count);
DEBUG_Printf("\n");
return;
case 'i':
while (count-- && DEBUG_DisassembleInstruction( &value.addr ));
......@@ -302,7 +302,7 @@ void DEBUG_ExamineMemory( const DBG_VALUE *_value, int count, char format )
{
GUID guid;
if (!DEBUG_READ_MEM_VERBOSE(pnt, &guid, sizeof(guid))) break;
DEBUG_Printf(DBG_CHN_MESG,"{%08lx-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x}\n",
DEBUG_Printf("{%08lx-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x}\n",
guid.Data1, guid.Data2, guid.Data3,
guid.Data4[0], guid.Data4[1], guid.Data4[2], guid.Data4[3],
guid.Data4[4], guid.Data4[5], guid.Data4[6], guid.Data4[7] );
......@@ -311,7 +311,7 @@ void DEBUG_ExamineMemory( const DBG_VALUE *_value, int count, char format )
if (count)
{
DEBUG_PrintAddress( &value.addr, DEBUG_CurrThread->dbg_mode, FALSE );
DEBUG_Printf(DBG_CHN_MESG,": ");
DEBUG_Printf(": ");
}
}
return;
......@@ -320,15 +320,15 @@ void DEBUG_ExamineMemory( const DBG_VALUE *_value, int count, char format )
_t _v; \
for(i=0; i<count; i++) { \
if (!DEBUG_READ_MEM_VERBOSE(pnt, &_v, sizeof(_t))) break; \
DEBUG_Printf(DBG_CHN_MESG,_f,(_vv)); \
DEBUG_Printf(_f,(_vv)); \
pnt += sizeof(_t); value.addr.off += sizeof(_t); \
if ((i % (_l)) == (_l)-1) { \
DEBUG_Printf(DBG_CHN_MESG,"\n"); \
DEBUG_Printf("\n"); \
DEBUG_PrintAddress( &value.addr, DEBUG_CurrThread->dbg_mode, FALSE );\
DEBUG_Printf(DBG_CHN_MESG,": ");\
DEBUG_Printf(": ");\
} \
} \
DEBUG_Printf(DBG_CHN_MESG,"\n"); \
DEBUG_Printf("\n"); \
} \
return
#define DO_DUMP(_t,_l,_f) DO_DUMP2(_t,_l,_f,_v)
......@@ -350,7 +350,7 @@ void DEBUG_ExamineMemory( const DBG_VALUE *_value, int count, char format )
* address space. The string stops when either len chars (if <> -1)
* have been printed, or the '\0' char is printed
*/
int DEBUG_PrintStringA(int chnl, const DBG_ADDR* address, int len)
int DEBUG_PrintStringA(const DBG_ADDR* address, int len)
{
char* lin = (void*)DEBUG_ToLinear(address);
char ch[CHARBUFSIZE+1];
......@@ -364,7 +364,7 @@ int DEBUG_PrintStringA(int chnl, const DBG_ADDR* address, int len)
if (!DEBUG_READ_MEM_VERBOSE(lin, ch, to_write)) break;
ch[to_write] = '\0'; /* protect from displaying junk */
to_write = lstrlenA(ch);
DEBUG_OutputA(chnl, ch, to_write);
DEBUG_OutputA(ch, to_write);
lin += to_write;
written += to_write;
if (to_write < CHARBUFSIZE) break;
......@@ -372,7 +372,7 @@ int DEBUG_PrintStringA(int chnl, const DBG_ADDR* address, int len)
return written; /* number of actually written chars */
}
int DEBUG_PrintStringW(int chnl, const DBG_ADDR* address, int len)
int DEBUG_PrintStringW(const DBG_ADDR* address, int len)
{
char* lin = (void*)DEBUG_ToLinear(address);
WCHAR ch[CHARBUFSIZE+1];
......@@ -386,7 +386,7 @@ int DEBUG_PrintStringW(int chnl, const DBG_ADDR* address, int len)
if (!DEBUG_READ_MEM_VERBOSE(lin, ch, to_write * sizeof(WCHAR))) break;
ch[to_write] = 0; /* protect from displaying junk */
to_write = lstrlenW(ch);
DEBUG_OutputW(chnl, ch, to_write);
DEBUG_OutputW(ch, to_write);
lin += to_write;
written += to_write;
if (to_write < CHARBUFSIZE) break;
......
......@@ -26,6 +26,9 @@
#include "debugger.h"
#include "wingdi.h"
#include "winuser.h"
#include "wine/debug.h"
WINE_DEFAULT_DEBUG_CHANNEL(winedbg);
/***********************************************************************
* Creates and links a new module to the current process
......@@ -445,25 +448,25 @@ int DEBUG_LoadEntryPoints(const char* pfx)
(module.flags & NE_FFLAGS_WIN32) /* NE module */)
continue;
if (!first) {
if (pfx) DEBUG_Printf(DBG_CHN_MESG, pfx);
DEBUG_Printf(DBG_CHN_MESG, " ");
if (pfx) DEBUG_Printf(pfx);
DEBUG_Printf(" ");
rowcount = 3 + (pfx ? strlen(pfx) : 0);
first = 1;
}
len = strlen(entry.szModule);
if ((rowcount + len) > 76) {
DEBUG_Printf(DBG_CHN_MESG, "\n ");
DEBUG_Printf("\n ");
rowcount = 3;
}
DEBUG_Printf(DBG_CHN_MESG, " %s", entry.szModule);
DEBUG_Printf(" %s", entry.szModule);
rowcount += len + 1;
DEBUG_LoadModule16(entry.hModule, &module, moduleAddr, entry.szModule);
} while (ModuleNext16(&entry));
#endif
if (first) DEBUG_Printf(DBG_CHN_MESG, "\n");
if (first) DEBUG_Printf("\n");
return first;
}
......@@ -485,11 +488,11 @@ void DEBUG_ReportDIL(enum DbgInfoLoad dil, const char* pfx, const char* filename
fmt = "Can't find file for %s '%s' (%p)\n";
break;
default:
DEBUG_Printf(DBG_CHN_ERR, "Oooocch (%d)\n", dil);
WINE_ERR("Oooocch (%d)\n", dil);
return;
}
DEBUG_Printf(DBG_CHN_MESG, fmt, pfx, filename, load_addr);
DEBUG_Printf(fmt, pfx, filename, load_addr);
}
static const char* DEBUG_GetModuleType(enum DbgModuleType type)
......@@ -540,8 +543,8 @@ static inline BOOL DEBUG_IsContainer(const DBG_MODULE* wmod_cntnr,
static void DEBUG_InfoShareModule(const DBG_MODULE* module, int ident)
{
if (ident) DEBUG_Printf(DBG_CHN_MESG, " \\-");
DEBUG_Printf(DBG_CHN_MESG, "%s\t0x%08lx-%08lx\t%s\n",
if (ident) DEBUG_Printf(" \\-");
DEBUG_Printf("%s\t0x%08lx-%08lx\t%s\n",
DEBUG_GetModuleType(module->type),
(DWORD)module->load_addr, (DWORD)module->load_addr + module->size,
module->module_name);
......@@ -560,7 +563,7 @@ void DEBUG_InfoShare(void)
ref = DBG_alloc(sizeof(DBG_MODULE*) * DEBUG_CurrProcess->num_modules);
if (!ref) return;
DEBUG_Printf(DBG_CHN_MESG, "Module\tAddress\t\t\tName\t%d modules\n",
DEBUG_Printf("Module\tAddress\t\t\tName\t%d modules\n",
DEBUG_CurrProcess->num_modules);
memcpy(ref, DEBUG_CurrProcess->modules,
......@@ -588,7 +591,7 @@ void DEBUG_InfoShare(void)
DEBUG_InfoShareModule(ref[i], 0);
break;
default:
DEBUG_Printf(DBG_CHN_ERR, "Unknown type (%d)\n", ref[i]->type);
WINE_ERR("Unknown type (%d)\n", ref[i]->type);
}
}
DBG_free(ref);
......@@ -604,11 +607,11 @@ void DEBUG_DumpModule(DWORD mod)
if (!(wmod = DEBUG_FindModuleByHandle((HANDLE)mod, DMT_UNKNOWN)) &&
!(wmod = DEBUG_FindModuleByAddr((void*)mod, DMT_UNKNOWN))) {
DEBUG_Printf(DBG_CHN_MESG, "'0x%08lx' is not a valid module handle or address\n", mod);
DEBUG_Printf("'0x%08lx' is not a valid module handle or address\n", mod);
return;
}
DEBUG_Printf(DBG_CHN_MESG, "Module '%s' (handle=%p) 0x%08lx-0x%08lx (%s, debug info %s)\n",
DEBUG_Printf("Module '%s' (handle=%p) 0x%08lx-0x%08lx (%s, debug info %s)\n",
wmod->module_name, wmod->handle, (DWORD)wmod->load_addr,
(DWORD)wmod->load_addr + wmod->size,
DEBUG_GetModuleType(wmod->type), DEBUG_GetDbgInfo(wmod->dil));
......@@ -626,12 +629,11 @@ void DEBUG_WalkModules(void)
if (!DEBUG_CurrProcess)
{
DEBUG_Printf(DBG_CHN_MESG,
"Cannot walk classes while no process is loaded\n");
DEBUG_Printf("Cannot walk classes while no process is loaded\n");
return;
}
DEBUG_Printf(DBG_CHN_MESG, "Address\t\t\tModule\tName\n");
DEBUG_Printf("Address\t\t\tModule\tName\n");
amod = DBG_alloc(sizeof(DBG_MODULE*) * DEBUG_CurrProcess->num_modules);
if (!amod) return;
......@@ -643,7 +645,7 @@ void DEBUG_WalkModules(void)
for (i = 0; i < DEBUG_CurrProcess->num_modules; i++) {
if (amod[i]->type == DMT_ELF) continue;
DEBUG_Printf(DBG_CHN_MESG, "0x%08lx-%08lx\t(%s)\t%s\n",
DEBUG_Printf("0x%08lx-%08lx\t(%s)\t%s\n",
(DWORD)amod[i]->load_addr,
(DWORD)amod[i]->load_addr + amod[i]->size,
DEBUG_GetModuleType(amod[i]->type), amod[i]->module_name);
......
......@@ -88,40 +88,40 @@ static char *DEBUG_Flags( DWORD flag, char *buf )
*/
void DEBUG_InfoRegisters(const CONTEXT* ctx)
{
DEBUG_Printf(DBG_CHN_MESG,"Register dump:\n");
DEBUG_Printf("Register dump:\n");
#ifdef __i386__
/* First get the segment registers out of the way */
DEBUG_Printf( DBG_CHN_MESG," CS:%04x SS:%04x DS:%04x ES:%04x FS:%04x GS:%04x",
(WORD)ctx->SegCs, (WORD)ctx->SegSs,
(WORD)ctx->SegDs, (WORD)ctx->SegEs,
(WORD)ctx->SegFs, (WORD)ctx->SegGs );
DEBUG_Printf(" CS:%04x SS:%04x DS:%04x ES:%04x FS:%04x GS:%04x",
(WORD)ctx->SegCs, (WORD)ctx->SegSs,
(WORD)ctx->SegDs, (WORD)ctx->SegEs,
(WORD)ctx->SegFs, (WORD)ctx->SegGs);
if (DEBUG_CurrThread->dbg_mode != MODE_32)
{
char flag[33];
DEBUG_Printf( DBG_CHN_MESG,"\n IP:%04x SP:%04x BP:%04x FLAGS:%04x(%s)\n",
LOWORD(ctx->Eip), LOWORD(ctx->Esp),
LOWORD(ctx->Ebp), LOWORD(ctx->EFlags),
DEBUG_Flags(LOWORD(ctx->EFlags), flag));
DEBUG_Printf( DBG_CHN_MESG," AX:%04x BX:%04x CX:%04x DX:%04x SI:%04x DI:%04x\n",
LOWORD(ctx->Eax), LOWORD(ctx->Ebx),
LOWORD(ctx->Ecx), LOWORD(ctx->Edx),
LOWORD(ctx->Esi), LOWORD(ctx->Edi) );
DEBUG_Printf("\n IP:%04x SP:%04x BP:%04x FLAGS:%04x(%s)\n",
LOWORD(ctx->Eip), LOWORD(ctx->Esp),
LOWORD(ctx->Ebp), LOWORD(ctx->EFlags),
DEBUG_Flags(LOWORD(ctx->EFlags), flag));
DEBUG_Printf(" AX:%04x BX:%04x CX:%04x DX:%04x SI:%04x DI:%04x\n",
LOWORD(ctx->Eax), LOWORD(ctx->Ebx),
LOWORD(ctx->Ecx), LOWORD(ctx->Edx),
LOWORD(ctx->Esi), LOWORD(ctx->Edi));
}
else /* 32-bit mode */
{
char flag[33];
DEBUG_Printf( DBG_CHN_MESG, "\n EIP:%08lx ESP:%08lx EBP:%08lx EFLAGS:%08lx(%s)\n",
ctx->Eip, ctx->Esp,
ctx->Ebp, ctx->EFlags,
DEBUG_Flags(ctx->EFlags, flag));
DEBUG_Printf( DBG_CHN_MESG, " EAX:%08lx EBX:%08lx ECX:%08lx EDX:%08lx\n",
ctx->Eax, ctx->Ebx,
ctx->Ecx, ctx->Edx );
DEBUG_Printf( DBG_CHN_MESG, " ESI:%08lx EDI:%08lx\n",
ctx->Esi, ctx->Edi );
DEBUG_Printf("\n EIP:%08lx ESP:%08lx EBP:%08lx EFLAGS:%08lx(%s)\n",
ctx->Eip, ctx->Esp,
ctx->Ebp, ctx->EFlags,
DEBUG_Flags(ctx->EFlags, flag));
DEBUG_Printf(" EAX:%08lx EBX:%08lx ECX:%08lx EDX:%08lx\n",
ctx->Eax, ctx->Ebx,
ctx->Ecx, ctx->Edx );
DEBUG_Printf(" ESI:%08lx EDI:%08lx\n",
ctx->Esi, ctx->Edi );
}
#endif
}
......@@ -145,8 +145,8 @@ BOOL DEBUG_ValidateRegisters(void)
/* Check that a selector is a valid ring-3 LDT selector, or a NULL selector */
#define CHECK_SEG(seg,name) \
if (((seg) & ~3) && ((((seg) & 7) != 7) || !DEBUG_IsSelector(seg))) { \
DEBUG_Printf( DBG_CHN_MESG, "*** Invalid value for %s register: %04x\n", \
(name), (WORD)(seg) ); \
DEBUG_Printf("*** Invalid value for %s register: %04x\n", \
(name), (WORD)(seg) ); \
return FALSE; \
}
......@@ -164,14 +164,14 @@ BOOL DEBUG_ValidateRegisters(void)
if (!(DEBUG_context.SegCs & ~3))
{
DEBUG_Printf( DBG_CHN_MESG, "*** Invalid value for CS register: %04x\n",
(WORD)DEBUG_context.SegCs );
DEBUG_Printf("*** Invalid value for CS register: %04x\n",
(WORD)DEBUG_context.SegCs );
return FALSE;
}
if (!(DEBUG_context.SegSs & ~3))
{
DEBUG_Printf( DBG_CHN_MESG, "*** Invalid value for SS register: %04x\n",
(WORD)DEBUG_context.SegSs );
DEBUG_Printf("*** Invalid value for SS register: %04x\n",
(WORD)DEBUG_context.SegSs );
return FALSE;
}
......
......@@ -68,12 +68,12 @@ DEBUG_ShowDir(void)
{
struct searchlist * sl;
DEBUG_Printf(DBG_CHN_MESG,"Search list :\n");
DEBUG_Printf("Search list :\n");
for(sl = listhead; sl; sl = sl->next)
{
DEBUG_Printf(DBG_CHN_MESG, "\t%s\n", sl->path);
DEBUG_Printf("\t%s\n", sl->path);
}
DEBUG_Printf(DBG_CHN_MESG, "\n");
DEBUG_Printf("\n");
}
void
......@@ -250,7 +250,7 @@ DEBUG_DisplaySource(char * sourcefile, int start, int end)
ol->nlines = 0;
ol->linelist = NULL;
ofiles = ol;
DEBUG_Printf(DBG_CHN_MESG,"Unable to open file %s\n", tmppath);
DEBUG_Printf("Unable to open file %s\n", tmppath);
return FALSE;
}
}
......@@ -329,7 +329,7 @@ DEBUG_DisplaySource(char * sourcefile, int start, int end)
memcpy(&buffer, addr + ol->linelist[i],
(ol->linelist[i+1] - ol->linelist[i]) - 1);
}
DEBUG_Printf(DBG_CHN_MESG,"%d\t%s\n", i + 1, buffer);
DEBUG_Printf("%d\t%s\n", i + 1, buffer);
}
DEBUG_UnmapFile(addr, hMap);
......@@ -355,7 +355,7 @@ DEBUG_List(struct list_id * source1, struct list_id * source2,
&& source2->sourcefile != NULL
&& strcmp(source1->sourcefile, source2->sourcefile) != 0 )
{
DEBUG_Printf(DBG_CHN_MESG, "Ambiguous source file specification.\n");
DEBUG_Printf("Ambiguous source file specification.\n");
return;
}
......@@ -379,7 +379,7 @@ DEBUG_List(struct list_id * source1, struct list_id * source2,
if( sourcefile == NULL )
{
DEBUG_Printf(DBG_CHN_MESG, "No source file specified.\n");
DEBUG_Printf("No source file specified.\n");
return;
}
......@@ -442,14 +442,14 @@ BOOL DEBUG_DisassembleInstruction(DBG_ADDR *addr)
BOOL ret = TRUE;
DEBUG_PrintAddress(addr, DEBUG_CurrThread->dbg_mode, TRUE);
DEBUG_Printf(DBG_CHN_MESG, ": ");
DEBUG_Printf(": ");
if (!DEBUG_READ_MEM_VERBOSE((void*)DEBUG_ToLinear(addr), &ch, sizeof(ch))) {
DEBUG_Printf(DBG_CHN_MESG, "-- no code --");
DEBUG_Printf("-- no code --");
ret = FALSE;
} else {
DEBUG_Disasm(addr, TRUE);
}
DEBUG_Printf(DBG_CHN_MESG,"\n");
DEBUG_Printf("\n");
return ret;
}
......
......@@ -68,6 +68,11 @@
#endif
#endif
#include "wine/debug.h"
WINE_DEFAULT_DEBUG_CHANNEL(winedbg);
WINE_DECLARE_DEBUG_CHANNEL(winedbg_stabs);
#ifndef N_UNDF
#define N_UNDF 0x00
#endif
......@@ -230,7 +235,7 @@ DEBUG_FileSubNr2StabEnum(int filenr, int subnr)
{
struct datatype** ret;
/* DEBUG_Printf(DBG_CHN_MESG, "creating type id for (%d,%d)\n", filenr, subnr); */
WINE_TRACE_(winedbg_stabs)("creating type id for (%d,%d)\n", filenr, subnr);
/* FIXME: I could perhaps create a dummy include_def for each compilation
* unit which would allow not to handle those two cases separately
......@@ -261,7 +266,7 @@ DEBUG_FileSubNr2StabEnum(int filenr, int subnr)
}
ret = &idef->vector[subnr];
}
/* DEBUG_Printf(DBG_CHN_MESG,"(%d,%d) is %d\n",filenr,subnr,ret); */
WINE_TRACE_(winedbg_stabs)("(%d,%d) is %p\n",filenr,subnr,ret);
return ret;
}
......@@ -606,7 +611,7 @@ static int DEBUG_PTS_ReadTypedef(struct ParseTypedefData* ptd, const char* typen
if (*++ptd->ptr == 's') {
ptd->ptr++;
if (DEBUG_PTS_ReadNum(ptd, &sz) == -1) {
DEBUG_Printf(DBG_CHN_MESG, "Not an attribute... NIY\n");
WINE_ERR_(winedbg_stabs)("Not an attribute... NIY\n");
ptd->ptr -= 2;
return -1;
}
......@@ -664,8 +669,7 @@ static int DEBUG_PTS_ReadTypedef(struct ParseTypedefData* ptd, const char* typen
*DEBUG_FileSubNr2StabEnum(filenr1, subnr1) = new_dt;
} else {
if (DEBUG_GetType(dt1) != DT_STRUCT) {
DEBUG_Printf(DBG_CHN_MESG,
"Forward declaration is not an aggregate\n");
WINE_ERR_(winedbg_stabs)("Forward declaration is not an aggregate\n");
return -1;
}
......@@ -780,7 +784,7 @@ static int DEBUG_PTS_ReadTypedef(struct ParseTypedefData* ptd, const char* typen
}
break;
default:
DEBUG_Printf(DBG_CHN_MESG, "Unknown type '%c'\n", ptd->ptr[-1]);
WINE_ERR_(winedbg_stabs)("Unknown type '%c'\n", ptd->ptr[-1]);
return -1;
}
}
......@@ -796,13 +800,11 @@ static int DEBUG_PTS_ReadTypedef(struct ParseTypedefData* ptd, const char* typen
*DEBUG_FileSubNr2StabEnum(filenr1, subnr1) = *ret_dt = new_dt;
#if 0
if (typename) {
DEBUG_Printf(DBG_CHN_MESG, "Adding (%d,%d) %s => ", filenr1, subnr1, typename);
if (typename && WINE_TRACE_ON(winedbg_stabs)) {
DEBUG_Printf("Adding (%d,%d) %s => ", filenr1, subnr1, typename);
DEBUG_PrintTypeCast(new_dt);
DEBUG_Printf(DBG_CHN_MESG, "\n");
DEBUG_Printf("\n");
}
#endif
return 0;
}
......@@ -836,20 +838,20 @@ static int DEBUG_ParseTypedefStab(char* ptr, const char* typename)
if (ret == -1 || *ptd.ptr) {
#ifdef PTS_DEBUG
int i;
DEBUG_Printf(DBG_CHN_MESG, "Failure on %s\n", ptr);
WINE_TRACE_(winedbg_stabs)("Failure on %s\n", ptr);
if (ret == -1)
{
for (i = 0; i < ptd.err_idx; i++)
{
DEBUG_Printf(DBG_CHN_MESG, "[%d]: line %d => %s\n",
i, ptd.errors[i].line, ptd.errors[i].ptr);
WINE_TRACE_(winedbg_stabs)("[%d]: line %d => %s\n",
i, ptd.errors[i].line, ptd.errors[i].ptr);
}
}
else
DEBUG_Printf(DBG_CHN_MESG, "[0]: => %s\n", ptd.ptr);
WINE_TRACE_(winedbg_stabs)("[0]: => %s\n", ptd.ptr);
#else
DEBUG_Printf(DBG_CHN_MESG, "Failure on %s at %s\n", ptr, ptd.ptr);
WINE_ERR_(winedbg_stabs)("Failure on %s at %s\n", ptr, ptd.ptr);
#endif
return FALSE;
}
......@@ -988,7 +990,8 @@ enum DbgInfoLoad DEBUG_ParseStabs(char * addr, void *load_offset,
stab_strcpy(symname, sizeof(symname), ptr);
#ifdef __ELF__
new_value.addr.off = 0;
/* EPP used to be: new_value.addr.off = 0; */
new_value.addr.off = (unsigned long)load_offset + stab_ptr->n_value;
curr_sym = DEBUG_AddSymbol( symname, &new_value, currpath,
SYM_WINE | SYM_DATA | SYM_INVALID );
#else
......@@ -1197,17 +1200,15 @@ enum DbgInfoLoad DEBUG_ParseStabs(char * addr, void *load_offset,
*/
break;
default:
DEBUG_Printf(DBG_CHN_MESG, "Unknown stab type 0x%02x\n", stab_ptr->n_type);
WINE_ERR_(winedbg_stabs)("Unknown stab type 0x%02x\n", stab_ptr->n_type);
break;
}
stabbuff[0] = '\0';
#if 0
DEBUG_Printf(DBG_CHN_MESG, "0x%02x %x %s\n", stab_ptr->n_type,
(unsigned int) stab_ptr->n_value,
strs + (unsigned int) stab_ptr->n_un.n_name);
#endif
WINE_TRACE_(winedbg_stabs)("0x%02x %x %s\n", stab_ptr->n_type,
(unsigned int) stab_ptr->n_value,
strs + (unsigned int) stab_ptr->n_un.n_name);
}
DEBUG_FreeIncludes();
......@@ -1314,7 +1315,7 @@ enum DbgInfoLoad DEBUG_LoadElfStabs(DBG_MODULE* module)
int stabstrsect;
if (module->type != DMT_ELF || !module->elf_info) {
DEBUG_Printf(DBG_CHN_ERR, "Bad elf module '%s'\n", module->module_name);
WINE_ERR("Bad elf module '%s'\n", module->module_name);
return DIL_ERROR;
}
......@@ -1354,7 +1355,7 @@ enum DbgInfoLoad DEBUG_LoadElfStabs(DBG_MODULE* module)
}
if (stabsect == -1 || stabstrsect == -1) {
DEBUG_Printf(DBG_CHN_WARN, "No .stab section\n");
WINE_WARN("No .stab section\n");
goto leave;
}
......@@ -1370,7 +1371,7 @@ enum DbgInfoLoad DEBUG_LoadElfStabs(DBG_MODULE* module)
dil = DIL_LOADED;
} else {
dil = DIL_ERROR;
DEBUG_Printf(DBG_CHN_WARN, "Couldn't read correctly read stabs\n");
WINE_WARN("Couldn't read correctly read stabs\n");
goto leave;
}
......@@ -1420,7 +1421,7 @@ static enum DbgInfoLoad DEBUG_ProcessElfFile(const char* filename,
DWORD size;
DWORD delta;
DEBUG_Printf(DBG_CHN_TRACE, "Processing elf file '%s'\n", filename);
WINE_TRACE("Processing elf file '%s'\n", filename);
/* check that the file exists, and that the module hasn't been loaded yet */
if (stat(filename, &statbuf) == -1) goto leave;
......@@ -1486,7 +1487,7 @@ static enum DbgInfoLoad DEBUG_ProcessElfFile(const char* filename,
}
if ((module->elf_info = DBG_alloc(sizeof(ELF_DBG_INFO))) == NULL) {
DEBUG_Printf(DBG_CHN_ERR, "OOM\n");
WINE_ERR("OOM\n");
exit(0);
}
......@@ -1640,8 +1641,7 @@ enum DbgInfoLoad DEBUG_ReadExecutableDbgInfo(const char* exe_name)
if (dbg_hdr.r_brk) {
DBG_VALUE value;
DEBUG_Printf(DBG_CHN_TRACE, "Setting up a breakpoint on r_brk(%lx)\n",
(unsigned long)dbg_hdr.r_brk);
WINE_TRACE("Setting up a breakpoint on r_brk(%lx)\n", (unsigned long)dbg_hdr.r_brk);
DEBUG_SetBreakpoints(FALSE);
value.type = NULL;
......
......@@ -76,7 +76,7 @@ void DEBUG_InfoStack(void)
value.addr.seg = DEBUG_context.SegSs;
value.addr.off = DEBUG_context.Esp;
DEBUG_Printf(DBG_CHN_MESG,"Stack dump:\n");
DEBUG_Printf("Stack dump:\n");
switch (DEBUG_GetSelectorType(value.addr.seg))
{
case MODE_32: /* 32-bit mode */
......@@ -88,9 +88,9 @@ void DEBUG_InfoStack(void)
DEBUG_ExamineMemory( &value, 24, 'w' );
break;
default:
DEBUG_Printf(DBG_CHN_MESG, "Bad segment (%ld)\n", value.addr.seg);
DEBUG_Printf("Bad segment (%ld)\n", value.addr.seg);
}
DEBUG_Printf(DBG_CHN_MESG,"\n");
DEBUG_Printf("\n");
#endif
}
......@@ -102,7 +102,7 @@ static void DEBUG_ForceFrame(DBG_ADDR *stack, DBG_ADDR *code, int frameno, enum
frames = (struct bt_info *)DBG_realloc(frames,
nframe*sizeof(struct bt_info));
if (noisy)
DEBUG_Printf(DBG_CHN_MESG,"%s%d ", (theframe == curr_frame ? "=>" : " "),
DEBUG_Printf("%s%d ", (theframe == curr_frame ? "=>" : " "),
frameno);
frames[theframe].cs = code->seg;
frames[theframe].eip = code->off;
......@@ -115,8 +115,8 @@ static void DEBUG_ForceFrame(DBG_ADDR *stack, DBG_ADDR *code, int frameno, enum
frames[theframe].ss = stack->seg;
frames[theframe].ebp = stack->off;
if (noisy) {
DEBUG_Printf( DBG_CHN_MESG, (mode != MODE_32) ? " (bp=%04lx%s)\n" : " (ebp=%08lx%s)\n",
stack->off, caveat?caveat:"" );
DEBUG_Printf((mode != MODE_32) ? " (bp=%04lx%s)\n" : " (ebp=%08lx%s)\n",
stack->off, caveat ? caveat : "");
}
}
......@@ -205,7 +205,7 @@ void DEBUG_BackTrace(DWORD tid, BOOL noisy)
int copy_curr_frame = 0;
struct bt_info* copy_frames = NULL;
if (noisy) DEBUG_Printf( DBG_CHN_MESG, "Backtrace:\n" );
if (noisy) DEBUG_Printf("Backtrace:\n");
if (tid == DEBUG_CurrTid)
{
......@@ -221,7 +221,7 @@ void DEBUG_BackTrace(DWORD tid, BOOL noisy)
if (!thread)
{
DEBUG_Printf( DBG_CHN_MESG, "Unknown thread id (0x%08lx) in current process\n", tid);
DEBUG_Printf("Unknown thread id (0x%08lx) in current process\n", tid);
return;
}
memset(&ctx, 0, sizeof(ctx));
......@@ -230,7 +230,7 @@ void DEBUG_BackTrace(DWORD tid, BOOL noisy)
if ( SuspendThread( thread->handle ) == -1 ||
!GetThreadContext( thread->handle, &ctx ))
{
DEBUG_Printf( DBG_CHN_MESG, "Can't get context for thread id (0x%08lx) in current process\n", tid);
DEBUG_Printf("Can't get context for thread id (0x%08lx) in current process\n", tid);
return;
}
/* need to avoid trashing stack frame for current thread */
......@@ -280,7 +280,7 @@ void DEBUG_BackTrace(DWORD tid, BOOL noisy)
is16 = TRUE;
break;
default:
if (noisy) DEBUG_Printf( DBG_CHN_MESG, "Bad segment '%x'\n", ss);
if (noisy) DEBUG_Printf("Bad segment '%x'\n", ss);
return;
}
......@@ -289,14 +289,14 @@ void DEBUG_BackTrace(DWORD tid, BOOL noisy)
*/
cur_switch = (DWORD)thread->teb + OFFSET_OF(TEB, cur_stack);
if (!DEBUG_READ_MEM((void*)cur_switch, &next_switch, sizeof(next_switch))) {
if (noisy) DEBUG_Printf( DBG_CHN_MESG, "Can't read TEB:cur_stack\n");
if (noisy) DEBUG_Printf("Can't read TEB:cur_stack\n");
return;
}
if (is16) {
if (!DEBUG_READ_MEM((void*)next_switch, &frame32, sizeof(STACK32FRAME))) {
if (noisy) DEBUG_Printf( DBG_CHN_MESG, "Bad stack frame 0x%08lx\n",
(unsigned long)(STACK32FRAME*)next_switch );
if (noisy) DEBUG_Printf("Bad stack frame 0x%08lx\n",
(unsigned long)(STACK32FRAME*)next_switch );
return;
}
cur_switch = (DWORD)frame32.frame16;
......@@ -308,8 +308,8 @@ void DEBUG_BackTrace(DWORD tid, BOOL noisy)
p = DEBUG_ToLinear(&tmp);
if (!DEBUG_READ_MEM((void*)p, &frame16, sizeof(STACK16FRAME))) {
if (noisy) DEBUG_Printf( DBG_CHN_MESG, "Bad stack frame 0x%08lx\n",
(unsigned long)(STACK16FRAME*)p );
if (noisy) DEBUG_Printf("Bad stack frame 0x%08lx\n",
(unsigned long)(STACK16FRAME*)p );
return;
}
cur_switch = (DWORD)frame16.frame32;
......@@ -330,8 +330,8 @@ void DEBUG_BackTrace(DWORD tid, BOOL noisy)
if (is16) {
if (!DEBUG_READ_MEM((void*)next_switch, &frame32, sizeof(STACK32FRAME))) {
if (noisy) DEBUG_Printf( DBG_CHN_MESG, "Bad stack frame 0x%08lx\n",
(unsigned long)(STACK32FRAME*)next_switch );
if (noisy) DEBUG_Printf("Bad stack frame 0x%08lx\n",
(unsigned long)(STACK32FRAME*)next_switch );
return;
}
......@@ -349,8 +349,8 @@ void DEBUG_BackTrace(DWORD tid, BOOL noisy)
p = DEBUG_ToLinear(&tmp);
if (!DEBUG_READ_MEM((void*)p, &frame16, sizeof(STACK16FRAME))) {
if (noisy) DEBUG_Printf( DBG_CHN_MESG, "Bad stack frame 0x%08lx\n",
(unsigned long)(STACK16FRAME*)p );
if (noisy) DEBUG_Printf("Bad stack frame 0x%08lx\n",
(unsigned long)(STACK16FRAME*)p );
return;
}
cur_switch = (DWORD)frame16.frame32;
......@@ -364,8 +364,8 @@ void DEBUG_BackTrace(DWORD tid, BOOL noisy)
p = DEBUG_ToLinear(&tmp);
if (!DEBUG_READ_MEM((void*)p, &frame16, sizeof(STACK16FRAME))) {
if (noisy) DEBUG_Printf( DBG_CHN_MESG, "Bad stack frame 0x%08lx\n",
(unsigned long)(STACK16FRAME*)p );
if (noisy) DEBUG_Printf("Bad stack frame 0x%08lx\n",
(unsigned long)(STACK16FRAME*)p );
return;
}
......@@ -379,8 +379,8 @@ void DEBUG_BackTrace(DWORD tid, BOOL noisy)
next_switch = cur_switch;
if (!DEBUG_READ_MEM((void*)next_switch, &frame32, sizeof(STACK32FRAME))) {
if (noisy) DEBUG_Printf( DBG_CHN_MESG, "Bad stack frame 0x%08lx\n",
(unsigned long)(STACK32FRAME*)next_switch );
if (noisy) DEBUG_Printf("Bad stack frame 0x%08lx\n",
(unsigned long)(STACK32FRAME*)next_switch );
return;
}
cur_switch = (DWORD)frame32.frame16;
......@@ -399,7 +399,7 @@ void DEBUG_BackTrace(DWORD tid, BOOL noisy)
: DEBUG_Frame32( &addr, &cs, ++frameno, noisy);
}
}
if (noisy) DEBUG_Printf( DBG_CHN_MESG, "\n" );
if (noisy) DEBUG_Printf("\n");
if (tid != DEBUG_CurrTid)
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment