com php-src: better info literal: phpdbg_info.c
| From: | Bob Weinand | Date: | Fri, 22 Nov 2013 09:56:17 +0000 |
| Subject: | com php-src: better info literal: phpdbg_info.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-74718@lists.php.net to get a copy of this message | ||
Commit: 46a67d15fe5d50d56c1372b0d2518cbe3e3cace3
Author: krakjoe <joe.watkins@live.co.uk> Fri, 22 Nov 2013 09:56:17 +0000
Parents: a6bd3807c44fcd7e27c5d7135f843f2c69e536db
Branches: PHP-5.6
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=46a67d15fe5d50d56c1372b0d2518cbe3e3cace3
Log:
better info literal
Changed paths:
M phpdbg_info.c
Diff:
diff --git a/phpdbg_info.c b/phpdbg_info.c
index a3a3f01..4b98267 100644
--- a/phpdbg_info.c
+++ b/phpdbg_info.c
@@ -18,9 +18,12 @@
*/
#include "php.h"
+#include "phpdbg.h"
#include "phpdbg_utils.h"
#include "phpdbg_info.h"
+ZEND_EXTERN_MODULE_GLOBALS(phpdbg);
+
PHPDBG_INFO(files) /* {{{ */
{
HashPosition pos;
@@ -146,15 +149,32 @@ PHPDBG_INFO(vars) /* {{{ */
PHPDBG_INFO(literal) /* {{{ */
{
- if (EG(in_execution) && EG(active_op_array)) {
- zend_uint literal =0;
- phpdbg_notice(
- "Literal Constants %d", EG(active_op_array)->last_literal-1);
+ if ((EG(in_execution) && EG(active_op_array)) || PHPDBG_G(ops)) {
+ zend_op_array *ops = EG(active_op_array) ? EG(active_op_array) : PHPDBG_G(ops);
+ zend_uint literal =0, count = ops->last_literal-1;
+
+ if (ops->function_name) {
+ if (ops->scope) {
+ phpdbg_notice(
+ "Literal Constants in %s::%s() (%d)", ops->scope->name, ops->function_name,
count);
+ } else {
+ phpdbg_notice(
+ "Literal Constants in %s() (%d)", ops->function_name, count);
+ }
+ } else {
+ if (ops->filename) {
+ phpdbg_notice(
+ "Literal Constants in %s (%d)", ops->filename, count);
+ } else {
+ phpdbg_notice(
+ "Literal Constants @ %p (%d)", ops, count);
+ }
+ }
- while (literal < EG(active_op_array)->last_literal) {
+ while (literal < ops->last_literal) {
phpdbg_write("|-------- C%lu -------> [", literal);
zend_print_zval(
- &EG(active_op_array)->literals[literal].constant, 0);
+ &ops->literals[literal].constant, 0);
phpdbg_write("]");
phpdbg_writeln(EMPTY);
literal++;