X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=blobdiff_plain;f=InOsEmuPkg%2FUnix%2FGdbRun;h=c374cb8ca535cc2440785e0e755d7521c2e9dd67;hp=cf4ca7fe5ae609a4d323fdcbed93feecea8f25b2;hb=0bc9421b147f6f54d6fde72e320466d2db61ae8c;hpb=8e4b3d32a8baedd7e39d4e82b4e8458e217e7f6e diff --git a/InOsEmuPkg/Unix/GdbRun b/InOsEmuPkg/Unix/GdbRun index cf4ca7fe5a..c374cb8ca5 100644 --- a/InOsEmuPkg/Unix/GdbRun +++ b/InOsEmuPkg/Unix/GdbRun @@ -27,6 +27,43 @@ set $_exitcode = 42 define hook-stop if $_exitcode != 42 quit + else + source SecMain.gdb + end +end + +# +# We keep track of the number of symbol files we have loaded via gdb +# scripts in the $SymbolFilesAdded variable +# +set $SymbolFileChangesCount = 0 + +# +# This macro adds a symbols file for gdb +# +# @param $arg0 - Symbol file changes number +# @param $arg1 - Symbol file name +# @param $arg2 - Image address +# +define AddFirmwareSymbolFile + if $SymbolFileChangesCount < $arg0 + add-symbol-file $arg1 $arg2 + set $SymbolFileChangesCount = $arg0 + end +end + +# +# This macro removes a symbols file for gdb +# +# @param $arg0 - Symbol file changes number +# @param $arg1 - Symbol file name +# +define RemoveFirmwareSymbolFile + if $SymbolFileChangesCount < $arg0 + # + # Currently there is not a method to remove a single symbol file + # + set $SymbolFileChangesCount = $arg0 end end