- Fix issue were prompt was unresponsive after first command.
- Enable x86_64 disassembly and default to intel syntax
- Print addresses with %p so that their full 64bit glory is shown.
- Fix a warning.

svn path=/branches/ros-amd64-bringup/; revision=45114
This commit is contained in:
Samuel Serapion 2010-01-17 07:20:26 +00:00
parent f1ca0f6da8
commit 66062a3d7f
5 changed files with 18 additions and 18 deletions

View file

@ -26,7 +26,7 @@ typedef ULONG_PTR bfd_vma;
typedef unsigned char bfd_byte; typedef unsigned char bfd_byte;
enum bfd_endian { BFD_ENDIAN_BIG, BIG_ENDIAN_LITTLE, BFD_ENDIAN_UNKNOWN }; enum bfd_endian { BFD_ENDIAN_BIG, BIG_ENDIAN_LITTLE, BFD_ENDIAN_UNKNOWN };
typedef void* bfd; typedef void* bfd;
typedef signed int bfd_signed_vma; typedef LONG_PTR bfd_signed_vma;
#define bfd_mach_x86_64_intel_syntax 0 #define bfd_mach_x86_64_intel_syntax 0
#define bfd_mach_x86_64 1 #define bfd_mach_x86_64 1
#define bfd_mach_i386_i386_intel_syntax 2 #define bfd_mach_i386_i386_intel_syntax 2
@ -36,7 +36,7 @@ typedef signed int bfd_signed_vma;
#define _(X) X #define _(X) X
#define ATTRIBUTE_UNUSED #define ATTRIBUTE_UNUSED
extern int sprintf(char *str, const char *format, ...); extern int sprintf(char *str, const char *format, ...);
#define sprintf_vma(BUF, VMA) sprintf(BUF, "0x%X", VMA) #define sprintf_vma(BUF, VMA) sprintf(BUF, "%p", VMA)
#define _setjmp setjmp #define _setjmp setjmp
#define _INC_SETJMPEX #define _INC_SETJMPEX
struct disassemble_info; struct disassemble_info;
@ -82,7 +82,7 @@ KdbpPrintAddressInCode(ULONG_PTR Addr, struct disassemble_info * Ignored)
{ {
if (!KdbSymPrintAddress((void*)Addr)) if (!KdbSymPrintAddress((void*)Addr))
{ {
DbgPrint("<%08x>", Addr); DbgPrint("<%p>", Addr);
} }
} }
@ -2102,9 +2102,9 @@ print_insn (pc, info)
p++; p++;
} }
#else #else
mode_64bit = 0; mode_64bit = 1;
priv.orig_sizeflag = AFLAG | DFLAG; priv.orig_sizeflag = AFLAG | DFLAG;
/*intel_syntax = 0;*/ intel_syntax = 1;
#endif #endif
if (intel_syntax) if (intel_syntax)

View file

@ -30,12 +30,12 @@ _KdbEnter:
mov [rsp + KTRAP_FRAME_R11], r11 mov [rsp + KTRAP_FRAME_R11], r11
/* Save xmm registers */ /* Save xmm registers */
// movdqa [rsp + KTRAP_FRAME_Xmm0], xmm0 movdqa [rsp + KTRAP_FRAME_Xmm0], xmm0
// movdqa [rsp + KTRAP_FRAME_Xmm1], xmm1 movdqa [rsp + KTRAP_FRAME_Xmm1], xmm1
// movdqa [rsp + KTRAP_FRAME_Xmm2], xmm2 movdqa [rsp + KTRAP_FRAME_Xmm2], xmm2
// movdqa [rsp + KTRAP_FRAME_Xmm3], xmm3 movdqa [rsp + KTRAP_FRAME_Xmm3], xmm3
// movdqa [rsp + KTRAP_FRAME_Xmm4], xmm4 movdqa [rsp + KTRAP_FRAME_Xmm4], xmm4
// movdqa [rsp + KTRAP_FRAME_Xmm5], xmm5 movdqa [rsp + KTRAP_FRAME_Xmm5], xmm5
/* Save cs and previous mode */ /* Save cs and previous mode */
mov ax, cs mov ax, cs

View file

@ -461,7 +461,7 @@ KdbpStepIntoInstruction(
} }
/* Get the interrupt descriptor */ /* Get the interrupt descriptor */
if (!NT_SUCCESS(KdbpSafeReadMemory(IntDesc, (PVOID)(ULONG_PTR)(Idtr.Base + (IntVect * 8)), sizeof (IntDesc)))) if (!NT_SUCCESS(KdbpSafeReadMemory(IntDesc, (PVOID)((ULONG_PTR)Idtr.Base + (IntVect * 8)), sizeof (IntDesc))))
{ {
/*KdbpPrint("Couldn't access memory at 0x%p\n", (ULONG_PTR)Idtr.Base + (IntVect * 8));*/ /*KdbpPrint("Couldn't access memory at 0x%p\n", (ULONG_PTR)Idtr.Base + (IntVect * 8));*/
return FALSE; return FALSE;

View file

@ -548,7 +548,7 @@ KdbpCmdDisassembleX(
while (Count > 0) while (Count > 0)
{ {
if (!KdbSymPrintAddress((PVOID)Address)) if (!KdbSymPrintAddress((PVOID)Address))
KdbpPrint("<%x>:", Address); KdbpPrint("<%p>:", Address);
else else
KdbpPrint(":"); KdbpPrint(":");
@ -574,7 +574,7 @@ KdbpCmdDisassembleX(
while (Count-- > 0) while (Count-- > 0)
{ {
if (!KdbSymPrintAddress((PVOID)Address)) if (!KdbSymPrintAddress((PVOID)Address))
KdbpPrint("<%x>: ", Address); KdbpPrint("<%p>: ", Address);
else else
KdbpPrint(": "); KdbpPrint(": ");
@ -2722,7 +2722,7 @@ KdbpReadCommand(
NextKey = '\0'; NextKey = '\0';
} }
if ((ULONG)(Buffer - Orig) >= (Size - 1)) if ((ULONG_PTR)(Buffer - Orig) >= (Size - 1))
{ {
/* Buffer is full, accept only newlines */ /* Buffer is full, accept only newlines */
if (Key != '\n') if (Key != '\n')

View file

@ -142,12 +142,12 @@ KdbSymPrintAddress(
FunctionName); FunctionName);
if (NT_SUCCESS(Status)) if (NT_SUCCESS(Status))
{ {
DbgPrint("<%wZ:%x (%s:%d (%s))>", DbgPrint("<%wZ:%p (%s:%d (%s))>",
&LdrEntry->BaseDllName, RelativeAddress, FileName, LineNumber, FunctionName); &LdrEntry->BaseDllName, RelativeAddress, FileName, LineNumber, FunctionName);
} }
else else
{ {
DbgPrint("<%wZ:%x>", &LdrEntry->BaseDllName, RelativeAddress); DbgPrint("<%wZ:%p>", &LdrEntry->BaseDllName, RelativeAddress);
} }
return TRUE; return TRUE;