I basically want to debug a cgi programm with gdb by emulating the environment variables and stdin stream.
How do I set 开发者_高级运维the variables and stdin?I am using lampp and gdb.
Thanks!
From http://inside.mines.edu/~lwiencke/elab/gdb/gdb_19.html:
show environment [varname]
set environment varname [=] value
And from http://davis.lbl.gov/Manuals/GDB/gdb_5.html#SEC22
You can redirect your program's input and/or output using shell redirection with the run command. For example,
E.g.
run < input_file
would redirect the standard input of your debugged program.
精彩评论