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

    Join Date
    May 2013
    Posts
    26
    Rep Power
    0

    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:
    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 Demi-God (4500 - 4999 posts)

    Join Date
    Aug 2011
    Posts
    4,841
    Rep Power
    480
    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