1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2013
    Rep Power

    Gdb parameter entry

    I'm a novice with gdb, and am wondering if anyone can explain how to enter parameters while running gdb in -tui mode.
    Whenever parameter entry is called, such as when running the following code:
    printf("Please enter the source string: ");
    fgets(string1, sizeof(string1), stdin);
    there doesn't seem to be any way for gdb to accept the data entry. Is there any trick that I should be aware of?
  2. #2
  3. Contributing User
    Devshed God 1st Plane (5500 - 5999 posts)

    Join Date
    Aug 2011
    Rep Power
    Set a break for the line following the input (after fgets) then continue running your program. If you get stuck debugging a library module you don't want to see command "finish" to break after the stack frame pops.

    Mind you, if this advice doesn't help, I've never used gdbtui. I usually use gdb within emacs gdb mode.
    [code]Code tags[/code] are essential for python code and Makefiles!

IMN logo majestic logo threadwatch logo seochat tools logo