Skip to content

Commit

Permalink
parsedump: Simplify by using poi instead of regex
Browse files Browse the repository at this point in the history
Instead of using `dt` on `OpenZFS!cbuf` and checking the output we can
just use `poi(OpenZFS!cbuf)` in the `.writemem` command.

Signed-off-by: Axel Gembe <[email protected]>
  • Loading branch information
EchterAgo authored and andrewc12 committed Oct 15, 2023
1 parent 5fcb34f commit f8bcabb
Showing 1 changed file with 1 addition and 10 deletions.
11 changes: 1 addition & 10 deletions contrib/windows/parsedump/parsedump.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,16 +26,7 @@ def run(arg):

stack = run("k ; q")

cbuf = run("dt OpenZFS!cbuf ; q")
# print(cbuf)
b = re.search(r"'dt OpenZFS!cbuf ; q'"
"[\\s\\S]+?(0x[0-9A-Za-z]{8}`[0-9A-Za-z]{8})",
cbuf)
cbufaddr = b.group()[-19:]

cbuf2 = run(
".writemem C:\\cbuf.txt " + cbufaddr + " L100000 ; q",
)
cbuf = run(".writemem C:\\cbuf.txt poi(OpenZFS!cbuf) L100000 ; q")

with open("C:\\stack.txt", "w") as file:
file.write(analyze)
Expand Down

0 comments on commit f8bcabb

Please sign in to comment.