Steps to reproduce: 1. start `gdb -nh` 2. define the following command (gdb) define argnum Type commands for definition of "argnum". End with a line saying just "end". >print $argc >end (gdb) 3. type the following: (gdb) argnum (1+1) $1 = 1 works as expected. 4. type the following: (gdb) argnum (1 + 1) $2 = 3 Expected: same result as at point 3. Actual result: gdb did not evaluate the argument, and passed three instead of one.
Argument parsing is purely textual.
@Andreas I am sorry about that. But why did you close the bug as invalid?
@Andreas let me elaborate: such behavior is irrational for obvious reasons. I know a lot of languages, but not a single one, where passing an arithmetic operation in braces without whitespace works different from doing the same with whitespace. So, do you have a link to docs or whatever to confirm that this is a valid behavior?
Reopening per lack of elaboration on reasons of closing.
Arguments to user-defined commands aren't evaluated, they are textually split on spaces, as documented in the manual.