Skip to content

Commit

Permalink
Add script to generate pooltag.txt for debugger use
Browse files Browse the repository at this point in the history
Note: script does not correctly handle src/common paths and attributes
  pool tags discovered within to 'common.sys'

Signed-off-by: Owen Smith <[email protected]>
  • Loading branch information
OwenSmi authored and Paul Durrant committed Sep 28, 2023
1 parent 31d1748 commit db7d41c
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions gentags.ps1
Original file line number Diff line number Diff line change
@@ -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
}

0 comments on commit db7d41c

Please sign in to comment.