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
8a65cdd1
Commit
8a65cdd1
authored
Mar 20, 2024
by
Eric Pouech
Committed by
Alexandre Julliard
Mar 21, 2024
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winedbg: Add ability to set executable name.
Either from command line option, or as a command. Mostly handy for scripting. Signed-off-by:
Eric Pouech
<
epouech@codeweavers.com
>
parent
5d91ab65
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
22 additions
and
6 deletions
+22
-6
dbg.y
programs/winedbg/dbg.y
+2
-1
debug.l
programs/winedbg/debug.l
+1
-0
debugger.h
programs/winedbg/debugger.h
+1
-0
tgt_active.c
programs/winedbg/tgt_active.c
+7
-0
winedbg.c
programs/winedbg/winedbg.c
+9
-5
winedbg.man.in
programs/winedbg/winedbg.man.in
+2
-0
No files found.
programs/winedbg/dbg.y
View file @
8a65cdd1
...
@@ -58,7 +58,7 @@ static void parser(const char*);
...
@@ -58,7 +58,7 @@ static void parser(const char*);
%token <string> tPATH tIDENTIFIER tSTRING tINTVAR
%token <string> tPATH tIDENTIFIER tSTRING tINTVAR
%token <integer> tNUM tFORMAT
%token <integer> tNUM tFORMAT
%token <type> tTYPEDEF
%token <type> tTYPEDEF
%token tSYMBOLFILE tRUN tATTACH tDETACH tKILL tMAINTENANCE tTYPE tMINIDUMP
%token tSYMBOLFILE t
EXECFILE t
RUN tATTACH tDETACH tKILL tMAINTENANCE tTYPE tMINIDUMP
%token tNOPROCESS tWOW
%token tNOPROCESS tWOW
/* can be prefixed by module name */
/* can be prefixed by module name */
...
@@ -146,6 +146,7 @@ command:
...
@@ -146,6 +146,7 @@ command:
| tKILL { dbg_curr_process->process_io->close_process(dbg_curr_process, TRUE); }
| tKILL { dbg_curr_process->process_io->close_process(dbg_curr_process, TRUE); }
| tMINIDUMP pathname { minidump_write($2, (dbg_curr_thread && dbg_curr_thread->in_exception) ? &dbg_curr_thread->excpt_record : NULL);}
| tMINIDUMP pathname { minidump_write($2, (dbg_curr_thread && dbg_curr_thread->in_exception) ? &dbg_curr_thread->excpt_record : NULL);}
| tECHO tSTRING { dbg_printf("%s\n", $2); }
| tECHO tSTRING { dbg_printf("%s\n", $2); }
| tEXECFILE pathname { dbg_set_exec_file($2); }
| run_command
| run_command
| list_command
| list_command
| disassemble_command
| disassemble_command
...
...
programs/winedbg/debug.l
View file @
8a65cdd1
...
@@ -224,6 +224,7 @@ STRING \"(\\[^\n]|[^\\"\n])*\"
...
@@ -224,6 +224,7 @@ STRING \"(\\[^\n]|[^\\"\n])*\"
<INITIAL>rwatch|rwatc|rwat { BEGIN(NOCMD); return tRWATCH; }
<INITIAL>rwatch|rwatc|rwat { BEGIN(NOCMD); return tRWATCH; }
<INITIAL>whatis|whati|what { BEGIN(NOCMD); return tWHATIS; }
<INITIAL>whatis|whati|what { BEGIN(NOCMD); return tWHATIS; }
<INITIAL,NOPROCESS>run|ru|r { BEGIN(AWORD_EXPECTED); return tRUN;}
<INITIAL,NOPROCESS>run|ru|r { BEGIN(AWORD_EXPECTED); return tRUN;}
<INITIAL,NOPROCESS>exec-file { BEGIN(PATH_EXPECTED); return tEXECFILE;}
<INITIAL>detach|detac|deta|det { BEGIN(NOCMD); return tDETACH; }
<INITIAL>detach|detac|deta|det { BEGIN(NOCMD); return tDETACH; }
<INITIAL>kill|kil|ki|k { BEGIN(NOCMD); return tKILL; }
<INITIAL>kill|kil|ki|k { BEGIN(NOCMD); return tKILL; }
<INITIAL,NOPROCESS>maintenance|maint { BEGIN(MAINT_CMD); return tMAINTENANCE; }
<INITIAL,NOPROCESS>maintenance|maint { BEGIN(MAINT_CMD); return tMAINTENANCE; }
...
...
programs/winedbg/debugger.h
View file @
8a65cdd1
...
@@ -474,6 +474,7 @@ struct list_string
...
@@ -474,6 +474,7 @@ struct list_string
char
*
string
;
char
*
string
;
struct
list_string
*
next
;
struct
list_string
*
next
;
};
};
extern
void
dbg_set_exec_file
(
const
char
*
path
);
extern
void
dbg_run_debuggee
(
struct
list_string
*
ls
);
extern
void
dbg_run_debuggee
(
struct
list_string
*
ls
);
extern
void
dbg_wait_next_exception
(
DWORD
cont
,
int
count
,
int
mode
);
extern
void
dbg_wait_next_exception
(
DWORD
cont
,
int
count
,
int
mode
);
extern
enum
dbg_start
dbg_active_attach
(
int
argc
,
char
*
argv
[]);
extern
enum
dbg_start
dbg_active_attach
(
int
argc
,
char
*
argv
[]);
...
...
programs/winedbg/tgt_active.c
View file @
8a65cdd1
...
@@ -87,6 +87,7 @@ BOOL dbg_attach_debuggee(DWORD pid)
...
@@ -87,6 +87,7 @@ BOOL dbg_attach_debuggee(DWORD pid)
SetEnvironmentVariableA
(
"DBGHELP_NOLIVE"
,
NULL
);
SetEnvironmentVariableA
(
"DBGHELP_NOLIVE"
,
NULL
);
dbg_curr_process
->
active_debuggee
=
TRUE
;
dbg_curr_process
->
active_debuggee
=
TRUE
;
dbg_printf
(
"WineDbg attached to pid %04lx
\n
"
,
dbg_curr_pid
);
return
TRUE
;
return
TRUE
;
}
}
...
@@ -670,6 +671,7 @@ static BOOL dbg_start_debuggee(LPSTR cmdLine)
...
@@ -670,6 +671,7 @@ static BOOL dbg_start_debuggee(LPSTR cmdLine)
free
(
dbg_last_cmd_line
);
free
(
dbg_last_cmd_line
);
dbg_last_cmd_line
=
cmdLine
;
dbg_last_cmd_line
=
cmdLine
;
}
}
dbg_printf
(
"WineDbg starting on pid %04lx
\n
"
,
dbg_curr_pid
);
return
TRUE
;
return
TRUE
;
}
}
...
@@ -755,6 +757,11 @@ static char *dbg_build_command_line( char **argv )
...
@@ -755,6 +757,11 @@ static char *dbg_build_command_line( char **argv )
return
ret
;
return
ret
;
}
}
void
dbg_set_exec_file
(
const
char
*
path
)
{
free
(
dbg_executable
);
dbg_executable
=
strdup
(
path
);
}
void
dbg_run_debuggee
(
struct
list_string
*
ls
)
void
dbg_run_debuggee
(
struct
list_string
*
ls
)
{
{
...
...
programs/winedbg/winedbg.c
View file @
8a65cdd1
...
@@ -637,11 +637,8 @@ void dbg_start_interactive(const char* filename, HANDLE hFile)
...
@@ -637,11 +637,8 @@ void dbg_start_interactive(const char* filename, HANDLE hFile)
struct
dbg_process
*
p
;
struct
dbg_process
*
p
;
struct
dbg_process
*
p2
;
struct
dbg_process
*
p2
;
if
(
dbg_curr_process
)
if
(
dbg_curr_process
&&
dbg_curr_process
->
active_debuggee
)
{
dbg_active_wait_for_first_exception
();
dbg_printf
(
"WineDbg starting on pid %04lx
\n
"
,
dbg_curr_pid
);
if
(
dbg_curr_process
->
active_debuggee
)
dbg_active_wait_for_first_exception
();
}
dbg_interactiveP
=
TRUE
;
dbg_interactiveP
=
TRUE
;
parser_handle
(
filename
,
hFile
);
parser_handle
(
filename
,
hFile
);
...
@@ -759,6 +756,13 @@ int main(int argc, char** argv)
...
@@ -759,6 +756,13 @@ int main(int argc, char** argv)
argc
--
;
argv
++
;
argc
--
;
argv
++
;
continue
;
continue
;
}
}
if
(
!
strcmp
(
argv
[
0
],
"--exec"
)
&&
argc
>
1
)
{
argc
--
;
argv
++
;
dbg_set_exec_file
(
argv
[
0
]);
argc
--
;
argv
++
;
continue
;
}
if
(
!
strcmp
(
argv
[
0
],
"--file"
)
&&
argc
>
1
)
if
(
!
strcmp
(
argv
[
0
],
"--file"
)
&&
argc
>
1
)
{
{
argc
--
;
argv
++
;
argc
--
;
argv
++
;
...
...
programs/winedbg/winedbg.man.in
View file @
8a65cdd1
...
@@ -61,6 +61,8 @@ When in \fBdefault\fR mode, the following options are available:
...
@@ -61,6 +61,8 @@ When in \fBdefault\fR mode, the following options are available:
\fBwinedbg\fR will execute the command \fIstring\fR as if it was keyed on
\fBwinedbg\fR will execute the command \fIstring\fR as if it was keyed on
winedbg command line, and then will exit. This can be handy for
winedbg command line, and then will exit. This can be handy for
getting the pid of running processes (winedbg --command "info proc").
getting the pid of running processes (winedbg --command "info proc").
.IP \fB--exec\ \fIfilename\fR
Sets the executable name, without starting the executable.
.IP \fB--file\ \fIfilename\fR
.IP \fB--file\ \fIfilename\fR
\fBwinedbg\fR will execute the list of commands contained in file
\fBwinedbg\fR will execute the list of commands contained in file
filename as if they were keyed on winedbg command line, and then
filename as if they were keyed on winedbg command line, and then
...
...
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