Jonathan
Jonathan

Reputation: 4918

Debug CGI by simulation

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!

Upvotes: 1

Views: 504

Answers (1)

DS.
DS.

Reputation: 24110

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.

Upvotes: 1

Related Questions