]> xenbits.xensource.com Git - pvdrivers/win/xenbus.git/commitdiff
Add script to generate pooltag.txt for debugger use
authorOwen Smith <owen.smith@cloud.com>
Wed, 13 Sep 2023 08:48:35 +0000 (09:48 +0100)
committerPaul Durrant <pdurrant@amazon.com>
Thu, 28 Sep 2023 11:50:15 +0000 (12:50 +0100)
Note: script does not correctly handle src/common paths and attributes
  pool tags discovered within to 'common.sys'

Signed-off-by: Owen Smith <owen.smith@cloud.com>
gentags.ps1 [new file with mode: 0644]

diff --git a/gentags.ps1 b/gentags.ps1
new file mode 100644 (file)
index 0000000..9c2efa1
--- /dev/null
@@ -0,0 +1,26 @@
+Function Parse-Tags {
+    param(
+        [string]$drivername
+    )
+
+    Get-ChildItem ("./src/" + $drivername) | Foreach-Object {
+        $file = $_.Name
+        Get-Content $_.FullName | ForEach {
+            if ($_.Contains("TAG") -And $_.Contains("#define")) {
+                $vals = $_.Split(' ', 3)
+                $name = $vals[1].Trim()
+                $tags = $vals[2].Trim().Trim("'").PadRight(4)
+                Write-Host "TAG:" $name "=" $tags
+                $driver = ($drivername + ".sys").PadRight(16)
+                ($tags + " - " + $driver + " - XEN " + $drivername + "\" + $file + " " + $name) | Add-Content "./pooltag.txt"
+            }
+        }
+    }
+}
+
+if (Test-Path "./pooltag.txt") {
+    Remove-Item "./pooltag.txt"
+}
+Get-ChildItem "./src" | ?{$_.PSIsContainer}  | ForEach-Object {
+    Parse-Tags $_.Name
+}