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
88949b2c
Commit
88949b2c
authored
Apr 04, 2012
by
Eric Pouech
Committed by
Alexandre Julliard
Apr 05, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winedbg: Fix set instruction when sizeof(int) <> sizeof register.
parent
13f483a2
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
76 additions
and
12 deletions
+76
-12
be_arm.c
programs/winedbg/be_arm.c
+8
-0
be_cpu.h
programs/winedbg/be_cpu.h
+2
-0
be_i386.c
programs/winedbg/be_i386.c
+8
-0
be_ppc.c
programs/winedbg/be_ppc.c
+8
-0
be_sparc.c
programs/winedbg/be_sparc.c
+8
-0
be_x86_64.c
programs/winedbg/be_x86_64.c
+8
-0
dbg.y
programs/winedbg/dbg.y
+1
-1
debugger.h
programs/winedbg/debugger.h
+2
-1
memory.c
programs/winedbg/memory.c
+2
-2
types.c
programs/winedbg/types.c
+29
-8
No files found.
programs/winedbg/be_arm.c
View file @
88949b2c
...
...
@@ -255,6 +255,13 @@ static int be_arm_fetch_float(const struct dbg_lvalue* lvalue, unsigned size,
return
TRUE
;
}
static
int
be_arm_store_integer
(
const
struct
dbg_lvalue
*
lvalue
,
unsigned
size
,
unsigned
is_signed
,
LONGLONG
val
)
{
dbg_printf
(
"be_arm_store_integer: not done
\n
"
);
return
FALSE
;
}
struct
backend_cpu
be_arm
=
{
IMAGE_FILE_MACHINE_ARMV7
,
...
...
@@ -280,5 +287,6 @@ struct backend_cpu be_arm =
be_arm_adjust_pc_for_break
,
be_arm_fetch_integer
,
be_arm_fetch_float
,
be_arm_store_integer
,
};
#endif
programs/winedbg/be_cpu.h
View file @
88949b2c
...
...
@@ -112,6 +112,8 @@ struct backend_cpu
int
(
*
fetch_integer
)(
const
struct
dbg_lvalue
*
lvalue
,
unsigned
size
,
unsigned
is_signed
,
LONGLONG
*
);
/* Reads a real from memory and stores it inside a long double */
int
(
*
fetch_float
)(
const
struct
dbg_lvalue
*
lvalue
,
unsigned
size
,
long
double
*
);
/* Writes an integer to memory */
int
(
*
store_integer
)(
const
struct
dbg_lvalue
*
lvalue
,
unsigned
size
,
unsigned
is_signed
,
LONGLONG
);
};
extern
struct
backend_cpu
*
be_cpu
;
...
...
programs/winedbg/be_i386.c
View file @
88949b2c
...
...
@@ -772,6 +772,13 @@ static int be_i386_fetch_float(const struct dbg_lvalue* lvalue, unsigned size,
return
TRUE
;
}
static
int
be_i386_store_integer
(
const
struct
dbg_lvalue
*
lvalue
,
unsigned
size
,
unsigned
is_signed
,
LONGLONG
val
)
{
/* this is simple as we're on a little endian CPU */
return
memory_write_value
(
lvalue
,
size
,
&
val
);
}
struct
backend_cpu
be_i386
=
{
IMAGE_FILE_MACHINE_I386
,
...
...
@@ -797,5 +804,6 @@ struct backend_cpu be_i386 =
be_i386_adjust_pc_for_break
,
be_i386_fetch_integer
,
be_i386_fetch_float
,
be_i386_store_integer
,
};
#endif
programs/winedbg/be_ppc.c
View file @
88949b2c
...
...
@@ -173,6 +173,13 @@ static int be_ppc_fetch_float(const struct dbg_lvalue* lvalue, unsigned size,
return
FALSE
;
}
static
int
be_ppc_store_integer
(
const
struct
dbg_lvalue
*
lvalue
,
unsigned
size
,
unsigned
is_signed
,
LONGLONG
val
)
{
dbg_printf
(
"be_ppc_store_integer: not done
\n
"
);
return
FALSE
;
}
struct
backend_cpu
be_ppc
=
{
IMAGE_FILE_MACHINE_POWERPC
,
...
...
@@ -198,5 +205,6 @@ struct backend_cpu be_ppc =
be_ppc_adjust_pc_for_break
,
be_ppc_fetch_integer
,
be_ppc_fetch_float
,
be_ppc_store_integer
,
};
#endif
programs/winedbg/be_sparc.c
View file @
88949b2c
...
...
@@ -148,6 +148,13 @@ static int be_sparc_fetch_float(const struct dbg_lvalue* lvalue, unsigned size,
return
FALSE
;
}
static
int
be_sparc_store_integer
(
const
struct
dbg_lvalue
*
lvalue
,
unsigned
size
,
unsigned
is_signed
,
LONGLONG
val
)
{
dbg_printf
(
"be_sparc_store_integer: not done
\n
"
);
return
FALSE
;
}
struct
backend_cpu
be_sparc
=
{
IMAGE_FILE_MACHINE_SPARC
,
...
...
@@ -173,5 +180,6 @@ struct backend_cpu be_sparc =
be_sparc_adjust_pc_for_break
,
be_sparc_fetch_integer
,
be_sparc_fetch_float
,
be_sparc_store_integer
,
};
#endif
programs/winedbg/be_x86_64.c
View file @
88949b2c
...
...
@@ -638,6 +638,13 @@ static int be_x86_64_fetch_float(const struct dbg_lvalue* lvalue, unsigned size,
return
TRUE
;
}
static
int
be_x86_64_store_integer
(
const
struct
dbg_lvalue
*
lvalue
,
unsigned
size
,
unsigned
is_signed
,
LONGLONG
val
)
{
/* this is simple as we're on a little endian CPU */
return
memory_write_value
(
lvalue
,
size
,
&
val
);
}
struct
backend_cpu
be_x86_64
=
{
IMAGE_FILE_MACHINE_AMD64
,
...
...
@@ -663,5 +670,6 @@ struct backend_cpu be_x86_64 =
be_x86_64_adjust_pc_for_break
,
be_x86_64_fetch_integer
,
be_x86_64_fetch_float
,
be_x86_64_store_integer
,
};
#endif
programs/winedbg/dbg.y
View file @
88949b2c
...
...
@@ -204,7 +204,7 @@ disassemble_command:
;
set_command:
tSET lvalue_addr '=' expr_
rvalue { memory_write_value(&$2, sizeof(int)
, &$4); }
tSET lvalue_addr '=' expr_
lvalue { types_store_value(&$2
, &$4); }
| tSET '+' tIDENTIFIER { info_wine_dbg_channel(TRUE, NULL, $3); }
| tSET '+' tALL { info_wine_dbg_channel(TRUE, NULL, "all"); }
| tSET '-' tIDENTIFIER { info_wine_dbg_channel(FALSE, NULL, $3); }
...
...
programs/winedbg/debugger.h
View file @
88949b2c
...
...
@@ -437,8 +437,9 @@ extern void print_value(const struct dbg_lvalue* addr, char format,
extern
int
types_print_type
(
const
struct
dbg_type
*
,
BOOL
details
);
extern
int
print_types
(
void
);
extern
long
int
types_extract_as_integer
(
const
struct
dbg_lvalue
*
);
extern
LONGLONG
types_extract_as_longlong
(
const
struct
dbg_lvalue
*
,
unsigned
*
psize
);
extern
LONGLONG
types_extract_as_longlong
(
const
struct
dbg_lvalue
*
,
unsigned
*
psize
,
BOOL
*
pissigned
);
extern
void
types_extract_as_address
(
const
struct
dbg_lvalue
*
,
ADDRESS64
*
);
extern
BOOL
types_store_value
(
struct
dbg_lvalue
*
lvalue_to
,
const
struct
dbg_lvalue
*
lvalue_from
);
extern
BOOL
types_udt_find_element
(
struct
dbg_lvalue
*
value
,
const
char
*
name
,
long
int
*
tmpbuf
);
extern
BOOL
types_array_index
(
const
struct
dbg_lvalue
*
value
,
int
index
,
struct
dbg_lvalue
*
result
);
extern
BOOL
types_get_info
(
const
struct
dbg_type
*
,
IMAGEHLP_SYMBOL_TYPE_INFO
,
void
*
);
...
...
programs/winedbg/memory.c
View file @
88949b2c
...
...
@@ -524,7 +524,7 @@ void print_basic(const struct dbg_lvalue* lvalue, char format)
if
(
format
!=
0
)
{
unsigned
size
;
LONGLONG
res
=
types_extract_as_longlong
(
lvalue
,
&
size
);
LONGLONG
res
=
types_extract_as_longlong
(
lvalue
,
&
size
,
NULL
);
WCHAR
wch
;
switch
(
format
)
...
...
@@ -557,7 +557,7 @@ void print_basic(const struct dbg_lvalue* lvalue, char format)
}
if
(
lvalue
->
type
.
id
==
dbg_itype_segptr
)
{
dbg_print_longlong
(
types_extract_as_longlong
(
lvalue
,
NULL
),
TRUE
);
dbg_print_longlong
(
types_extract_as_longlong
(
lvalue
,
NULL
,
NULL
),
TRUE
);
}
else
print_typed_basic
(
lvalue
);
}
...
...
programs/winedbg/types.c
View file @
88949b2c
...
...
@@ -53,12 +53,14 @@ BOOL types_get_real_type(struct dbg_type* type, DWORD* tag)
* Given a lvalue, try to get an integral (or pointer/address) value
* out of it
*/
LONGLONG
types_extract_as_longlong
(
const
struct
dbg_lvalue
*
lvalue
,
unsigned
*
psize
)
LONGLONG
types_extract_as_longlong
(
const
struct
dbg_lvalue
*
lvalue
,
unsigned
*
psize
,
BOOL
*
issigned
)
{
LONGLONG
rtn
;
DWORD
tag
,
bt
;
DWORD64
size
;
struct
dbg_type
type
=
lvalue
->
type
;
BOOL
s
=
FALSE
;
if
(
!
types_get_real_type
(
&
type
,
&
tag
))
RaiseException
(
DEBUG_STATUS_NOT_AN_INTEGER
,
0
,
0
,
NULL
);
...
...
@@ -69,6 +71,7 @@ LONGLONG types_extract_as_longlong(const struct dbg_lvalue* lvalue, unsigned* ps
}
if
(
psize
)
*
psize
=
0
;
if
(
issigned
)
*
issigned
=
FALSE
;
switch
(
tag
)
{
case
SymTagBaseType
:
...
...
@@ -87,30 +90,31 @@ LONGLONG types_extract_as_longlong(const struct dbg_lvalue* lvalue, unsigned* ps
{
case
btChar
:
case
btInt
:
if
(
!
be_cpu
->
fetch_integer
(
lvalue
,
(
unsigned
)
size
,
TRUE
,
&
rtn
))
if
(
!
be_cpu
->
fetch_integer
(
lvalue
,
(
unsigned
)
size
,
s
=
TRUE
,
&
rtn
))
RaiseException
(
DEBUG_STATUS_INTERNAL_ERROR
,
0
,
0
,
NULL
);
break
;
case
btUInt
:
if
(
!
be_cpu
->
fetch_integer
(
lvalue
,
(
unsigned
)
size
,
FALSE
,
&
rtn
))
if
(
!
be_cpu
->
fetch_integer
(
lvalue
,
(
unsigned
)
size
,
s
=
FALSE
,
&
rtn
))
RaiseException
(
DEBUG_STATUS_INTERNAL_ERROR
,
0
,
0
,
NULL
);
break
;
case
btFloat
:
RaiseException
(
DEBUG_STATUS_NOT_AN_INTEGER
,
0
,
0
,
NULL
);
}
if
(
psize
)
*
psize
=
(
unsigned
)
size
;
if
(
issigned
)
*
issigned
=
s
;
break
;
case
SymTagPointerType
:
if
(
!
be_cpu
->
fetch_integer
(
lvalue
,
sizeof
(
void
*
),
FALSE
,
&
rtn
))
if
(
!
be_cpu
->
fetch_integer
(
lvalue
,
sizeof
(
void
*
),
s
=
FALSE
,
&
rtn
))
RaiseException
(
DEBUG_STATUS_INTERNAL_ERROR
,
0
,
0
,
NULL
);
break
;
case
SymTagArrayType
:
case
SymTagUDT
:
if
(
!
be_cpu
->
fetch_integer
(
lvalue
,
sizeof
(
unsigned
),
FALSE
,
&
rtn
))
if
(
!
be_cpu
->
fetch_integer
(
lvalue
,
sizeof
(
unsigned
),
s
=
FALSE
,
&
rtn
))
RaiseException
(
DEBUG_STATUS_INTERNAL_ERROR
,
0
,
0
,
NULL
);
break
;
case
SymTagEnum
:
/* FIXME: we don't handle enum size */
if
(
!
be_cpu
->
fetch_integer
(
lvalue
,
sizeof
(
unsigned
),
FALSE
,
&
rtn
))
if
(
!
be_cpu
->
fetch_integer
(
lvalue
,
sizeof
(
unsigned
),
s
=
FALSE
,
&
rtn
))
RaiseException
(
DEBUG_STATUS_INTERNAL_ERROR
,
0
,
0
,
NULL
);
break
;
case
SymTagFunctionType
:
...
...
@@ -133,7 +137,7 @@ LONGLONG types_extract_as_longlong(const struct dbg_lvalue* lvalue, unsigned* ps
*/
long
int
types_extract_as_integer
(
const
struct
dbg_lvalue
*
lvalue
)
{
return
types_extract_as_longlong
(
lvalue
,
NULL
);
return
types_extract_as_longlong
(
lvalue
,
NULL
,
NULL
);
}
/******************************************************************
...
...
@@ -150,10 +154,27 @@ void types_extract_as_address(const struct dbg_lvalue* lvalue, ADDRESS64* addr)
else
{
addr
->
Mode
=
AddrModeFlat
;
addr
->
Offset
=
types_extract_as_longlong
(
lvalue
,
NULL
);
addr
->
Offset
=
types_extract_as_longlong
(
lvalue
,
NULL
,
NULL
);
}
}
BOOL
types_store_value
(
struct
dbg_lvalue
*
lvalue_to
,
const
struct
dbg_lvalue
*
lvalue_from
)
{
LONGLONG
val
;
DWORD64
size
;
BOOL
is_signed
;
if
(
!
types_get_info
(
&
lvalue_to
->
type
,
TI_GET_LENGTH
,
&
size
))
return
FALSE
;
if
(
sizeof
(
val
)
<
size
)
{
dbg_printf
(
"Unsufficient size
\n
"
);
return
FALSE
;
}
/* FIXME: should support floats as well */
val
=
types_extract_as_longlong
(
lvalue_from
,
NULL
,
&
is_signed
);
return
be_cpu
->
store_integer
(
lvalue_to
,
size
,
is_signed
,
val
);
}
/******************************************************************
* types_get_udt_element_lvalue
*
...
...
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