mirror of
https://github.com/reactos/reactos.git
synced 2025-08-02 13:16:07 +00:00
[NTOSKRNL]
Fix MSVC build, when KDBG is used svn path=/trunk/; revision=53165
This commit is contained in:
parent
5d38248144
commit
d42308e0a7
1 changed files with 21 additions and 18 deletions
|
@ -466,17 +466,17 @@ KdbpCmdEvalExpression(
|
||||||
*/
|
*/
|
||||||
static VOID
|
static VOID
|
||||||
KdbpPrintStructInternal
|
KdbpPrintStructInternal
|
||||||
(PROSSYM_INFO Info,
|
(PROSSYM_INFO Info,
|
||||||
PCHAR Indent,
|
PCHAR Indent,
|
||||||
BOOLEAN DoRead,
|
BOOLEAN DoRead,
|
||||||
PVOID BaseAddress,
|
PVOID BaseAddress,
|
||||||
PROSSYM_AGGREGATE Aggregate)
|
PROSSYM_AGGREGATE Aggregate)
|
||||||
{
|
{
|
||||||
ULONG i;
|
ULONG i;
|
||||||
ULONGLONG Result;
|
ULONGLONG Result;
|
||||||
PROSSYM_AGGREGATE_MEMBER Member;
|
PROSSYM_AGGREGATE_MEMBER Member;
|
||||||
ULONG IndentLen = strlen(Indent);
|
ULONG IndentLen = strlen(Indent);
|
||||||
ROSSYM_AGGREGATE MemberAggregate = { };
|
ROSSYM_AGGREGATE MemberAggregate = {0 };
|
||||||
|
|
||||||
for (i = 0; i < Aggregate->NumElements; i++) {
|
for (i = 0; i < Aggregate->NumElements; i++) {
|
||||||
Member = &Aggregate->Elements[i];
|
Member = &Aggregate->Elements[i];
|
||||||
|
@ -508,7 +508,7 @@ KdbpPrintStructInternal
|
||||||
default: {
|
default: {
|
||||||
if (Member->Size < 8) {
|
if (Member->Size < 8) {
|
||||||
if (NT_SUCCESS(KdbpSafeReadMemory(&Result, ((PCHAR)BaseAddress) + Member->BaseOffset, Member->Size))) {
|
if (NT_SUCCESS(KdbpSafeReadMemory(&Result, ((PCHAR)BaseAddress) + Member->BaseOffset, Member->Size))) {
|
||||||
int j;
|
ULONG j;
|
||||||
for (j = 0; j < Member->Size; j++) {
|
for (j = 0; j < Member->Size; j++) {
|
||||||
KdbpPrint(" %02x", (int)(Result & 0xff));
|
KdbpPrint(" %02x", (int)(Result & 0xff));
|
||||||
Result >>= 8;
|
Result >>= 8;
|
||||||
|
@ -551,24 +551,26 @@ KdbpCmdPrintStruct(
|
||||||
ULONG Argc,
|
ULONG Argc,
|
||||||
PCHAR Argv[])
|
PCHAR Argv[])
|
||||||
{
|
{
|
||||||
int i;
|
ULONG i;
|
||||||
ULONGLONG Result = 0;
|
ULONGLONG Result = 0;
|
||||||
PVOID BaseAddress = 0;
|
PVOID BaseAddress = 0;
|
||||||
ROSSYM_AGGREGATE Aggregate = { };
|
ROSSYM_AGGREGATE Aggregate = {0};
|
||||||
UNICODE_STRING ModName = { };
|
UNICODE_STRING ModName = {0};
|
||||||
ANSI_STRING AnsiName = { };
|
ANSI_STRING AnsiName = {0};
|
||||||
CHAR Indent[100] = { };
|
CHAR Indent[100] = {0};
|
||||||
|
PROSSYM_INFO Info;
|
||||||
|
|
||||||
if (Argc < 3) goto end;
|
if (Argc < 3) goto end;
|
||||||
AnsiName.Length = AnsiName.MaximumLength = strlen(Argv[1]);
|
AnsiName.Length = AnsiName.MaximumLength = strlen(Argv[1]);
|
||||||
AnsiName.Buffer = Argv[1];
|
AnsiName.Buffer = Argv[1];
|
||||||
RtlAnsiStringToUnicodeString(&ModName, &AnsiName, TRUE);
|
RtlAnsiStringToUnicodeString(&ModName, &AnsiName, TRUE);
|
||||||
PROSSYM_INFO Info = KdbpSymFindCachedFile(&ModName);
|
Info = KdbpSymFindCachedFile(&ModName);
|
||||||
|
|
||||||
if (!Info || !RosSymAggregate(Info, Argv[2], &Aggregate)) {
|
if (!Info || !RosSymAggregate(Info, Argv[2], &Aggregate)) {
|
||||||
DPRINT1("Could not get aggregate\n");
|
DPRINT1("Could not get aggregate\n");
|
||||||
goto end;
|
goto end;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Get an argument for location if it was given
|
// Get an argument for location if it was given
|
||||||
if (Argc > 3) {
|
if (Argc > 3) {
|
||||||
ULONG len;
|
ULONG len;
|
||||||
|
@ -579,7 +581,7 @@ KdbpCmdPrintStruct(
|
||||||
len = strlen(Argv[i]);
|
len = strlen(Argv[i]);
|
||||||
Argv[i][len] = ' ';
|
Argv[i][len] = ' ';
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Evaluate the expression */
|
/* Evaluate the expression */
|
||||||
DPRINT1("Arg: %s\n", ArgStart);
|
DPRINT1("Arg: %s\n", ArgStart);
|
||||||
if (KdbpEvaluateExpression(ArgStart, strlen(ArgStart), &Result)) {
|
if (KdbpEvaluateExpression(ArgStart, strlen(ArgStart), &Result)) {
|
||||||
|
@ -1330,7 +1332,7 @@ KdbpCmdBreakPoint(ULONG Argc, PCHAR Argv[])
|
||||||
if (strcmp(Argv[i+1], "IF") == 0) /* IF found */
|
if (strcmp(Argv[i+1], "IF") == 0) /* IF found */
|
||||||
{
|
{
|
||||||
ConditionArgIndex = i + 2;
|
ConditionArgIndex = i + 2;
|
||||||
if (ConditionArgIndex >= Argc)
|
if ((ULONG)ConditionArgIndex >= Argc)
|
||||||
{
|
{
|
||||||
KdbpPrint("%s: IF requires condition expression.\n", Argv[0]);
|
KdbpPrint("%s: IF requires condition expression.\n", Argv[0]);
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
@ -2605,6 +2607,7 @@ CountOnePageUp(PCHAR Buffer, ULONG BufLength, PCHAR pCurPos)
|
||||||
p = p0;
|
p = p0;
|
||||||
for (j = KdbNumberOfRowsTerminal; j--; )
|
for (j = KdbNumberOfRowsTerminal; j--; )
|
||||||
{
|
{
|
||||||
|
int linesCnt;
|
||||||
p1 = memrchr(p0, '\n', p-p0);
|
p1 = memrchr(p0, '\n', p-p0);
|
||||||
prev_p = p;
|
prev_p = p;
|
||||||
p = p1;
|
p = p1;
|
||||||
|
@ -2615,7 +2618,7 @@ CountOnePageUp(PCHAR Buffer, ULONG BufLength, PCHAR pCurPos)
|
||||||
p = p0;
|
p = p0;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
int linesCnt = (KdbNumberOfColsTerminal+prev_p-p-2) / KdbNumberOfColsTerminal;
|
linesCnt = (KdbNumberOfColsTerminal+prev_p-p-2) / KdbNumberOfColsTerminal;
|
||||||
if (linesCnt > 1)
|
if (linesCnt > 1)
|
||||||
j -= linesCnt-1;
|
j -= linesCnt-1;
|
||||||
}
|
}
|
||||||
|
@ -3528,7 +3531,7 @@ KdpPrompt(IN LPSTR InString,
|
||||||
KdbpTryGetCharKeyboard(&DummyScanCode, 5);
|
KdbpTryGetCharKeyboard(&DummyScanCode, 5);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Null terminate the output string -- documentation states that
|
* Null terminate the output string -- documentation states that
|
||||||
* DbgPrompt does not null terminate, but it does
|
* DbgPrompt does not null terminate, but it does
|
||||||
*/
|
*/
|
||||||
|
@ -3536,7 +3539,7 @@ KdpPrompt(IN LPSTR InString,
|
||||||
|
|
||||||
/* Print a new line */
|
/* Print a new line */
|
||||||
KdPortPutByteEx(&SerialPortInfo, '\r');
|
KdPortPutByteEx(&SerialPortInfo, '\r');
|
||||||
KdPortPutByteEx(&SerialPortInfo, '\n');
|
KdPortPutByteEx(&SerialPortInfo, '\n');
|
||||||
|
|
||||||
/* Release spinlock */
|
/* Release spinlock */
|
||||||
KiReleaseSpinLock(&KdpSerialSpinLock);
|
KiReleaseSpinLock(&KdpSerialSpinLock);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue