I'm trying to leverage "gu" command in a conditional breakpoint or as a "CommandString" in a regular breakpoint. For example let's consider break on a malloc() function when we want to see in logs what pointer was allocated and what was the size of an allocation:
bp msvcrt!malloc "r $t1=@rcx; gu; .printf \"malloc: %p %08x\\n\",@rax,@$t1; gc"
tldr: So, we've created a temporary register $t1, assigned it to the size of allocation (the arch is x64, thus @rcx = "size"), steeped out of the function using "gu" command, and finally printed pointer at @rax plus our temp register value. You can try it yourself with a "notepad.exe" ;)
It's kind of working, we can see the data:
Some commands were skipped because previous commands caused target execution inside an event handler.malloc: 000001d2e78d42c0 00000100
Some commands were skipped because previous commands caused target execution inside an event handler.malloc: 000001d2e78d4700 00000088
Some commands were skipped because previous commands caused target execution inside an event handler.malloc: 000001d2e78d47c0 00000088
Some commands were skipped because previous commands caused target execution inside an event handler.malloc: 000001d2e78d4880 00000038
Some commands were skipped because previous commands caused target execution inside an event handler.malloc: 000001d2e78d4f10 000000f0
Some commands were skipped because previous commands caused target execution inside an event handler.malloc: 000001d2e78d5030 00001124
Some commands were skipped because previous commands caused target execution inside an event handler.malloc: 000001d2e78d6190 00002430
Some commands were skipped because previous commands caused target execution inside an event handler.malloc: 000001d2e78d85f0 00000200
Some commands were skipped because previous commands caused target execution inside an event handler.malloc: 000001d2e78d8820 00000080
Some commands were skipped because previous commands caused target execution inside an event handler.malloc: 000001d2e78d88d0 00000080
With the only small exception which is noisy string "Some commands were skipped because previous commands caused target execution inside an event handler.". It seems it's always in a logs when we're using "gu" as a "CommandString".
Any ideas how to get rid of it or what is the intended way of solving such a problem?
Regards!