Search notes:

Debugging tools for Windows: scripting with JavaScript

The script

"use strict"

function invokeScript() {
   host.diagnostics.debugLog('Threads');
   var proc = host.currentProcess;
   for (var thr of proc.Threads) {
      host.diagnostics.debugLog("  " + thr + "\n");
   }
}
Github repository Windows-Debugging-Tools, path: /scripting/JavaScript/iterate-threads/script.js

Launch notepad and execute the script in it

start-process notepad

while($true) {
  #
  # Wait until notepad is started
  #
    $status = get-process notepad -errorAction silentlyContinue
    if (! $status) {
      start-sleep -milliSeconds 66
    }
    else {
      break
    }
}


#
#  Attach to process and run script
#  to display threads.
#
cdb -pn notepad.exe -c ".scriptrun script.js"
Github repository Windows-Debugging-Tools, path: /scripting/JavaScript/iterate-threads/launch-notepad-and-run-script.ps1

See also

Object model
Debugging tools for Windows: scripting

Index

Fatal error: Uncaught PDOException: SQLSTATE[HY000]: General error: 8 attempt to write a readonly database in /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php:78 Stack trace: #0 /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php(78): PDOStatement->execute(Array) #1 /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php(30): insert_webrequest_('/notes/Windows/...', 1740452821, '3.145.115.18', 'Mozilla/5.0 App...', NULL) #2 /home/httpd/vhosts/renenyffenegger.ch/httpsdocs/notes/Windows/development/Debugging/tools/scripting/JavaScript/index(79): insert_webrequest() #3 {main} thrown in /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php on line 78