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
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
84 additions
and
92 deletions
+84
-92
types.c
debugger/types.c
+84
-92
No files found.
debugger/types.c
View file @
4304aee8
...
...
@@ -340,28 +340,32 @@ DEBUG_InitTypes(void)
}
long
long
int
DEBUG_GetExprValue
(
const
DBG_VALUE
*
_value
,
char
**
format
)
DEBUG_GetExprValue
(
const
DBG_VALUE
*
_value
,
char
**
format
)
{
unsigned
int
rtn
;
struct
datatype
*
type2
=
NULL
;
struct
en_values
*
e
;
char
*
def_format
=
"0x%x"
;
DBG_VALUE
value
=
*
_value
;
assert
(
_value
->
cookie
==
DV_TARGET
||
_value
->
cookie
==
DV_HOST
);
rtn
=
0
;
/* FIXME? I don't quite get this...
* if this is wrong, value.addr shall be linearized
*/
value
.
addr
.
seg
=
0
;
assert
(
value
.
type
!=
NULL
);
switch
(
value
.
type
->
type
)
{
case
DT_BASIC
:
rtn
=
0
;
long
long
int
rtn
;
unsigned
int
rtn2
;
struct
datatype
*
type2
=
NULL
;
struct
en_values
*
e
;
char
*
def_format
=
"0x%x"
;
DBG_VALUE
value
=
*
_value
;
assert
(
_value
->
cookie
==
DV_TARGET
||
_value
->
cookie
==
DV_HOST
);
rtn
=
0
;
rtn2
=
0
;
/* FIXME? I don't quite get this...
* if this is wrong, value.addr shall be linearized
*/
value
.
addr
.
seg
=
0
;
assert
(
value
.
type
!=
NULL
);
switch
(
value
.
type
->
type
)
{
case
DT_BASIC
:
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 */
if
(
_value
->
cookie
==
DV_TARGET
)
{
if
(
!
DEBUG_READ_MEM_VERBOSE
((
void
*
)
value
.
addr
.
off
,
&
rtn
,
...
...
@@ -370,100 +374,88 @@ DEBUG_GetExprValue(const DBG_VALUE *_value, char ** format)
}
else
{
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
)
&&
((
rtn
>>
(
value
.
type
->
un
.
basic
.
basic_size
*
8
-
1
))
!=
0
)
)
{
rtn
=
rtn
|
((
-
1
)
<<
(
value
.
type
->
un
.
basic
.
basic_size
*
8
));
}
if
(
value
.
type
->
un
.
basic
.
output_format
!=
NULL
)
{
def_format
=
value
.
type
->
un
.
basic
.
output_format
;
}
&&
((
rtn
>>
(
value
.
type
->
un
.
basic
.
basic_size
*
8
-
1
))
!=
0
))
{
rtn
=
rtn
|
((
-
1
)
<<
(
value
.
type
->
un
.
basic
.
basic_size
*
8
));
}
if
(
value
.
type
->
un
.
basic
.
output_format
!=
NULL
)
{
def_format
=
value
.
type
->
un
.
basic
.
output_format
;
}
/*
* 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
&&
((
rtn
<
0x20
)
||
(
rtn
>
0x80
))
)
{
def_format
=
"%d"
;
}
&&
((
rtn
<
0x20
)
||
(
rtn
>
0x80
)))
{
def_format
=
"%d"
;
}
break
;
case
DT_POINTER
:
case
DT_POINTER
:
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
;
}
else
{
rtn
=
*
(
unsigned
int
*
)(
value
.
addr
.
off
);
rtn
2
=
*
(
unsigned
int
*
)(
value
.
addr
.
off
);
}
type2
=
value
.
type
->
un
.
pointer
.
pointsto
;
if
(
!
type2
)
{
def_format
=
"Internal symbol error: unable to access memory location 0x%08x"
;
rtn
=
0
;
break
;
if
(
!
type2
)
{
def_format
=
"Internal symbol error: unable to access memory location 0x%08x"
;
rtn
=
0
;
break
;
}
if
(
type2
->
type
==
DT_BASIC
&&
type2
->
un
.
basic
.
basic_size
==
1
)
{
if
(
_value
->
cookie
==
DV_TARGET
)
{
char
ch
;
def_format
=
"
\"
%S
\"
"
;
if
(
!
DEBUG_READ_MEM_VERBOSE
((
void
*
)
rtn
,
&
ch
,
1
))
return
0
;
}
else
{
def_format
=
"
\"
%s
\"
"
;
}
}
else
{
def_format
=
"0x%8.8x"
;
}
if
(
type2
->
type
==
DT_BASIC
&&
type2
->
un
.
basic
.
basic_size
==
1
)
{
if
(
_value
->
cookie
==
DV_TARGET
)
{
char
ch
;
def_format
=
"
\"
%S
\"
"
;
/* FIXME: assuming little endian */
if
(
!
DEBUG_READ_MEM_VERBOSE
((
void
*
)
rtn2
,
&
ch
,
1
))
return
0
;
}
else
{
def_format
=
"
\"
%s
\"
"
;
}
}
else
{
def_format
=
"0x%8.8x"
;
}
rtn
=
rtn2
;
break
;
case
DT_ARRAY
:
case
DT_STRUCT
:
case
DT_ARRAY
:
case
DT_STRUCT
:
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
;
rtn
=
rtn2
;
def_format
=
"0x%8.8x"
;
break
;
case
DT_ENUM
:
case
DT_ENUM
:
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
;
for
(
e
=
value
.
type
->
un
.
enumeration
.
members
;
e
;
e
=
e
->
next
)
{
if
(
e
->
value
==
rtn
)
{
break
;
}
}
if
(
e
!=
NULL
)
{
rtn
=
(
int
)
e
->
name
;
def_format
=
"%s"
;
}
else
{
def_format
=
"%d"
;
}
rtn
=
rtn2
;
def_format
=
"%d"
;
for
(
e
=
value
.
type
->
un
.
enumeration
.
members
;
e
;
e
=
e
->
next
)
{
if
(
e
->
value
==
rtn
)
{
rtn
=
(
int
)
e
->
name
;
def_format
=
"%s"
;
break
;
}
}
break
;
default:
default:
rtn
=
0
;
break
;
}
if
(
format
!=
NULL
)
{
}
if
(
format
!=
NULL
)
{
*
format
=
def_format
;
}
return
rtn
;
}
return
rtn
;
}
unsigned
int
...
...
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