31i73 / atom-dbg

An Atom package - An interactive debugger frontend
https://atom.io/packages/dbg
MIT License
30 stars 4 forks source link

How to react to "cin" function or other input ones? #22

Closed Kael-Chan closed 7 years ago

Kael-Chan commented 7 years ago

when using atom-dbg on call of functions like cin, there's no method to enter uses data in it. how to solve it ? thank you~

vanossj commented 7 years ago

I have a pull request, 31i73/atom-dbg-gdb#16, for this.

But as a work around, you can connect a terminal window, outside of atom, to your debug application for standard IO.

Linux (and Mac?)

  1. Open a terminal Note: you have to keep this terminal open, or you will have to update the tty path in the config file.
  2. Run the command tty you will get output the path to the terminal file, something like /dev/pts/12
  3. Create/Edit the debug config for your project. Add "-tty=/dev/pts/12" (match path from tty command) to gdb_arguments

    example

    "connect to term":
    debugger: 'dbg-gdb'
    path: "out"
    gdb_arguments: ["-tty=/dev/pts/12"]

Windows

not yet tested, but should work.

  1. Create/Edit the debug config for your project. Add "set new-console on" to gdb_commands array

example

"start new term":
    debugger: 'dbg-gdb'
    path: "out.exe"
    gdb_commands: ["set new-console on"]