mirror of
https://github.com/tianocore/edk2
synced 2026-08-27 00:23:19 -04:00
EmulatorPkg/Unix/Host: Fix symbol loading with clang
Fix symbol loading issues with clang compilers where SecGdbSciptBreak() is optimized away and the gdb/lldb breakpoint on that symbol is never hit and no symbols are loaded for any modules. Update the implementation of SecGdbScriptBreak() so it is never inlined and add code to the implementation of SecGdbScriptBreak() to guarantee that the entire function is never optimized away by using a volatile loop variable. Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
This commit is contained in:
parent
30af217203
commit
1aaa37e00a
1 changed files with 11 additions and 2 deletions
|
|
@ -1112,9 +1112,7 @@ DlLoadImage (
|
|||
#endif
|
||||
}
|
||||
|
||||
#ifdef __APPLE__
|
||||
__attribute__ ((noinline))
|
||||
#endif
|
||||
VOID
|
||||
SecGdbScriptBreak (
|
||||
char *FileName,
|
||||
|
|
@ -1123,6 +1121,17 @@ SecGdbScriptBreak (
|
|||
int AddSymbolFlag
|
||||
)
|
||||
{
|
||||
volatile UINTN Index;
|
||||
|
||||
//
|
||||
// Disable inline and have this function do some work to prevent
|
||||
// optimizing this function away. It must always be in symbol table to
|
||||
// set breakpoint for gdb script to run, load symbols, and set pending
|
||||
// breakpoints.
|
||||
//
|
||||
for (Index = 0; Index < 1; Index++) {
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue