[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] Add script to generate pooltag.txt for debugger use
- To: win-pv-devel@xxxxxxxxxxxxxxxxxxxx
- From: Paul Durrant <xadimgnik@xxxxxxxxx>
- Date: Thu, 28 Sep 2023 11:47:11 +0100
- Delivery-date: Thu, 28 Sep 2023 10:47:19 +0000
- List-id: Developer list for the Windows PV Drivers subproject <win-pv-devel.lists.xenproject.org>
On 13/09/2023 09:48, Owen Smith wrote:
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@xxxxxxxxx>
---
gentags.ps1 | 26 ++++++++++++++++++++++++++
1 file changed, 26 insertions(+)
create mode 100644 gentags.ps1
Acked-by: Paul Durrant <paul@xxxxxxx>
diff --git a/gentags.ps1 b/gentags.ps1
new file mode 100644
index 0000000..9c2efa1
--- /dev/null
+++ b/gentags.ps1
@@ -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
+}
|