I’ve created a small golang progarm that calls shell scripts depending on the input argument.
But when I call a GDB setup script for my embedded project the GDB application imediately exits. However when I run it from the command line (bash). It works like a charm.
I think it is because GDB understands that it isn’t run by a “real” termianl.
//Code that runs the script. cmd := exec.Command(path, args) cmd.Stdout = os.Stdout cmd.Stderr = os.Stderr cmd.Run() Output: . . . Loading section _net_buf_pool_area, size 0xc0 lma 0x1a6e1 Start address 0x398c, load size 108444 Transfer rate: 4412 KB/sec, 4518 bytes/write. (gdb) quit A debugging session is active. --Type <RET> for more, q to quit, c to continue without paging-- Inferior 1 [Remote target] will be killed. Quit anyway? (y or n) [answered Y; input not from terminal]
Is it possible to fool the gdb program to think it is being run by a “real” terminal?