how do I use GDB

Discussion in 'Mac Programming' started by dancks, Jan 10, 2011.

  1. dancks macrumors member

    dancks

    Joined:
    Nov 8, 2009
    #1
    with a file that requires input?

    I tried running it and it just says reading source from library with trailing "..."
     
  2. jared_kipe macrumors 68030

    jared_kipe

    Joined:
    Dec 8, 2003
    Location:
    Seattle
    #2
    I'm not sure, maybe remove the input file bit and hard code in a test file?
     
  3. kpua macrumors 6502

    Joined:
    Jul 25, 2006
    #3
    This is how I do it from the command line:

    Code:
    $ gdb /path/to/my/program
    … license and loading info …
    (gdb) run /path/to/my/inputfile
    
    You can even attach the file to standard input by doing

    Code:
    (gdb) run < /path/to/my/inputfile
    
    like you normally would from the command line.

    If you're using Xcode, you get info on your executable and set the arguments in there.
     

Share This Page