Replace '.' and '-' in ${op} with '_', before setting d_${op}=true.

Also remove or simplify older code that did the same thing in a
different way.  The old code handled most cases, but did not change
op=kernel.gdb to op=kernel_gdb.