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
6843fee6
Commit
6843fee6
authored
Jan 11, 2003
by
Eric Pouech
Committed by
Alexandre Julliard
Jan 11, 2003
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added 'info symbol' command to look for defined symbols.
parent
e9005937
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
66 additions
and
1 deletion
+66
-1
dbg.y
programs/winedbg/dbg.y
+2
-1
debug.l
programs/winedbg/debug.l
+1
-0
debugger.h
programs/winedbg/debugger.h
+1
-0
hash.c
programs/winedbg/hash.c
+62
-0
No files found.
programs/winedbg/dbg.y
View file @
6843fee6
...
...
@@ -52,7 +52,7 @@ int yyerror(char *);
%token tCONT tPASS tSTEP tLIST tNEXT tQUIT tHELP tBACKTRACE tINFO tWALK tUP tDOWN
%token tENABLE tDISABLE tBREAK tWATCH tDELETE tSET tMODE tPRINT tEXAM tABORT tVM86
%token tCLASS tMAPS tMODULE tSTACK tSEGMENTS tREGS tWND tQUEUE tLOCAL tEXCEPTION
%token tCLASS tMAPS tMODULE tSTACK tSEGMENTS t
SYMBOL t
REGS tWND tQUEUE tLOCAL tEXCEPTION
%token tPROCESS tTHREAD tMODREF tEOL tEOF
%token tFRAME tSHARE tCOND tDISPLAY tUNDISPLAY tDISASSEMBLE
%token tSTEPI tNEXTI tFINISH tSHOW tDIR tWHATIS tSOURCE
...
...
@@ -234,6 +234,7 @@ info_command:
| tINFO tSEGMENTS expr_value tEOL { DEBUG_InfoSegments( $3, 1 ); DEBUG_FreeExprMem(); }
| tINFO tSEGMENTS tEOL { DEBUG_InfoSegments( 0, -1 ); }
| tINFO tSTACK tEOL { DEBUG_InfoStack(); }
| tINFO tSYMBOL tSTRING { DEBUG_InfoSymbols($3); }
| tINFO tMAPS tEOL { DEBUG_InfoVirtual(); }
| tINFO tWND expr_value tEOL{ DEBUG_InfoWindow( (HWND)$3 ); DEBUG_FreeExprMem(); }
| tINFO tLOCAL tEOL { DEBUG_InfoLocals(); }
...
...
programs/winedbg/debug.l
View file @
6843fee6
...
...
@@ -152,6 +152,7 @@ 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>maps|map { return tMAPS; }
<INFO_CMD,WALK_CMD>window|windo|wind|win|wnd { return tWND; }
<HELP_CMD>info|inf|in { return tINFO; }
...
...
programs/winedbg/debugger.h
View file @
6843fee6
...
...
@@ -388,6 +388,7 @@ extern BOOL DEBUG_GetLineNumberAddr( const struct name_hash *, const int lineno,
extern
int
DEBUG_SetLocalSymbolType
(
struct
wine_locals
*
sym
,
struct
datatype
*
type
);
extern
BOOL
DEBUG_Normalize
(
struct
name_hash
*
nh
);
void
DEBUG_InfoSymbols
(
const
char
*
str
);
/* debugger/info.c */
extern
void
DEBUG_PrintBasic
(
const
DBG_VALUE
*
value
,
int
count
,
char
format
);
...
...
programs/winedbg/hash.c
View file @
6843fee6
...
...
@@ -1334,3 +1334,65 @@ int DEBUG_SetLocalSymbolType(struct wine_locals * sym, struct datatype * type)
return
TRUE
;
}
static
int
cmp_sym_by_name
(
const
void
*
p1
,
const
void
*
p2
)
{
struct
name_hash
**
name1
=
(
struct
name_hash
**
)
p1
;
struct
name_hash
**
name2
=
(
struct
name_hash
**
)
p2
;
return
strcmp
(
(
*
name1
)
->
name
,
(
*
name2
)
->
name
);
}
#include <regex.h>
void
DEBUG_InfoSymbols
(
const
char
*
str
)
{
int
i
;
struct
name_hash
*
nh
;
struct
name_hash
**
array
=
NULL
;
unsigned
num_used_array
=
0
;
unsigned
num_alloc_array
=
0
;
const
char
*
name
;
enum
dbg_mode
mode
;
regex_t
preg
;
regcomp
(
&
preg
,
str
,
REG_NOSUB
);
/* grab all symbols */
for
(
i
=
0
;
i
<
NR_NAME_HASH
;
i
++
)
{
for
(
nh
=
name_hash_table
[
i
];
nh
;
nh
=
nh
->
next
)
{
if
(
regexec
(
&
preg
,
nh
->
name
,
0
,
NULL
,
0
)
==
0
)
{
if
(
num_used_array
==
num_alloc_array
)
{
array
=
HeapReAlloc
(
GetProcessHeap
(),
0
,
array
,
sizeof
(
*
array
)
*
(
num_alloc_array
+=
32
));
if
(
!
array
)
return
;
}
array
[
num_used_array
++
]
=
nh
;
}
}
}
regfree
(
&
preg
);
/* now sort them by alphabetical order */
qsort
(
array
,
num_used_array
,
sizeof
(
*
array
),
cmp_sym_by_name
);
/* and display them */
for
(
i
=
0
;
i
<
num_used_array
;
i
++
)
{
mode
=
DEBUG_GetSelectorType
(
array
[
i
]
->
value
.
addr
.
seg
);
name
=
DEBUG_FindNearestSymbol
(
&
array
[
i
]
->
value
.
addr
,
TRUE
,
NULL
,
0
,
NULL
);
if
(
mode
!=
MODE_32
)
DEBUG_Printf
(
DBG_CHN_MESG
,
"%04lx:%04lx :"
,
array
[
i
]
->
value
.
addr
.
seg
&
0xFFFF
,
array
[
i
]
->
value
.
addr
.
off
);
else
DEBUG_Printf
(
DBG_CHN_MESG
,
"%08lx :"
,
array
[
i
]
->
value
.
addr
.
off
);
if
(
name
)
DEBUG_Printf
(
DBG_CHN_MESG
,
" %s
\n
"
,
name
);
}
HeapFree
(
GetProcessHeap
(),
0
,
array
);
}
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