TianoCore EDK2 master
Loading...
Searching...
No Matches
EdbCmdSymbol.c
Go to the documentation of this file.
1
9#include "Edb.h"
10
20CHAR16 *
22 IN CHAR16 *FullPath
23 )
24{
25 CHAR16 *FileName;
26 CHAR16 *TempFileName;
27
28 FileName = FullPath;
29 TempFileName = StrGetNewTokenLine (FullPath, L"\\");
30
31 while (TempFileName != NULL) {
32 FileName = TempFileName;
33 TempFileName = StrGetNextTokenLine (L"\\");
34 PatchForStrTokenBefore (TempFileName, L'\\');
35 }
36
37 return FileName;
38}
39
49CHAR16 *
51 IN CHAR16 *FullPath
52 )
53{
54 CHAR16 *FileName;
55
56 FileName = GetFileNameFromFullPath (FullPath);
57 if (FileName != FullPath) {
58 *(FileName - 1) = 0;
59 return FullPath;
60 }
61
62 return L"";
63}
64
76CHAR16 *
78 IN CHAR16 *DirPath,
79 IN CHAR16 *FilePath,
80 IN UINTN Size
81 )
82{
83 UINTN DirPathSize;
84
85 DirPathSize = StrLen (DirPath);
86 *(DirPath + DirPathSize) = L'\\';
87 StrnCatS (DirPath, DirPathSize + Size + 1, FilePath, Size);
88
89 *(DirPath + DirPathSize + Size + 1) = 0;
90
91 return DirPath;
92}
93
94CHAR16 *mSymbolTypeStr[] = {
95 L"( F)",
96 L"(SF)",
97 L"(GV)",
98 L"(SV)",
99};
100
110CHAR16 *
112 IN EFI_DEBUGGER_SYMBOL_TYPE Type
113 )
114{
115 if ((Type < 0) || (Type >= EfiDebuggerSymbolTypeMax)) {
116 return L"(?)";
117 }
118
119 return mSymbolTypeStr[Type];
120}
121
132EFI_DEBUG_STATUS
134 IN UINTN Address,
135 IN EFI_DEBUGGER_PRIVATE_DATA *DebuggerPrivate
136 )
137{
140 UINTN CandidateAddress;
141
142 //
143 // Find the nearest symbol address
144 //
145 CandidateAddress = EbdFindSymbolAddress (Address, EdbMatchSymbolTypeNearestAddress, &Object, &Entry);
146 if ((CandidateAddress == 0) || (CandidateAddress == (UINTN)-1) || (Entry == NULL)) {
147 EDBPrint (L"Symbole at Address not found!\n");
148 return EFI_DEBUG_CONTINUE;
149 } else if (Address != CandidateAddress) {
150 EDBPrint (L"Symbole at Address not found, print nearest one!\n");
151 }
152
153 //
154 // Display symbol
155 //
156 EDBPrint (L"Symbol File Name: %s\n", Object->Name);
157 if (sizeof (UINTN) == sizeof (UINT64)) {
158 EDBPrint (L" Address Type Symbol\n");
159 EDBPrint (L" ================== ==== ========\n");
160 // EDBPrint (L" 0xFFFFFFFF00000000 ( F) TestMain\n");
161 EDBPrint (
162 L" 0x%016lx %s %a\n",
163 (UINT64)Entry->Rva + Object->BaseAddress,
164 EdbSymbolTypeToStr (Entry->Type),
165 Entry->Name
166 );
167 } else {
168 EDBPrint (L" Address Type Symbol\n");
169 EDBPrint (L" ========== ==== ========\n");
170 // EDBPrint (L" 0xFFFF0000 ( F) TestMain\n");
171 EDBPrint (
172 L" 0x%08x %s %a\n",
173 Entry->Rva + Object->BaseAddress,
174 EdbSymbolTypeToStr (Entry->Type),
175 Entry->Name
176 );
177 }
178
179 //
180 // Done
181 //
182 return EFI_DEBUG_CONTINUE;
183}
184
196EFI_DEBUG_STATUS
198 IN CHAR16 *SymbolFileName,
199 IN CHAR16 *SymbolName,
200 IN EFI_DEBUGGER_PRIVATE_DATA *DebuggerPrivate
201 )
202{
203 UINTN Index;
204 UINTN SubIndex;
207
208 if (DebuggerPrivate->DebuggerSymbolContext.ObjectCount == 0) {
209 EDBPrint (L"No Symbol File!\n");
210 return EFI_DEBUG_CONTINUE;
211 }
212
213 //
214 // Go throuth each symbol file
215 //
216 Object = DebuggerPrivate->DebuggerSymbolContext.Object;
217 for (Index = 0; Index < DebuggerPrivate->DebuggerSymbolContext.ObjectCount; Index++, Object++) {
218 if ((SymbolFileName != NULL) &&
219 (StriCmp (SymbolFileName, Object->Name) != 0))
220 {
221 continue;
222 }
223
224 //
225 // Break each symbol file
226 //
227 if (Index != 0) {
228 if (SetPageBreak ()) {
229 break;
230 }
231 }
232
233 EDBPrint (L"Symbol File Name: %s\n", Object->Name);
234 if (Object->EntryCount == 0) {
235 EDBPrint (L"No Symbol!\n");
236 continue;
237 }
238
239 Entry = Object->Entry;
240 if (sizeof (UINTN) == sizeof (UINT64)) {
241 EDBPrint (L" Address Type Symbol\n");
242 EDBPrint (L" ================== ==== ========\n");
243 // EDBPrint (L" 0xFFFFFFFF00000000 ( F) TestMain (EbcTest.obj)\n");
244 } else {
245 EDBPrint (L" Address Type Symbol\n");
246 EDBPrint (L" ========== ==== ========\n");
247 // EDBPrint (L" 0xFFFF0000 ( F) TestMain (EbcTest.obj)\n");
248 }
249
250 //
251 // Go through each symbol name
252 //
253 for (SubIndex = 0; SubIndex < Object->EntryCount; SubIndex++, Entry++) {
254 if ((SymbolName != NULL) &&
255 (StrCmpUnicodeAndAscii (SymbolName, Entry->Name) != 0))
256 {
257 continue;
258 }
259
260 //
261 // Break symbol
262 //
263 if (((SubIndex % EFI_DEBUGGER_LINE_NUMBER_IN_PAGE) == 0) &&
264 (SubIndex != 0))
265 {
266 if (SetPageBreak ()) {
267 break;
268 }
269 }
270
271 if (sizeof (UINTN) == sizeof (UINT64)) {
272 EDBPrint (
273 L" 0x%016lx %s %a (%a)\n",
274 (UINT64)Entry->Rva + Object->BaseAddress,
275 EdbSymbolTypeToStr (Entry->Type),
276 Entry->Name,
277 Entry->ObjName
278 );
279 } else {
280 EDBPrint (
281 L" 0x%08x %s %a (%a)\n",
282 Entry->Rva + Object->BaseAddress,
283 EdbSymbolTypeToStr (Entry->Type),
284 Entry->Name,
285 Entry->ObjName
286 );
287 }
288 }
289 }
290
291 //
292 // Done
293 //
294 return EFI_DEBUG_CONTINUE;
295}
296
309EFI_DEBUG_STATUS
311 IN CHAR16 *CommandArg,
312 IN EFI_DEBUGGER_PRIVATE_DATA *DebuggerPrivate,
313 IN EFI_EXCEPTION_TYPE ExceptionType,
314 IN OUT EFI_SYSTEM_CONTEXT SystemContext
315 )
316{
317 CHAR16 *SymbolFileName;
318 CHAR16 *SymbolName;
319 CHAR16 *CommandStr;
320 UINTN Address;
321
322 SymbolFileName = NULL;
323 SymbolName = NULL;
324 CommandStr = CommandArg;
325
326 //
327 // display symbol according to address
328 //
329 if (CommandStr != NULL) {
330 if ((StriCmp (CommandStr, L"F") != 0) &&
331 (StriCmp (CommandStr, L"S") != 0))
332 {
333 Address = Xtoi (CommandStr);
334 return DebuggerDisplaySymbolAccrodingToAddress (Address, DebuggerPrivate);
335 }
336 }
337
338 //
339 // Get SymbolFileName
340 //
341 if (CommandStr != NULL) {
342 if (StriCmp (CommandStr, L"F") == 0) {
343 CommandStr = StrGetNextTokenLine (L" ");
344 if (CommandStr == NULL) {
345 EDBPrint (L"Symbol File Name missing!\n");
346 return EFI_DEBUG_CONTINUE;
347 } else {
348 SymbolFileName = CommandStr;
349 CommandStr = StrGetNextTokenLine (L" ");
350 }
351 }
352 }
353
354 //
355 // Get SymbolName
356 //
357 if (CommandStr != NULL) {
358 if (StriCmp (CommandStr, L"S") == 0) {
359 CommandStr = StrGetNextTokenLine (L" ");
360 if (CommandStr == NULL) {
361 EDBPrint (L"Symbol Name missing!\n");
362 return EFI_DEBUG_CONTINUE;
363 } else {
364 SymbolName = CommandStr;
365 CommandStr = StrGetNextTokenLine (L" ");
366 }
367 }
368 }
369
370 if (CommandStr != NULL) {
371 EDBPrint (L"Argument error!\n");
372 return EFI_DEBUG_CONTINUE;
373 }
374
375 //
376 // display symbol according to name
377 //
378 return DebuggerDisplaySymbolAccrodingToName (SymbolFileName, SymbolName, DebuggerPrivate);
379}
380
393EFI_DEBUG_STATUS
395 IN CHAR16 *CommandArg,
396 IN EFI_DEBUGGER_PRIVATE_DATA *DebuggerPrivate,
397 IN EFI_EXCEPTION_TYPE ExceptionType,
398 IN OUT EFI_SYSTEM_CONTEXT SystemContext
399 )
400{
401 UINTN BufferSize;
402 VOID *Buffer;
403 EFI_STATUS Status;
404 CHAR16 *FileName;
405 CHAR16 *CommandArg2;
406 BOOLEAN IsLoadCode;
407 CHAR16 *DirName;
408 CHAR16 CodFile[EFI_DEBUGGER_SYMBOL_NAME_MAX];
409 CHAR16 *CodFileName;
410 UINTN Index;
411
412 //
413 // Check the argument
414 //
415 if (CommandArg == NULL) {
416 EDBPrint (L"SymbolFile not found!\n");
417 return EFI_DEBUG_CONTINUE;
418 }
419
420 IsLoadCode = FALSE;
421 CommandArg2 = StrGetNextTokenLine (L" ");
422 if (CommandArg2 != NULL) {
423 if (StriCmp (CommandArg2, L"a") == 0) {
424 IsLoadCode = TRUE;
425 } else {
426 EDBPrint (L"Argument error!\n");
427 return EFI_DEBUG_CONTINUE;
428 }
429 }
430
431 if (StrLen (CommandArg) <= 4) {
432 EDBPrint (L"SymbolFile name error!\n");
433 return EFI_DEBUG_CONTINUE;
434 }
435
436 if (StriCmp (CommandArg + (StrLen (CommandArg) - 4), L".map") != 0) {
437 EDBPrint (L"SymbolFile name error!\n");
438 return EFI_DEBUG_CONTINUE;
439 }
440
441 //
442 // Read MAP file to memory
443 //
444 Status = ReadFileToBuffer (DebuggerPrivate, CommandArg, &BufferSize, &Buffer, TRUE);
445 if (EFI_ERROR (Status)) {
446 EDBPrint (L"SymbolFile read error!\n");
447 return EFI_DEBUG_CONTINUE;
448 }
449
450 FileName = GetFileNameFromFullPath (CommandArg);
451 //
452 // Load Symbol
453 //
454 Status = EdbLoadSymbol (DebuggerPrivate, FileName, BufferSize, Buffer);
455 if (EFI_ERROR (Status)) {
456 EDBPrint (L"LoadSymbol error!\n");
457 gBS->FreePool (Buffer);
458 return EFI_DEBUG_CONTINUE;
459 }
460
461 gBS->FreePool (Buffer);
462
463 //
464 // Patch Symbol for RVA
465 //
466 Status = EdbPatchSymbolRVA (DebuggerPrivate, FileName, EdbEbcImageRvaSearchTypeLast);
467 if (EFI_ERROR (Status)) {
468 EDBPrint (L"PatchSymbol RVA - %r! Using the RVA in symbol file.\n", Status);
469 } else {
470 DEBUG ((DEBUG_ERROR, "PatchSymbol RVA successfully!\n"));
471 }
472
473 if (!IsLoadCode) {
474 return EFI_DEBUG_CONTINUE;
475 }
476
477 //
478 // load each cod file
479 //
480 DirName = GetDirNameFromFullPath (CommandArg);
481 ZeroMem (CodFile, sizeof (CodFile));
482 if (StrCmp (DirName, L"") != 0) {
483 StrCpyS (CodFile, sizeof (CodFile), DirName);
484 } else {
485 DirName = L"\\";
486 }
487
488 //
489 // Go throuth each file under this dir
490 //
491 Index = 0;
492 CodFileName = GetFileNameUnderDir (DebuggerPrivate, DirName, L".cod", &Index);
493 while (CodFileName != NULL) {
494 ZeroMem (CodFile, sizeof (CodFile));
495 if (StrCmp (DirName, L"\\") != 0) {
496 StrCpyS (CodFile, sizeof (CodFile), DirName);
497 }
498
499 //
500 // read cod file to memory
501 //
502 Status = ReadFileToBuffer (DebuggerPrivate, ConstructFullPath (CodFile, CodFileName, EFI_DEBUGGER_SYMBOL_NAME_MAX - StrLen (CodFile) - 2), &BufferSize, &Buffer, FALSE);
503 if (EFI_ERROR (Status)) {
504 EDBPrint (L"CodeFile read error!\n");
505 CodFileName = GetFileNameUnderDir (DebuggerPrivate, DirName, L".cod", &Index);
506 continue;
507 }
508
509 //
510 // Load Code
511 //
512 Status = EdbLoadCode (DebuggerPrivate, FileName, CodFileName, BufferSize, Buffer);
513 if (EFI_ERROR (Status)) {
514 EDBPrint (L"LoadCode error!\n");
515 gBS->FreePool (Buffer);
516 CodFileName = GetFileNameUnderDir (DebuggerPrivate, DirName, L".cod", &Index);
517 continue;
518 }
519
520 //
521 // Record the buffer
522 //
523 Status = EdbAddCodeBuffer (DebuggerPrivate, FileName, CodFileName, BufferSize, Buffer);
524 if (EFI_ERROR (Status)) {
525 EDBPrint (L"AddCodeBuffer error!\n");
526 gBS->FreePool (Buffer);
527 CodFileName = GetFileNameUnderDir (DebuggerPrivate, DirName, L".cod", &Index);
528 continue;
529 }
530
531 //
532 // Get next file
533 //
534 CodFileName = GetFileNameUnderDir (DebuggerPrivate, DirName, L".cod", &Index);
535 }
536
537 //
538 // Done
539 //
540 return EFI_DEBUG_CONTINUE;
541}
542
555EFI_DEBUG_STATUS
557 IN CHAR16 *CommandArg,
558 IN EFI_DEBUGGER_PRIVATE_DATA *DebuggerPrivate,
559 IN EFI_EXCEPTION_TYPE ExceptionType,
560 IN OUT EFI_SYSTEM_CONTEXT SystemContext
561 )
562{
563 EFI_STATUS Status;
564 CHAR16 *FileName;
565 CHAR16 *DirName;
566 CHAR16 CodFile[EFI_DEBUGGER_SYMBOL_NAME_MAX];
567 CHAR16 *CodFileName;
568 UINTN Index;
569 VOID *BufferPtr;
570
571 //
572 // Check the argument
573 //
574 if (CommandArg == NULL) {
575 EDBPrint (L"SymbolFile not found!\n");
576 return EFI_DEBUG_CONTINUE;
577 }
578
579 FileName = GetFileNameFromFullPath (CommandArg);
580
581 //
582 // Unload Code
583 //
584 DirName = GetDirNameFromFullPath (CommandArg);
585 ZeroMem (CodFile, sizeof (CodFile));
586 if (StrCmp (DirName, L"") != 0) {
587 StrCpyS (CodFile, sizeof (CodFile), DirName);
588 } else {
589 DirName = L"\\";
590 }
591
592 //
593 // Go through each file under this dir
594 //
595 Index = 0;
596 CodFileName = GetFileNameUnderDir (DebuggerPrivate, DirName, L".cod", &Index);
597 while (CodFileName != NULL) {
598 ZeroMem (CodFile, sizeof (CodFile));
599 if (StrCmp (DirName, L"\\") != 0) {
600 StrCpyS (CodFile, sizeof (CodFile), DirName);
601 }
602
603 //
604 // Unload Code
605 //
606 Status = EdbUnloadCode (DebuggerPrivate, FileName, CodFileName, &BufferPtr);
607 if (EFI_ERROR (Status)) {
608 EDBPrint (L"UnloadCode error!\n");
609 CodFileName = GetFileNameUnderDir (DebuggerPrivate, DirName, L".cod", &Index);
610 continue;
611 }
612
613 //
614 // Delete the code buffer
615 //
616 Status = EdbDeleteCodeBuffer (DebuggerPrivate, FileName, CodFileName, BufferPtr);
617 if (EFI_ERROR (Status)) {
618 EDBPrint (L"DeleteCodeBuffer error!\n");
619 CodFileName = GetFileNameUnderDir (DebuggerPrivate, DirName, L".cod", &Index);
620 continue;
621 }
622
623 //
624 // Get next file
625 //
626 CodFileName = GetFileNameUnderDir (DebuggerPrivate, DirName, L".cod", &Index);
627 }
628
629 //
630 // Unload Symbol
631 //
632 Status = EdbUnloadSymbol (DebuggerPrivate, FileName);
633 if (EFI_ERROR (Status)) {
634 EDBPrint (L"UnloadSymbol error!\n");
635 }
636
637 //
638 // Done
639 //
640 return EFI_DEBUG_CONTINUE;
641}
642
655EFI_DEBUG_STATUS
657 IN CHAR16 *CommandArg,
658 IN EFI_DEBUGGER_PRIVATE_DATA *DebuggerPrivate,
659 IN EFI_EXCEPTION_TYPE ExceptionType,
660 IN OUT EFI_SYSTEM_CONTEXT SystemContext
661 )
662{
663 if (CommandArg == NULL) {
664 DebuggerPrivate->DebuggerSymbolContext.DisplaySymbol = !DebuggerPrivate->DebuggerSymbolContext.DisplaySymbol;
665 EdbShowDisasm (DebuggerPrivate, SystemContext);
666 } else if (StriCmp (CommandArg, L"on") == 0) {
667 DebuggerPrivate->DebuggerSymbolContext.DisplaySymbol = TRUE;
668 EdbShowDisasm (DebuggerPrivate, SystemContext);
669 } else if (StriCmp (CommandArg, L"off") == 0) {
670 DebuggerPrivate->DebuggerSymbolContext.DisplaySymbol = FALSE;
671 EdbShowDisasm (DebuggerPrivate, SystemContext);
672 } else {
673 EDBPrint (L"DisplaySymbol - argument error\n");
674 }
675
676 return EFI_DEBUG_CONTINUE;
677}
678
691EFI_DEBUG_STATUS
693 IN CHAR16 *CommandArg,
694 IN EFI_DEBUGGER_PRIVATE_DATA *DebuggerPrivate,
695 IN EFI_EXCEPTION_TYPE ExceptionType,
696 IN OUT EFI_SYSTEM_CONTEXT SystemContext
697 )
698{
699 UINTN BufferSize;
700 VOID *Buffer;
701 EFI_STATUS Status;
702 CHAR16 *CommandArg2;
703 CHAR16 *FileName;
704 CHAR16 *MapFileName;
705
706 //
707 // Check the argument
708 //
709 if (CommandArg == NULL) {
710 EDBPrint (L"CodeFile not found!\n");
711 return EFI_DEBUG_CONTINUE;
712 }
713
714 CommandArg2 = StrGetNextTokenLine (L" ");
715 if (CommandArg2 == NULL) {
716 EDBPrint (L"SymbolFile not found!\n");
717 return EFI_DEBUG_CONTINUE;
718 }
719
720 if (StrLen (CommandArg) <= 4) {
721 EDBPrint (L"CodeFile name error!\n");
722 return EFI_DEBUG_CONTINUE;
723 }
724
725 if (StriCmp (CommandArg + (StrLen (CommandArg) - 4), L".cod") != 0) {
726 EDBPrint (L"CodeFile name error!\n");
727 return EFI_DEBUG_CONTINUE;
728 }
729
730 if (StrLen (CommandArg2) <= 4) {
731 EDBPrint (L"SymbolFile name error!\n");
732 return EFI_DEBUG_CONTINUE;
733 }
734
735 if (StriCmp (CommandArg2 + (StrLen (CommandArg2) - 4), L".map") != 0) {
736 EDBPrint (L"SymbolFile name error!\n");
737 return EFI_DEBUG_CONTINUE;
738 }
739
740 //
741 // read cod file to memory
742 //
743 Status = ReadFileToBuffer (DebuggerPrivate, CommandArg, &BufferSize, &Buffer, TRUE);
744 if (EFI_ERROR (Status)) {
745 EDBPrint (L"CodeFile read error!\n");
746 return EFI_DEBUG_CONTINUE;
747 }
748
749 FileName = GetFileNameFromFullPath (CommandArg);
750 MapFileName = GetFileNameFromFullPath (CommandArg2);
751 //
752 // Load Code
753 //
754 Status = EdbLoadCode (DebuggerPrivate, MapFileName, FileName, BufferSize, Buffer);
755 if (EFI_ERROR (Status)) {
756 EDBPrint (L"LoadCode error!\n");
757 gBS->FreePool (Buffer);
758 return EFI_DEBUG_CONTINUE;
759 }
760
761 //
762 // Record the buffer
763 //
764 Status = EdbAddCodeBuffer (DebuggerPrivate, MapFileName, FileName, BufferSize, Buffer);
765 if (EFI_ERROR (Status)) {
766 EDBPrint (L"AddCodeBuffer error!\n");
767 gBS->FreePool (Buffer);
768 return EFI_DEBUG_CONTINUE;
769 }
770
771 //
772 // Done
773 //
774 return EFI_DEBUG_CONTINUE;
775}
776
789EFI_DEBUG_STATUS
791 IN CHAR16 *CommandArg,
792 IN EFI_DEBUGGER_PRIVATE_DATA *DebuggerPrivate,
793 IN EFI_EXCEPTION_TYPE ExceptionType,
794 IN OUT EFI_SYSTEM_CONTEXT SystemContext
795 )
796{
797 CHAR16 *CommandArg2;
798 CHAR16 *FileName;
799 CHAR16 *MapFileName;
800 EFI_STATUS Status;
801 VOID *BufferPtr;
802
803 //
804 // Check the argument
805 //
806 if (CommandArg == NULL) {
807 EDBPrint (L"CodeFile not found!\n");
808 return EFI_DEBUG_CONTINUE;
809 }
810
811 CommandArg2 = StrGetNextTokenLine (L" ");
812 if (CommandArg2 == NULL) {
813 EDBPrint (L"SymbolFile not found!\n");
814 return EFI_DEBUG_CONTINUE;
815 }
816
817 FileName = GetFileNameFromFullPath (CommandArg);
818 MapFileName = GetFileNameFromFullPath (CommandArg2);
819
820 //
821 // Unload Code
822 //
823 Status = EdbUnloadCode (DebuggerPrivate, MapFileName, FileName, &BufferPtr);
824 if (EFI_ERROR (Status)) {
825 EDBPrint (L"UnloadCode error!\n");
826 return EFI_DEBUG_CONTINUE;
827 }
828
829 //
830 // Delete Code buffer
831 //
832 Status = EdbDeleteCodeBuffer (DebuggerPrivate, MapFileName, FileName, BufferPtr);
833 if (EFI_ERROR (Status)) {
834 EDBPrint (L"DeleteCodeBuffer error!\n");
835 }
836
837 //
838 // Done
839 //
840 return EFI_DEBUG_CONTINUE;
841}
842
855EFI_DEBUG_STATUS
857 IN CHAR16 *CommandArg,
858 IN EFI_DEBUGGER_PRIVATE_DATA *DebuggerPrivate,
859 IN EFI_EXCEPTION_TYPE ExceptionType,
860 IN OUT EFI_SYSTEM_CONTEXT SystemContext
861 )
862{
863 if (CommandArg == NULL) {
864 DebuggerPrivate->DebuggerSymbolContext.DisplayCodeOnly = !DebuggerPrivate->DebuggerSymbolContext.DisplayCodeOnly;
865 EdbShowDisasm (DebuggerPrivate, SystemContext);
866 } else if (StriCmp (CommandArg, L"on") == 0) {
867 DebuggerPrivate->DebuggerSymbolContext.DisplayCodeOnly = TRUE;
868 EdbShowDisasm (DebuggerPrivate, SystemContext);
869 } else if (StriCmp (CommandArg, L"off") == 0) {
870 DebuggerPrivate->DebuggerSymbolContext.DisplayCodeOnly = FALSE;
871 EdbShowDisasm (DebuggerPrivate, SystemContext);
872 } else {
873 EDBPrint (L"DisplayCode - argument error\n");
874 }
875
876 return EFI_DEBUG_CONTINUE;
877}
UINT64 UINTN
EFI_STATUS ReadFileToBuffer(IN CHAR16 *FileName, OUT UINTN *BufferSize, OUT VOID **Buffer)
Definition: AppSupport.c:81
RETURN_STATUS EFIAPI StrCpyS(OUT CHAR16 *Destination, IN UINTN DestMax, IN CONST CHAR16 *Source)
Definition: SafeString.c:226
INTN EFIAPI StrCmp(IN CONST CHAR16 *FirstString, IN CONST CHAR16 *SecondString)
Definition: String.c:109
RETURN_STATUS EFIAPI StrnCatS(IN OUT CHAR16 *Destination, IN UINTN DestMax, IN CONST CHAR16 *Source, IN UINTN Length)
Definition: SafeString.c:507
UINTN EFIAPI StrLen(IN CONST CHAR16 *String)
Definition: String.c:30
VOID *EFIAPI ZeroMem(OUT VOID *Buffer, IN UINTN Length)
EFI_DEBUG_STATUS DebuggerListSymbol(IN CHAR16 *CommandArg, IN EFI_DEBUGGER_PRIVATE_DATA *DebuggerPrivate, IN EFI_EXCEPTION_TYPE ExceptionType, IN OUT EFI_SYSTEM_CONTEXT SystemContext)
Definition: EdbCmdSymbol.c:310
EFI_DEBUG_STATUS DebuggerLoadCode(IN CHAR16 *CommandArg, IN EFI_DEBUGGER_PRIVATE_DATA *DebuggerPrivate, IN EFI_EXCEPTION_TYPE ExceptionType, IN OUT EFI_SYSTEM_CONTEXT SystemContext)
Definition: EdbCmdSymbol.c:692
EFI_DEBUG_STATUS DebuggerDisplaySymbolAccrodingToAddress(IN UINTN Address, IN EFI_DEBUGGER_PRIVATE_DATA *DebuggerPrivate)
Definition: EdbCmdSymbol.c:133
EFI_DEBUG_STATUS DebuggerDisplaySymbolAccrodingToName(IN CHAR16 *SymbolFileName, IN CHAR16 *SymbolName, IN EFI_DEBUGGER_PRIVATE_DATA *DebuggerPrivate)
Definition: EdbCmdSymbol.c:197
EFI_DEBUG_STATUS DebuggerUnloadCode(IN CHAR16 *CommandArg, IN EFI_DEBUGGER_PRIVATE_DATA *DebuggerPrivate, IN EFI_EXCEPTION_TYPE ExceptionType, IN OUT EFI_SYSTEM_CONTEXT SystemContext)
Definition: EdbCmdSymbol.c:790
EFI_DEBUG_STATUS DebuggerUnloadSymbol(IN CHAR16 *CommandArg, IN EFI_DEBUGGER_PRIVATE_DATA *DebuggerPrivate, IN EFI_EXCEPTION_TYPE ExceptionType, IN OUT EFI_SYSTEM_CONTEXT SystemContext)
Definition: EdbCmdSymbol.c:556
CHAR16 * GetDirNameFromFullPath(IN CHAR16 *FullPath)
Definition: EdbCmdSymbol.c:50
EFI_DEBUG_STATUS DebuggerDisplayCode(IN CHAR16 *CommandArg, IN EFI_DEBUGGER_PRIVATE_DATA *DebuggerPrivate, IN EFI_EXCEPTION_TYPE ExceptionType, IN OUT EFI_SYSTEM_CONTEXT SystemContext)
Definition: EdbCmdSymbol.c:856
EFI_DEBUG_STATUS DebuggerDisplaySymbol(IN CHAR16 *CommandArg, IN EFI_DEBUGGER_PRIVATE_DATA *DebuggerPrivate, IN EFI_EXCEPTION_TYPE ExceptionType, IN OUT EFI_SYSTEM_CONTEXT SystemContext)
Definition: EdbCmdSymbol.c:656
CHAR16 * ConstructFullPath(IN CHAR16 *DirPath, IN CHAR16 *FilePath, IN UINTN Size)
Definition: EdbCmdSymbol.c:77
CHAR16 * EdbSymbolTypeToStr(IN EFI_DEBUGGER_SYMBOL_TYPE Type)
Definition: EdbCmdSymbol.c:111
EFI_DEBUG_STATUS DebuggerLoadSymbol(IN CHAR16 *CommandArg, IN EFI_DEBUGGER_PRIVATE_DATA *DebuggerPrivate, IN EFI_EXCEPTION_TYPE ExceptionType, IN OUT EFI_SYSTEM_CONTEXT SystemContext)
Definition: EdbCmdSymbol.c:394
CHAR16 * GetFileNameFromFullPath(IN CHAR16 *FullPath)
Definition: EdbCmdSymbol.c:21
EFI_STATUS EdbShowDisasm(IN EFI_DEBUGGER_PRIVATE_DATA *DebuggerPrivate, IN EFI_SYSTEM_CONTEXT SystemContext)
CHAR16 *EFIAPI StrGetNewTokenLine(IN CHAR16 *String, IN CHAR16 *CharSet)
UINTN EFIAPI Xtoi(CHAR16 *Str)
BOOLEAN EFIAPI SetPageBreak(VOID)
Definition: EdbSupportUI.c:605
CHAR16 *EFIAPI StrGetNextTokenLine(IN CHAR16 *CharSet)
UINTN EFIAPI EDBPrint(IN CONST CHAR16 *Format,...)
Definition: EdbSupportUI.c:683
INTN EFIAPI StrCmpUnicodeAndAscii(IN CHAR16 *String, IN CHAR8 *String2)
VOID EFIAPI PatchForStrTokenBefore(IN CHAR16 *Buffer, IN CHAR16 Patch)
INTN EFIAPI StriCmp(IN CHAR16 *String, IN CHAR16 *String2)
CHAR16 *EFIAPI GetFileNameUnderDir(IN EFI_DEBUGGER_PRIVATE_DATA *DebuggerPrivate, IN CHAR16 *DirName, IN CHAR16 *FileName, IN OUT UINTN *Index)
EFI_STATUS EdbLoadSymbol(IN EFI_DEBUGGER_PRIVATE_DATA *DebuggerPrivate, IN CHAR16 *FileName, IN UINTN BufferSize, IN VOID *Buffer)
Definition: EdbSymbol.c:693
EFI_STATUS EdbLoadCode(IN EFI_DEBUGGER_PRIVATE_DATA *DebuggerPrivate, IN CHAR16 *MapFileName, IN CHAR16 *FileName, IN UINTN BufferSize, IN VOID *Buffer)
Definition: EdbSymbol.c:1438
EFI_STATUS EdbUnloadSymbol(IN EFI_DEBUGGER_PRIVATE_DATA *DebuggerPrivate, IN CHAR16 *FileName)
Definition: EdbSymbol.c:614
EFI_STATUS EdbAddCodeBuffer(IN EFI_DEBUGGER_PRIVATE_DATA *DebuggerPrivate, IN CHAR16 *MapFileName, IN CHAR16 *CodeFileName, IN UINTN SourceBufferSize, IN VOID *SourceBuffer)
Definition: EdbSymbol.c:1630
EFI_STATUS EdbUnloadCode(IN EFI_DEBUGGER_PRIVATE_DATA *DebuggerPrivate, IN CHAR16 *MapFileName, IN CHAR16 *FileName, OUT VOID **Buffer)
Definition: EdbSymbol.c:1554
EFI_STATUS EdbPatchSymbolRVA(IN EFI_DEBUGGER_PRIVATE_DATA *DebuggerPrivate, IN CHAR16 *FileName, IN EDB_EBC_IMAGE_RVA_SEARCH_TYPE SearchType)
Definition: EdbSymbol.c:997
UINTN EbdFindSymbolAddress(IN UINTN Address, IN EDB_MATCH_SYMBOL_TYPE Type, OUT EFI_DEBUGGER_SYMBOL_OBJECT **RetObject, OUT EFI_DEBUGGER_SYMBOL_ENTRY **RetEntry)
Definition: EdbSymbol.c:477
EFI_STATUS EdbDeleteCodeBuffer(IN EFI_DEBUGGER_PRIVATE_DATA *DebuggerPrivate, IN CHAR16 *MapFileName, IN CHAR16 *CodeFileName, IN VOID *SourceBuffer)
Definition: EdbSymbol.c:1674
#define NULL
Definition: Base.h:319
#define TRUE
Definition: Base.h:301
#define FALSE
Definition: Base.h:307
#define IN
Definition: Base.h:279
#define OUT
Definition: Base.h:284
#define DEBUG(Expression)
Definition: DebugLib.h:434
INTN EFI_EXCEPTION_TYPE
Definition: DebugSupport.h:35
RETURN_STATUS EFI_STATUS
Definition: UefiBaseType.h:29
EFI_BOOT_SERVICES * gBS