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
02ecb684
Commit
02ecb684
authored
Dec 21, 2001
by
Eric Pouech
Committed by
Alexandre Julliard
Dec 21, 2001
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed stabs parsing for GCC 3.0 (default types).
Added boolean type support. Simplified internal types handling.
parent
c19bb1ab
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
198 additions
and
149 deletions
+198
-149
break.c
debugger/break.c
+2
-2
dbg.y
debugger/dbg.y
+14
-14
debugger.h
debugger/debugger.h
+16
-9
expr.c
debugger/expr.c
+9
-8
info.c
debugger/info.c
+9
-5
intvar.h
debugger/intvar.h
+37
-37
memory.c
debugger/memory.c
+2
-2
msc.c
debugger/msc.c
+15
-15
stabs.c
debugger/stabs.c
+51
-3
types.c
debugger/types.c
+42
-53
winedbg.c
debugger/winedbg.c
+1
-1
No files found.
debugger/break.c
View file @
02ecb684
...
...
@@ -328,7 +328,7 @@ void DEBUG_AddBreakpoint( const DBG_VALUE *_value, BOOL (*func)(void) )
int
num
;
BYTE
ch
;
if
(
value
.
type
!=
NULL
&&
value
.
type
==
DEBUG_
TypeIntConst
)
if
(
value
.
type
!=
NULL
&&
value
.
type
==
DEBUG_
GetBasicType
(
DT_BASIC_CONST_INT
)
)
{
/*
* We know that we have the actual offset stored somewhere
...
...
@@ -460,7 +460,7 @@ void DEBUG_AddWatchpoint( const DBG_VALUE *_value, BOOL is_write )
DEBUG_FixAddress
(
&
value
.
addr
,
DEBUG_context
.
SegCs
);
#endif
if
(
value
.
type
!=
NULL
&&
value
.
type
==
DEBUG_
TypeIntConst
)
if
(
value
.
type
!=
NULL
&&
value
.
type
==
DEBUG_
GetBasicType
(
DT_BASIC_CONST_INT
)
)
{
/*
* We know that we have the actual offset stored somewhere
...
...
debugger/dbg.y
View file @
02ecb684
...
...
@@ -243,20 +243,20 @@ type_cast:
type_expr:
type_expr '*' { $$ = DEBUG_FindOrMakePointerType($1); }
|
tINT { $$ = DEBUG_TypeCast(DT_BASIC, "int"
); }
| tCHAR { $$ = DEBUG_
TypeCast(DT_BASIC, "char"
); }
| tLONG tINT { $$ = DEBUG_
TypeCast(DT_BASIC, "long int"
); }
| tUNSIGNED tINT { $$ = DEBUG_
TypeCast(DT_BASIC, "unsigned int"
); }
| tLONG tUNSIGNED tINT { $$ = DEBUG_
TypeCast(DT_BASIC, "long unsigned int"
); }
| tLONG tLONG tINT { $$ = DEBUG_
TypeCast(DT_BASIC, "long long int"
); }
| tLONG tLONG tUNSIGNED tINT{ $$ = DEBUG_
TypeCast(DT_BASIC, "long long unsigned int"
); }
| tSHORT tINT { $$ = DEBUG_
TypeCast(DT_BASIC, "short int"
); }
| tSHORT tUNSIGNED tINT { $$ = DEBUG_
TypeCast(DT_BASIC, "short unsigned int"
); }
| tSIGNED tCHAR { $$ = DEBUG_
TypeCast(DT_BASIC, "signed char"
); }
| tUNSIGNED tCHAR { $$ = DEBUG_
TypeCast(DT_BASIC, "unsigned char"
); }
| tFLOAT { $$ = DEBUG_
TypeCast(DT_BASIC, "float"
); }
| tDOUBLE { $$ = DEBUG_
TypeCast(DT_BASIC, "double"
); }
| tLONG tDOUBLE { $$ = DEBUG_
TypeCast(DT_BASIC, "long double"
); }
|
tINT { $$ = DEBUG_GetBasicType(DT_BASIC_INT
); }
| tCHAR { $$ = DEBUG_
GetBasicType(DT_BASIC_CHAR
); }
| tLONG tINT { $$ = DEBUG_
GetBasicType(DT_BASIC_LONGINT
); }
| tUNSIGNED tINT { $$ = DEBUG_
GetBasicType(DT_BASIC_UINT
); }
| tLONG tUNSIGNED tINT { $$ = DEBUG_
GetBasicType(DT_BASIC_ULONGINT
); }
| tLONG tLONG tINT { $$ = DEBUG_
GetBasicType(DT_BASIC_LONGLONGINT
); }
| tLONG tLONG tUNSIGNED tINT{ $$ = DEBUG_
GetBasicType(DT_BASIC_ULONGLONGINT
); }
| tSHORT tINT { $$ = DEBUG_
GetBasicType(DT_BASIC_SHORTINT
); }
| tSHORT tUNSIGNED tINT { $$ = DEBUG_
GetBasicType(DT_BASIC_USHORTINT
); }
| tSIGNED tCHAR { $$ = DEBUG_
GetBasicType(DT_BASIC_SCHAR
); }
| tUNSIGNED tCHAR { $$ = DEBUG_
GetBasicType(DT_BASIC_UCHAR
); }
| tFLOAT { $$ = DEBUG_
GetBasicType(DT_BASIC_FLOAT
); }
| tDOUBLE { $$ = DEBUG_
GetBasicType(DT_BASIC_DOUBLE
); }
| tLONG tDOUBLE { $$ = DEBUG_
GetBasicType(DT_BASIC_LONGDOUBLE
); }
| tSTRUCT tIDENTIFIER { $$ = DEBUG_TypeCast(DT_STRUCT, $2); }
| tUNION tIDENTIFIER { $$ = DEBUG_TypeCast(DT_STRUCT, $2); }
| tENUM tIDENTIFIER { $$ = DEBUG_TypeCast(DT_ENUM, $2); }
...
...
debugger/debugger.h
View file @
02ecb684
...
...
@@ -29,6 +29,21 @@
enum
debug_type
{
DT_BASIC
,
DT_POINTER
,
DT_ARRAY
,
DT_STRUCT
,
DT_ENUM
,
DT_FUNC
,
DT_BITFIELD
};
enum
debug_type_basic
{
DT_BASIC_INT
=
1
,
DT_BASIC_CHAR
,
DT_BASIC_LONGINT
,
DT_BASIC_UINT
,
DT_BASIC_ULONGINT
,
DT_BASIC_LONGLONGINT
,
DT_BASIC_ULONGLONGINT
,
DT_BASIC_SHORTINT
,
DT_BASIC_USHORTINT
,
DT_BASIC_SCHAR
,
DT_BASIC_UCHAR
,
DT_BASIC_FLOAT
,
DT_BASIC_LONGDOUBLE
,
DT_BASIC_DOUBLE
,
DT_BASIC_CMPLX_INT
,
DT_BASIC_CMPLX_FLOAT
,
DT_BASIC_CMPLX_DOUBLE
,
DT_BASIC_CMPLX_LONGDOUBLE
,
DT_BASIC_VOID
,
/* modifier on size isn't possible on current types definitions
* so we need to add more types... */
DT_BASIC_BOOL1
,
DT_BASIC_BOOL2
,
DT_BASIC_BOOL4
,
/* this is not really a basic type... */
DT_BASIC_STRING
,
/* this is for historical reasons... should take care of it RSN */
DT_BASIC_CONST_INT
,
/* to be kept as last... sentinel entry... do not use */
DT_BASIC_LAST
};
/*
* Return values for DEBUG_CheckLinenoStatus. Used to determine
...
...
@@ -39,15 +54,6 @@ enum debug_type {DT_BASIC, DT_POINTER, DT_ARRAY, DT_STRUCT, DT_ENUM,
#define AT_LINENUMBER (2)
#define FUNC_IS_TRAMPOLINE (3)
/*
* For constants generated by the parser, we use this datatype
*/
extern
struct
datatype
*
DEBUG_TypeShortUInt
;
extern
struct
datatype
*
DEBUG_TypeInt
;
extern
struct
datatype
*
DEBUG_TypeIntConst
;
extern
struct
datatype
*
DEBUG_TypeUSInt
;
extern
struct
datatype
*
DEBUG_TypeString
;
typedef
struct
{
DWORD
seg
;
/* 0xffffffff means current default segment (cs or ds) */
...
...
@@ -480,6 +486,7 @@ 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
struct
datatype
*
DEBUG_GetBasicType
(
enum
debug_type_basic
);
/* debugger/winedbg.c */
#define DBG_CHN_MESG 1
...
...
debugger/expr.c
View file @
02ecb684
...
...
@@ -314,19 +314,19 @@ DBG_VALUE DEBUG_EvalExpr(struct expr * exp)
rtn
.
cookie
=
DV_TARGET
;
break
;
case
EXPR_TYPE_STRING
:
rtn
.
type
=
DEBUG_
TypeString
;
rtn
.
type
=
DEBUG_
GetBasicType
(
DT_BASIC_STRING
)
;
rtn
.
cookie
=
DV_HOST
;
rtn
.
addr
.
off
=
(
unsigned
int
)
&
exp
->
un
.
string
.
str
;
rtn
.
addr
.
seg
=
0
;
break
;
case
EXPR_TYPE_CONST
:
rtn
.
type
=
DEBUG_
TypeIntConst
;
rtn
.
type
=
DEBUG_
GetBasicType
(
DT_BASIC_CONST_INT
)
;
rtn
.
cookie
=
DV_HOST
;
rtn
.
addr
.
off
=
(
unsigned
int
)
&
exp
->
un
.
constant
.
value
;
rtn
.
addr
.
seg
=
0
;
break
;
case
EXPR_TYPE_US_CONST
:
rtn
.
type
=
DEBUG_
TypeUSInt
;
rtn
.
type
=
DEBUG_
GetBasicType
(
DT_BASIC_USHORTINT
)
;
rtn
.
cookie
=
DV_HOST
;
rtn
.
addr
.
off
=
(
unsigned
int
)
&
exp
->
un
.
u_const
.
value
;
rtn
.
addr
.
seg
=
0
;
...
...
@@ -431,7 +431,7 @@ DBG_VALUE DEBUG_EvalExpr(struct expr * exp)
*/
exp
->
un
.
call
.
result
=
0
;
#endif
rtn
.
type
=
DEBUG_
TypeInt
;
rtn
.
type
=
DEBUG_
GetBasicType
(
DT_BASIC_INT
)
;
rtn
.
cookie
=
DV_HOST
;
rtn
.
addr
.
off
=
(
unsigned
int
)
&
exp
->
un
.
call
.
result
;
...
...
@@ -456,13 +456,14 @@ DBG_VALUE DEBUG_EvalExpr(struct expr * exp)
{
RaiseException
(
DEBUG_STATUS_BAD_TYPE
,
0
,
0
,
NULL
);
}
if
(
exp1
.
type
==
DEBUG_TypeIntConst
&&
exp2
.
type
==
DEBUG_TypeIntConst
)
if
(
exp1
.
type
==
DEBUG_GetBasicType
(
DT_BASIC_CONST_INT
)
&&
exp2
.
type
==
DEBUG_GetBasicType
(
DT_BASIC_CONST_INT
)
)
{
rtn
.
type
=
exp1
.
type
;
}
else
{
rtn
.
type
=
DEBUG_TypeInt
;
rtn
.
type
=
DEBUG_GetBasicType
(
DT_BASIC_INT
)
;
}
rtn
.
addr
.
seg
=
0
;
rtn
.
addr
.
off
=
(
unsigned
int
)
&
exp
->
un
.
binop
.
result
;
...
...
@@ -595,13 +596,13 @@ DBG_VALUE DEBUG_EvalExpr(struct expr * exp)
}
rtn
.
addr
.
seg
=
0
;
rtn
.
addr
.
off
=
(
unsigned
int
)
&
exp
->
un
.
unop
.
result
;
if
(
exp1
.
type
==
DEBUG_
TypeIntConst
)
if
(
exp1
.
type
==
DEBUG_
GetBasicType
(
DT_BASIC_CONST_INT
)
)
{
rtn
.
type
=
exp1
.
type
;
}
else
{
rtn
.
type
=
DEBUG_
TypeInt
;
rtn
.
type
=
DEBUG_
GetBasicType
(
DT_BASIC_INT
)
;
}
switch
(
exp
->
un
.
unop
.
unop_type
)
{
...
...
debugger/info.c
View file @
02ecb684
...
...
@@ -65,11 +65,7 @@ void DEBUG_PrintBasic( const DBG_VALUE* value, int count, char format )
case
0
:
if
(
default_format
!=
NULL
)
{
if
(
strstr
(
default_format
,
"%S"
)
==
NULL
)
{
DEBUG_nchar
+=
DEBUG_Printf
(
DBG_CHN_MESG
,
default_format
,
res
);
}
else
if
(
strstr
(
default_format
,
"%S"
)
!=
NULL
)
{
char
*
ptr
;
int
state
=
0
;
...
...
@@ -107,6 +103,14 @@ void DEBUG_PrintBasic( const DBG_VALUE* value, int count, char format )
}
}
}
else
if
(
strcmp
(
default_format
,
"%B"
)
==
0
)
{
DEBUG_nchar
+=
DEBUG_Printf
(
DBG_CHN_MESG
,
"%s"
,
res
?
"true"
:
"false"
);
}
else
{
DEBUG_nchar
+=
DEBUG_Printf
(
DBG_CHN_MESG
,
default_format
,
res
);
}
}
break
;
}
...
...
debugger/intvar.h
View file @
02ecb684
...
...
@@ -6,53 +6,53 @@
*/
/* break handling */
INTERNAL_VAR
(
BreakAllThreadsStartup
,
FALSE
,
NULL
,
D
EBUG_TypeIntConst
)
INTERNAL_VAR
(
BreakOnCritSectTimeOut
,
FALSE
,
NULL
,
D
EBUG_TypeIntConst
)
INTERNAL_VAR
(
BreakOnAttach
,
FALSE
,
NULL
,
D
EBUG_TypeIntConst
)
INTERNAL_VAR
(
BreakOnFirstChance
,
TRUE
,
NULL
,
D
EBUG_TypeIntConst
)
INTERNAL_VAR
(
BreakOnDllLoad
,
FALSE
,
NULL
,
D
EBUG_TypeIntConst
)
INTERNAL_VAR
(
BreakAllThreadsStartup
,
FALSE
,
NULL
,
D
T_BASIC_CONST_INT
)
INTERNAL_VAR
(
BreakOnCritSectTimeOut
,
FALSE
,
NULL
,
D
T_BASIC_CONST_INT
)
INTERNAL_VAR
(
BreakOnAttach
,
FALSE
,
NULL
,
D
T_BASIC_CONST_INT
)
INTERNAL_VAR
(
BreakOnFirstChance
,
TRUE
,
NULL
,
D
T_BASIC_CONST_INT
)
INTERNAL_VAR
(
BreakOnDllLoad
,
FALSE
,
NULL
,
D
T_BASIC_CONST_INT
)
/* output handling */
INTERNAL_VAR
(
ConChannelMask
,
DBG_CHN_MESG
,
NULL
,
D
EBUG_TypeIntConst
)
INTERNAL_VAR
(
StdChannelMask
,
0
,
NULL
,
D
EBUG_TypeIntConst
)
INTERNAL_VAR
(
UseXTerm
,
TRUE
,
NULL
,
D
EBUG_TypeIntConst
)
INTERNAL_VAR
(
ConChannelMask
,
DBG_CHN_MESG
,
NULL
,
D
T_BASIC_CONST_INT
)
INTERNAL_VAR
(
StdChannelMask
,
0
,
NULL
,
D
T_BASIC_CONST_INT
)
INTERNAL_VAR
(
UseXTerm
,
TRUE
,
NULL
,
D
T_BASIC_CONST_INT
)
/* debugging debugger */
INTERNAL_VAR
(
ExtDbgOnInvalidAddress
,
FALSE
,
NULL
,
D
EBUG_TypeIntConst
)
INTERNAL_VAR
(
ExtDbgOnInvalidAddress
,
FALSE
,
NULL
,
D
T_BASIC_CONST_INT
)
/* current process/thread */
INTERNAL_VAR
(
ThreadId
,
FALSE
,
&
DEBUG_CurrTid
,
D
EBUG_TypeIntConst
)
INTERNAL_VAR
(
ProcessId
,
FALSE
,
&
DEBUG_CurrPid
,
D
EBUG_TypeIntConst
)
INTERNAL_VAR
(
ThreadId
,
FALSE
,
&
DEBUG_CurrTid
,
D
T_BASIC_CONST_INT
)
INTERNAL_VAR
(
ProcessId
,
FALSE
,
&
DEBUG_CurrPid
,
D
T_BASIC_CONST_INT
)
/* context manipulation */
#ifdef __i386__
/* FIXME: 16 bit registers use imply that CPU is little endian, which is
* the case when running natively i386 code
*/
INTERNAL_VAR
(
eip
,
0
,
&
DEBUG_context
.
Eip
,
D
EBUG_TypeIntConst
)
INTERNAL_VAR
(
ip
,
0
,
&
DEBUG_context
.
Eip
,
D
EBUG_TypeShortUInt
)
INTERNAL_VAR
(
pc
,
0
,
&
DEBUG_context
.
Eip
,
D
EBUG_TypeIntConst
)
INTERNAL_VAR
(
flags
,
0
,
&
DEBUG_context
.
EFlags
,
D
EBUG_TypeIntConst
)
INTERNAL_VAR
(
esp
,
0
,
&
DEBUG_context
.
Esp
,
D
EBUG_TypeIntConst
)
INTERNAL_VAR
(
sp
,
0
,
&
DEBUG_context
.
Esp
,
D
EBUG_TypeShortUInt
)
INTERNAL_VAR
(
eax
,
0
,
&
DEBUG_context
.
Eax
,
D
EBUG_TypeIntConst
)
INTERNAL_VAR
(
ax
,
0
,
&
DEBUG_context
.
Eax
,
D
EBUG_TypeShortUInt
)
INTERNAL_VAR
(
ebx
,
0
,
&
DEBUG_context
.
Ebx
,
D
EBUG_TypeIntConst
)
INTERNAL_VAR
(
bx
,
0
,
&
DEBUG_context
.
Ebx
,
D
EBUG_TypeShortUInt
)
INTERNAL_VAR
(
ecx
,
0
,
&
DEBUG_context
.
Ecx
,
D
EBUG_TypeIntConst
)
INTERNAL_VAR
(
cx
,
0
,
&
DEBUG_context
.
Ecx
,
D
EBUG_TypeShortUInt
)
INTERNAL_VAR
(
edx
,
0
,
&
DEBUG_context
.
Edx
,
D
EBUG_TypeIntConst
)
INTERNAL_VAR
(
dx
,
0
,
&
DEBUG_context
.
Edx
,
D
EBUG_TypeShortUInt
)
INTERNAL_VAR
(
esi
,
0
,
&
DEBUG_context
.
Esi
,
D
EBUG_TypeIntConst
)
INTERNAL_VAR
(
si
,
0
,
&
DEBUG_context
.
Esi
,
D
EBUG_TypeShortUInt
)
INTERNAL_VAR
(
edi
,
0
,
&
DEBUG_context
.
Edi
,
D
EBUG_TypeIntConst
)
INTERNAL_VAR
(
di
,
0
,
&
DEBUG_context
.
Edi
,
D
EBUG_TypeShortUInt
)
INTERNAL_VAR
(
ebp
,
0
,
&
DEBUG_context
.
Ebp
,
D
EBUG_TypeIntConst
)
INTERNAL_VAR
(
bp
,
0
,
&
DEBUG_context
.
Ebp
,
D
EBUG_TypeShortUInt
)
INTERNAL_VAR
(
es
,
0
,
&
DEBUG_context
.
SegEs
,
D
EBUG_TypeIntConst
)
INTERNAL_VAR
(
ds
,
0
,
&
DEBUG_context
.
SegDs
,
D
EBUG_TypeIntConst
)
INTERNAL_VAR
(
cs
,
0
,
&
DEBUG_context
.
SegCs
,
D
EBUG_TypeIntConst
)
INTERNAL_VAR
(
ss
,
0
,
&
DEBUG_context
.
SegSs
,
D
EBUG_TypeIntConst
)
INTERNAL_VAR
(
fs
,
0
,
&
DEBUG_context
.
SegFs
,
D
EBUG_TypeIntConst
)
INTERNAL_VAR
(
gs
,
0
,
&
DEBUG_context
.
SegGs
,
D
EBUG_TypeIntConst
)
INTERNAL_VAR
(
eip
,
0
,
&
DEBUG_context
.
Eip
,
D
T_BASIC_CONST_INT
)
INTERNAL_VAR
(
ip
,
0
,
&
DEBUG_context
.
Eip
,
D
T_BASIC_USHORTINT
)
INTERNAL_VAR
(
pc
,
0
,
&
DEBUG_context
.
Eip
,
D
T_BASIC_CONST_INT
)
INTERNAL_VAR
(
flags
,
0
,
&
DEBUG_context
.
EFlags
,
D
T_BASIC_CONST_INT
)
INTERNAL_VAR
(
esp
,
0
,
&
DEBUG_context
.
Esp
,
D
T_BASIC_CONST_INT
)
INTERNAL_VAR
(
sp
,
0
,
&
DEBUG_context
.
Esp
,
D
T_BASIC_USHORTINT
)
INTERNAL_VAR
(
eax
,
0
,
&
DEBUG_context
.
Eax
,
D
T_BASIC_CONST_INT
)
INTERNAL_VAR
(
ax
,
0
,
&
DEBUG_context
.
Eax
,
D
T_BASIC_USHORTINT
)
INTERNAL_VAR
(
ebx
,
0
,
&
DEBUG_context
.
Ebx
,
D
T_BASIC_CONST_INT
)
INTERNAL_VAR
(
bx
,
0
,
&
DEBUG_context
.
Ebx
,
D
T_BASIC_USHORTINT
)
INTERNAL_VAR
(
ecx
,
0
,
&
DEBUG_context
.
Ecx
,
D
T_BASIC_CONST_INT
)
INTERNAL_VAR
(
cx
,
0
,
&
DEBUG_context
.
Ecx
,
D
T_BASIC_USHORTINT
)
INTERNAL_VAR
(
edx
,
0
,
&
DEBUG_context
.
Edx
,
D
T_BASIC_CONST_INT
)
INTERNAL_VAR
(
dx
,
0
,
&
DEBUG_context
.
Edx
,
D
T_BASIC_USHORTINT
)
INTERNAL_VAR
(
esi
,
0
,
&
DEBUG_context
.
Esi
,
D
T_BASIC_CONST_INT
)
INTERNAL_VAR
(
si
,
0
,
&
DEBUG_context
.
Esi
,
D
T_BASIC_USHORTINT
)
INTERNAL_VAR
(
edi
,
0
,
&
DEBUG_context
.
Edi
,
D
T_BASIC_CONST_INT
)
INTERNAL_VAR
(
di
,
0
,
&
DEBUG_context
.
Edi
,
D
T_BASIC_USHORTINT
)
INTERNAL_VAR
(
ebp
,
0
,
&
DEBUG_context
.
Ebp
,
D
T_BASIC_CONST_INT
)
INTERNAL_VAR
(
bp
,
0
,
&
DEBUG_context
.
Ebp
,
D
T_BASIC_USHORTINT
)
INTERNAL_VAR
(
es
,
0
,
&
DEBUG_context
.
SegEs
,
D
T_BASIC_CONST_INT
)
INTERNAL_VAR
(
ds
,
0
,
&
DEBUG_context
.
SegDs
,
D
T_BASIC_CONST_INT
)
INTERNAL_VAR
(
cs
,
0
,
&
DEBUG_context
.
SegCs
,
D
T_BASIC_CONST_INT
)
INTERNAL_VAR
(
ss
,
0
,
&
DEBUG_context
.
SegSs
,
D
T_BASIC_CONST_INT
)
INTERNAL_VAR
(
fs
,
0
,
&
DEBUG_context
.
SegFs
,
D
T_BASIC_CONST_INT
)
INTERNAL_VAR
(
gs
,
0
,
&
DEBUG_context
.
SegGs
,
D
T_BASIC_CONST_INT
)
#endif
debugger/memory.c
View file @
02ecb684
...
...
@@ -212,7 +212,7 @@ BOOL DEBUG_GrabAddress( DBG_VALUE* value, BOOL fromCode )
* and hope that this is a sensible thing to do.
*/
if
(
value
->
type
!=
NULL
)
{
if
(
value
->
type
==
DEBUG_
TypeIntConst
)
{
if
(
value
->
type
==
DEBUG_
GetBasicType
(
DT_BASIC_CONST_INT
)
)
{
/*
* We know that we have the actual offset stored somewhere
* else in 32-bit space. Grab it, and we
...
...
@@ -227,7 +227,7 @@ BOOL DEBUG_GrabAddress( DBG_VALUE* value, BOOL fromCode )
if
(
DEBUG_TypeDerefPointer
(
value
,
&
testtype
)
==
0
)
return
FALSE
;
if
(
testtype
!=
NULL
||
value
->
type
==
DEBUG_
TypeIntConst
)
if
(
testtype
!=
NULL
||
value
->
type
==
DEBUG_
GetBasicType
(
DT_BASIC_CONST_INT
)
)
value
->
addr
.
off
=
DEBUG_GetExprValue
(
value
,
NULL
);
}
}
else
if
(
!
value
->
addr
.
seg
&&
!
value
->
addr
.
off
)
{
...
...
debugger/msc.c
View file @
02ecb684
...
...
@@ -1104,21 +1104,21 @@ DEBUG_InitCVDataTypes(void)
*/
cv_basic_types
[
T_NOTYPE
]
=
NULL
;
cv_basic_types
[
T_ABS
]
=
NULL
;
cv_basic_types
[
T_VOID
]
=
DEBUG_
NewDataType
(
DT_BASIC
,
"void"
);
cv_basic_types
[
T_CHAR
]
=
DEBUG_
NewDataType
(
DT_BASIC
,
"char"
);
cv_basic_types
[
T_SHORT
]
=
DEBUG_
NewDataType
(
DT_BASIC
,
"short int"
);
cv_basic_types
[
T_LONG
]
=
DEBUG_
NewDataType
(
DT_BASIC
,
"long int"
);
cv_basic_types
[
T_QUAD
]
=
DEBUG_
NewDataType
(
DT_BASIC
,
"long long int"
);
cv_basic_types
[
T_UCHAR
]
=
DEBUG_
NewDataType
(
DT_BASIC
,
"unsigned char"
);
cv_basic_types
[
T_USHORT
]
=
DEBUG_
NewDataType
(
DT_BASIC
,
"short unsigned int"
);
cv_basic_types
[
T_ULONG
]
=
DEBUG_
NewDataType
(
DT_BASIC
,
"long unsigned int"
);
cv_basic_types
[
T_UQUAD
]
=
DEBUG_
NewDataType
(
DT_BASIC
,
"long long unsigned int"
);
cv_basic_types
[
T_REAL32
]
=
DEBUG_
NewDataType
(
DT_BASIC
,
"float"
);
cv_basic_types
[
T_REAL64
]
=
DEBUG_
NewDataType
(
DT_BASIC
,
"double"
);
cv_basic_types
[
T_RCHAR
]
=
DEBUG_
NewDataType
(
DT_BASIC
,
"char"
);
cv_basic_types
[
T_WCHAR
]
=
DEBUG_
NewDataType
(
DT_BASIC
,
"short"
);
cv_basic_types
[
T_INT4
]
=
DEBUG_
NewDataType
(
DT_BASIC
,
"int"
);
cv_basic_types
[
T_UINT4
]
=
DEBUG_
NewDataType
(
DT_BASIC
,
"unsigned int"
);
cv_basic_types
[
T_VOID
]
=
DEBUG_
GetBasicType
(
DT_BASIC_VOID
);
cv_basic_types
[
T_CHAR
]
=
DEBUG_
GetBasicType
(
DT_BASIC_CHAR
);
cv_basic_types
[
T_SHORT
]
=
DEBUG_
GetBasicType
(
DT_BASIC_SHORTINT
);
cv_basic_types
[
T_LONG
]
=
DEBUG_
GetBasicType
(
DT_BASIC_LONGINT
);
cv_basic_types
[
T_QUAD
]
=
DEBUG_
GetBasicType
(
DT_BASIC_LONGLONGINT
);
cv_basic_types
[
T_UCHAR
]
=
DEBUG_
GetBasicType
(
DT_BASIC_UCHAR
);
cv_basic_types
[
T_USHORT
]
=
DEBUG_
GetBasicType
(
DT_BASIC_USHORTINT
);
cv_basic_types
[
T_ULONG
]
=
DEBUG_
GetBasicType
(
DT_BASIC_ULONGINT
);
cv_basic_types
[
T_UQUAD
]
=
DEBUG_
GetBasicType
(
DT_BASIC_ULONGLONGINT
);
cv_basic_types
[
T_REAL32
]
=
DEBUG_
GetBasicType
(
DT_BASIC_FLOAT
);
cv_basic_types
[
T_REAL64
]
=
DEBUG_
GetBasicType
(
DT_BASIC_DOUBLE
);
cv_basic_types
[
T_RCHAR
]
=
DEBUG_
GetBasicType
(
DT_BASIC_CHAR
);
cv_basic_types
[
T_WCHAR
]
=
DEBUG_
GetBasicType
(
DT_BASIC_SHORTINT
);
cv_basic_types
[
T_INT4
]
=
DEBUG_
GetBasicType
(
DT_BASIC_INT
);
cv_basic_types
[
T_UINT4
]
=
DEBUG_
GetBasicType
(
DT_BASIC_UINT
);
cv_basic_types
[
T_32PVOID
]
=
DEBUG_FindOrMakePointerType
(
cv_basic_types
[
T_VOID
]);
cv_basic_types
[
T_32PCHAR
]
=
DEBUG_FindOrMakePointerType
(
cv_basic_types
[
T_CHAR
]);
...
...
debugger/stabs.c
View file @
02ecb684
...
...
@@ -395,7 +395,7 @@ static inline int DEBUG_PTS_ReadArray(struct ParseTypedefData* ptd, struct datat
static
int
DEBUG_PTS_ReadTypedef
(
struct
ParseTypedefData
*
ptd
,
const
char
*
typename
,
struct
datatype
**
ret_dt
)
{
int
idx
,
lo
,
hi
;
int
idx
,
lo
,
hi
,
sz
=
-
1
;
struct
datatype
*
new_dt
=
NULL
;
/* newly created data type */
struct
datatype
*
ref_dt
;
/* referenced data type (pointer...) */
struct
datatype
*
dt1
;
/* intermediate data type (scope is limited) */
...
...
@@ -422,7 +422,7 @@ static int DEBUG_PTS_ReadTypedef(struct ParseTypedefData* ptd, const char* typen
case
'@'
:
if
(
*++
ptd
->
ptr
==
's'
)
{
ptd
->
ptr
++
;
if
(
DEBUG_PTS_ReadNum
(
ptd
,
&
lo
)
==
-
1
)
{
if
(
DEBUG_PTS_ReadNum
(
ptd
,
&
sz
)
==
-
1
)
{
DEBUG_Printf
(
DBG_CHN_MESG
,
"Not an attribute... NIY
\n
"
);
ptd
->
ptr
-=
2
;
return
-
1
;
...
...
@@ -516,8 +516,56 @@ static int DEBUG_PTS_ReadTypedef(struct ParseTypedefData* ptd, const char* typen
new_dt
=
DEBUG_NewDataType
(
lo
,
ptd
->
buf
+
idx
);
ptd
->
idx
=
idx
;
break
;
case
'-'
:
if
(
DEBUG_PTS_ReadNum
(
ptd
,
&
lo
)
==
-
1
)
{
DEBUG_Printf
(
DBG_CHN_MESG
,
"Should be a number (%s)...
\n
"
,
ptd
->
ptr
);
return
-
1
;
}
else
{
enum
debug_type_basic
basic
=
DT_BASIC_LAST
;
switch
(
lo
)
{
case
1
:
basic
=
DT_BASIC_INT
;
break
;
case
2
:
basic
=
DT_BASIC_CHAR
;
break
;
case
3
:
basic
=
DT_BASIC_SHORTINT
;
break
;
case
4
:
basic
=
DT_BASIC_LONGINT
;
break
;
case
5
:
basic
=
DT_BASIC_UCHAR
;
break
;
case
6
:
basic
=
DT_BASIC_SCHAR
;
break
;
case
7
:
basic
=
DT_BASIC_USHORTINT
;
break
;
case
8
:
basic
=
DT_BASIC_UINT
;
break
;
/* case 9: basic = DT_BASIC_UINT"; */
case
10
:
basic
=
DT_BASIC_ULONGINT
;
break
;
case
11
:
basic
=
DT_BASIC_VOID
;
break
;
case
12
:
basic
=
DT_BASIC_FLOAT
;
break
;
case
13
:
basic
=
DT_BASIC_DOUBLE
;
break
;
case
14
:
basic
=
DT_BASIC_LONGDOUBLE
;
break
;
/* case 15: basic = DT_BASIC_INT; break; */
case
16
:
switch
(
sz
)
{
case
32
:
basic
=
DT_BASIC_BOOL1
;
break
;
case
16
:
basic
=
DT_BASIC_BOOL2
;
break
;
case
8
:
basic
=
DT_BASIC_BOOL4
;
break
;
}
break
;
/* case 17: basic = DT_BASIC_SHORT real; break; */
/* case 18: basic = DT_BASIC_REAL; break; */
case
25
:
basic
=
DT_BASIC_CMPLX_FLOAT
;
break
;
case
26
:
basic
=
DT_BASIC_CMPLX_DOUBLE
;
break
;
/* case 30: basic = DT_BASIC_wchar"; break; */
case
31
:
basic
=
DT_BASIC_LONGLONGINT
;
break
;
case
32
:
basic
=
DT_BASIC_ULONGLONGINT
;
break
;
default:
DEBUG_Printf
(
DBG_CHN_MESG
,
"Unsupported integral type (%d/%d)
\n
"
,
lo
,
sz
);
return
-
1
;
}
if
(
!
(
new_dt
=
DEBUG_GetBasicType
(
basic
)))
{
DEBUG_Printf
(
DBG_CHN_MESG
,
"Basic type %d not found
\n
"
,
basic
);
return
-
1
;
}
if
(
*
ptd
->
ptr
++
!=
';'
)
return
-
1
;
}
break
;
default:
DEBUG_Printf
(
DBG_CHN_MESG
,
"Unknown type '%c'
\n
"
,
*
ptd
->
ptr
);
DEBUG_Printf
(
DBG_CHN_MESG
,
"Unknown type '%c'
\n
"
,
ptd
->
ptr
[
-
1
]
);
return
-
1
;
}
}
...
...
debugger/types.c
View file @
02ecb684
...
...
@@ -87,36 +87,12 @@ struct datatype
}
un
;
};
#define BASIC_INT 1
#define BASIC_CHAR 2
#define BASIC_LONG 3
#define BASIC_UINT 4
#define BASIC_LUI 5
#define BASIC_LONGLONG 6
#define BASIC_ULONGLONGI 7
#define BASIC_SHORT 8
#define BASIC_SHORTUI 9
#define BASIC_SCHAR 10
#define BASIC_UCHAR 11
#define BASIC_FLT 12
#define BASIC_LONG_DOUBLE 13
#define BASIC_DOUBLE 14
#define BASIC_CMPLX_INT 15
#define BASIC_CMPLX_FLT 16
#define BASIC_CMPLX_DBL 17
#define BASIC_CMPLX_LONG_DBL 18
#define BASIC_VOID 19
struct
datatype
*
DEBUG_TypeInt
=
NULL
;
struct
datatype
*
DEBUG_TypeIntConst
=
NULL
;
struct
datatype
*
DEBUG_TypeUSInt
=
NULL
;
struct
datatype
*
DEBUG_TypeString
=
NULL
;
struct
datatype
*
DEBUG_TypeShortUInt
=
NULL
;
/*
* All of the types that have been defined so far.
*/
static
struct
datatype
*
type_hash_table
[
NR_TYPE_HASH
+
1
];
static
struct
datatype
*
pointer_types
=
NULL
;
static
struct
datatype
*
basic_types
[
DT_BASIC_LAST
];
static
unsigned
int
type_hash
(
const
char
*
name
)
{
...
...
@@ -168,6 +144,7 @@ DEBUG_InitBasic(int type, char * name, int size, int b_signed,
dt
->
un
.
basic
.
basic_size
=
size
;
dt
->
un
.
basic
.
b_signed
=
b_signed
;
dt
->
un
.
basic
.
output_format
=
output_format
;
basic_types
[
type
]
=
dt
;
}
return
dt
;
...
...
@@ -200,6 +177,16 @@ DEBUG_LookupDataType(enum debug_type xtype, int hash, const char * typename)
}
struct
datatype
*
DEBUG_GetBasicType
(
enum
debug_type_basic
basic
)
{
if
(
basic
==
0
||
basic
>=
DT_BASIC_LAST
)
{
return
NULL
;
}
return
basic_types
[
basic
];
}
struct
datatype
*
DEBUG_NewDataType
(
enum
debug_type
xtype
,
const
char
*
typename
)
{
struct
datatype
*
dt
=
NULL
;
...
...
@@ -293,7 +280,6 @@ void
DEBUG_InitTypes
(
void
)
{
static
int
beenhere
=
0
;
struct
datatype
*
chartype
;
if
(
beenhere
++
!=
0
)
{
...
...
@@ -301,36 +287,39 @@ DEBUG_InitTypes(void)
}
/*
*
Special version of int used with constants of various kind
s.
*
Initialize a few builtin type
s.
*/
DEBUG_TypeIntConst
=
DEBUG_InitBasic
(
BASIC_INT
,
NULL
,
4
,
1
,
"%d"
);
DEBUG_InitBasic
(
DT_BASIC_INT
,
"int"
,
4
,
1
,
"%d"
);
DEBUG_InitBasic
(
DT_BASIC_CHAR
,
"char"
,
1
,
1
,
"'%c'"
);
DEBUG_InitBasic
(
DT_BASIC_LONGINT
,
"long int"
,
4
,
1
,
"%d"
);
DEBUG_InitBasic
(
DT_BASIC_UINT
,
"unsigned int"
,
4
,
0
,
"%d"
);
DEBUG_InitBasic
(
DT_BASIC_ULONGINT
,
"long unsigned int"
,
4
,
0
,
"%d"
);
DEBUG_InitBasic
(
DT_BASIC_LONGLONGINT
,
"long long int"
,
8
,
1
,
"%ld"
);
DEBUG_InitBasic
(
DT_BASIC_ULONGLONGINT
,
"long long unsigned int"
,
8
,
0
,
"%ld"
);
DEBUG_InitBasic
(
DT_BASIC_SHORTINT
,
"short int"
,
2
,
1
,
"%d"
);
DEBUG_InitBasic
(
DT_BASIC_USHORTINT
,
"short unsigned int"
,
2
,
0
,
"%d"
);
DEBUG_InitBasic
(
DT_BASIC_SCHAR
,
"signed char"
,
1
,
1
,
"'%c'"
);
DEBUG_InitBasic
(
DT_BASIC_UCHAR
,
"unsigned char"
,
1
,
0
,
"'%c'"
);
DEBUG_InitBasic
(
DT_BASIC_FLOAT
,
"float"
,
4
,
0
,
"%f"
);
DEBUG_InitBasic
(
DT_BASIC_DOUBLE
,
"long double"
,
12
,
0
,
NULL
);
DEBUG_InitBasic
(
DT_BASIC_LONGDOUBLE
,
"double"
,
8
,
0
,
"%lf"
);
DEBUG_InitBasic
(
DT_BASIC_CMPLX_INT
,
"complex int"
,
8
,
1
,
NULL
);
DEBUG_InitBasic
(
DT_BASIC_CMPLX_FLOAT
,
"complex float"
,
8
,
0
,
NULL
);
DEBUG_InitBasic
(
DT_BASIC_CMPLX_DOUBLE
,
"complex double"
,
16
,
0
,
NULL
);
DEBUG_InitBasic
(
DT_BASIC_CMPLX_LONGDOUBLE
,
"complex long double"
,
24
,
0
,
NULL
);
DEBUG_InitBasic
(
DT_BASIC_VOID
,
"void"
,
0
,
0
,
NULL
);
DEBUG_InitBasic
(
DT_BASIC_BOOL1
,
NULL
,
1
,
0
,
"%B"
);
DEBUG_InitBasic
(
DT_BASIC_BOOL2
,
NULL
,
2
,
0
,
"%B"
);
DEBUG_InitBasic
(
DT_BASIC_BOOL4
,
NULL
,
4
,
0
,
"%B"
);
basic_types
[
DT_BASIC_STRING
]
=
DEBUG_NewDataType
(
DT_POINTER
,
NULL
);
DEBUG_SetPointerType
(
basic_types
[
DT_BASIC_STRING
],
basic_types
[
DT_BASIC_CHAR
]);
/*
*
Initialize a few builtin type
s.
*
Special version of int used with constants of various kind
s.
*/
DEBUG_TypeInt
=
DEBUG_InitBasic
(
BASIC_INT
,
"int"
,
4
,
1
,
"%d"
);
chartype
=
DEBUG_InitBasic
(
BASIC_CHAR
,
"char"
,
1
,
1
,
"'%c'"
);
DEBUG_InitBasic
(
BASIC_LONG
,
"long int"
,
4
,
1
,
"%d"
);
DEBUG_TypeUSInt
=
DEBUG_InitBasic
(
BASIC_UINT
,
"unsigned int"
,
4
,
0
,
"%d"
);
DEBUG_InitBasic
(
BASIC_LUI
,
"long unsigned int"
,
4
,
0
,
"%d"
);
DEBUG_InitBasic
(
BASIC_LONGLONG
,
"long long int"
,
8
,
1
,
"%ld"
);
DEBUG_InitBasic
(
BASIC_ULONGLONGI
,
"long long unsigned int"
,
8
,
0
,
"%ld"
);
DEBUG_InitBasic
(
BASIC_SHORT
,
"short int"
,
2
,
1
,
"%d"
);
DEBUG_TypeShortUInt
=
DEBUG_InitBasic
(
BASIC_SHORTUI
,
"short unsigned int"
,
2
,
0
,
"%d"
);
DEBUG_InitBasic
(
BASIC_SCHAR
,
"signed char"
,
1
,
1
,
"'%c'"
);
DEBUG_InitBasic
(
BASIC_UCHAR
,
"unsigned char"
,
1
,
0
,
"'%c'"
);
DEBUG_InitBasic
(
BASIC_FLT
,
"float"
,
4
,
0
,
"%f"
);
DEBUG_InitBasic
(
BASIC_LONG_DOUBLE
,
"double"
,
8
,
0
,
"%lf"
);
DEBUG_InitBasic
(
BASIC_DOUBLE
,
"long double"
,
12
,
0
,
NULL
);
DEBUG_InitBasic
(
BASIC_CMPLX_INT
,
"complex int"
,
8
,
1
,
NULL
);
DEBUG_InitBasic
(
BASIC_CMPLX_FLT
,
"complex float"
,
8
,
0
,
NULL
);
DEBUG_InitBasic
(
BASIC_CMPLX_DBL
,
"complex double"
,
16
,
0
,
NULL
);
DEBUG_InitBasic
(
BASIC_CMPLX_LONG_DBL
,
"complex long double"
,
24
,
0
,
NULL
);
DEBUG_InitBasic
(
BASIC_VOID
,
"void"
,
0
,
0
,
NULL
);
DEBUG_TypeString
=
DEBUG_NewDataType
(
DT_POINTER
,
NULL
);
DEBUG_SetPointerType
(
DEBUG_TypeString
,
chartype
);
DEBUG_InitBasic
(
DT_BASIC_CONST_INT
,
NULL
,
4
,
1
,
"%d"
);
/*
* Now initialize the builtins for codeview.
...
...
@@ -381,7 +370,7 @@ DEBUG_GetExprValue(const DBG_VALUE* _value, char** format)
rtn
=
rtn
|
((
-
1
)
<<
(
value
.
type
->
un
.
basic
.
basic_size
*
8
));
}
/* float type has to be promoted as a double */
if
(
value
.
type
->
un
.
basic
.
basic_type
==
BASIC_FL
T
)
{
if
(
value
.
type
->
un
.
basic
.
basic_type
==
DT_BASIC_FLOA
T
)
{
float
f
;
double
d
;
memcpy
(
&
f
,
&
rtn
,
sizeof
(
f
));
...
...
debugger/winedbg.c
View file @
02ecb684
...
...
@@ -72,7 +72,7 @@ static BOOL DEBUG_IntVarsRW(int read)
/* initializes internal vars table */
#define INTERNAL_VAR(_var,_val,_ref,_typ) \
div->val = _val; div->name = #_var; div->pval = _ref; \
div->type =
_typ
; div++;
div->type =
DEBUG_GetBasicType(_typ)
; div++;
#include "intvar.h"
#undef INTERNAL_VAR
}
...
...
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