diff options
author | Anderw Fish <afish@apple.com> | 2014-08-29 18:52:42 +0000 |
---|---|---|
committer | andrewfish <andrewfish@6f19259b-4bc3-4df7-8a09-765794883524> | 2014-08-29 18:52:42 +0000 |
commit | 4880fc9ff7a60f939a0a36b6e081b57dda533d00 (patch) | |
tree | 5c0c39aab3356ea084d4d1ded93a7acd29ec737b /EmulatorPkg/Unix/Host/Host.c | |
parent | e320062406d72820016be97786fb94ab577a13d1 (diff) | |
download | edk2-platforms-4880fc9ff7a60f939a0a36b6e081b57dda533d00.tar.xz |
EmulatorPkg: Unix: Add LLDB support for Xcode 5
Xcode5 retired gdb, so this patch adds support for using, and loading symbols
in, lldb. It also supports building with Xcode 5.
The lldb script also supports dumping out the build generated guid database
and it prints guids out with thier Cname if available. lldbefi.py also
contains some EFI specific type formatters. Symbols are loaded via the
lldbefi.py script setting a breakpoint on SecGdbScriptBreak() and runing a
breakpoint action Python function that uses the arguments to
SecGdbScriptBreak() to load symbols.
The location of SecGdbScriptBreak() in Host.c was updated to move symbol
loading control into the lldb Python script, since lldb only uses the
arguments to SecGdbScriptBreak() and not the files generated by the
emulator. The +1 on the SecGdbScriptBreak() argument makes it string size,
not string length, as this is what the lldb script is looking for.
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Anderw Fish <afish@apple.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@15982 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'EmulatorPkg/Unix/Host/Host.c')
-rw-r--r-- | EmulatorPkg/Unix/Host/Host.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/EmulatorPkg/Unix/Host/Host.c b/EmulatorPkg/Unix/Host/Host.c index 7eecbceaad..2f01cf88a2 100644 --- a/EmulatorPkg/Unix/Host/Host.c +++ b/EmulatorPkg/Unix/Host/Host.c @@ -1161,6 +1161,8 @@ GdbScriptAddImage ( SymbolsAddr ); fclose (GdbTempFile); + // This is for the lldb breakpoint only + SecGdbScriptBreak (ImageContext->PdbPointer, strlen (ImageContext->PdbPointer) + 1, (long unsigned int)(ImageContext->ImageAddress + ImageContext->SizeOfHeaders), 1); } else { ASSERT (FALSE); } @@ -1178,8 +1180,10 @@ GdbScriptAddImage ( // // Target for gdb breakpoint in a script that uses gGdbWorkingFileName to set a breakpoint. // Hey what can you say scripting in gdb is not that great.... + // Also used for the lldb breakpoint script. The lldb breakpoint script does + // not use the file, it uses the arguments. // - SecGdbScriptBreak (ImageContext->PdbPointer, strlen (ImageContext->PdbPointer), (long unsigned int)(ImageContext->ImageAddress + ImageContext->SizeOfHeaders), 1); + SecGdbScriptBreak (ImageContext->PdbPointer, strlen (ImageContext->PdbPointer) + 1, (long unsigned int)(ImageContext->ImageAddress + ImageContext->SizeOfHeaders), 1); } else { ASSERT (FALSE); } @@ -1235,6 +1239,7 @@ GdbScriptRemoveImage ( ImageContext->PdbPointer ); fclose (GdbTempFile); + SecGdbScriptBreak (ImageContext->PdbPointer, strlen (ImageContext->PdbPointer) + 1, 0, 0); } else { ASSERT (FALSE); } @@ -1248,7 +1253,7 @@ GdbScriptRemoveImage ( // Target for gdb breakpoint in a script that uses gGdbWorkingFileName to set a breakpoint. // Hey what can you say scripting in gdb is not that great.... // - SecGdbScriptBreak (ImageContext->PdbPointer, strlen (ImageContext->PdbPointer), 0, 0); + SecGdbScriptBreak (ImageContext->PdbPointer, strlen (ImageContext->PdbPointer) + 1, 0, 0); } else { ASSERT (FALSE); } |