Re: / (slash) command : fast way to temporarily change setting(s) to run a command
Simon Marchi <[email protected]>
| Newsgroups | gmane.comp.gdb.devel |
|---|---|
| Message-ID | <[email protected]> |
On 2019-04-16 02:48, Philippe Waroquiers wrote: > On Mon, 2019-04-15 at 23:06 -0400, Simon Marchi wrote: >> Hi Philippe, >> >> I like the idea, I would probably use it most with /e (for long >> strings) and /p. >> I just tried it a little bit, and I appreciate the fact that it's easy >> to apply >> to your previous command. Just type up and add the prefix to the >> beginning of the >> line. > Interesting, that was not the primary use case I was thinking to. > > We could make this even easier by making COMMAND optional in: > Usage: /SETTING... [COMMAND] > and giving no command means to repeat the previous command with the > additional > given settings e.g. : > (gdb) some command > .... some command output > (gdb) /e > => executes /e some command > > (gdb) /e some command > ... some command output > (gdb) /p > => executes /ep some command > > I guess we probably call dont_repeat () in / command > when no COMMAND is given. Ah yeah, that sounds good too, I would be consistent with the fact that just like you can do: (gdb) p 10 $4 = 10 (gdb) p/x $5 = 0xa Does it mean that as a side-effect, "/" alone would repeat the previos command unaltered? Simon