开发者

Debug CGI by simulation

开发者 https://www.devze.com 2022-12-29 08:11 出处:网络
I basically want to debug a cgi programm with gdb by emulating the environment variables and stdin stream.

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消