This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[RFC 0/5] Implenent 'frame apply COMMAND', enhance 'thread apply COMMAND'
- From: Philippe Waroquiers <philippe dot waroquiers at skynet dot be>
- To: gdb-patches at sourceware dot org
- Date: Sat, 5 May 2018 21:27:59 +0200
- Subject: [RFC 0/5] Implenent 'frame apply COMMAND', enhance 'thread apply COMMAND'
- Ironport-phdr: 9a23:QIv3cxL2NnO0s/P/kdmcpTZWNBhigK39O0sv0rFitYgRLfzxwZ3uMQTl6Ol3ixeRBMOHs6kC07KempujcFRI2YyGvnEGfc4EfD4+ouJSoTYdBtWYA1bwNv/gYn9yNs1DUFh44yPzahANS47xaFLIv3K98yMZFAnhOgppPOT1HZPZg9iq2+yo9JDffwtFiCChbb9uMR67sRjfus4KjIV4N60/0AHJonxGe+RXwWNnO1eelAvi68mz4ZBu7T1et+ou+MBcX6r6eb84TaFDAzQ9L281/szrugLdQgaJ+3ART38ZkhtMAwjC8RH6QpL8uTb0u+ZhxCWXO9D9QLYpUjqg8qhrUgflhicZOTAk/m/Zict+gblHrB69vRFz35TZbJ2JOPd4Y6jTfckaRW1EXstJTSJBAoK8b48OD+oZJeZXsZT2qFsUohukAgmsHf7vyj5WiX/sxq0xzuMsERnG3AwhG9IOsWzUrM3rO6sIX+G61rPIzTLab/NL2Dfy9pLIcgs6rPGXXrJxcczRxlczFw/flVqft5XoMjWI3eoOq2iW9/dsWf6rhmI9tg18rCSjyt0xhoXXh48Z0E7I+CtnzIszONa2UlR0YcS+H5tVryyaMox2Td48TGxwoyY6z6EGuYa8fCgX1JQr3x7fZOKDc4iP+h/jUfueLS14hHJifbKwmQ6+8UmmyuLiSsm5yEtGojZBn9XWq3wA2QDf5tKaRvdj/0qtwyiD2g7N5u1cJEA7j6vbK5ovwr4qkZoTtFzOHjf2mEX3iK+Wd10k+vC25Oj9bLTpvIWcN4htigHjM6QhhNa/Af8jPwgVXGia+eK826P//UHjW7pFkOU6krPFv5DCOcQbuqm5Dhda0ok+8BmzFi+m384EnXYbLFJKZgmHgpPyO1HJPfD4F+uwjEqikThx3fDJIKftApLXLnjMw//deuNy50QZ0AMvxtBS/LpPDawbK//sU1X88tvCAUwXKQuxlt7nCdF8zpsTEV2GGKiALaLfq0TAsvovIu2NfJcY/in0Mf88+v/jl2QRglwMe6S1m5EaPiPrVs96KlmUNCK/yuwKFn0H61Iz
This patch series :
* implements a new command
'frame apply [all | COUNT | -COUNT] [-FLAGS...] COMMAND'.
* enhance 'thread apply COMMAND' by adding a -FLAGS argument
* adds some shortcuts commands
* documents the above in gdb.texinfo and NEWS.
Th new command 'frame apply' allows to apply a COMMAND to a number of frames,
or to all frames.
The optional -FLAGS... argument allows to control what output to produce
and how to handle errors raised when applying COMMAND to a frame.
Some examples usages for this new command:
frame apply all info frame
Produce info frame for all frames
frame apply all p $sp
For each frame, print the location, followed by the frame sp
frame apply all -qq p $sp
Same as before, but -qq flags (q = quiet) indicate to only print
the frames sp.
frame apply all -vv p $sp
Same as before, but -vv flags (v = verbose) indicate to print
location and source line for each frame.
frame apply all p some_local_var_somewhere
Print some_local_var_somewhere in all frames. 'frame apply'
will abort as soon as the print command fails.
frame apply all -c p some_local_var_somewhere
Same as before, but -c flag (c = continue) means to
print the error and continue applying command in case the
print command fails.
frame apply all -s p some_local_var_somewhere
Same as before, but -s flag (s = silent) means to
be silent for frames where the print command fails.
In other words, this allows to 'search' the frame in which
some_local_var_somewhere can be printed.
'thread apply' command has been enhanced to also accepts a -FLAGS...
argument.
Some examples usages for this new argument:
thread apply all -s frame apply all -s p some_local_var_somewhere
Prints the thread id, frame location and some_local_var_somewhere
value in frames of threads that have such local var.
To make the life of the user easier, the most typical use cases
have shortcuts :
faas : shortcut for 'frame apply all -s'
taas : shortcut for 'thread apply all -s'
tfaas : shortcut for 'thread apply all -s frame apply all -s"
An example usage :
tfaas p some_local_var_somewhere
same as the longer:
'thread apply all -s frame apply all -s p some_local_var_somewhere'
The patch serie provides the implementation and all user visible documentation.
What is still missing is:
* Missing regression tests.
Not yet done as this is painful, and so is better done once there is
an agreement on the behaviour.
* Missing ChangeLog.
Not yet done as this is painful, and is IMO close to or completely useless.
So, I will do it for the (first) RFA, once the flow of RFC comments
stops :).