Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
b2557f25
Commit
b2557f25
authored
Jan 02, 2007
by
Eric Pouech
Committed by
Alexandre Julliard
Jan 04, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winedbg: Added a maintenance command to load a given module (for debug purposes).
parent
2ffc90d6
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
101 additions
and
4 deletions
+101
-4
Makefile.in
programs/winedbg/Makefile.in
+1
-0
dbg.y
programs/winedbg/dbg.y
+4
-2
debug.l
programs/winedbg/debug.l
+3
-2
debugger.h
programs/winedbg/debugger.h
+3
-0
tgt_module.c
programs/winedbg/tgt_module.c
+90
-0
No files found.
programs/winedbg/Makefile.in
View file @
b2557f25
...
@@ -25,6 +25,7 @@ C_SRCS = \
...
@@ -25,6 +25,7 @@ C_SRCS = \
stack.c
\
stack.c
\
tgt_active.c
\
tgt_active.c
\
tgt_minidump.c
\
tgt_minidump.c
\
tgt_module.c
\
types.c
\
types.c
\
winedbg.c
winedbg.c
...
...
programs/winedbg/dbg.y
View file @
b2557f25
...
@@ -54,8 +54,8 @@ static int dbg_error(const char*);
...
@@ -54,8 +54,8 @@ static int dbg_error(const char*);
%token tENABLE tDISABLE tBREAK tHBREAK tWATCH tDELETE tSET tPRINT tEXAM
%token tENABLE tDISABLE tBREAK tHBREAK tWATCH tDELETE tSET tPRINT tEXAM
%token tABORT tECHO
%token tABORT tECHO
%token tCLASS tMAPS tSTACK tSEGMENTS tSYMBOL tREGS tALLREGS tWND tQUEUE tLOCAL tEXCEPTION
%token tCLASS tMAPS tSTACK tSEGMENTS tSYMBOL tREGS tALLREGS tWND tQUEUE tLOCAL tEXCEPTION
%token tPROCESS tTHREAD t
MODREF t
EOL tEOF
%token tPROCESS tTHREAD tEOL tEOF
%token tFRAME tSHARE tCOND tDISPLAY tUNDISPLAY tDISASSEMBLE
%token tFRAME tSHARE t
MODULE t
COND tDISPLAY tUNDISPLAY tDISASSEMBLE
%token tSTEPI tNEXTI tFINISH tSHOW tDIR tWHATIS tSOURCE
%token tSTEPI tNEXTI tFINISH tSHOW tDIR tWHATIS tSOURCE
%token <string> tPATH tIDENTIFIER tSTRING tDEBUGSTR tINTVAR
%token <string> tPATH tIDENTIFIER tSTRING tDEBUGSTR tINTVAR
%token <integer> tNUM tFORMAT
%token <integer> tNUM tFORMAT
...
@@ -285,6 +285,8 @@ info_command:
...
@@ -285,6 +285,8 @@ info_command:
maintenance_command:
maintenance_command:
tMAINTENANCE tTYPE { print_types(); }
tMAINTENANCE tTYPE { print_types(); }
| tMAINTENANCE tMODULE tSTRING { tgt_module_load($3, FALSE); }
| tMAINTENANCE '*' tMODULE tSTRING { tgt_module_load($4, TRUE); }
;
;
noprocess_state:
noprocess_state:
...
...
programs/winedbg/debug.l
View file @
b2557f25
...
@@ -177,11 +177,12 @@ STRING \"[^\n"]+\"
...
@@ -177,11 +177,12 @@ STRING \"[^\n"]+\"
<INITIAL>whatis|whati|what { BEGIN(NOCMD); return tWHATIS; }
<INITIAL>whatis|whati|what { BEGIN(NOCMD); return tWHATIS; }
<INITIAL,NOPROCESS>run|ru|r { BEGIN(ASTRING_EXPECTED); return tRUN;}
<INITIAL,NOPROCESS>run|ru|r { BEGIN(ASTRING_EXPECTED); return tRUN;}
<INITIAL>detach|detac|deta|det { BEGIN(NOCMD); return tDETACH; }
<INITIAL>detach|detac|deta|det { BEGIN(NOCMD); return tDETACH; }
<INITIAL
>maintenance|maint
{ BEGIN(MAINT_CMD); return tMAINTENANCE; }
<INITIAL
,NOPROCESS>maintenance|maint
{ BEGIN(MAINT_CMD); return tMAINTENANCE; }
<INITIAL>minidump|mdmp { BEGIN(PATH_EXPECTED); return tMINIDUMP; }
<INITIAL>minidump|mdmp { BEGIN(PATH_EXPECTED); return tMINIDUMP; }
<INITIAL>echo { BEGIN(ASTRING_EXPECTED); return tECHO; }
<INITIAL>echo { BEGIN(ASTRING_EXPECTED); return tECHO; }
<NOPROCESS>attach|attac|atta|att { BEGIN(NOCMD); return tATTACH; }
<NOPROCESS>attach|attac|atta|att { BEGIN(NOCMD); return tATTACH; }
<INFO_CMD>share|shar|sha { return tSHARE; }
<INFO_CMD>share|shar|sha { return tSHARE; }
<MAINT_CMD>module|modul|mod { BEGIN(ASTRING_EXPECTED); return tMODULE; }
<INFO_CMD>locals|local|loca|loc { return tLOCAL; }
<INFO_CMD>locals|local|loca|loc { return tLOCAL; }
<INFO_CMD>class|clas|cla { return tCLASS; }
<INFO_CMD>class|clas|cla { return tCLASS; }
<INFO_CMD>process|proces|proce|proc { return tPROCESS; }
<INFO_CMD>process|proces|proce|proc { return tPROCESS; }
...
...
programs/winedbg/debugger.h
View file @
b2557f25
...
@@ -393,6 +393,9 @@ extern BOOL dbg_attach_debuggee(DWORD pid, BOOL cofe);
...
@@ -393,6 +393,9 @@ extern BOOL dbg_attach_debuggee(DWORD pid, BOOL cofe);
extern
void
minidump_write
(
const
char
*
,
const
EXCEPTION_RECORD
*
);
extern
void
minidump_write
(
const
char
*
,
const
EXCEPTION_RECORD
*
);
extern
enum
dbg_start
minidump_reload
(
int
argc
,
char
*
argv
[]);
extern
enum
dbg_start
minidump_reload
(
int
argc
,
char
*
argv
[]);
/* tgt_module.c */
extern
enum
dbg_start
tgt_module_load
(
const
char
*
name
,
BOOL
keep
);
/* types.c */
/* types.c */
extern
void
print_value
(
const
struct
dbg_lvalue
*
addr
,
char
format
,
int
level
);
extern
void
print_value
(
const
struct
dbg_lvalue
*
addr
,
char
format
,
int
level
);
extern
int
types_print_type
(
const
struct
dbg_type
*
,
BOOL
details
);
extern
int
types_print_type
(
const
struct
dbg_type
*
,
BOOL
details
);
...
...
programs/winedbg/tgt_module.c
0 → 100644
View file @
b2557f25
/*
* Wine debugger - loading a module for debug purposes
*
* Copyright 2006 Eric Pouech
*
* 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
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#define NONAMELESSUNION
#define NONAMELESSSTRUCT
#include "config.h"
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <stdarg.h>
#include "debugger.h"
#include "wine/debug.h"
WINE_DEFAULT_DEBUG_CHANNEL
(
winedbg
);
static
struct
be_process_io
be_process_module_io
;
static
BOOL
WINAPI
tgt_process_module_read
(
HANDLE
hProcess
,
const
void
*
addr
,
void
*
buffer
,
SIZE_T
len
,
SIZE_T
*
rlen
)
{
return
FALSE
;
}
static
BOOL
WINAPI
tgt_process_module_write
(
HANDLE
hProcess
,
void
*
addr
,
const
void
*
buffer
,
SIZE_T
len
,
SIZE_T
*
wlen
)
{
return
FALSE
;
}
enum
dbg_start
tgt_module_load
(
const
char
*
name
,
BOOL
keep
)
{
DWORD
opts
=
SymGetOptions
();
HANDLE
hDummy
=
(
HANDLE
)
0x87654321
;
SymSetOptions
((
opts
&
~
(
SYMOPT_UNDNAME
|
SYMOPT_DEFERRED_LOADS
))
|
SYMOPT_LOAD_LINES
|
SYMOPT_AUTO_PUBLICS
|
0x40000000
);
SymInitialize
(
hDummy
,
NULL
,
FALSE
);
SymLoadModule
(
hDummy
,
NULL
,
name
,
NULL
,
0
,
0
);
if
(
keep
)
{
dbg_printf
(
"Non supported mode... errors may occur
\n
"
"Use at your own risks
\n
"
);
SymSetOptions
(
SymGetOptions
()
|
0x40000000
);
dbg_curr_process
=
dbg_add_process
(
&
be_process_module_io
,
1
,
hDummy
);
dbg_curr_pid
=
1
;
/* FIXME: missing thread creation, fetching frames, restoring dbghelp's options... */
}
else
{
SymCleanup
(
hDummy
);
SymSetOptions
(
opts
);
}
return
start_ok
;
}
static
BOOL
tgt_process_module_close_process
(
struct
dbg_process
*
pcs
,
BOOL
kill
)
{
SymCleanup
(
pcs
->
handle
);
dbg_del_process
(
pcs
);
return
TRUE
;
}
static
struct
be_process_io
be_process_module_io
=
{
tgt_process_module_close_process
,
tgt_process_module_read
,
tgt_process_module_write
,
};
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment