Commit 193c83f6 authored by Jeremy White's avatar Jeremy White Committed by Alexandre Julliard

Properly respect a disassemble x,y command (prior behavior would do

y-x instructions, no matter how wide each instruction was).
parent 627260f8
...@@ -314,7 +314,7 @@ extern BOOL memory_get_current_stack(ADDRESS* address); ...@@ -314,7 +314,7 @@ extern BOOL memory_get_current_stack(ADDRESS* address);
extern BOOL memory_get_current_frame(ADDRESS* address); extern BOOL memory_get_current_frame(ADDRESS* address);
extern BOOL memory_get_string(HANDLE hp, void* addr, BOOL in_debuggee, BOOL unicode, char* buffer, int size); extern BOOL memory_get_string(HANDLE hp, void* addr, BOOL in_debuggee, BOOL unicode, char* buffer, int size);
extern BOOL memory_get_string_indirect(HANDLE hp, void* addr, BOOL unicode, char* buffer, int size); extern BOOL memory_get_string_indirect(HANDLE hp, void* addr, BOOL unicode, char* buffer, int size);
extern void memory_disassemble(const struct dbg_lvalue*, const struct dbg_lvalue*, int offset); extern void memory_disassemble(const struct dbg_lvalue*, const struct dbg_lvalue*, int instruction_count);
extern BOOL memory_disasm_one_insn(ADDRESS* addr); extern BOOL memory_disasm_one_insn(ADDRESS* addr);
extern void print_bare_address(const ADDRESS* addr); extern void print_bare_address(const ADDRESS* addr);
extern void print_address(const ADDRESS* addr, BOOLEAN with_line); extern void print_address(const ADDRESS* addr, BOOLEAN with_line);
......
...@@ -598,9 +598,11 @@ BOOL memory_disasm_one_insn(ADDRESS* addr) ...@@ -598,9 +598,11 @@ BOOL memory_disasm_one_insn(ADDRESS* addr)
} }
void memory_disassemble(const struct dbg_lvalue* xstart, void memory_disassemble(const struct dbg_lvalue* xstart,
const struct dbg_lvalue* xend, int offset) const struct dbg_lvalue* xend, int instruction_count)
{ {
static ADDRESS last = {0,0,0}; static ADDRESS last = {0,0,0};
int stop = 0;
int i;
if (!xstart && !xend) if (!xstart && !xend)
{ {
...@@ -613,7 +615,10 @@ void memory_disassemble(const struct dbg_lvalue* xstart, ...@@ -613,7 +615,10 @@ void memory_disassemble(const struct dbg_lvalue* xstart,
last.Mode = AddrModeFlat; last.Mode = AddrModeFlat;
last.Offset = types_extract_as_integer(xstart); last.Offset = types_extract_as_integer(xstart);
} }
if (xend) offset = types_extract_as_integer(xend) - last.Offset + 1; if (xend)
stop = types_extract_as_integer(xend);
} }
while (offset-- > 0 && memory_disasm_one_insn(&last)); for (i = 0; (instruction_count == 0 || i < instruction_count) &&
(stop == 0 || last.Offset <= stop); i++)
memory_disasm_one_insn(&last);
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment