From c1dd532cdeed9528ea15a3c2f7962bad7827d6c5 Mon Sep 17 00:00:00 2001 From: "Andrey Halyavin (halyavin)" Date: Fri, 3 Feb 2006 17:00:44 +0000 Subject: [PATCH] fixing bugs in debug.inc from diamond git-svn-id: svn://kolibrios.org@44 a494cfbc-eb01-0410-851d-a64ba20cac60 --- kernel/trunk/core/debug.inc | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/kernel/trunk/core/debug.inc b/kernel/trunk/core/debug.inc index 37746e5f33..5b4edf6189 100644 --- a/kernel/trunk/core/debug.inc +++ b/kernel/trunk/core/debug.inc @@ -236,7 +236,7 @@ debug_read_process_memory: ; ecx=length ; esi->buffer in debugger ; edx=address in debuggee -; out: [esp+36]=eax=sizeof(read) +; out: [esp+36]=sizeof(read) ; destroys all add esi, std_application_base_address push ebx @@ -244,14 +244,17 @@ debug_read_process_memory: call check_region pop ebx dec eax - jnz .ret + jnz .err call get_debuggee_slot - jc .stiret + jc .err + shr eax, 5 mov ebx, esi call read_process_memory -.stiret: sti -.ret: + mov dword [esp+36], eax + ret +.err: + or dword [esp+36], -1 ret debug_write_process_memory: @@ -260,7 +263,7 @@ debug_write_process_memory: ; ecx=length ; esi->buffer in debugger ; edx=address in debuggee -; out: [esp+36]=eax=sizeof(write) +; out: [esp+36]=sizeof(write) ; destroys all add esi, std_application_base_address push ebx @@ -268,14 +271,14 @@ debug_write_process_memory: call check_region pop ebx dec eax - jnz .ret + jnz debug_read_process_memory.err call get_debuggee_slot - jc .stiret + jc debug_read_process_memory.err + shr eax, 5 mov ebx, esi call write_process_memory -.stiret: sti -.ret: + mov [esp+36], eax ret debugger_notify: