Loading...
doc/debugging/debugging.md xnu-12377.101.15 xnu-10063.141.1
--- xnu/xnu-12377.101.15/doc/debugging/debugging.md
+++ xnu/xnu-10063.141.1/doc/debugging/debugging.md
@@ -1,10 +1,10 @@
 # XNU debugging
 
-Debugging XNU through kernel core files or with a live device.
+Debugging xnu through kernel core files or with a live device.
 
 ## Overview
 
-XNU’s debugging macros are compatible with Python 3.9+. Please be careful about pulling
+xnu’s debugging macros are compatible with both Python 3.9+. Please be careful about pulling
 in the latest language features. Some users are living on older Xcodes and may not have the newest
 Python installed.
 
@@ -133,7 +133,11 @@
 
 ## Testing changes
 
-Please check documentation here: <doc:macro_testing>
+There is no perfect test suite to check that macros are producing a correct value compared to what
+the debugger sees in a target.
+
+Be careful when touching common framework code. For larger changes, ask the Platform Triage team to
+validate that the changes work in their environment before integration.
 
 ### Coding style
 
@@ -209,46 +213,41 @@
 Then collect coverage:.
 
 ```
-(lldb) xnudebug coverage /tmp/coverage.cov showallstacks
-
-...
-
-Coverage info saved to: "/tmp/coverage.cov"
-```
-
-You can then run `coverage html --data-file=/tmp/coverage.cov` in your terminal
-to generate an HTML report.
-
-
-Combine coverage from multiple files:
-
-```
-# Point PATH to local python where coverage is installed.
-$ export PATH="$HOME/Library/Python/3.8/bin:$PATH"
-
-# Use --keep to avoid deletion of input files after merge.
-$ coverage combine --keep <list of .coverage files or dirs to scan>
-
-# Get HTML report or use other subcommands to inspect.
-$ coverage html
-```
-
-It is possible to start coverage collection **before** importing the operating system library and
-loading macros to check code run during bootstrapping.
-
-For this, you'll need to run coverage manually:
-# 1. Start LLDB
+# 1. Start LLDB with your macros as described above.
 
 # 2. Load and start code coverage recording.
 (lldb) script import coverage
-(lldb) script cov = coverage.Coverage(data_file=_filepath_)
+(lldb) script cov = coverage.Coverage()
 (lldb) script cov.start()
 
-# 3. Load macros
+# 3. Do the testing.
 
 # 4. Collect the coverage.
 (lldb) script cov.stop()
 (lldb) script cov.save()
+```
+
+You can override the default file (*.coverage*) by adding an additional environment variable to LLDB:
+
+```
+$ env COVERAGE_FILE="${OUTDIR}/.coverage.mytest" # usual LLDB command line
+```
+
+Combine coverage from multiple files:
+
+```
+# Point PATH to local python where coverage is installed.
+$ export PATH="$HOME/Library/Python/3.8/bin:$PATH"
+
+# Use --keep to avoid deletion of input files after merge.
+$ coverage combine --keep <list of .coverage files or dirs to scan>
+
+# Get HTML report or use other subcommands to inspect.
+$ coverage html
+```
+
+It is possible to start coverage collection **before** importing the operating system library and
+loading macros to check code run during bootstrapping.
 
 ### Performance testing