[KDGDB] Minor formatting/typo fixes

This commit is contained in:
Hermès Bélusca-Maïto
2026-03-21 18:16:07 +01:00
parent 6c532e771e
commit d012a8c4a3
4 changed files with 15 additions and 23 deletions
+3 -6
View File
@@ -105,7 +105,7 @@ thread_to_reg(PETHREAD Thread, enum reg_name reg_name)
#endif
if (!Thread->Tcb.InitialStack)
{
/* Terminated thread ? */
/* Terminated thread? */
switch (reg_name)
{
case RSP:
@@ -119,7 +119,7 @@ thread_to_reg(PETHREAD Thread, enum reg_name reg_name)
}
else
{
switch(reg_name)
switch (reg_name)
{
case RSP: return &Thread->Tcb.KernelStack;
case RIP:
@@ -189,7 +189,6 @@ gdb_send_registers(void)
RegisterPtr = thread_to_reg(DbgThread, i);
size = reg_size[i] * 2;
RegisterStr[size] = 0;
while (size)
{
if (RegisterPtr)
@@ -255,9 +254,7 @@ gdb_send_register(void)
}
else
{
KDDBGPRINT("KDDBG : Sending registers as memory.\n");
KDDBGPRINT("KDGDB: Sending registers as memory.\n");
return send_gdb_memory(ptr, reg_size[reg_name]);
}
}
+5 -8
View File
@@ -110,7 +110,7 @@ handle_gdb_set_thread(void)
Status = send_gdb_packet("OK");
break;
default:
KDDBGPRINT("KDGBD: Unknown 'H' command: %s\n", gdb_input);
KDDBGPRINT("KDGDB: Unknown 'H' command: %s\n", gdb_input);
Status = send_gdb_packet("");
}
@@ -347,7 +347,7 @@ handle_gdb_query(void)
ULONG Sent = 0;
static BOOLEAN allDone = FALSE;
KDDBGPRINT("KDGDB: qXfer:libraries:read !\n");
KDDBGPRINT("KDGDB: qXfer:libraries:read\n");
/* Start the packet */
start_gdb_packet();
@@ -874,7 +874,7 @@ handle_gdb_remove_breakpoint(
if (Handle == 0)
{
KDDBGPRINT("Received %s, but breakpoint was never inserted ?!\n", gdb_input);
KDDBGPRINT("Received %s, but breakpoint was never inserted?!\n", gdb_input);
return LOOP_IF_SUCCESS(send_gdb_packet("E01"));
}
@@ -907,7 +907,6 @@ handle_gdb_c(
if (Status != KdPacketReceived)
return Status;
if (CurrentStateChange.NewState == DbgKdExceptionStateChange)
{
DBGKM_EXCEPTION64* Exception = &CurrentStateChange.u.Exception;
@@ -981,7 +980,6 @@ handle_gdb_v(
if (strncmp(gdb_input, "vCont;s", 7) == 0)
{
return handle_gdb_s(State, MessageData, MessageLength, KdContext);
}
}
@@ -1001,9 +999,9 @@ gdb_receive_and_interpret_packet(
do
{
KDDBGPRINT("KDGBD: Receiving packet.\n");
KDDBGPRINT("KDGDB: Receiving packet.\n");
Status = gdb_receive_packet(KdContext);
KDDBGPRINT("KDGBD: Packet \"%s\" received with status %u\n", gdb_input, Status);
KDDBGPRINT("KDGDB: Packet \"%s\" received with status %u\n", gdb_input, Status);
if (Status != KdPacketReceived)
return Status;
@@ -1065,4 +1063,3 @@ gdb_receive_and_interpret_packet(
return Status;
}
+5 -7
View File
@@ -87,7 +87,7 @@ thread_to_reg(PETHREAD Thread, enum reg_name reg_name, unsigned short* size)
if (!Thread->Tcb.InitialStack)
{
/* Terminated thread ? */
/* Terminated thread? */
switch (reg_name)
{
case ESP:
@@ -135,7 +135,7 @@ thread_to_reg(PETHREAD Thread, enum reg_name reg_name, unsigned short* size)
static PULONG Esp;
Esp = Thread->Tcb.KernelStack;
*size = 4;
switch(reg_name)
switch (reg_name)
{
case EBP: return &Esp[3];
case ESP: return &Esp;
@@ -165,7 +165,7 @@ gdb_send_registers(void)
if (((gdb_dbg_pid == 0) && (gdb_dbg_tid == 0)) ||
gdb_tid_to_handle(gdb_dbg_tid) == PsGetThreadId((PETHREAD)(ULONG_PTR)CurrentStateChange.Thread))
{
for(i=0; i < 16; i++)
for (i = 0; i < 16; i++)
{
RegisterPtr = ctx_to_reg(&CurrentContext, i, &size);
RegisterStr[0] = hex_chars[RegisterPtr[0] >> 4];
@@ -193,7 +193,7 @@ gdb_send_registers(void)
return finish_gdb_packet();
}
for(i=0; i < 16; i++)
for (i = 0; i < 16; i++)
{
RegisterPtr = thread_to_reg(DbgThread, i, &size);
if (RegisterPtr)
@@ -257,9 +257,7 @@ gdb_send_register(void)
}
else
{
KDDBGPRINT("KDDBG : Sending registers as memory.\n");
KDDBGPRINT("KDGDB: Sending registers as memory.\n");
return send_gdb_memory(ptr, size);
}
}
+2 -2
View File
@@ -304,7 +304,7 @@ FirstSendHandler(
return FALSE;
}
KDDBGPRINT("KDGDB: START!\n");
KDDBGPRINT("KDGDB: START\n");
Thread = (PETHREAD)(ULONG_PTR)StateChange->Thread;
@@ -374,7 +374,7 @@ KdReceivePacket(
{
static BOOLEAN ignore = 0;
KDDBGPRINT("Debug prompt.\n");
/* HACK ! Debug prompt asks for break or ignore. First break, then ignore. */
/* HACK: Debug prompt asks for break or ignore. First break, then ignore. */
MessageData->Length = 1;
MessageData->Buffer[0] = ignore ? 'i' : 'b';
ignore = !ignore;