How to use dbg from command-line? |
|
Hi there,
Trying to use dbg from command-line, using php-dbg-bage, php-dbg-server and pgp-dbg-client from Red Hat Linux 8.0. The output from phpinfo looks like dbg is active: dbg DBG php debugger, version 2.10pl3, Copyright 2001, Dmitri Dmitrienko, dd@cron.ru Version 2.10pl3 Linked as a shared library. Profiler compiled, disabled Directive Local Value Master Value debugger.enable_session_cookie On On debugger.enabled On On debugger.fail_silently On On debugger.ignore_nops Off Off debugger.JIT_enabled On On debugger.JIT_host clienthost clienthost debugger.JIT_level 3 3 debugger.JIT_port 7869 7869 debugger.profiler_enabled Off Off debugger.session_nocache On On debugger.timeout_seconds 300 300 But I cannot figure out how to start a debug session and run a php script step-by-step. Tried http://127.0.0.1/~fernando/TestePHP/info.php?DBGSESSID=1@clienthost:7869 but simply see the phpinfo page. Tried also $ cd ~/public_html/TestePHP $ dbg dbg>file info.php Reading symbols from /home/fernando/public_html/TestePHP/info.php...done. dbg>run Starting program: `/home/fernando/public_html/TestePHP/info.php' But it looks frozen. No reply from the browser, from the command-line or from telnet 127.0.0.1 7869 (connection refused). Isn't there a quick start guide for dbg? I am used to gdb and jdb, php-dbg should't be so hard to get working! |
||||||||||||
|
|
Thanks for your help, now it looks like my script is being debugged. Here's the script:
<!DOCTYPE html PUBLIC "-//IETF//DTD HTML 4.01 Transitional//EN"> <html> <head> <meta name="generator" content="HTML Tidy, see www.w3.org"> <title>Configuração do PHP local</title> </head> <body> <h1>Configuração do PHP local</h1> <?php $a = 10; $b = "este é um teste"; echo "$b : $a"; $c = $a * 2; phpinfo(); ?> </body> </html> And here's a debugging session: [fernando@linux220 TestePHP]$ dbg DBG php debugger, version 2.10rc2, Copyright 2001, Dmitri Dmitrienko, dd@cron.rudbg>set mode on dbg>set mapurlroot http://127.0.0.1/~fernando dbg>set mapremoteroot /home/fernando/public_html dbg>set maplocalroot /home/fernando/public_html/ dbg>file info.php Reading symbols from /home/fernando/public_html/TestePHP/info.php...done. dbg>run Starting program: `/home/fernando/public_html/TestePHP/info.php' /home/fernando/public_html/TestePHP/info.php:9 </home/fernando/public_html/TestePHP/info.php::main()> dbg>step /home/fernando/public_html/TestePHP/info.php:10 </home/fernando/public_html/TestePHP/info.php::main()> dbg>step /home/fernando/public_html/TestePHP/info.php:11 </home/fernando/public_html/TestePHP/info.php::main()> dbg>print $a $1 = 10 dbg>step /home/fernando/public_html/TestePHP/info.php:12 </home/fernando/public_html/TestePHP/info.php::main()> dbg>print $b $2 = "este é um teste" dbg>print $c 3: Invalid expression (Undefined variable: c) dbg>step /home/fernando/public_html/TestePHP/info.php:13 </home/fernando/public_html/TestePHP/info.php::main()> dbg>list dbg>list main dbg>list main() dbg>list info.php dbg>list info.php::main dbg>cont Now you see three problems: 1. I can't list any source line from inside dbg. Sure that's something I'm doing wrong, but I found no docs on that 2. I can't see any output from my script 3. After I use the "cont" command the debugger seems to freeze. Thanks in advance for any hint. |
||||||||||||
|
Site Admin
|
list command is not imlemented
after you run cont you can press ctrl-C to unfreeze debugger Displaying the output is not implemented either. This console application is just a simplest sample that I was going to enhance but had to stopped because switched to GUI front-end. Why don't you try phpED for Linux ? |
||||||||||||
|
|
So I did evetything it was possible. Thanks.
Now I'm working for an organization that set rules on using open source software only, so I'll have to try all options before going to phpEd. But I work as an independent consultant and other projects do not have this restriction, I'll evaluate it as soon as time allows. But what about the browser URL containing DBGSESSID=1@clienthost:7869, wouldn't it be possible to start a script from the browser and debug using the command-line? There isn't a way to get the output of the script debugged with DBG or DBG under DDD? |
||||||||||||
|
Site Admin
|
I was going to implement "listen" command but havn't finished it.
So, I'm sorry. No way to start script in a browser and debug it using command line debugger. |
||||||||||||
|
How to use dbg from command-line? |
|
||
Content © NuSphere Corp., PHP IDE team
Powered by phpBB © phpBB Group, Design by phpBBStyles.com | Styles Database.
Powered by
Powered by phpBB © phpBB Group, Design by phpBBStyles.com | Styles Database.
Powered by