Documentation

man bash explains what set -x does as follows:

After expanding each simple command, for command, case command,
select command, or
arithmetic for command, display the expanded value of PS4, followed by the command
and its expanded arguments or associated word list.

The default value for PS4 is, as shown above, a plus sign followed by a space.

For an interactive shell, pressing Ctrl+x followed by * after typing the glob pattern will edit your command line with that glob pattern expanded. From the bash man page:

glob-expand-word (C-x *)

The word before point is treated as a pattern for pathname
expansion, and the list of matching file names is inserted,
replacing the word. If a numeric argument is supplied, an
asterisk is appended before pathname expansion.

I am using bash from Mac OS. I tried ctrl+x, command+x. I am not sure if it does any command line editing. could you elaborate more?
– Weishi ZengJan 7 '15 at 10:44

@WeishiZeng I don't know why it's not working for you. Did you press Ctrl+x, * immediately after typing echo * and before pressing the enter key? If it still doesn't work, you could modify ~/.inputrc and bind glob-expand-word to something else.
– jamesdlinJan 7 '15 at 18:45

contrl+x moves cursor to the word echo, but doesn't edit anything. "Ctrl+x, " what does it mean?? (is it ctrl+x OR ctrl+??) * is on Shift, so I need to press Shift as well to get a *, right?
– Weishi ZengJan 8 '15 at 22:20

Right, press Ctrl+x followed by Shift+8. You could try seing if Ctrl+x, g works, or, as I said earlier, assign your own key in the .inputrc file.
– jamesdlinJan 8 '15 at 22:59