[buildqtc] add --gdb-only option and refactor script

Signed-off-by: Juha Kallioinen <juha.kallioinen@jolla.com>