gdb: Merge similar tests into a single test script