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
4304aee8
Commit
4304aee8
authored
Oct 22, 2000
by
Eric Pouech
Committed by
Alexandre Julliard
Oct 22, 2000
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed floating point data printing and made basic types reading more
robust.
parent
e7b84a9b
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
34 additions
and
42 deletions
+34
-42
types.c
debugger/types.c
+34
-42
No files found.
debugger/types.c
View file @
4304aee8
...
@@ -340,9 +340,10 @@ DEBUG_InitTypes(void)
...
@@ -340,9 +340,10 @@ DEBUG_InitTypes(void)
}
}
long
long
int
long
long
int
DEBUG_GetExprValue
(
const
DBG_VALUE
*
_value
,
char
**
format
)
DEBUG_GetExprValue
(
const
DBG_VALUE
*
_value
,
char
**
format
)
{
{
unsigned
int
rtn
;
long
long
int
rtn
;
unsigned
int
rtn2
;
struct
datatype
*
type2
=
NULL
;
struct
datatype
*
type2
=
NULL
;
struct
en_values
*
e
;
struct
en_values
*
e
;
char
*
def_format
=
"0x%x"
;
char
*
def_format
=
"0x%x"
;
...
@@ -350,18 +351,21 @@ DEBUG_GetExprValue(const DBG_VALUE *_value, char ** format)
...
@@ -350,18 +351,21 @@ DEBUG_GetExprValue(const DBG_VALUE *_value, char ** format)
assert
(
_value
->
cookie
==
DV_TARGET
||
_value
->
cookie
==
DV_HOST
);
assert
(
_value
->
cookie
==
DV_TARGET
||
_value
->
cookie
==
DV_HOST
);
rtn
=
0
;
rtn
=
0
;
rtn2
=
0
;
/* FIXME? I don't quite get this...
/* FIXME? I don't quite get this...
* if this is wrong, value.addr shall be linearized
* if this is wrong, value.addr shall be linearized
*/
*/
value
.
addr
.
seg
=
0
;
value
.
addr
.
seg
=
0
;
assert
(
value
.
type
!=
NULL
);
assert
(
value
.
type
!=
NULL
);
switch
(
value
.
type
->
type
)
switch
(
value
.
type
->
type
)
{
{
case
DT_BASIC
:
case
DT_BASIC
:
rtn
=
0
;
if
(
value
.
type
->
un
.
basic
.
basic_size
>
sizeof
(
rtn
))
{
DEBUG_Printf
(
DBG_CHN_ERR
,
"Size too large (%d)
\n
"
,
value
.
type
->
un
.
basic
.
basic_size
);
return
0
;
}
/* FIXME: following code implies i386 byte ordering */
/* FIXME: following code implies i386 byte ordering */
if
(
_value
->
cookie
==
DV_TARGET
)
{
if
(
_value
->
cookie
==
DV_TARGET
)
{
if
(
!
DEBUG_READ_MEM_VERBOSE
((
void
*
)
value
.
addr
.
off
,
&
rtn
,
if
(
!
DEBUG_READ_MEM_VERBOSE
((
void
*
)
value
.
addr
.
off
,
&
rtn
,
...
@@ -371,86 +375,75 @@ DEBUG_GetExprValue(const DBG_VALUE *_value, char ** format)
...
@@ -371,86 +375,75 @@ DEBUG_GetExprValue(const DBG_VALUE *_value, char ** format)
memcpy
(
&
rtn
,
(
void
*
)
value
.
addr
.
off
,
value
.
type
->
un
.
basic
.
basic_size
);
memcpy
(
&
rtn
,
(
void
*
)
value
.
addr
.
off
,
value
.
type
->
un
.
basic
.
basic_size
);
}
}
if
(
(
value
.
type
->
un
.
basic
.
b_signed
)
if
(
(
value
.
type
->
un
.
basic
.
b_signed
)
&&
((
value
.
type
->
un
.
basic
.
basic_size
&
3
)
!=
0
)
&&
((
value
.
type
->
un
.
basic
.
basic_size
&
3
)
!=
0
)
&&
((
rtn
>>
(
value
.
type
->
un
.
basic
.
basic_size
*
8
-
1
))
!=
0
)
)
&&
((
rtn
>>
(
value
.
type
->
un
.
basic
.
basic_size
*
8
-
1
))
!=
0
))
{
{
rtn
=
rtn
|
((
-
1
)
<<
(
value
.
type
->
un
.
basic
.
basic_size
*
8
));
rtn
=
rtn
|
((
-
1
)
<<
(
value
.
type
->
un
.
basic
.
basic_size
*
8
));
}
}
if
(
value
.
type
->
un
.
basic
.
output_format
!=
NULL
)
if
(
value
.
type
->
un
.
basic
.
output_format
!=
NULL
)
{
{
def_format
=
value
.
type
->
un
.
basic
.
output_format
;
def_format
=
value
.
type
->
un
.
basic
.
output_format
;
}
}
/*
/*
* Check for single character prints that are out of range.
* Check for single character prints that are out of range.
*/
*/
if
(
value
.
type
->
un
.
basic
.
basic_size
==
1
if
(
value
.
type
->
un
.
basic
.
basic_size
==
1
&&
strcmp
(
def_format
,
"'%c'"
)
==
0
&&
strcmp
(
def_format
,
"'%c'"
)
==
0
&&
((
rtn
<
0x20
)
||
(
rtn
>
0x80
))
)
&&
((
rtn
<
0x20
)
||
(
rtn
>
0x80
)))
{
{
def_format
=
"%d"
;
def_format
=
"%d"
;
}
}
break
;
break
;
case
DT_POINTER
:
case
DT_POINTER
:
if
(
_value
->
cookie
==
DV_TARGET
)
{
if
(
_value
->
cookie
==
DV_TARGET
)
{
if
(
!
DEBUG_READ_MEM_VERBOSE
((
void
*
)
value
.
addr
.
off
,
&
rtn
,
sizeof
(
void
*
)))
if
(
!
DEBUG_READ_MEM_VERBOSE
((
void
*
)
value
.
addr
.
off
,
&
rtn
2
,
sizeof
(
void
*
)))
return
0
;
return
0
;
}
else
{
}
else
{
rtn
=
*
(
unsigned
int
*
)(
value
.
addr
.
off
);
rtn
2
=
*
(
unsigned
int
*
)(
value
.
addr
.
off
);
}
}
type2
=
value
.
type
->
un
.
pointer
.
pointsto
;
type2
=
value
.
type
->
un
.
pointer
.
pointsto
;
if
(
!
type2
)
if
(
!
type2
)
{
{
def_format
=
"Internal symbol error: unable to access memory location 0x%08x"
;
def_format
=
"Internal symbol error: unable to access memory location 0x%08x"
;
rtn
=
0
;
rtn
=
0
;
break
;
break
;
}
}
if
(
type2
->
type
==
DT_BASIC
&&
type2
->
un
.
basic
.
basic_size
==
1
)
if
(
type2
->
type
==
DT_BASIC
&&
type2
->
un
.
basic
.
basic_size
==
1
)
{
{
if
(
_value
->
cookie
==
DV_TARGET
)
{
if
(
_value
->
cookie
==
DV_TARGET
)
{
char
ch
;
char
ch
;
def_format
=
"
\"
%S
\"
"
;
def_format
=
"
\"
%S
\"
"
;
if
(
!
DEBUG_READ_MEM_VERBOSE
((
void
*
)
rtn
,
&
ch
,
1
))
/* FIXME: assuming little endian */
if
(
!
DEBUG_READ_MEM_VERBOSE
((
void
*
)
rtn2
,
&
ch
,
1
))
return
0
;
return
0
;
}
else
{
}
else
{
def_format
=
"
\"
%s
\"
"
;
def_format
=
"
\"
%s
\"
"
;
}
}
}
}
else
{
else
{
def_format
=
"0x%8.8x"
;
def_format
=
"0x%8.8x"
;
}
}
rtn
=
rtn2
;
break
;
break
;
case
DT_ARRAY
:
case
DT_ARRAY
:
case
DT_STRUCT
:
case
DT_STRUCT
:
assert
(
_value
->
cookie
==
DV_TARGET
);
assert
(
_value
->
cookie
==
DV_TARGET
);
if
(
!
DEBUG_READ_MEM_VERBOSE
((
void
*
)
value
.
addr
.
off
,
&
rtn
,
sizeof
(
rtn
)))
if
(
!
DEBUG_READ_MEM_VERBOSE
((
void
*
)
value
.
addr
.
off
,
&
rtn
2
,
sizeof
(
rtn2
)))
return
0
;
return
0
;
rtn
=
rtn2
;
def_format
=
"0x%8.8x"
;
def_format
=
"0x%8.8x"
;
break
;
break
;
case
DT_ENUM
:
case
DT_ENUM
:
assert
(
_value
->
cookie
==
DV_TARGET
);
assert
(
_value
->
cookie
==
DV_TARGET
);
if
(
!
DEBUG_READ_MEM_VERBOSE
((
void
*
)
value
.
addr
.
off
,
&
rtn
,
sizeof
(
rtn
)))
if
(
!
DEBUG_READ_MEM_VERBOSE
((
void
*
)
value
.
addr
.
off
,
&
rtn
2
,
sizeof
(
rtn2
)))
return
0
;
return
0
;
for
(
e
=
value
.
type
->
un
.
enumeration
.
members
;
e
;
e
=
e
->
next
)
rtn
=
rtn2
;
{
def_format
=
"%d"
;
if
(
e
->
value
==
rtn
)
for
(
e
=
value
.
type
->
un
.
enumeration
.
members
;
e
;
e
=
e
->
next
)
{
{
if
(
e
->
value
==
rtn
)
{
break
;
rtn
=
(
int
)
e
->
name
;
}
}
if
(
e
!=
NULL
)
{
rtn
=
(
int
)
e
->
name
;
def_format
=
"%s"
;
def_format
=
"%s"
;
break
;
}
}
else
{
def_format
=
"%d"
;
}
}
break
;
break
;
default:
default:
...
@@ -459,8 +452,7 @@ DEBUG_GetExprValue(const DBG_VALUE *_value, char ** format)
...
@@ -459,8 +452,7 @@ DEBUG_GetExprValue(const DBG_VALUE *_value, char ** format)
}
}
if
(
format
!=
NULL
)
if
(
format
!=
NULL
)
{
{
*
format
=
def_format
;
*
format
=
def_format
;
}
}
return
rtn
;
return
rtn
;
...
...
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