summaryrefslogtreecommitdiff
path: root/InOsEmuPkg/Unix/GdbRun
diff options
context:
space:
mode:
Diffstat (limited to 'InOsEmuPkg/Unix/GdbRun')
-rw-r--r--InOsEmuPkg/Unix/GdbRun37
1 files changed, 37 insertions, 0 deletions
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