how to debug c++ code called from php using exec() -
I am calling some C ++ code in my php app using "exec" as I have explained that I Once I execute it, I debug C ++ code. The C + + app starts and ends with a faster way for example with Eclipse attached to the process. Any idea how to debug C ++ code is called php with AP (exec)? I'm on Linux using Eclipse and GDB.
The php ap workflow is: get value from HTML form, these values are called exec () with C ++ code, get output from C, then using php on cHTML it Display it is a PHP controller and the C ++ model. In fact it depends on how you are using PHP code in the first place if you have a Using PHP to create web pages, where you do some C ++ code between the HTML (or whatever) generation, it is a bit difficult. If you are using the command line to run PHP, you can just type If you can not debug the actual application (because "MyProgram" output is part of your web page Is, for example), so I just run $ command
to "myprog arg1 arg2
in " gdb --args myprog arg1 arg2
$ gdb --args myprog arg1 arg2
on the command line on the machine, and debug the code standalone Or, if you have to debug it as part of the web-app, you might add sleep (10);
at the beginning of "myprog" , And gdb attach X
where X is the process ID (from top
or ps aux | grep myprog
, for example) - sleep (10);
line, and gdb command continue
.
Comments
Post a Comment