Author: fireball
Date: Sat Jun 30 22:58:09 2007
New Revision: 27348
URL: http://svn.reactos.org/svn/reactos?rev=27348&view=rev
Log:
- Commit a fix for KDBG's attach to process problem.
See issue #1263 for more details.
Modified:
trunk/reactos/ntoskrnl/kdbg/kdb.c
Modified: trunk/reactos/ntoskrnl/kdbg/kdb.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/kdbg/kdb.c?rev=27…
==============================================================================
--- trunk/reactos/ntoskrnl/kdbg/kdb.c (original)
+++ trunk/reactos/ntoskrnl/kdbg/kdb.c Sat Jun 30 22:58:09 2007
@@ -168,6 +168,29 @@
/* FIXME: copy v86 registers if TrapFrame is a V86 trapframe */
}
+STATIC VOID
+KdbpKdbTrapFrameFromKernelStack(PVOID KernelStack,
+ PKDB_KTRAP_FRAME KdbTrapFrame)
+{
+ ULONG_PTR *StackPtr;
+
+ RtlZeroMemory(KdbTrapFrame, sizeof(KDB_KTRAP_FRAME));
+ StackPtr = (ULONG_PTR *) KernelStack;
+ KdbTrapFrame->Tf.Ebp = StackPtr[3];
+ KdbTrapFrame->Tf.Edi = StackPtr[4];
+ KdbTrapFrame->Tf.Esi = StackPtr[5];
+ KdbTrapFrame->Tf.Ebx = StackPtr[6];
+ KdbTrapFrame->Tf.Eip = StackPtr[7];
+ KdbTrapFrame->Tf.HardwareEsp = (ULONG) (StackPtr + 8);
+ KdbTrapFrame->Tf.HardwareSegSs = KGDT_R0_DATA;
+ KdbTrapFrame->Tf.SegCs = KGDT_R0_CODE;
+ KdbTrapFrame->Tf.SegDs = KGDT_R0_DATA;
+ KdbTrapFrame->Tf.SegEs = KGDT_R0_DATA;
+ KdbTrapFrame->Tf.SegGs = KGDT_R0_DATA;
+
+ /* FIXME: what about the other registers??? */
+}
+
/*!\brief Overwrites the instruction at \a Address with \a NewInst and stores
* the old instruction in *OldInst.
*
@@ -1040,7 +1063,8 @@
if (KdbCurrentThread != KdbOriginalThread)
{
ASSERT(KdbCurrentTrapFrame == &KdbThreadTrapFrame);
- KdbpKdbTrapFrameToTrapFrame(KdbCurrentTrapFrame, KdbCurrentThread->Tcb.TrapFrame);
+ /* Actually, we can't save the context, there's no guarantee that there
+ * was a trap frame */
}
else
{
@@ -1050,12 +1074,13 @@
/* Switch to the thread's context */
if (Thread != KdbOriginalThread)
{
- if (Thread->Tcb.TrapFrame == NULL)
- {
- KdbpPrint("Threads TrapFrame is NULL! Cannot attach.\n");
- return FALSE;
- }
- KdbpTrapFrameToKdbTrapFrame(Thread->Tcb.TrapFrame, &KdbThreadTrapFrame);
+ /* The thread we're attaching to isn't the thread on which we entered
+ * kdb and so the thread we're attaching to is not running. There
+ * is no guarantee that it actually has a trap frame. So we have to
+ * peek directly at the registers which were saved on the stack when the
+ * thread was preempted in the scheduler */
+ KdbpKdbTrapFrameFromKernelStack(Thread->Tcb.KernelStack,
+ &KdbThreadTrapFrame);
KdbCurrentTrapFrame = &KdbThreadTrapFrame;
}
else /* Switching back to original thread */
@@ -1529,11 +1554,8 @@
}
}
- /* Save the current thread's trapframe */
- if (KdbCurrentTrapFrame == &KdbThreadTrapFrame)
- {
- KdbpKdbTrapFrameToTrapFrame(KdbCurrentTrapFrame, KdbCurrentThread->Tcb.TrapFrame);
- }
+ /* We can't update the current thread's trapframe 'cause it might not
+ have one */
/* Detach from attached process */
if (KdbCurrentProcess != KdbOriginalProcess)
Author: greatlrd
Date: Sat Jun 30 18:12:10 2007
New Revision: 27344
URL: http://svn.reactos.org/svn/reactos?rev=27344&view=rev
Log:
accpect pacth in bug 2314, with one smaller change
the msvcrt20.def change was not accpect, it need more time for review.
and we do not support __set_error in libcntpr.
the patch are base on current strtoul, the strtoull are the long long version
of strtoul. so he took current stroul and adpate it to long long. and also add
missing error code. patch are done by Pierre Schweitzer email heis_spiter at hotmail.com
See issue #2314 for more details.
Modified:
trunk/reactos/dll/ntdll/def/ntdll.def
trunk/reactos/dll/win32/crtdll/crtdll.def
trunk/reactos/dll/win32/msvcrt/msvcrt.def
trunk/reactos/lib/sdk/libcntpr/libcntpr.rbuild
trunk/reactos/lib/sdk/libcntpr/string/strtoul.c
Modified: trunk/reactos/dll/ntdll/def/ntdll.def
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/ntdll/def/ntdll.def?re…
==============================================================================
--- trunk/reactos/dll/ntdll/def/ntdll.def (original)
+++ trunk/reactos/dll/ntdll/def/ntdll.def Sat Jun 30 18:12:10 2007
@@ -1065,6 +1065,7 @@
strstr
strtol
strtoul
+strtoull
swprintf
tan
tolower
Modified: trunk/reactos/dll/win32/crtdll/crtdll.def
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/crtdll/crtdll.de…
==============================================================================
--- trunk/reactos/dll/win32/crtdll/crtdll.def (original)
+++ trunk/reactos/dll/win32/crtdll/crtdll.def Sat Jun 30 18:12:10 2007
@@ -523,6 +523,7 @@
strtok
strtol=NTDLL.strtol
strtoul
+strtoull
strxfrm
swprintf=crt_swprintf
swscanf
Modified: trunk/reactos/dll/win32/msvcrt/msvcrt.def
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/msvcrt/msvcrt.de…
==============================================================================
--- trunk/reactos/dll/win32/msvcrt/msvcrt.def (original)
+++ trunk/reactos/dll/win32/msvcrt/msvcrt.def Sat Jun 30 18:12:10 2007
@@ -797,6 +797,7 @@
strtok
strtol=NTDLL.strtol
strtoul
+strtoull
strxfrm
swprintf=crt_swprintf
swscanf
Modified: trunk/reactos/lib/sdk/libcntpr/libcntpr.rbuild
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/lib/sdk/libcntpr/libcntpr.…
==============================================================================
--- trunk/reactos/lib/sdk/libcntpr/libcntpr.rbuild (original)
+++ trunk/reactos/lib/sdk/libcntpr/libcntpr.rbuild Sat Jun 30 18:12:10 2007
@@ -137,6 +137,7 @@
<file>splitp.c</file>
<file>strtol.c</file>
<file>strtoul.c</file>
+ <file>strtoull.c</file>
<file>wcstol.c</file>
<file>wcstombs.c</file>
<file>wcstoul.c</file>
Modified: trunk/reactos/lib/sdk/libcntpr/string/strtoul.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/lib/sdk/libcntpr/string/st…
==============================================================================
--- trunk/reactos/lib/sdk/libcntpr/string/strtoul.c (original)
+++ trunk/reactos/lib/sdk/libcntpr/string/strtoul.c Sat Jun 30 18:12:10 2007
@@ -1,6 +1,9 @@
+#include <stdio.h>
#include <string.h>
+#include <errno.h>
#include <limits.h>
#include <ctype.h>
+
/*
* Convert a string to an unsigned long integer.
@@ -64,6 +67,7 @@
if (any < 0)
{
acc = ULONG_MAX;
+
}
else if (neg)
acc = -acc;
Author: fireball
Date: Sat Jun 30 00:51:06 2007
New Revision: 27340
URL: http://svn.reactos.org/svn/reactos?rev=27340&view=rev
Log:
- Create a branch for an ongoing ReactX work by Magnus Olsen (GreatLord).
Added:
branches/reactx/
- copied from r27339, trunk/