I have not worked with gdb for a long time, and this seems like a basic question.
I try to observe the structure as it changes, but instead of breaking down at a specific point and printing it out, I would rather have the application run as usual and give me a snapshot of the structure at a specific point. Think of a breakpoint that executes an action (print struct) rather than pausing execution.
I am interested in looking at changes in structure immediately, rather than gradually. I can get what I want through printf, but gdb is much more elegant.
Update: Thanks for all the answers. I want to look at one structure in a certain place, and the decision of the teams is what I need. It was very helpful.
source share