gdb_input.c (c2c66aff) | gdb_input.c (de369ce2) |
---|---|
1/* 2 * COPYRIGHT: GPL, see COPYING in the top level directory 3 * PROJECT: ReactOS kernel 4 * FILE: drivers/base/kddll/gdb_input.c 5 * PURPOSE: Base functions for the kernel debugger. 6 */ 7 8#include "kdgdb.h" --- 354 unchanged lines hidden (view full) --- 363 364 for ( ; 365 CurrentEntry != ModuleListHead; 366 CurrentEntry = CurrentEntry->Flink) 367 { 368 PLDR_DATA_TABLE_ENTRY TableEntry = CONTAINING_RECORD(CurrentEntry, LDR_DATA_TABLE_ENTRY, InLoadOrderLinks); 369 PVOID DllBase = (PVOID)((ULONG_PTR)TableEntry->DllBase + 0x1000); 370 LONG mem_length; | 1/* 2 * COPYRIGHT: GPL, see COPYING in the top level directory 3 * PROJECT: ReactOS kernel 4 * FILE: drivers/base/kddll/gdb_input.c 5 * PURPOSE: Base functions for the kernel debugger. 6 */ 7 8#include "kdgdb.h" --- 354 unchanged lines hidden (view full) --- 363 364 for ( ; 365 CurrentEntry != ModuleListHead; 366 CurrentEntry = CurrentEntry->Flink) 367 { 368 PLDR_DATA_TABLE_ENTRY TableEntry = CONTAINING_RECORD(CurrentEntry, LDR_DATA_TABLE_ENTRY, InLoadOrderLinks); 369 PVOID DllBase = (PVOID)((ULONG_PTR)TableEntry->DllBase + 0x1000); 370 LONG mem_length; |
371 char* ptr; | 371 USHORT i; |
372 373 /* Convert names to lower case. Yes this _is_ ugly */ | 372 373 /* Convert names to lower case. Yes this _is_ ugly */ |
374 _snprintf(name_helper, 64, "%wZ", &TableEntry->BaseDllName); 375 for (ptr = name_helper; *ptr; ptr++) | 374 for (i = 0; i < (TableEntry->BaseDllName.Length / sizeof(WCHAR)); i++) |
376 { | 375 { |
377 if (*ptr >= 'A' && *ptr <= 'Z') 378 *ptr += 'a' - 'A'; | 376 name_helper[i] = (char)TableEntry->BaseDllName.Buffer[i]; 377 if (name_helper[i] >= 'A' && name_helper[i] <= 'Z') 378 name_helper[i] += 'a' - 'A'; |
379 } | 379 } |
380 name_helper[i] = 0; |
|
380 381 /* GDB doesn't load the file if you don't prefix it with a drive letter... */ 382 mem_length = _snprintf(str_helper, 256, "<library name=\"C:\\%s\"><segment address=\"0x%p\"/></library>", &name_helper, DllBase); 383 384 /* DLL name must be too long. */ 385 if (mem_length < 0) 386 { 387 KDDBGPRINT("Failed to report %wZ\n", &TableEntry->BaseDllName); 388 continue; 389 } 390 391 if ((Sent + mem_length) > ToSend) 392 { 393 /* We're done for this pass */ 394 return finish_gdb_packet(); 395 } | 381 382 /* GDB doesn't load the file if you don't prefix it with a drive letter... */ 383 mem_length = _snprintf(str_helper, 256, "<library name=\"C:\\%s\"><segment address=\"0x%p\"/></library>", &name_helper, DllBase); 384 385 /* DLL name must be too long. */ 386 if (mem_length < 0) 387 { 388 KDDBGPRINT("Failed to report %wZ\n", &TableEntry->BaseDllName); 389 continue; 390 } 391 392 if ((Sent + mem_length) > ToSend) 393 { 394 /* We're done for this pass */ 395 return finish_gdb_packet(); 396 } |
396 | 397 |
397 Sent += send_gdb_partial_binary(str_helper, mem_length); 398 } 399 400 if ((ToSend - Sent) > 15) 401 { 402 Sent += send_gdb_partial_binary("</library-list>", 15); 403 allDone = TRUE; 404 } 405 406 return finish_gdb_packet(); | 398 Sent += send_gdb_partial_binary(str_helper, mem_length); 399 } 400 401 if ((ToSend - Sent) > 15) 402 { 403 Sent += send_gdb_partial_binary("</library-list>", 15); 404 allDone = TRUE; 405 } 406 407 return finish_gdb_packet(); |
407 | |
408 } 409 410 KDDBGPRINT("KDGDB: Unknown query: %s\n", gdb_input); 411 return send_gdb_packet(""); 412} 413 414#if 0 415static --- 612 unchanged lines hidden --- | 408 } 409 410 KDDBGPRINT("KDGDB: Unknown query: %s\n", gdb_input); 411 return send_gdb_packet(""); 412} 413 414#if 0 415static --- 612 unchanged lines hidden --- |