0

I want to create a GUI for GDB debugger, so I need a way to run GDB debugger in terminal and execute commands in that and also get output from that on user triggered events on my screen in ubuntu. how can I do that for such a program?

it tried

int main(){
    system("gnome-terminal 'gdb  test'");
    system("break main");
    return 0;
}

but it executes the command on the terminal not on the gdb program

πάντα ῥεῖ
  • 1
  • 13
  • 116
  • 190
kar09
  • 411
  • 3
  • 11

1 Answers1

1

Each of the system() calls opens a separate shell. So these are independent of each other.

If you want to continuously communicate with a child process, rather use popen() please.

πάντα ῥεῖ
  • 1
  • 13
  • 116
  • 190