From 1a353961547897658cfed758c5d20953858d0737 Mon Sep 17 00:00:00 2001
From: pompolic <pompolic@special-circumstanc.es>
Date: Fri, 12 Nov 2021 21:15:35 +0100
Subject: [PATCH] Update documentation

Remove finished TODO entry
---
 gdb-port/README                             | 19 +++++++++++++++++++
 gdb-port/parser-name-instrumentation-gdb.py |  3 ---
 2 files changed, 19 insertions(+), 3 deletions(-)

diff --git a/gdb-port/README b/gdb-port/README
index 5c893d5..fc3d22a 100644
--- a/gdb-port/README
+++ b/gdb-port/README
@@ -58,6 +58,8 @@ b, b_2
 
 This is not equivalent to advancing the input stream by [number] bytes, rather, it is equivalent to running until the next [number] pushes on the parser stack. See also `hammer-parser-backtrace`.
 
+If the GDB parameter "hammer-extended-parse-step-info" is set to "on", it will also invoke hammer-parser-backtrace and hammer-parser-preview-input.
+
 ```
 hammer-parse-continue
 ```
@@ -84,6 +86,23 @@ hammer-parser-mem-use-name <name>
 
 Print bytes allocated in the contexts of parsers matching `<name>`. `<name>` is either the name given to a parser in the H_RULE declaration, or `(Unnamed <type>)`, for example: `(Unnamed sequence)`. If multiple parsers match the name given, stats for all matching parsers will be printed.
 
+```
+hammer-parser-preview-input
+```
+
+Interprets the next 32 bytes of input as a UTF-8, and prints the resulting string.
+
+```
+hammer-parser-top-per-arena-mem
+```
+
+Finds the parser with highest number of allocated bytes in a single arena.
+
+```
+hammer-parser-top-total-arena-mem
+```
+
+Sums up each parser's memory use across all arenas, and prints the parser with the highest total allocated bytes.
 
 # Limitations
 
diff --git a/gdb-port/parser-name-instrumentation-gdb.py b/gdb-port/parser-name-instrumentation-gdb.py
index e2a79d5..139cce3 100644
--- a/gdb-port/parser-name-instrumentation-gdb.py
+++ b/gdb-port/parser-name-instrumentation-gdb.py
@@ -515,9 +515,6 @@ class HammerParserPreviewInput(gdb.Command):
 
 HammerParserPreviewInput()
 
-# TODO: a convenience feature for printing input preview + backtrace after step would be nice
-# idea: a configuration option which HammerParseStep could check, invoke the other 2 commands if true
-
 # Call when execution stopped at breakpoint in main
 def locate_perform_lowlevel_parse_retq():
 	arch = gdb.selected_frame().architecture()
-- 
GitLab