[PHP-CVS] com php-src: brought the ext/sybase_ct/config.w32 up to date: ext/sybase_ct/config.w32
Commit:5b0620831c41687950f1f34a225bea060122b503 Author:Anatol Belski a...@php.net Wed, 25 Dec 2013 23:29:42 +0100 Parents: a2503c6af38d5a2de172a9a746719c4b12b53034 Branches: PHP-5.5 PHP-5.6 master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=5b0620831c41687950f1f34a225bea060122b503 Log: brought the ext/sybase_ct/config.w32 up to date Changed paths: M ext/sybase_ct/config.w32 Diff: diff --git a/ext/sybase_ct/config.w32 b/ext/sybase_ct/config.w32 index bf56bd1..c773b62 100644 --- a/ext/sybase_ct/config.w32 +++ b/ext/sybase_ct/config.w32 @@ -7,8 +7,11 @@ ARG_WITH(sybase-ct, SYBASE_CT support, no); if (PHP_SYBASE_CT != no) { if (CHECK_HEADER_ADD_INCLUDE(ctpublic.h, CFLAGS_SYBASE_CT, PHP_PHP_BUILD + \\sybase\\include; + PHP_SYBASE_CT) - CHECK_LIB(libcs.lib, sybase_ct, PHP_PHP_BUILD + \\sybase\\lib; + PHP_SYBASE_CT) - CHECK_LIB(libct.lib, sybase_ct, PHP_PHP_BUILD + \\sybase\\lib; + PHP_SYBASE_CT)) { + (!X64 CHECK_LIB(libsybcs.lib, sybase_ct, PHP_PHP_BUILD + \\sybase\\lib; + PHP_SYBASE_CT) + CHECK_LIB(libsybct.lib, sybase_ct, PHP_PHP_BUILD + \\sybase\\lib; + PHP_SYBASE_CT) || + X64 CHECK_LIB(libsybcs64.lib, sybase_ct, PHP_PHP_BUILD + \\sybase\\lib; + PHP_SYBASE_CT) + CHECK_LIB(libsybct64.lib, sybase_ct, PHP_PHP_BUILD + \\sybase\\lib; + PHP_SYBASE_CT)) + ) { EXTENSION('sybase_ct', 'php_sybase_ct.c'); AC_DEFINE('HAVE_SYBASE_CT', 1); } else { -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: Merge branch 'PHP-5.4' into PHP-5.5: Zend/zend.c
Commit:3f7a145b5abd66d1c77e65060d15702db4d36529 Author:Anatol Belski a...@php.net Mon, 23 Dec 2013 12:00:49 +0100 Parents: f7b6db7555db9379547a1c9ead4051de1ffc8566 f156e684ac290f4ec69564f653d3167cdb5c62be Branches: PHP-5.5 PHP-5.6 master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=3f7a145b5abd66d1c77e65060d15702db4d36529 Log: Merge branch 'PHP-5.4' into PHP-5.5 * PHP-5.4: removed outdated IsDebuggerPresent declaration Changed paths: MM Zend/zend.c Diff: -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: opcodes: Zend/zend_vm_opcodes.h
Commit:a2e77fb258763113e29948f82db49a64139022d4 Author:krakjoe joe.watk...@live.co.uk Sun, 22 Dec 2013 13:20:17 + Committer: Anatol Belski a...@php.net Mon, 23 Dec 2013 12:29:01 +0100 Parents: 07e97f919d3d4d407debd70aa3c7ceb9e5d543db Branches: str_size_and_int64 Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=a2e77fb258763113e29948f82db49a64139022d4 Log: opcodes Changed paths: M Zend/zend_vm_opcodes.h Diff: diff --git a/Zend/zend_vm_opcodes.h b/Zend/zend_vm_opcodes.h index ed02663..d334e45 100644 --- a/Zend/zend_vm_opcodes.h +++ b/Zend/zend_vm_opcodes.h @@ -171,4 +171,4 @@ ZEND_API const char *zend_get_opcode_name(zend_uchar opcode); #define ZEND_FAST_RET163 #define ZEND_RECV_VARIADIC 164 -#endif +#endif \ No newline at end of file -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: Added suggestion about opcache.revalidate_freq setting in development environment: ext/opcache/README
Commit:f7b6db7555db9379547a1c9ead4051de1ffc8566 Author:Dmitry Stogov dmi...@zend.com Mon, 23 Dec 2013 13:09:45 +0400 Parents: 0dcaf0f445a4084f3dbb37411b6acead4658c5f5 Branches: PHP-5.5 PHP-5.6 master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=f7b6db7555db9379547a1c9ead4051de1ffc8566 Log: Added suggestion about opcache.revalidate_freq setting in development environment Changed paths: M ext/opcache/README Diff: diff --git a/ext/opcache/README b/ext/opcache/README index cb6ac34..693a7b4 100644 --- a/ext/opcache/README +++ b/ext/opcache/README @@ -40,7 +40,8 @@ after OPcache. Speed Tuning - -We recommend the following configuration options for best performance. +We recommend the following configuration options for best performance +in a production environment. opcache.memory_consumption=128 opcache.interned_strings_buffer=8 @@ -59,6 +60,9 @@ opcache.enable_file_override=1 In some cases you may like to prefer enabling/disabling some features to avoid incompatibilities at the cost of some performance degradation. +For development environment we would recommend setting opcache.revalidate_freq +into 0. + Configuration Directives -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: Merge branch 'PHP-5.5' into PHP-5.6: Zend/zend.c
Commit:19039984e291bdfd4c9e44d0543ac190027ba042 Author:Anatol Belski a...@php.net Mon, 23 Dec 2013 12:01:10 +0100 Parents: 8650d2dda65cf7ac70bf83323ca8036d01dbe349 3f7a145b5abd66d1c77e65060d15702db4d36529 Branches: PHP-5.6 master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=19039984e291bdfd4c9e44d0543ac190027ba042 Log: Merge branch 'PHP-5.5' into PHP-5.6 * PHP-5.5: removed outdated IsDebuggerPresent declaration Changed paths: MM Zend/zend.c Diff: -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: Merge branch 'master' into str_size_and_int64: Zend/zend_language_scanner.c
Commit:e540839c8b283a7b445ab6552f37f3b1ca0f2eaa Author:Anatol Belski a...@php.net Mon, 23 Dec 2013 23:39:42 +0100 Parents: 63ea29a2067ce06e20dda861480d91624389f0f3 392f6830a15aa670d7ad4de173175ed4e482ffdb Branches: str_size_and_int64 Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=e540839c8b283a7b445ab6552f37f3b1ca0f2eaa Log: Merge branch 'master' into str_size_and_int64 Conflicts: Zend/zend_vm_execute.h ext/opcache/Optimizer/pass1_5.c ext/opcache/ZendAccelerator.h Changed paths: MM Zend/zend_language_scanner.c Diff: -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: Fixed bug #66334 (Memory Leak in new pass1_5.c optimizations). (Terry): ext/opcache/Optimizer/pass1_5.c ext/opcache/tests/bug66334.phpt
Commit:ccb29a6e41afc3a5ced31e86951fca5119a2e8d0 Author:Dmitry Stogov dmi...@zend.com Mon, 23 Dec 2013 16:04:10 +0400 Parents: 8650d2dda65cf7ac70bf83323ca8036d01dbe349 Branches: PHP-5.6 master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=ccb29a6e41afc3a5ced31e86951fca5119a2e8d0 Log: Fixed bug #66334 (Memory Leak in new pass1_5.c optimizations). (Terry) Bugs: https://bugs.php.net/66334 Changed paths: M ext/opcache/Optimizer/pass1_5.c A ext/opcache/tests/bug66334.phpt Diff: diff --git a/ext/opcache/Optimizer/pass1_5.c b/ext/opcache/Optimizer/pass1_5.c index 4601562..5ab5bf4 100644 --- a/ext/opcache/Optimizer/pass1_5.c +++ b/ext/opcache/Optimizer/pass1_5.c @@ -383,9 +383,11 @@ if (ZEND_OPTIMIZER_PASS_1 OPTIMIZATION_LEVEL) { zend_module_entry *m; char *lc_name = zend_str_tolower_dup( Z_STRVAL(ZEND_OP1_LITERAL(opline - 1)), Z_STRLEN(ZEND_OP1_LITERAL(opline - 1))); + int found = zend_hash_find(module_registry, + lc_name, Z_STRLEN(ZEND_OP1_LITERAL(opline - 1)) + 1, (void *)m) == SUCCESS; - if (zend_hash_find(module_registry, - lc_name, Z_STRLEN(ZEND_OP1_LITERAL(opline - 1)) + 1, (void *)m) == FAILURE) { + efree(lc_name); + if (!found) { if (!PG(enable_dl)) { break; } else { @@ -405,7 +407,6 @@ if (ZEND_OPTIMIZER_PASS_1 OPTIMIZATION_LEVEL) { literal_dtor(ZEND_OP1_LITERAL(opline)); MAKE_NOP(opline); } - efree(lc_name); } else if (Z_STRLEN(ZEND_OP1_LITERAL(opline)) == sizeof(defined)-1 !memcmp(Z_STRVAL(ZEND_OP1_LITERAL(opline)), defined, sizeof(defined)-1)) { diff --git a/ext/opcache/tests/bug66334.phpt b/ext/opcache/tests/bug66334.phpt new file mode 100644 index 000..b2c6d7b --- /dev/null +++ b/ext/opcache/tests/bug66334.phpt @@ -0,0 +1,19 @@ +--TEST-- +Bug #66334 (Memory Leak in new pass1_5.c optimizations) +--INI-- +opcache.enable=1 +opcache.enable_cli=1 +opcache.optimization_level=-1 +opcache.file_update_protection=0 +enable_dl=0 +--SKIPIF-- +?php require_once('skipif.inc'); ? +--FILE-- +?php +if (extension_loaded(unknown_extension)) { + var_dump(1); +} else { + var_dump(2); +} +--EXPECT-- +int(2) -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: reformat: CREDITS
Commit:7b215b36bc9c478955242c5252af5412b6f1bedf Author:krakjoe joe.watk...@live.co.uk Mon, 23 Dec 2013 21:54:45 + Parents: 2d82e994b637f511fa160d5635318a61f0c06421 Branches: PHP-5.6 Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=7b215b36bc9c478955242c5252af5412b6f1bedf Log: reformat Changed paths: M CREDITS Diff: diff --git a/CREDITS b/CREDITS index 3a26c57..036bafe 100644 --- a/CREDITS +++ b/CREDITS @@ -1,4 +1,2 @@ phpdbg -Felipe Pena -Joe Watkins -Bob Weinand +Felipe Pena, Joe Watkins, Bob Weinand -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: credits file for phpdbg: sapi/phpdbg/CREDITS
Commit:265fdd91390a38deafbd193d4831c2e9db3b06fe Author:Joe Watkins krak...@php.net Mon, 23 Dec 2013 22:36:30 + Parents: 571ac343936dadc9673d2a94a8a8f36a606c8bb4 Branches: master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=265fdd91390a38deafbd193d4831c2e9db3b06fe Log: credits file for phpdbg Changed paths: A sapi/phpdbg/CREDITS Diff: diff --git a/sapi/phpdbg/CREDITS b/sapi/phpdbg/CREDITS new file mode 100644 index 000..036bafe --- /dev/null +++ b/sapi/phpdbg/CREDITS @@ -0,0 +1,2 @@ +phpdbg +Felipe Pena, Joe Watkins, Bob Weinand -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: credits file for phpdbg: sapi/phpdbg/CREDITS
Commit:617aefbcda56d9ef1fe8410f68bc057815bf5b08 Author:Joe Watkins krak...@php.net Mon, 23 Dec 2013 22:36:30 + Committer: Bob Weinand bobw...@hotmail.com Tue, 24 Dec 2013 00:16:47 +0100 Parents: 571ac343936dadc9673d2a94a8a8f36a606c8bb4 Branches: PHP-5.6 Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=617aefbcda56d9ef1fe8410f68bc057815bf5b08 Log: credits file for phpdbg Changed paths: A sapi/phpdbg/CREDITS Diff: diff --git a/sapi/phpdbg/CREDITS b/sapi/phpdbg/CREDITS new file mode 100644 index 000..036bafe --- /dev/null +++ b/sapi/phpdbg/CREDITS @@ -0,0 +1,2 @@ +phpdbg +Felipe Pena, Joe Watkins, Bob Weinand -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: removed outdated IsDebuggerPresent declaration: Zend/zend.c
Commit:ea7a70708f68b7952767260796da411b9fb400d6 Author:Anatol Belski a...@php.net Mon, 23 Dec 2013 11:53:47 +0100 Parents: 1c462a4e4d4ce375492995b014dcafe44825f6d3 Branches: str_size_and_int64 Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=ea7a70708f68b7952767260796da411b9fb400d6 Log: removed outdated IsDebuggerPresent declaration This piece of code seems to retain compatibility with some windows versions before 2000. Today it's not relevant anymore and only produces a warning C4273 because of the conflicting prototype. In VC9 the declaration is present in winbase.h:4142, but available is it already in winxp. Here's the doc link http://msdn.microsoft.com/en-us/library/windows/desktop/ms680345(v=vs.85).aspx Changed paths: M Zend/zend.c Diff: diff --git a/Zend/zend.c b/Zend/zend.c index 0c10b41..b6917e4 100644 --- a/Zend/zend.c +++ b/Zend/zend.c @@ -44,10 +44,6 @@ # define GLOBAL_CONSTANTS_TABLEEG(zend_constants) #endif -#if defined(ZEND_WIN32) ZEND_DEBUG -BOOL WINAPI IsDebuggerPresent(VOID); -#endif - /* true multithread-shared globals */ ZEND_API zend_class_entry *zend_standard_class_def = NULL; ZEND_API zend_size_t (*zend_printf)(const char *format, ...); -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: removed the all style function arg formats 'l', 's', 'p': Zend/zend_API.c Zend/zend_operators.h
Commit:a06a89dba67bbe132128d7d569a2139d3f40f513 Author:Anatol Belski a...@php.net Mon, 23 Dec 2013 14:24:34 -0800 Parents: 389b4d411eaa331fa6480886153016fb29b8b7f5 Branches: str_size_and_int64 Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=a06a89dba67bbe132128d7d569a2139d3f40f513 Log: removed the all style function arg formats 'l', 's', 'p' Changed paths: M Zend/zend_API.c M Zend/zend_operators.h Diff: diff --git a/Zend/zend_API.c b/Zend/zend_API.c index a37c23f..fd4bb6e 100644 --- a/Zend/zend_API.c +++ b/Zend/zend_API.c @@ -320,17 +320,9 @@ static const char *zend_parse_arg_impl(int arg_num, zval **arg, va_list *va, con spec_walk++; } -#ifdef ZEND_ENABLE_INT64 # define ZEND_CHECK_INT_RANGE c == 'I' -#else -# define ZEND_CHECK_INT_RANGE c == 'I' || c == 'L' -#endif switch (c) { -#ifdef ZEND_ENABLE_INT64 - case 'l': - case 'L': -#endif case 'i': case 'I': { @@ -348,7 +340,7 @@ static const char *zend_parse_arg_impl(int arg_num, zval **arg, va_list *va, con int type; if ((type = is_numeric_string(Z_STRVAL_PP(arg), Z_STRSIZE_PP(arg), p, d, -1)) == 0) { - return long; + return integer; } else if (type == IS_DOUBLE) { if (ZEND_CHECK_INT_RANGE) { if (d ZEND_INT_MAX) { @@ -386,7 +378,7 @@ static const char *zend_parse_arg_impl(int arg_num, zval **arg, va_list *va, con case IS_OBJECT: case IS_RESOURCE: default: - return long; + return integer; } } break; @@ -430,23 +422,15 @@ static const char *zend_parse_arg_impl(int arg_num, zval **arg, va_list *va, con } } break; -#ifdef ZEND_USE_LEGACY_STRING_TYPES - case 'p': /* Deprecated, Legacy int size */ - case 's': /* Deprecated, Legacy int size */ -#endif case 'P': /* New zend_size_t size */ case 'S': /* New zend_size_t size */ { char **p = va_arg(*va, char **); zend_size_t pl; zend_size_t *plsize; - int *plint; - if (c == 'p' || c == 's') { - plint = va_arg(*va, int *); - } else { - plsize = va_arg(*va, zend_size_t *); - } + plsize = va_arg(*va, zend_size_t *); + switch (Z_TYPE_PP(arg)) { case IS_NULL: if (check_null) { @@ -469,14 +453,14 @@ static const char *zend_parse_arg_impl(int arg_num, zval **arg, va_list *va, con } *p = Z_STRVAL_PP(arg); pl = Z_STRSIZE_PP(arg); - if ((c == 'p' || c == 'P') CHECK_ZVAL_NULL_PATH(*arg)) { + if ((c == 'P') CHECK_ZVAL_NULL_PATH(*arg)) { return a valid path; } break; case IS_OBJECT: if (parse_arg_object_to_string(arg, p, pl, IS_STRING TSRMLS_CC) == SUCCESS) { - if ((c == 'p' || c == 'P') CHECK_ZVAL_NULL_PATH(*arg)) { + if ((c == 'P') CHECK_ZVAL_NULL_PATH(*arg)) { return a valid path; } break; @@ -485,13 +469,10 @@ static const char *zend_parse_arg_impl(int arg_num, zval **arg, va_list *va, con case IS_ARRAY: case
[PHP-CVS] com php-src: stop warnings from unused opcode map: Zend/zend_vm_gen.php Zend/zend_vm_opcodes.c Zend/zend_vm_opcodes.h
Commit:f9affb5ae9ea32a572e6be1d073486ddb2d4df18 Author:krakjoe joe.watk...@live.co.uk Sun, 22 Dec 2013 13:00:51 + Committer: Anatol Belski a...@php.net Mon, 23 Dec 2013 12:24:11 +0100 Parents: aaca4ede153f9cf26277164d14f3499f76d0e69d Branches: str_size_and_int64 Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=f9affb5ae9ea32a572e6be1d073486ddb2d4df18 Log: stop warnings from unused opcode map Changed paths: M Zend/zend_vm_gen.php M Zend/zend_vm_opcodes.c M Zend/zend_vm_opcodes.h Diff: diff --git a/Zend/zend_vm_gen.php b/Zend/zend_vm_gen.php index 9996541..2088bf8 100644 --- a/Zend/zend_vm_gen.php +++ b/Zend/zend_vm_gen.php @@ -1208,8 +1208,8 @@ function gen_vm($def, $skel) { out($f, $GLOBALS['header_text']); fputs($f, #ifndef ZEND_VM_OPCODES_H\n#define ZEND_VM_OPCODES_H\n\n); - fputs($f, extern ZEND_API const char *zend_vm_opcodes_map[.($max_opcode + 1).];\n\n); - + fputs($f, ZEND_API const char *zend_get_opcode_name(zend_uchar opcode);\n\n); + foreach ($opcodes as $code = $dsc) { $code = str_pad((string)$code,$code_len, ,STR_PAD_LEFT); $op = str_pad($dsc[op],$max_opcode_len); @@ -1225,14 +1225,19 @@ function gen_vm($def, $skel) { // Insert header out($f, $GLOBALS['header_text']); - fputs($f,#include stdio.h\n\n); - + fputs($f,#include stdio.h\n); + fputs($f,#include zend.h\n\n); + fputs($f,const char *zend_vm_opcodes_map[.($max_opcode + 1).] = {\n); for ($i = 0; $i = $max_opcode; $i++) { fputs($f,\t.(isset($opcodes[$i][op])?''.$opcodes[$i][op].'':NULL).,\n); } - fputs($f, };\n); - + fputs($f, };\n\n); + +fputs($f, ZEND_API const char* zend_get_opcode_name(zend_uchar opcode) {\n); +fputs($f, \treturn zend_vm_opcodes_map[opcode];\n); +fputs($f, }\n); + fclose($f); echo zend_vm_opcodes.c generated successfully.\n; diff --git a/Zend/zend_vm_opcodes.c b/Zend/zend_vm_opcodes.c index 04af26c..177c3fd 100644 --- a/Zend/zend_vm_opcodes.c +++ b/Zend/zend_vm_opcodes.c @@ -19,6 +19,7 @@ */ #include stdio.h +#include zend.h const char *zend_vm_opcodes_map[165] = { ZEND_NOP, @@ -187,3 +188,7 @@ const char *zend_vm_opcodes_map[165] = { ZEND_FAST_RET, ZEND_RECV_VARIADIC, }; + +ZEND_API const char* zend_get_opcode_name(zend_uchar opcode) { + return zend_vm_opcodes_map[opcode]; +} diff --git a/Zend/zend_vm_opcodes.h b/Zend/zend_vm_opcodes.h index ad0d881..ed02663 100644 --- a/Zend/zend_vm_opcodes.h +++ b/Zend/zend_vm_opcodes.h @@ -21,7 +21,7 @@ #ifndef ZEND_VM_OPCODES_H #define ZEND_VM_OPCODES_H -extern ZEND_API const char *zend_vm_opcodes_map[165]; +ZEND_API const char *zend_get_opcode_name(zend_uchar opcode); #define ZEND_NOP 0 #define ZEND_ADD 1 @@ -171,4 +171,4 @@ extern ZEND_API const char *zend_vm_opcodes_map[165]; #define ZEND_FAST_RET163 #define ZEND_RECV_VARIADIC 164 -#endif \ No newline at end of file +#endif -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: restore NEWS to the state of 6c5e93fe17c264aa28f8eeb4ec78c9e4a7eedfba: NEWS
Commit:571ac343936dadc9673d2a94a8a8f36a606c8bb4 Author:Stanislav Malyshev s...@php.net Mon, 23 Dec 2013 14:10:08 -0800 Parents: a00e7f22d2981c0cf10d957df9b90df83894187f Branches: PHP-5.6 master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=571ac343936dadc9673d2a94a8a8f36a606c8bb4 Log: restore NEWS to the state of 6c5e93fe17c264aa28f8eeb4ec78c9e4a7eedfba Changed paths: M NEWS Diff: diff --git a/NEWS b/NEWS index fecf78c..536ab75 100644 --- a/NEWS +++ b/NEWS @@ -2,66 +2,6 @@ PHP NEWS ||| ?? ??? 20??, PHP 5.6.0 -- Core: - . Disallowed JMP into a finally block. (Laruence) - . Added validation of class names in the autoload process. (Dmitry) - . Fixed invalid C code in zend_strtod.c. (Lior Kaplan) - . Fixed bug #66041 (list() fails to unpack yielded ArrayAccess object). -(Nikita) - . Fixed bug #65764 (generators/throw_rethrow FAIL with -ZEND_COMPILE_EXTENDED_INFO). (Nikita) - . Fixed bug #61645 (fopen and O_NONBLOCK). (Mike) - . Fixed bug #66218 (zend_register_functions breaks reflection). (Remi) - -- Date: - . Fixed bug #66060 (Heap buffer over-read in DateInterval). (Remi) - . Fixed bug #65768 (DateTimeImmutable::diff does not work). (Nikita Nefedov) - -- DOM: - . Fixed bug #65196 (Passing DOMDocumentFragment to DOMDocument::saveHTML() -Produces invalid Markup). (Mike) - -- Exif: - . Fixed bug #65873 (Integer overflow in exif_read_data()). (Stas) - -- Filter: - . Fixed bug #66229 (128.0.0.0/16 isn't reserved any longer). (Adam) - -- GD: - . Fixed bug #64405 (Use freetype-config for determining freetype2 dir(s)). -(Adam) - -- PDO_odbc: - . Fixed bug #66311 (Stack smashing protection kills PDO/ODBC queries). -(michael at orlitzky dot com) - -- MySQLi: - . Fixed bug #65486 (mysqli_poll() is broken on win x64). (Anatol) - -- OPCache: - . Fixed reavlidate_path=1 behavior to avoid caching of symlinks values. -(Dmitry) - -- SNMP: - . Fixed SNMP_ERR_TOOBIG handling for bulk walk operations. (Boris Lytochkin) - -- SOAP - . Fixed bug #66112 (Use after free condition in SOAP extension). -(martin dot koegler at brz dot gv dot at) - -- Sockets: - . Fixed bug #65923 (ext/socket assumes AI_V4MAPPED is defined). (Felipe) - -- XSL - . Fixed bug #49634 (Segfault throwing an exception in a XSL registered -function). (Mike) - -- ZIP: - . Fixed Bug #66321 (ZipArchive::open() ze_obj-filename_len not real). (Remi) - -12 Dec 2013, PHP 5.5.7 - PHP-5.5 - - CLI server: . Added some MIME types to the CLI web server. (Chris Jones) -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: Merge branch 'PHP-5.6': Zend/zend.c
Commit:f4a96983e1ecf775c5310f223447a2fadf8683ce Author:Anatol Belski a...@php.net Mon, 23 Dec 2013 12:01:26 +0100 Parents: 62fa84a0311c429e8a6742607e5da549b8f5c7a8 19039984e291bdfd4c9e44d0543ac190027ba042 Branches: master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=f4a96983e1ecf775c5310f223447a2fadf8683ce Log: Merge branch 'PHP-5.6' * PHP-5.6: removed outdated IsDebuggerPresent declaration Changed paths: MM Zend/zend.c Diff: -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: Merge branch 'PHP-5.5' into PHP-5.6: ext/opcache/ZendAccelerator.c ext/opcache/ZendAccelerator.h ext/opcache/zend_accelerator_module.c
Commit:f5c200fce984e5f16677c7fa25a755f10a47eb07 Author:Dmitry Stogov dmi...@zend.com Mon, 23 Dec 2013 12:50:42 +0400 Parents: ee55edf5e41b695f781d36a808664e42d6a3dcd0 0dcaf0f445a4084f3dbb37411b6acead4658c5f5 Branches: PHP-5.6 master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=f5c200fce984e5f16677c7fa25a755f10a47eb07 Log: Merge branch 'PHP-5.5' into PHP-5.6 * PHP-5.5: Fixed Issue #140: opcache.enable_file_override doesn't respect opcache.revalidate_freq opcodes Bugs: https://bugs.php.net/140 Changed paths: MM ext/opcache/ZendAccelerator.c MM ext/opcache/ZendAccelerator.h MM ext/opcache/zend_accelerator_module.c Diff: diff --cc ext/opcache/ZendAccelerator.h index 487010b,dbda3b3..bd197fb --- a/ext/opcache/ZendAccelerator.h +++ b/ext/opcache/ZendAccelerator.h @@@ -330,8 -330,8 +330,9 @@@ extern char *zps_api_failure_reason void accel_shutdown(TSRMLS_D); void zend_accel_schedule_restart(zend_accel_restart_reason reason TSRMLS_DC); void zend_accel_schedule_restart_if_necessary(zend_accel_restart_reason reason TSRMLS_DC); + int validate_timestamp_and_record(zend_persistent_script *persistent_script, zend_file_handle *file_handle TSRMLS_DC); int zend_accel_invalidate(const char *filename, int filename_len, zend_bool force TSRMLS_DC); +int zend_accel_script_optimize(zend_persistent_script *persistent_script TSRMLS_DC); int accelerator_shm_read_lock(TSRMLS_D); void accelerator_shm_read_unlock(TSRMLS_D); -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: Fixed bug #66334 (Memory Leak in new pass1_5.c optimizations). (Terry): ext/opcache/Optimizer/pass1_5.c ext/opcache/tests/bug66334.phpt
Commit:c699696c438eeb3214d3a645110d03f98f8e979e Author:Dmitry Stogov dmi...@zend.com Mon, 23 Dec 2013 16:04:10 +0400 Committer: Anatol Belski a...@php.net Mon, 23 Dec 2013 20:30:27 +0100 Parents: 8d64f0ee711b00c0fdda37e8e55615b0d2510269 Branches: str_size_and_int64 Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=c699696c438eeb3214d3a645110d03f98f8e979e Log: Fixed bug #66334 (Memory Leak in new pass1_5.c optimizations). (Terry) Bugs: https://bugs.php.net/66334 Changed paths: M ext/opcache/Optimizer/pass1_5.c A ext/opcache/tests/bug66334.phpt Diff: diff --git a/ext/opcache/Optimizer/pass1_5.c b/ext/opcache/Optimizer/pass1_5.c index 9de8590..68db08a 100644 --- a/ext/opcache/Optimizer/pass1_5.c +++ b/ext/opcache/Optimizer/pass1_5.c @@ -383,9 +383,11 @@ if (ZEND_OPTIMIZER_PASS_1 OPTIMIZATION_LEVEL) { zend_module_entry *m; char *lc_name = zend_str_tolower_dup( Z_STRVAL(ZEND_OP1_LITERAL(opline - 1)), Z_STRSIZE(ZEND_OP1_LITERAL(opline - 1))); + int found = zend_hash_find(module_registry, + lc_name, Z_STRSIZE(ZEND_OP1_LITERAL(opline - 1)) + 1, (void *)m) == SUCCESS; - if (zend_hash_find(module_registry, - lc_name, Z_STRSIZE(ZEND_OP1_LITERAL(opline - 1)) + 1, (void *)m) == FAILURE) { + efree(lc_name); + if (!found) { if (!PG(enable_dl)) { break; } else { @@ -405,7 +407,6 @@ if (ZEND_OPTIMIZER_PASS_1 OPTIMIZATION_LEVEL) { literal_dtor(ZEND_OP1_LITERAL(opline)); MAKE_NOP(opline); } - efree(lc_name); } else if (Z_STRSIZE(ZEND_OP1_LITERAL(opline)) == sizeof(defined)-1 !memcmp(Z_STRVAL(ZEND_OP1_LITERAL(opline)), defined, sizeof(defined)-1)) { diff --git a/ext/opcache/tests/bug66334.phpt b/ext/opcache/tests/bug66334.phpt new file mode 100644 index 000..b2c6d7b --- /dev/null +++ b/ext/opcache/tests/bug66334.phpt @@ -0,0 +1,19 @@ +--TEST-- +Bug #66334 (Memory Leak in new pass1_5.c optimizations) +--INI-- +opcache.enable=1 +opcache.enable_cli=1 +opcache.optimization_level=-1 +opcache.file_update_protection=0 +enable_dl=0 +--SKIPIF-- +?php require_once('skipif.inc'); ? +--FILE-- +?php +if (extension_loaded(unknown_extension)) { + var_dump(1); +} else { + var_dump(2); +} +--EXPECT-- +int(2) -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: Bump ZEND_MODULE_API_NO due to the TSRMLS change to zend_is_true(): Zend/zend_modules.h
Commit:78f2ded86a8a33b3320444d2a8c67b431da5a662 Author:Sara Golemon poll...@php.net Sun, 22 Dec 2013 14:10:59 -0800 Committer: Anatol Belski a...@php.net Mon, 23 Dec 2013 12:30:16 +0100 Parents: a2e77fb258763113e29948f82db49a64139022d4 Branches: str_size_and_int64 Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=78f2ded86a8a33b3320444d2a8c67b431da5a662 Log: Bump ZEND_MODULE_API_NO due to the TSRMLS change to zend_is_true() Changed paths: M Zend/zend_modules.h Diff: diff --git a/Zend/zend_modules.h b/Zend/zend_modules.h index 00209a0..946406f 100644 --- a/Zend/zend_modules.h +++ b/Zend/zend_modules.h @@ -33,7 +33,7 @@ #define ZEND_MODULE_INFO_FUNC_ARGS zend_module_entry *zend_module TSRMLS_DC #define ZEND_MODULE_INFO_FUNC_ARGS_PASSTHRU zend_module TSRMLS_CC -#define ZEND_MODULE_API_NO 20131106 +#define ZEND_MODULE_API_NO 20131218 #ifdef ZTS #define USING_ZTS 1 #else -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: better way to detect leave/finish: phpdbg.c phpdbg.h phpdbg_prompt.c
Commit:775376b362dfb9e9d0bf29dcd4cd2a2155117398 Author:krakjoe joe.watk...@live.co.uk Mon, 18 Nov 2013 03:18:37 + Parents: 8ada4342a47170a38799282919714997d3771c06 Branches: PHP-5.6 Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=775376b362dfb9e9d0bf29dcd4cd2a2155117398 Log: better way to detect leave/finish Changed paths: M phpdbg.c M phpdbg.h M phpdbg_prompt.c Diff: diff --git a/phpdbg.c b/phpdbg.c index ec8d267..e542906 100644 --- a/phpdbg.c +++ b/phpdbg.c @@ -101,7 +101,7 @@ static PHP_RINIT_FUNCTION(phpdbg) /* {{{ */ zend_hash_init(PHPDBG_G(bp)[PHPDBG_BREAK_OPLINE], 8, NULL, NULL, 0); zend_hash_init(PHPDBG_G(bp)[PHPDBG_BREAK_METHOD], 8, NULL, php_phpdbg_destroy_bp_methods, 0); zend_hash_init(PHPDBG_G(bp)[PHPDBG_BREAK_COND], 8, NULL, php_phpdbg_destroy_bp_condition, 0); - + zend_hash_init(PHPDBG_G(seek), 8, NULL, NULL, 0); return SUCCESS; } /* }}} */ @@ -112,7 +112,8 @@ static PHP_RSHUTDOWN_FUNCTION(phpdbg) /* {{{ */ zend_hash_destroy(PHPDBG_G(bp)[PHPDBG_BREAK_OPLINE]); zend_hash_destroy(PHPDBG_G(bp)[PHPDBG_BREAK_METHOD]); zend_hash_destroy(PHPDBG_G(bp)[PHPDBG_BREAK_COND]); - + zend_hash_destroy(PHPDBG_G(seek)); + if (PHPDBG_G(exec)) { efree(PHPDBG_G(exec)); PHPDBG_G(exec) = NULL; diff --git a/phpdbg.h b/phpdbg.h index 0416b93..a12e03b 100644 --- a/phpdbg.h +++ b/phpdbg.h @@ -118,7 +118,7 @@ ZEND_BEGIN_MODULE_GLOBALS(phpdbg) phpdbg_param_t *lparam; /* last param */ zend_ulong flags; /* phpdbg flags */ FILE *oplog;/* opline log */ - zend_ulong seek;/* seek opline */ + HashTable seek; /* seek oplines */ ZEND_END_MODULE_GLOBALS(phpdbg) /* }}} */ diff --git a/phpdbg_prompt.c b/phpdbg_prompt.c index 7f976bf..a36cb24 100644 --- a/phpdbg_prompt.c +++ b/phpdbg_prompt.c @@ -309,7 +309,11 @@ static PHPDBG_COMMAND(until) /* {{{ */ for (next = self; next EG(active_op_array)-last; next++) { if (EG(active_op_array)-opcodes[next].lineno != opline-lineno) { - PHPDBG_G(seek) = (zend_ulong) EG(active_op_array)-opcodes[next]; + zend_hash_index_update( + PHPDBG_G(seek), + (zend_ulong) EG(active_op_array)-opcodes[next], + EG(active_op_array)-opcodes[next], + sizeof(zend_op), NULL); break; } } @@ -332,8 +336,15 @@ static PHPDBG_COMMAND(finish) /* {{{ */ zend_op *opline = EG(active_op_array)-opcodes[self]; for (next = self; next EG(active_op_array)-last; next++) { - if (EG(active_op_array)-opcodes[next].opcode == ZEND_RETURN) { - PHPDBG_G(seek) = (zend_ulong) EG(active_op_array)-opcodes[next]; + switch (EG(active_op_array)-opcodes[next].opcode) { + case ZEND_RETURN: + case ZEND_THROW: + case ZEND_EXIT: + zend_hash_index_update( + PHPDBG_G(seek), + (zend_ulong) EG(active_op_array)-opcodes[next], + EG(active_op_array)-opcodes[next], + sizeof(zend_op), NULL); break; } } @@ -356,8 +367,15 @@ static PHPDBG_COMMAND(leave) /* {{{ */ zend_op *opline = EG(active_op_array)-opcodes[self]; for (next = self; next EG(active_op_array)-last; next++) { - if (EG(active_op_array)-opcodes[next].opcode == ZEND_RETURN) { - PHPDBG_G(seek) = (zend_ulong) EG(active_op_array)-opcodes[next]; + switch (EG(active_op_array)-opcodes[next].opcode) { + case ZEND_RETURN: + case ZEND_THROW: + case ZEND_EXIT: + zend_hash_index_update( + PHPDBG_G(seek), + (zend_ulong) EG(active_op_array)-opcodes[next], + EG(active_op_array)-opcodes[next], + sizeof(zend_op), NULL); break; } } @@ -397,8 +415,10 @@ static
[PHP-CVS] com php-src: class printer: phpdbg_opcode.c phpdbg_print.c phpdbg_prompt.c phpdbg_utils.c test.php
Commit:68cff82d8bd6b046cbac556136b88dd76d6a116b Author:krakjoe joe.watk...@live.co.uk Wed, 13 Nov 2013 01:35:39 + Parents: 43c2748dced2a77b34c09c15e403c6970b74e2b2 Branches: PHP-5.6 Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=68cff82d8bd6b046cbac556136b88dd76d6a116b Log: class printer Changed paths: M phpdbg_opcode.c M phpdbg_print.c M phpdbg_prompt.c M phpdbg_utils.c M test.php Diff: diff --git a/phpdbg_opcode.c b/phpdbg_opcode.c index 5796678..39a5169 100644 --- a/phpdbg_opcode.c +++ b/phpdbg_opcode.c @@ -191,6 +191,7 @@ const char *phpdbg_decode_opcode(zend_uchar opcode) /* {{{ */ CASE(ZEND_RECV_VARIADIC); #endif CASE(ZEND_OP_DATA); - default: return UNKNOWN; + default: + return UNKNOWN; } } /* }}} */ diff --git a/phpdbg_print.c b/phpdbg_print.c index c0d8fb4..f5cbbd3 100644 --- a/phpdbg_print.c +++ b/phpdbg_print.c @@ -20,6 +20,7 @@ #include phpdbg.h #include phpdbg_print.h #include phpdbg_utils.h +#include phpdbg_opcode.h ZEND_EXTERN_MODULE_GLOBALS(phpdbg); @@ -41,7 +42,59 @@ PHPDBG_PRINT(class) /* {{{ */ if (expr expr_len 0L) { if (zend_lookup_class(expr, strlen(expr), ce TSRMLS_CC) == SUCCESS) { + phpdbg_notice( + %s %s: %s, + ((*ce)-type == ZEND_USER_CLASS) ? + User : Internal, + ((*ce)-ce_flags ZEND_ACC_INTERFACE) ? + Interface : + ((*ce)-ce_flags ZEND_ACC_ABSTRACT) ? + Abstract Class : + Class, + (*ce)-name); + phpdbg_writeln(Methods (%d):, zend_hash_num_elements((*ce)-function_table)); + if (zend_hash_num_elements((*ce)-function_table)) { + HashPosition position; + zend_function *method; + + for (zend_hash_internal_pointer_reset_ex((*ce)-function_table, position); +zend_hash_get_current_data_ex((*ce)-function_table, (void**) method, position) == SUCCESS; +zend_hash_move_forward_ex((*ce)-function_table, position)) { +switch (method-type) { + case ZEND_USER_FUNCTION: { + zend_op_array* op_array = method-op_array; + +if (op_array) { +zend_op *opline = op_array-opcodes[0]; +zend_uint opcode = 0, +end = op_array-last-1; + + phpdbg_writeln( +\t%s::%s() in %s:%d-%d, +(*ce)-name, method-common.function_name, +op_array-filename ? op_array-filename : unknown, +op_array-line_start, op_array-line_end); + +do { +char *decode = phpdbg_decode_opcode(opline-opcode); +if (decode != NULL) { +phpdbg_writeln( +\t\t%p:%s, opline, decode); +} else phpdbg_error(\tFailed to decode opline @ %ld, opline); + +opline++; +} while (++opcode end); +} + } break; + + default: { + phpdbg_writeln( + \tInternal Method %s::%s(), (*ce)-name, method-common.function_name); + } +} + } + } } else { phpdbg_error(Cannot find class %s/%lu, expr, expr_len); } diff --git a/phpdbg_prompt.c b/phpdbg_prompt.c index f7cba8c..d2cd8be 100644 --- a/phpdbg_prompt.c +++ b/phpdbg_prompt.c @@ -547,7 +547,7 @@ int phpdbg_interactive(TSRMLS_D) /* {{{ */ phpdbg_interactive_enter: phpdbg_write(PROMPT); - + while (!(PHPDBG_G(flags) PHPDBG_IS_QUITTING) fgets(cmd, PHPDBG_MAX_CMD, stdin) != NULL) { cmd_len = strlen(cmd) - 1; diff --git a/phpdbg_utils.c b/phpdbg_utils.c index 27ada70..3c8606c 100644 --- a/phpdbg_utils.c +++ b/phpdbg_utils.c @@ -23,6 +23,7 @@ #include php.h #include spprintf.h #include phpdbg.h +#include phpdbg_opcode.h #include phpdbg_utils.h ZEND_EXTERN_MODULE_GLOBALS(phpdbg); diff --git a/test.php b/test.php index 457e487..0f240e1 100644 --- a/test.php +++ b/test.php @@
[PHP-CVS] com php-src: Merge branch 'master' of https://github.com/krakjoe/phpdbg: phpdbg_cmd.c phpdbg_prompt.c phpdbg_utils.c
Commit:64194ef6523ed307ecbf74a39c0cd3e50eb64855 Author:krakjoe joe.watk...@live.co.uk Mon, 9 Dec 2013 09:35:54 + Parents: 12d071fa7c94c7edafd56499443a26cd8716cc6b b35f6ee7234af7a4872b434875de8d761b09ebe9 Branches: PHP-5.6 Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=64194ef6523ed307ecbf74a39c0cd3e50eb64855 Log: Merge branch 'master' of https://github.com/krakjoe/phpdbg Changed paths: MM phpdbg_cmd.c MM phpdbg_prompt.c MM phpdbg_utils.c Diff: -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: fix windows build warning: phpdbg_info.c
Commit:682164ae992c50fc075fad294de040fb60ff6529 Author:krakjoe joe.watk...@live.co.uk Sun, 24 Nov 2013 12:17:51 + Parents: d9c94663c1abed95074b5004fe75aef0ee756bab Branches: PHP-5.6 Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=682164ae992c50fc075fad294de040fb60ff6529 Log: fix windows build warning Changed paths: M phpdbg_info.c Diff: diff --git a/phpdbg_info.c b/phpdbg_info.c index 724b30c..d665f92 100644 --- a/phpdbg_info.c +++ b/phpdbg_info.c @@ -151,8 +151,7 @@ PHPDBG_INFO(literal) /* {{{ */ { 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); - unsigned int literal = 0; - int count = ops-last_literal-1; + int literal = 0, count = ops-last_literal-1; if (ops-function_name) { if (ops-scope) { -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: - Fix valgrind reports + CS: phpdbg.c phpdbg_list.c phpdbg_print.c
Commit:89514066787a1201bc4c4474cf78f21225ca412c Author:Felipe Pena felipe...@gmail.com Mon, 18 Nov 2013 19:55:29 -0200 Parents: a1156cae5cd5e334a4225debfdf6141d97dd96ec Branches: PHP-5.6 Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=89514066787a1201bc4c4474cf78f21225ca412c Log: - Fix valgrind reports + CS Changed paths: M phpdbg.c M phpdbg_list.c M phpdbg_print.c Diff: diff --git a/phpdbg.c b/phpdbg.c index eaa626d..6659075 100644 --- a/phpdbg.c +++ b/phpdbg.c @@ -41,6 +41,7 @@ static inline void php_phpdbg_globals_ctor(zend_phpdbg_globals *pg) /* {{{ */ pg-lcmd = NULL; pg-flags = PHPDBG_DEFAULT_FLAGS; pg-oplog = NULL; +memset(pg-lparam, 0, sizeof(phpdbg_param_t)); } /* }}} */ static PHP_MINIT_FUNCTION(phpdbg) /* {{{ */ @@ -94,14 +95,14 @@ static void php_phpdbg_destroy_bp_condition(void *data) /* {{{ */ } /* }}} */ static PHP_RINIT_FUNCTION(phpdbg) /* {{{ */ -{ +{ zend_hash_init(PHPDBG_G(bp)[PHPDBG_BREAK_FILE], 8, NULL, php_phpdbg_destroy_bp_file, 0); zend_hash_init(PHPDBG_G(bp)[PHPDBG_BREAK_SYM], 8, NULL, php_phpdbg_destroy_bp_symbol, 0); zend_hash_init(PHPDBG_G(bp)[PHPDBG_BREAK_OPLINE], 8, NULL, NULL, 0); zend_hash_init(PHPDBG_G(bp)[PHPDBG_BREAK_METHOD], 8, NULL, php_phpdbg_destroy_bp_methods, 0); zend_hash_init(PHPDBG_G(bp)[PHPDBG_BREAK_COND], 8, NULL, php_phpdbg_destroy_bp_condition, 0); zend_hash_init(PHPDBG_G(seek), 8, NULL, NULL, 0); - + return SUCCESS; } /* }}} */ @@ -113,7 +114,7 @@ static PHP_RSHUTDOWN_FUNCTION(phpdbg) /* {{{ */ zend_hash_destroy(PHPDBG_G(bp)[PHPDBG_BREAK_METHOD]); zend_hash_destroy(PHPDBG_G(bp)[PHPDBG_BREAK_COND]); zend_hash_destroy(PHPDBG_G(seek)); - + if (PHPDBG_G(exec)) { efree(PHPDBG_G(exec)); PHPDBG_G(exec) = NULL; diff --git a/phpdbg_list.c b/phpdbg_list.c index dcce374..241983d 100644 --- a/phpdbg_list.c +++ b/phpdbg_list.c @@ -153,7 +153,7 @@ void phpdbg_list_file(const char *filename, long count, long offset, int highlig return; } - last_pos = mem = mmap(0, st.st_size, PROT_READ, MAP_SHARED, fd, 0); + pos = last_pos = mem = mmap(0, st.st_size, PROT_READ, MAP_SHARED, fd, 0); end_pos = mem + st.st_size; #else @@ -170,7 +170,7 @@ void phpdbg_list_file(const char *filename, long count, long offset, int highlig return; } - last_pos = mem = (char*) MapViewOfFile(map, FILE_MAP_READ, 0, 0, 0); + pos = last_pos = mem = (char*) MapViewOfFile(map, FILE_MAP_READ, 0, 0, 0); if (mem == NULL) { phpdbg_error(Failed to map file in memory); CloseHandle(map); diff --git a/phpdbg_print.c b/phpdbg_print.c index 606e091..f3821be 100644 --- a/phpdbg_print.c +++ b/phpdbg_print.c @@ -37,7 +37,8 @@ PHPDBG_PRINT(opline) /* {{{ */ return SUCCESS; } /* }}} */ -static inline void phpdbg_print_function_helper(zend_function *method TSRMLS_DC) { +static inline void phpdbg_print_function_helper(zend_function *method TSRMLS_DC) /* {{{ */ +{ switch (method-type) { case ZEND_USER_FUNCTION: { zend_op_array* op_array = method-op_array; @@ -85,7 +86,7 @@ static inline void phpdbg_print_function_helper(zend_function *method TSRMLS_DC) } } } -} +} /* }}} */ PHPDBG_PRINT(exec) /* {{{ */ { -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: correction to aliases: phpdbg_help.h
Commit:e02c26d1f502a28103e1b2367547ed188c5ab4c5 Author:krakjoe joe.watk...@live.co.uk Mon, 18 Nov 2013 14:51:08 + Parents: 93c5968e72660d281a3869a0746c0c6009bc2b2b Branches: PHP-5.6 Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=e02c26d1f502a28103e1b2367547ed188c5ab4c5 Log: correction to aliases Changed paths: M phpdbg_help.h Diff: diff --git a/phpdbg_help.h b/phpdbg_help.h index 400d200..89de11b 100644 --- a/phpdbg_help.h +++ b/phpdbg_help.h @@ -68,7 +68,7 @@ static const phpdbg_command_t phpdbg_help_commands[] = { PHPDBG_COMMAND_D_EX(clear,reset breakpoints to execute without interruption, 'c', help_clear, NULL, 0), PHPDBG_COMMAND_D_EX(info, quick access to useful information on the console, 'i', help_info,NULL, 0), PHPDBG_COMMAND_D_EX(back, show debug backtrace information during execution, 't', help_back,NULL, 0), -PHPDBG_COMMAND_D_EX(quiet,be quiet during execution, 's', help_quiet, NULL, 0), +PHPDBG_COMMAND_D_EX(quiet,be quiet during execution, 'Q', help_quiet, NULL, 0), PHPDBG_COMMAND_D_EX(list, list code gives you quick access to code,'l', help_list, NULL, 0), PHPDBG_COMMAND_D_EX(oplog,keep clutter off the screen by logging oplines, 'O', help_oplog, NULL, 0), PHPDBG_COMMAND_D_EX(shell,execute system commands with direct shell access, '-', help_shell, NULL, 0), -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: Export conditional breaks: phpdbg_bp.c
Commit:485966252a200f53704e9156fff5f816798ef465 Author:Bob Weinand bobw...@hotmail.com Tue, 26 Nov 2013 09:21:04 +0100 Parents: bc7df607ab2d7771a3c2226b46598645e67e053f Branches: PHP-5.6 Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=485966252a200f53704e9156fff5f816798ef465 Log: Export conditional breaks Changed paths: M phpdbg_bp.c Diff: diff --git a/phpdbg_bp.c b/phpdbg_bp.c index 40a3a50..3fe4169 100644 --- a/phpdbg_bp.c +++ b/phpdbg_bp.c @@ -59,8 +59,8 @@ PHPDBG_API void phpdbg_export_breakpoints(FILE *handle TSRMLS_DC) /* {{{ */ zend_hash_move_forward_ex(table, position)) { zend_llist_position lposition; -phpdbg_breakfile_t *brake; - zend_ulong count = zend_llist_count(brakes); + phpdbg_breakfile_t *brake; + int count = zend_llist_count(brakes); if ((brake = zend_llist_get_first_ex(brakes, lposition))) { phpdbg_notice( @@ -134,8 +134,22 @@ PHPDBG_API void phpdbg_export_breakpoints(FILE *handle TSRMLS_DC) /* {{{ */ } } - /* export other types here after resolving errors from source command */ + if (PHPDBG_G(flags) PHPDBG_HAS_COND_BP) { + phpdbg_breakcond_t *brake; + + table = PHPDBG_G(bp)[PHPDBG_BREAK_COND]; + + phpdbg_notice( + Exporting conditional breakpoints (%d), zend_hash_num_elements(table)); + + for (zend_hash_internal_pointer_reset_ex(table, position); + zend_hash_get_current_data_ex(table, (void**) brake, position) == SUCCESS; + zend_hash_move_forward_ex(table, position)) { + fprintf( + handle, break on %s\n, Z_STRVAL(brake-code)); + } + } } /* }}} */ PHPDBG_API void phpdbg_set_breakpoint_file(const char *path, long line_num TSRMLS_DC) /* {{{ */ -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: fix eval for new input handling: phpdbg_prompt.c
Commit:e71766273077cff6bb8836a37e0d199f4564c612 Author:krakjoe joe.watk...@live.co.uk Wed, 20 Nov 2013 14:25:15 + Parents: 4f5c7a963c2f653e45ed6d8de390ac228c28138d Branches: PHP-5.6 Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=e71766273077cff6bb8836a37e0d199f4564c612 Log: fix eval for new input handling Changed paths: M phpdbg_prompt.c Diff: diff --git a/phpdbg_prompt.c b/phpdbg_prompt.c index 10fb60a..c69c056 100644 --- a/phpdbg_prompt.c +++ b/phpdbg_prompt.c @@ -514,12 +514,26 @@ static PHPDBG_COMMAND(eval) /* {{{ */ case STR_PARAM: { zend_bool stepping = (PHPDBG_G(flags) PHPDBG_IS_STEPPING); zval retval; - + char *code = NULL; + PHPDBG_G(flags) = ~ PHPDBG_IS_STEPPING; + if (input input-start) { + code = (char*) input-start; + + if (memcmp( + code, eval, sizeof(eval)-1) == SUCCESS) { + code += sizeof(eval)-1; + } else code += sizeof(E)-1; + + while (code isspace(*code)) { + code++; + } + } else code = param-str; + /* disable stepping while eval() in progress */ PHPDBG_G(flags) |= PHPDBG_IN_EVAL; - if (zend_eval_stringl(param-str, param-len, + if (zend_eval_stringl(code, strlen(code), retval, eval()'d code TSRMLS_CC) == SUCCESS) { zend_print_zval_r( retval, 0 TSRMLS_CC); -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: - Fix code: phpdbg_opcode.c
Commit:ac0ecc476c6b5a562b98026acc76390c2597392b Author:Felipe Pena felipe...@gmail.com Sun, 10 Nov 2013 19:00:58 -0200 Parents: 52f9c52475bdcdece80e05105ca44779cbcf7607 Branches: PHP-5.6 Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=ac0ecc476c6b5a562b98026acc76390c2597392b Log: - Fix code Changed paths: M phpdbg_opcode.c Diff: diff --git a/phpdbg_opcode.c b/phpdbg_opcode.c index 60d4075..5796678 100644 --- a/phpdbg_opcode.c +++ b/phpdbg_opcode.c @@ -18,11 +18,12 @@ */ #include zend_vm_opcodes.h +#include zend_compile.h #include phpdbg_opcode.h const char *phpdbg_decode_opcode(zend_uchar opcode) /* {{{ */ { -#define CASE(s) return #s +#define CASE(s) case s: return #s switch (opcode) { CASE(ZEND_NOP); CASE(ZEND_ADD); -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: Small bug fix on error: phpdbg_bp.c phpdbg_bp.h
Commit:24585722b1a9acd87387285a301a6c5e084d21bc Author:Bob Weinand bobw...@hotmail.com Thu, 28 Nov 2013 22:03:59 +0100 Parents: d7f6e884932423662aaf319bced391c91c76cb48 Branches: PHP-5.6 Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=24585722b1a9acd87387285a301a6c5e084d21bc Log: Small bug fix on error Changed paths: M phpdbg_bp.c M phpdbg_bp.h Diff: diff --git a/phpdbg_bp.c b/phpdbg_bp.c index 22d376e..11f2754 100644 --- a/phpdbg_bp.c +++ b/phpdbg_bp.c @@ -319,10 +319,11 @@ PHPDBG_API void phpdbg_set_breakpoint_opline(zend_ulong opline TSRMLS_DC) /* {{{ } } while (--i); - if (!branch || + if (i || (zend_ulong)(branch-op_array + branch-op_array-last) = opline || (opline - (zend_ulong)branch-op_array) % sizeof(zend_op) 0) { phpdbg_error(No opline could be found at 0x%lx, opline); + return; } opline_break.opline = (opline - (zend_ulong)branch-op_array) / sizeof(zend_op); @@ -379,7 +380,7 @@ PHPDBG_API void phpdbg_set_breakpoint_opline(zend_ulong opline TSRMLS_DC) /* {{{ } } /* }}} */ -PHPDBG_API void phpdbg_resolve_op_array_break(phpdbg_breakopline_t *brake, zend_op_array *op_array TSRMLS_DC) { +PHPDBG_API int phpdbg_resolve_op_array_break(phpdbg_breakopline_t *brake, zend_op_array *op_array TSRMLS_DC) { phpdbg_breakline_t opline_break; if (op_array-last brake-opline) { if (brake-class_name == NULL) { @@ -387,6 +388,8 @@ PHPDBG_API void phpdbg_resolve_op_array_break(phpdbg_breakopline_t *brake, zend_ } else { phpdbg_error(There are only %d oplines in method %s::%s (breaking at opline %d impossible), op_array-last, brake-class_name, brake-func_name, brake-opline); } + + return FAILURE; } opline_break.id = brake-id; @@ -396,6 +399,8 @@ PHPDBG_API void phpdbg_resolve_op_array_break(phpdbg_breakopline_t *brake, zend_ PHPDBG_G(flags) |= PHPDBG_HAS_OPLINE_BP; zend_hash_index_update(PHPDBG_G(bp)[PHPDBG_BREAK_OPLINE], opline_break.opline, opline_break, sizeof(phpdbg_breakline_t), NULL); + + return SUCCESS; } PHPDBG_API void phpdbg_resolve_op_array_breaks(zend_op_array *op_array TSRMLS_DC) { @@ -416,9 +421,7 @@ PHPDBG_API void phpdbg_resolve_op_array_breaks(zend_op_array *op_array TSRMLS_DC for (zend_hash_internal_pointer_reset_ex(oplines_table, position); zend_hash_get_current_data_ex(oplines_table, (void**) brake, position) == SUCCESS; zend_hash_move_forward_ex(oplines_table, position)) { - zend_try { - phpdbg_resolve_op_array_break(brake, op_array TSRMLS_CC); - } zend_end_try(); + phpdbg_resolve_op_array_break(brake, op_array TSRMLS_CC); } } @@ -447,9 +450,12 @@ PHPDBG_API int phpdbg_resolve_opline_break(phpdbg_breakopline_t *new_break TSRML } else { phpdbg_error(%s::%s is not an user defined method, no oplines exist, new_break-class_name, new_break-func_name); } + return 2; } - phpdbg_resolve_op_array_break(new_break, func-op_array TSRMLS_CC); + if (phpdbg_resolve_op_array_break(new_break, func-op_array TSRMLS_CC) == FAILURE) { + return 2; + } return SUCCESS; } @@ -467,10 +473,17 @@ PHPDBG_API void phpdbg_set_breakpoint_method_opline(const char *class, const cha new_break.opline = opline; new_break.id = PHPDBG_G(bp_count)++; - if (phpdbg_resolve_opline_break(new_break TSRMLS_CC) == FAILURE) { - phpdbg_notice(Pending breakpoint #%d at %s::%s:%d, new_break.id, new_break.class_name, new_break.func_name, opline); - } else { - phpdbg_notice(Breakpoint #%d added at %s::%s:%d, new_break.id, new_break.class_name, new_break.func_name, opline); + switch (phpdbg_resolve_opline_break(new_break TSRMLS_CC)) { + case FAILURE: + phpdbg_notice(Pending breakpoint #%d at %s::%s:%d, new_break.id, new_break.class_name, new_break.func_name, opline); + break; + + case SUCCESS: + phpdbg_notice(Breakpoint #%d added at %s::%s:%d, new_break.id, new_break.class_name, new_break.func_name, opline); + break; + + case 2: + return; } if (zend_hash_find(PHPDBG_G(bp)[PHPDBG_BREAK_METHOD_OPLINE], new_break.class_name, new_break.class_len, (void **)class_table) == FAILURE) { @@ -512,10 +525,17 @@ PHPDBG_API void phpdbg_set_breakpoint_function_opline(const char *function, int new_break.opline = opline; new_break.id = PHPDBG_G(bp_count)++; - if
[PHP-CVS] com php-src: another tut: tutorials/simples.md
Commit:e0c4f87a897e005f5927baa8a747e6266d052813 Author:krakjoe joe.watk...@live.co.uk Fri, 22 Nov 2013 13:49:35 + Parents: 4fd2edbeb42b842d0c7cdb00363c7b09aa89b906 Branches: PHP-5.6 Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=e0c4f87a897e005f5927baa8a747e6266d052813 Log: another tut Changed paths: A tutorials/simples.md Diff: diff --git a/tutorials/simples.md b/tutorials/simples.md new file mode 100644 index 000..d8b53d6 --- /dev/null +++ b/tutorials/simples.md @@ -0,0 +1,132 @@ +Simples +=== +*Everything is simple ...* + +It is easy to imagine that debugging a whole web application might be difficult, in a console program, in fact this is not the case: + +A web application is just an instance of the PHP interpreter with some very specific super globals set. + +With everything in the correct place, your web application has no clue that it being served not to a client, but to you, probably in your underwear. + +With the facts established, you can use phpdbg to debug anything that is PHP, with a bit of cleverness in the right places. + +Very Simple +=== +*A good starting place ...* + +``` +phpdbg -e/path/to/my/script.php +``` + +The command above will result in a phpdbg console that has executed *.phpdbginit* (if it exists) and is ready to compile, inspect, step through +and execute the code contained in */path/to/my/script.php* + +The first thing to do upon being presented with the console, is decide what to break for ... + +Many options exist for choosing (and setting) breakpoints: + +``` +phpdbg b phpdbg::isGreat +phpdbg b phpdbg_is_great +``` + +The commands above will be the most common for most developers; that is, specifying the entry point of a function or method on which to break execution. + +Introspection of code is supported on the console, for anything that is compiled, if help is required remembering the name of a particular method then issue: + +``` +phpdbg compile +phpdbg print class myClassName +``` + +Introspection doesn't only provide you with names, but the addresses of every opcode in every statement, which you may use to specify with as much precision as +is possible where to break execution. + +**There is a print command for particular methods, useful if a class is very large and your screen is not !** + +At this point, break points are set; the next thing to do is issue the run command: + +``` +phpdbg run +``` + +This will cause execution of the context, if a breakpoint is reached, the interactive console returns such that more commands can be issued. + +When a breakpoint is reached, several options for continuation exist: + + - step through every instruction + - run past the end of the stack + - run to the end of the stack + +*Q: WTF is a stack?* + +*A: Generally the current codepath, more precisely: current function, method or file* + +Just quickly; an explanation of what to and past the end of a stack means: + +Assuming there is a break set for *my_function_somewhere* in the following code: + +``` +function my_function_somewhere($input = array()) /* break here on entry to the function */ +{ + /* ... the stack ... */ + + if (count($input)) + { + /* to - */ return $input[1]; + } + else + { + /* to - */ return rand(1, 100); + } +} + +/* past - */ $result = my_function_somewhere(); +if ($result) +{ + /* and so on */ + var_dump($result); +} +``` + +The commands *finish* and *leave*, run *past* and *to* the end of the stack respecitively. + +**Note: the finish command does not automatically break; to break past the end of the stack enable stepping before issuing finish, the leave command breaks implicitly** + +On with execution ... += +*Stepping, slowly, is sometimes the way forward ...* + +Should you want to inspect what happens during the execution of the stack, enable stepping: + +``` +phpdbg step 1 +``` + +In case it wasn't obvious, the next thing to do is nearly always *next*: + +``` +phpdbg next +``` + +Which will cause the vm to assume control and continue execution until the next break point, or completion. + +Stepping through every single instruction is not usually beneficial, issue: + +``` +phpdbg step 0 +``` + +To disable stepping again, and only interrupt execution for breakpoints. + +As hard as it gets ... +== +*Web Applications* + +As mentioned, a web application is only a script executing with some specific super globals set; + +**The mocking of any web request just requires that you set the super globals of the script accordingly** + +We refer to this as bootstrapping, mostly because I have always wanted a genuine reason to use that word. + +See the example, for help with bootstrapping ... -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: ...: README.md
Commit:a6864679a2866e69a3659e29e9b112353764560d Author:krakjoe joe.watk...@live.co.uk Sun, 10 Nov 2013 23:38:55 + Parents: 4f5096af3ceaf5670050353fc8a41d164b8b058b Branches: PHP-5.6 Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=a6864679a2866e69a3659e29e9b112353764560d Log: ... Changed paths: M README.md Diff: diff --git a/README.md b/README.md index a15e556..78d811f 100644 --- a/README.md +++ b/README.md @@ -29,6 +29,16 @@ make -j8 make install-phpdbg ``` +Command Line Options + + +The following switches are implemented (just like cli SAPI): + + - -n ignore php ini + - -c search for php ini in path + - -z load zend extension + - -d define php ini entry + Screeny === -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: - Fix conflict: phpdbg_prompt.c test.php
Commit:33098232dc27c4f22dd38d17268fd59a64b1d000 Author:Felipe Pena felipe...@gmail.com Sun, 17 Nov 2013 14:13:13 -0200 Parents: 478446b665acb80411b0c7dee417962e88848842 02e3718ef907c3d6063ea746e5a1fd1047ded7bc Branches: PHP-5.6 Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=33098232dc27c4f22dd38d17268fd59a64b1d000 Log: - Fix conflict Changed paths: MM phpdbg_prompt.c MM test.php Diff: diff --cc test.php index fab577b,d11310b..dc1ecdb --- a/test.php +++ b/test.php @@@ -1,5 -1,7 +1,8 @@@ ?php + + if (isset($include)) - include (sprintf(%s/web-bootstrap.php, dirname(__FILE__))); ++ include (sprintf(%s/web-bootstrap.php, dirname(__FILE__))); + class phpdbg { public function isGreat($greeting = null) { printf( -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: debugging new input stuff: phpdbg_cmd.c phpdbg_cmd.h phpdbg_prompt.c
Commit:5af371409cb361dc0ce452212b0b4020a7d36f46 Author:krakjoe joe.watk...@live.co.uk Tue, 19 Nov 2013 20:27:23 + Parents: 1a2618b229f03247bb2006a272598d9a7ec66994 Branches: PHP-5.6 Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=5af371409cb361dc0ce452212b0b4020a7d36f46 Log: debugging new input stuff Changed paths: M phpdbg_cmd.c M phpdbg_cmd.h M phpdbg_prompt.c Diff: diff --git a/phpdbg_cmd.c b/phpdbg_cmd.c index 227e659..8eb38d7 100644 --- a/phpdbg_cmd.c +++ b/phpdbg_cmd.c @@ -137,7 +137,8 @@ static inline phpdbg_input_t** phpdbg_read_argv(char *buffer, int *argc TSRMLS_D phpdbg_input_t *arg = emalloc(sizeof(phpdbg_input_t));\ if (arg) {\ b[l]=0;\ - arg-string = estrndup(b, l);\ + arg-length = l;\ + arg-string = estrndup(b, arg-length);\ arg-argv=NULL;\ arg-argc=0;\ argv = (phpdbg_input_t**) erealloc(argv, sizeof(phpdbg_input_t*) * ((*argc)+1));\ @@ -319,6 +320,52 @@ void phpdbg_destroy_input(phpdbg_input_t **input TSRMLS_DC) /*{{{ */ } } /* }}} */ +int phpdbg_do_cmd_ex(const phpdbg_command_t *command, phpdbg_input_t *input TSRMLS_DC) /* {{{ */ +{ + int rc = FAILURE; + + if (input-argc 0) { + while (command command-name command-handler) { + if (((command-name_len == input-argv[0]-length) + (memcmp(command-name, input-argv[0]-string, command-name_len) == SUCCESS)) || + (command-alias + (input-argv[0]-length == 1) + (command-alias == *input-argv[0]-string))) { + if (command-subs input-argc 1) { + phpdbg_input_t sub; + + sub.argc = input-argc-1; + sub.argv = input-argv[1]; + + return phpdbg_do_cmd_ex(command-subs, sub TSRMLS_CC); + } + + phpdbg_debug( + found command %s for %s with %d arguments, + command-name, input-argv[0]-string, input-argc-1); + { + int arg; + for (arg=1; arginput-argc; arg++) { + phpdbg_debug( + \t#%d: [%s=%d], + arg, + input-argv[arg]-string, + input-argv[arg]-length); + } + } + break; + } + command++; + } + } else { + /* this should NEVER happen */ + phpdbg_error( + No function executed !!); + } + + return rc; +} /* }}} */ + int phpdbg_do_cmd(const phpdbg_command_t *command, char *cmd_line, size_t cmd_len TSRMLS_DC) /* {{{ */ { int rc = FAILURE; diff --git a/phpdbg_cmd.h b/phpdbg_cmd.h index a8865ce..47ada44 100644 --- a/phpdbg_cmd.h +++ b/phpdbg_cmd.h @@ -88,6 +88,7 @@ struct _phpdbg_command_t { * Command Executor */ phpdbg_input_t* phpdbg_read_input(TSRMLS_D); +int phpdbg_do_cmd_ex(const phpdbg_command_t*, phpdbg_input_t *input TSRMLS_DC); int phpdbg_do_cmd(const phpdbg_command_t*, char*, size_t TSRMLS_DC); phpdbg_param_type phpdbg_parse_param(const char*, size_t, phpdbg_param_t* TSRMLS_DC); void phpdbg_clear_param(phpdbg_param_t* TSRMLS_DC); diff --git a/phpdbg_prompt.c b/phpdbg_prompt.c index d5b4bda..bb7dc00 100644 --- a/phpdbg_prompt.c +++ b/phpdbg_prompt.c @@ -973,6 +973,8 @@ int phpdbg_interactive(TSRMLS_D) /* {{{ */ if (input input-length 0L) { do { + phpdbg_do_cmd_ex(phpdbg_prompt_commands, input TSRMLS_CC); + switch (ret = phpdbg_do_cmd(phpdbg_prompt_commands, input-string, input-length TSRMLS_CC)) { case FAILURE: if (!(PHPDBG_G(flags) PHPDBG_IS_QUITTING)) { -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: Merge branch 'master' of https://github.com/krakjoe/phpdbg: phpdbg_prompt.c
Commit:403072e488e1b8e6b6faa70e99801edaee2dc3ad Author:krakjoe joe.watk...@live.co.uk Sat, 16 Nov 2013 11:12:22 + Parents: 19ada893cbe55edc148021951413db87ebccfb44 0629f32afcaaed5f10aa45feb76deca86f0f6135 Branches: PHP-5.6 Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=403072e488e1b8e6b6faa70e99801edaee2dc3ad Log: Merge branch 'master' of https://github.com/krakjoe/phpdbg Changed paths: MM phpdbg_prompt.c Diff: -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: - WS changes: phpdbg_help.c
Commit:8532076c6465e73e7b437f43601c43a70560bf85 Author:Felipe Pena felipe...@gmail.com Sun, 10 Nov 2013 14:16:52 -0200 Parents: c060093acf5f1732938dc06eae0c76d39d375827 Branches: PHP-5.6 Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=8532076c6465e73e7b437f43601c43a70560bf85 Log: - WS changes Changed paths: M phpdbg_help.c Diff: diff --git a/phpdbg_help.c b/phpdbg_help.c index 916764d..978f7ae 100644 --- a/phpdbg_help.c +++ b/phpdbg_help.c @@ -25,12 +25,13 @@ PHPDBG_HELP(exec) /* {{{ */ { - printf(Will attempt execution, if compilation has not yet taken place, it occurs now.\n); - printf(The execution context must be set before execution can take place\n); - return SUCCESS; + printf(Will attempt execution, if compilation has not yet taken place, it occurs now.\n); + printf(The execution context must be set before execution can take place\n); + return SUCCESS; } /* }}} */ -PHPDBG_HELP(step) { /* {{{ */ +PHPDBG_HELP(step) /* {{{ */ +{ printf(You can enable and disable stepping at any phpdbg prompt during execution\n); printf(For example:\n); printf(\tphpdbg stepping 1\n); @@ -39,68 +40,68 @@ PHPDBG_HELP(step) { /* {{{ */ return SUCCESS; } /* }}} */ -PHPDBG_HELP(next) { /* {{{ */ -printf(While stepping through execution, use the next command to step back into the vm and execute the next opcode); -return SUCCESS; +PHPDBG_HELP(next) /* {{{ */ +{ + printf(While stepping through execution, use the next command to step back into the vm and execute the next opcode); + return SUCCESS; } /* }}} */ PHPDBG_HELP(compile) /* {{{ */ { - printf(Pre-compilation of the execution context provides the opportunity to inspect the opcodes before they are executed\n); - printf(The execution context must be set for compilation to succeed\n); - printf(If errors occur during compilation they must be resolved before execution can take place.\n); - printf(You do not need to exit phpdbg to retry compilation\n); - return SUCCESS; + printf(Pre-compilation of the execution context provides the opportunity to inspect the opcodes before they are executed\n); + printf(The execution context must be set for compilation to succeed\n); + printf(If errors occur during compilation they must be resolved before execution can take place.\n); + printf(You do not need to exit phpdbg to retry compilation\n); + return SUCCESS; } /* }}} */ PHPDBG_HELP(print) /* {{{ */ { -printf(By default, print will show information about the current execution environment\n); -printf(To show specific information pass an expression to print, for example:\n); -printf(\tphpdbg print opcodes[0]\n); -printf(Will show the opline @ 0\n); -printf(Available print commands:\n); -printf(\tNone\n); - -return SUCCESS; + printf(By default, print will show information about the current execution environment\n); + printf(To show specific information pass an expression to print, for example:\n); + printf(\tphpdbg print opcodes[0]\n); + printf(Will show the opline @ 0\n); + printf(Available print commands:\n); + printf(\tNone\n); + return SUCCESS; } /* }}} */ -PHPDBG_HELP(run) /* {{{ */ +PHPDBG_HELP(run) /* {{{ */ { -printf(Run the code inside the debug vm, you should have break points and variables set before running\n); -printf(The execution context must not be set, but not necessarily compiled before execution occurs\n); -return SUCCESS; + printf(Run the code inside the debug vm, you should have break points and variables set before running\n); + printf(The execution context must not be set, but not necessarily compiled before execution occurs\n); + return SUCCESS; } /* }}} */ PHPDBG_HELP(eval) /* {{{ */ { -printf(Access to eval() allows you to change the environment during execution, careful though !!); -return SUCCESS; + printf(Access to eval() allows you to change the environment during execution, careful though !!); + return SUCCESS; } /* }}} */ PHPDBG_HELP(break) /* {{{ */ { -printf(Setting a breakpoint stops execution at a specific stage, the syntax is:\n); -printf(\tfile:line\n); -printf([more to come]\n); -printf(For example:\n); -printf(\tphpdbg break test.php:1\n); -printf(Will break execution on line 1 of test.php\n); - -return SUCCESS; + printf(Setting a breakpoint stops execution at a specific stage, the syntax is:\n); + printf(\tfile:line\n); + printf([more to come]\n); + printf(For example:\n); + printf(\tphpdbg break test.php:1\n); + printf(Will break execution on line 1 of test.php\n); + return SUCCESS; } /* }}} */ PHPDBG_HELP(cont) /* {{{ */ { -printf(Continues execution after a breakpoint is met\n); -printf([Warnings about using stepping and break points here]\n); -
[PHP-CVS] com php-src: update image: tutorials/phpdbg.png
Commit:04149df4895ba821a3988a645d2e13a186e419d8 Author:krakjoe joe.watk...@live.co.uk Thu, 14 Nov 2013 21:18:12 + Parents: 4c62cc97e49e70f0740b55e67b6d77494d130664 Branches: PHP-5.6 Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=04149df4895ba821a3988a645d2e13a186e419d8 Log: update image Changed paths: M tutorials/phpdbg.png Diff: diff --git a/tutorials/phpdbg.png b/tutorials/phpdbg.png index 5260d4d..7c41c89 100644 Binary files a/tutorials/phpdbg.png and b/tutorials/phpdbg.png differ -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: Merge branch 'master' of https://github.com/krakjoe/phpdbg: phpdbg_prompt.c
Commit:1b41ab2e343467e6373025bdc782e251ea406f3e Author:krakjoe joe.watk...@live.co.uk Sun, 10 Nov 2013 15:16:54 + Parents: 2f9b34d4b639b79a82d75f4ed509bfbc0e72e9de a6d573cd895847e42010f55a2e0211a6bd566f1e Branches: PHP-5.6 Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=1b41ab2e343467e6373025bdc782e251ea406f3e Log: Merge branch 'master' of https://github.com/krakjoe/phpdbg Changed paths: MM phpdbg_prompt.c Diff: -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: compress text/tidy up: phpdbg_help.c phpdbg_help.h phpdbg_prompt.c
Commit:8588f5cc84b7b69ad7231b2c987e2626a32e59b1 Author:krakjoe joe.watk...@live.co.uk Mon, 18 Nov 2013 13:23:28 + Parents: a1478217ce6f9c64f40c316500aaf56cf938f431 Branches: PHP-5.6 Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=8588f5cc84b7b69ad7231b2c987e2626a32e59b1 Log: compress text/tidy up Changed paths: M phpdbg_help.c M phpdbg_help.h M phpdbg_prompt.c Diff: diff --git a/phpdbg_help.c b/phpdbg_help.c index 7bd2e95..75b6cb7 100644 --- a/phpdbg_help.c +++ b/phpdbg_help.c @@ -103,8 +103,8 @@ PHPDBG_HELP(compile) /* {{{ */ PHPDBG_HELP(print) /* {{{ */ { phpdbg_help_header(); - phpdbg_writeln(By default, print will show information about the current execution environment); - phpdbg_writeln(Other printing commands give access to address, file and line information); + phpdbg_writeln(By default, print will show information about the current execution context); + phpdbg_writeln(Other printing commands give access to instruction information); phpdbg_writeln(EMPTY); phpdbg_writeln(Examples:); phpdbg_writeln(\t%sprint class \\my\\class, PROMPT); diff --git a/phpdbg_help.h b/phpdbg_help.h index a54c43a..400d200 100644 --- a/phpdbg_help.h +++ b/phpdbg_help.h @@ -54,23 +54,23 @@ PHPDBG_HELP(shell); */ static const phpdbg_command_t phpdbg_help_commands[] = { PHPDBG_COMMAND_D_EX(exec, the execution context should be a valid path,'e', help_exec,NULL, 0), - PHPDBG_COMMAND_D_EX(compile, pre-compilation allows inspection of code before execution, 'c', help_compile, NULL, 0), + PHPDBG_COMMAND_D_EX(compile, allow inspection of code before execution, 'c', help_compile, NULL, 0), PHPDBG_COMMAND_D_EX(step, step through execution to break at every opcode, 's', help_step,NULL, 0), PHPDBG_COMMAND_D_EX(next, continue executing while stepping or after breaking, 'n', help_next,NULL, 0), PHPDBG_COMMAND_D_EX(run, execute inside the phpdbg vm, 'r', help_run, NULL, 0), - PHPDBG_COMMAND_D_EX(eval, access to eval() allows you to affect the environment during execution, 'E', help_eval,NULL, 0), + PHPDBG_COMMAND_D_EX(eval, access to eval() allows affecting the environment, 'E', help_eval, NULL, 0), PHPDBG_COMMAND_D_EX(until,continue until the current line is executed, 'u', help_until, NULL, 0), PHPDBG_COMMAND_D_EX(finish, continue until the current function has returned,'f', help_finish, NULL, 0), PHPDBG_COMMAND_D_EX(leave,continue until the current function is returning,'L', help_leave, NULL, 0), - PHPDBG_COMMAND_D_EX(print,printing allows inspection of the execution environment, 'p', help_print, NULL, 0), + PHPDBG_COMMAND_D_EX(print,print context information or instructions, 'p', help_print, NULL, 0), PHPDBG_COMMAND_D_EX(break,breakpoints allow execution interruption,'b', help_break, NULL, 0), - PHPDBG_COMMAND_D_EX(clean,resetting the environment is useful while debugging and recompiling, 'X', help_clean, NULL, 0), - PHPDBG_COMMAND_D_EX(clear,clearing breakpoints allows you to run code without interruption,'c', help_clear, NULL, 0), + PHPDBG_COMMAND_D_EX(clean,resetting the environment is useful while debugging, 'X', help_clean, NULL, 0), + PHPDBG_COMMAND_D_EX(clear,reset breakpoints to execute without interruption, 'c', help_clear, NULL, 0), PHPDBG_COMMAND_D_EX(info, quick access to useful information on the console, 'i', help_info,NULL, 0), PHPDBG_COMMAND_D_EX(back, show debug backtrace information during execution, 't', help_back,NULL, 0), PHPDBG_COMMAND_D_EX(quiet,be quiet during execution, 's', help_quiet, NULL, 0), - PHPDBG_COMMAND_D_EX(list, listing code gives you quick access to code while executing, 'l', help_list,NULL, 0), - PHPDBG_COMMAND_D_EX(oplog,keep clutter off the screen by sending oplogs to a file, 'O', help_oplog, NULL, 0), +
[PHP-CVS] com php-src: Fixed file opline num resolving: phpdbg_bp.c
Commit:3ffb4aaf9ba018192c8eadf3c72ddee619ac9165 Author:Bob Weinand bobw...@hotmail.com Tue, 3 Dec 2013 16:10:57 +0100 Parents: 76f889569f029c9fe15d87a0b80db07e483b0cf1 Branches: PHP-5.6 Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=3ffb4aaf9ba018192c8eadf3c72ddee619ac9165 Log: Fixed file opline num resolving Changed paths: M phpdbg_bp.c Diff: diff --git a/phpdbg_bp.c b/phpdbg_bp.c index a7be7eb..4f6b79e 100644 --- a/phpdbg_bp.c +++ b/phpdbg_bp.c @@ -445,8 +445,28 @@ PHPDBG_API int phpdbg_resolve_opline_break(phpdbg_breakopline_t *new_break TSRML zend_function *func; if (new_break-func_name == NULL) { - /* no idea yet ...; currently only settable before including of file */ - return FAILURE; + if (EG(current_execute_data) == NULL) { + if (PHPDBG_G(ops) != NULL !memcmp(PHPDBG_G(ops)-filename, new_break-class_name, new_break-class_len)) { + if (phpdbg_resolve_op_array_break(new_break, PHPDBG_G(ops) TSRMLS_CC) == SUCCESS) { + return SUCCESS; + } else { + return 2; + } + } + return FAILURE; + } else { + zend_execute_data *execute_data = EG(current_execute_data); + do { + if (execute_data-op_array-function_name == NULL execute_data-op_array-scope == NULL !memcmp(execute_data-op_array-filename, new_break-class_name, new_break-class_len)) { + if (phpdbg_resolve_op_array_break(new_break, execute_data-op_array TSRMLS_CC) == SUCCESS) { + return SUCCESS; + } else { + return 2; + } + } + } while ((execute_data = execute_data-prev_execute_data) != NULL); + return FAILURE; + } } if (new_break-class_name != NULL) { @@ -624,7 +644,7 @@ PHPDBG_API void phpdbg_set_breakpoint_file_opline(const char *file, int opline T return; } - PHPDBG_G(flags) |= PHPDBG_HAS_FUNCTION_OPLINE_BP; + PHPDBG_G(flags) |= PHPDBG_HAS_FILE_OPLINE_BP; zend_hash_index_update(file_table, new_break.opline, new_break, sizeof(phpdbg_breakopline_t), NULL); } -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: ...: tutorials/show-printing.png
Commit:7928d1f9e2bae63a4c8dae282cac100e78e83daa Author:krakjoe joe.watk...@live.co.uk Wed, 13 Nov 2013 10:16:09 + Parents: ae683043e2a05cedaddd624279559b20e3fe45ed Branches: PHP-5.6 Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=7928d1f9e2bae63a4c8dae282cac100e78e83daa Log: ... Changed paths: M tutorials/show-printing.png Diff: diff --git a/tutorials/show-printing.png b/tutorials/show-printing.png index cc409bc..6ea55f3 100644 Binary files a/tutorials/show-printing.png and b/tutorials/show-printing.png differ -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: Tiny whitespace fix in makefile (aligning with other Installing messages): Makefile.frag
Commit:baceff6ad4bad3f13426be01db2971294dfe703f Author:Bob Weinand bobw...@hotmail.com Mon, 9 Dec 2013 19:58:19 +0100 Parents: 2fa3479df5d63236e79abb55ca932c435dfa5291 Branches: PHP-5.6 Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=baceff6ad4bad3f13426be01db2971294dfe703f Log: Tiny whitespace fix in makefile (aligning with other Installing messages) Changed paths: M Makefile.frag Diff: diff --git a/Makefile.frag b/Makefile.frag index 8a9528b..5be6d5b 100644 --- a/Makefile.frag +++ b/Makefile.frag @@ -9,7 +9,7 @@ $(BUILD_BINARY): $(PHP_GLOBAL_OBJS) $(PHP_BINARY_OBJS) $(PHP_PHPDBG_OBJS) $(BUILD_PHPDBG) install-phpdbg: $(BUILD_BINARY) - @echo Installing phpdbg binary:$(INSTALL_ROOT)$(bindir)/ + @echo Installing phpdbg binary: $(INSTALL_ROOT)$(bindir)/ @$(mkinstalldirs) $(INSTALL_ROOT)$(bindir) @$(mkinstalldirs) $(INSTALL_ROOT)$(localstatedir)/log @$(mkinstalldirs) $(INSTALL_ROOT)$(localstatedir)/run -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: change version for release: phpdbg.h
Commit:e7fa292493dbcb251dce2a7463d5f1c80f5232ad Author:krakjoe joe.watk...@live.co.uk Sat, 23 Nov 2013 18:40:28 + Parents: cafafb0e011983543f03851ba16b2eaf61b95631 Branches: PHP-5.6 Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=e7fa292493dbcb251dce2a7463d5f1c80f5232ad Log: change version for release Changed paths: M phpdbg.h Diff: diff --git a/phpdbg.h b/phpdbg.h index 8a1b814..f412f50 100644 --- a/phpdbg.h +++ b/phpdbg.h @@ -118,7 +118,7 @@ /* {{{ strings */ #define PHPDBG_ISSUES http://github.com/krakjoe/phpdbg/issues; -#define PHPDBG_VERSION 0.1.0-dev /* }}} */ +#define PHPDBG_VERSION 0.1.0 /* }}} */ /* {{{ output descriptors */ #define PHPDBG_STDIN 0 -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: Merge branch 'master' of https://github.com/krakjoe/phpdbg: phpdbg_prompt.c
Commit:22d85c6a637f07d6c7866773a6978c9d3906c592 Author:krakjoe joe.watk...@live.co.uk Sun, 10 Nov 2013 16:05:23 + Parents: 2f4acda67b9fd7659b8424345789f90061c141a8 53f4201566c813740e62cf37588b4daa23503f89 Branches: PHP-5.6 Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=22d85c6a637f07d6c7866773a6978c9d3906c592 Log: Merge branch 'master' of https://github.com/krakjoe/phpdbg Changed paths: MM phpdbg_prompt.c Diff: -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: fix test: tests/commands/0105_clear.test
Commit:cbaf610ee410e05ee2ec3a83007074f17c5c63ae Author:krakjoe joe.watk...@live.co.uk Mon, 9 Dec 2013 09:43:26 + Parents: 64194ef6523ed307ecbf74a39c0cd3e50eb64855 Branches: PHP-5.6 Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=cbaf610ee410e05ee2ec3a83007074f17c5c63ae Log: fix test Changed paths: M tests/commands/0105_clear.test Diff: diff --git a/tests/commands/0105_clear.test b/tests/commands/0105_clear.test index 1ac3c3b..b547b0d 100644 --- a/tests/commands/0105_clear.test +++ b/tests/commands/0105_clear.test @@ -5,11 +5,14 @@ # options: -rr # #[Clearing Breakpoints] -#File 0 -#Functions 0 -#Methods 0 -#Oplines 0 -#Conditionals 0 +#File%w%d +#Functions%w%d +#Methods%w%d +#Oplines%w%d +#File oplines%w%d +#Function oplines%w%d +#Method oplines%w%d +#Conditionals%w%d # clear quit -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: Added breaking upon fatal-ish error: phpdbg.c
Commit:20318c49606274c87005b89f5f3a52e484cd760e Author:Bob Weinand bobw...@hotmail.com Sat, 21 Dec 2013 22:42:11 +0100 Parents: ef3e0119b8437c855049ee3a67b0317dce055669 Branches: PHP-5.6 Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=20318c49606274c87005b89f5f3a52e484cd760e Log: Added breaking upon fatal-ish error Changed paths: M phpdbg.c Diff: diff --git a/phpdbg.c b/phpdbg.c index 17193ed..4b75ce2 100644 --- a/phpdbg.c +++ b/phpdbg.c @@ -438,6 +438,35 @@ static void php_sapi_phpdbg_log_message(char *message TSRMLS_DC) /* {{{ */ */ if (phpdbg_booted) { phpdbg_error(%s, message); + + switch (PG(last_error_type)) { + case E_ERROR: + case E_CORE_ERROR: + case E_COMPILE_ERROR: + case E_USER_ERROR: + case E_PARSE: + case E_RECOVERABLE_ERROR: + if (!(PHPDBG_G(flags) PHPDBG_IN_EVAL)) { + phpdbg_list_file( + zend_get_executed_filename(TSRMLS_C), + 3, + zend_get_executed_lineno(TSRMLS_C)-1, + zend_get_executed_lineno(TSRMLS_C) + TSRMLS_CC + ); + } + + do { + switch (phpdbg_interactive(TSRMLS_C)) { + case PHPDBG_LEAVE: + case PHPDBG_FINISH: + case PHPDBG_UNTIL: + case PHPDBG_NEXT: + return; + } + } while (!(PHPDBG_G(flags) PHPDBG_IS_QUITTING)); + + } } else fprintf(stdout, %s\n, message); } /* }}} */ -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: Merge branch 'master' of github.com:krakjoe/phpdbg: phpdbg_prompt.c
Commit:b133dbefe02ab717ac7a435ce16cc471fca06827 Author:Felipe Pena felipe...@gmail.com Tue, 12 Nov 2013 11:34:09 -0200 Parents: af90b6d5c737646fa2b1f30d2f85a67fd8d770a7 4269b29c03a5f4a30c02f79a8cad0550fc09c958 Branches: PHP-5.6 Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=b133dbefe02ab717ac7a435ce16cc471fca06827 Log: Merge branch 'master' of github.com:krakjoe/phpdbg Changed paths: MM phpdbg_prompt.c Diff: -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: - Added phpdbg_is_empty function: phpdbg_prompt.c phpdbg_utils.c phpdbg_utils.h
Commit:6658f58d4afcb80ffaeac460564aecb1591ecd93 Author:Felipe Pena felipe...@gmail.com Tue, 12 Nov 2013 00:50:15 -0200 Parents: 79ab9a3f74e9ecb3d9acfc4a0050b491bda56185 Branches: PHP-5.6 Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=6658f58d4afcb80ffaeac460564aecb1591ecd93 Log: - Added phpdbg_is_empty function Changed paths: M phpdbg_prompt.c M phpdbg_utils.c M phpdbg_utils.h Diff: diff --git a/phpdbg_prompt.c b/phpdbg_prompt.c index 5fd0712..b71bd3d 100644 --- a/phpdbg_prompt.c +++ b/phpdbg_prompt.c @@ -498,7 +498,7 @@ static PHPDBG_COMMAND(quiet) { /* {{{ */ static PHPDBG_COMMAND(list) /* {{{ */ { - if (phpdbg_is_numeric(expr)) { + if (phpdbg_is_empty(expr) || phpdbg_is_numeric(expr)) { long offset = 0, count = strtol(expr, NULL, 0); const char *filename = PHPDBG_G(exec); diff --git a/phpdbg_utils.c b/phpdbg_utils.c index 4991d3d..e3408ed 100644 --- a/phpdbg_utils.c +++ b/phpdbg_utils.c @@ -30,3 +30,14 @@ int phpdbg_is_numeric(const char *str) /* {{{ */ } return 0; } /* }}} */ + +int phpdbg_is_empty(const char *str) /* {{{ */ +{ + for (; *str; str++) { + if (isspace(*str)) { + continue; + } + return 0; + } + return 1; +} /* }}} */ diff --git a/phpdbg_utils.h b/phpdbg_utils.h index 231a1b3..3cb430f 100644 --- a/phpdbg_utils.h +++ b/phpdbg_utils.h @@ -20,6 +20,7 @@ #ifndef PHPDBG_UTILS_H #define PHPDBG_UTILS_H -int phpdbg_is_numeric(const char *); +int phpdbg_is_numeric(const char*); +int phpdbg_is_empty(const char*); #endif /* PHPDBG_UTILS_H */ -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: web-bootstrap example: web-bootstrap.php
Commit:4b2490426f46d360345d353b94c5b4a03c38a92a Author:krakjoe joe.watk...@live.co.uk Tue, 12 Nov 2013 06:57:56 + Parents: bb715ac77d6a83eeb9973037a087d32f872ba77a Branches: PHP-5.6 Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=4b2490426f46d360345d353b94c5b4a03c38a92a Log: web-bootstrap example Changed paths: A web-bootstrap.php Diff: diff --git a/web-bootstrap.php b/web-bootstrap.php new file mode 100644 index 000..c5802c1 --- /dev/null +++ b/web-bootstrap.php @@ -0,0 +1,46 @@ +?php +define(PHPDBG_BOOTPATH, /opt/php-zts/htdocs); +define(PHPDBG_BOOTSTRAP, index.php); +define(PHPDBG_BOOTSTRAPPED, sprintf(/%s, PHPDBG_BOOTSTRAP)); + +$_SERVER = array +( + 'HTTP_HOST' = 'localhost', + 'HTTP_CONNECTION' = 'keep-alive', + 'HTTP_ACCEPT' = 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8', + 'HTTP_USER_AGENT' = 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/29.0.1547.65 Safari/537.36', + 'HTTP_ACCEPT_ENCODING' = 'gzip,deflate,sdch', + 'HTTP_ACCEPT_LANGUAGE' = 'en-US,en;q=0.8', + 'HTTP_COOKIE' = 'tz=Europe%2FLondon; __utma=1.347100075.1384196523.1384196523.1384196523.1; __utmc=1; __utmz=1.1384196523.1.1.utmcsr=(direct)|utmccn=(direct)|utmcmd=(none)', + 'PATH' = '/usr/local/bin:/usr/bin:/bin', + 'SERVER_SIGNATURE' = 'addressApache/2.4.6 (Ubuntu) Server at phpdbg.com Port 80/address', + 'SERVER_SOFTWARE' = 'Apache/2.4.6 (Ubuntu)', + 'SERVER_NAME' = 'localhost', + 'SERVER_ADDR' = '127.0.0.1', + 'SERVER_PORT' = '80', + 'REMOTE_ADDR' = '128.0.0.1', + 'DOCUMENT_ROOT' = dirname(__FILE__), + 'REQUEST_SCHEME' = 'http', + 'CONTEXT_PREFIX' = '', + 'CONTEXT_DOCUMENT_ROOT' = dirname(__FILE__), + 'SERVER_ADMIN' = '[no address given]', + 'SCRIPT_FILENAME' = sprintf( +'%s/%s', dirname(__FILE__), PHPDBG_BOOTSTRAP + ), + 'REMOTE_PORT' = '47931', + 'GATEWAY_INTERFACE' = 'CGI/1.1', + 'SERVER_PROTOCOL' = 'HTTP/1.1', + 'REQUEST_METHOD' = 'GET', + 'QUERY_STRING' = '', + 'REQUEST_URI' = PHPDBG_BOOTSTRAPPED, + 'SCRIPT_NAME' = PHPDBG_BOOTSTRAPPED, + 'PHP_SELF' = PHPDBG_BOOTSTRAPPED, + 'REQUEST_TIME' = time(), +); + +$_GET = array +( +request = variables +); + +chdir(PHPDBG_BOOTPATH); -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: windows: config.w32
Commit:9e47ce64acb74509a1c396f2b234a1b474028ce4 Author:krakjoe joe.watk...@live.co.uk Tue, 12 Nov 2013 12:11:02 + Parents: 6cc7a5784eed6fe24e9fa4982d0c01cc463d8355 Branches: PHP-5.6 Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=9e47ce64acb74509a1c396f2b234a1b474028ce4 Log: windows Changed paths: A config.w32 Diff: diff --git a/config.w32 b/config.w32 new file mode 100644 index 000..2359283 --- /dev/null +++ b/config.w32 @@ -0,0 +1,5 @@ +ARG_ENABLE('phpdbg', 'Build phpdbg', 'yes'); + +if (PHP_PHPDBG == yes) { +SAPI('phpdbg', 'phpdbg.c phpdbg_prompt.c phpdbg_help.c phpdbg_print.c phpdbg_bp.c phpdbg_opcode.c phpdbg_list.c phpdbg_utils.c', 'phpdbg.exe'); +} -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: ...: tutorials/java/src/phpdbg/ui/DebugSocket.java tutorials/java/src/phpdbg/ui/JConsole.java
Commit:9b498765abd28e23f707a1a63dedb78527aab11e Author:krakjoe joe.watk...@live.co.uk Fri, 29 Nov 2013 10:22:02 + Parents: 28854065902b1b3b7c8c83c5b5dd7e486fe0e8b0 Branches: PHP-5.6 Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=9b498765abd28e23f707a1a63dedb78527aab11e Log: ... Changed paths: M tutorials/java/src/phpdbg/ui/DebugSocket.java M tutorials/java/src/phpdbg/ui/JConsole.java diff --git a/tutorials/java/src/phpdbg/ui/DebugSocket.java b/tutorials/java/src/phpdbg/ui/DebugSocket.java index 0dfa107..eb46af0 100644 --- a/tutorials/java/src/phpdbg/ui/DebugSocket.java +++ b/tutorials/java/src/phpdbg/ui/DebugSocket.java @@ -20,18 +20,26 @@ import phpdbg.ui.JConsole.MessageType; public class DebugSocket extends Socket implements Runnable { private final Boolean reader; private final JConsole main; -private Boolean quit; +private final Thread thread; +private volatile Boolean quit; +private volatile Boolean started; + public DebugSocket(final String host, final Integer port, final JConsole main, Boolean reader) throws IOException { super(host, port); this.main = main; this.reader = reader; this.quit = false; - -synchronized(main) { -if (!main.isConnected()) { -main.setConnected(true); +this.started = false; +this.thread = new Thread(this); +} + +public void start() { +synchronized(this) { +if (!started) { + started = true; + thread.start(); } } } @@ -39,19 +47,26 @@ public class DebugSocket extends Socket implements Runnable { public void quit() { synchronized(this) { quit = true; -this.notifyAll(); +started = false; +notifyAll(); } } @Override public void run() { try { +synchronized(main) { +if (!main.isConnected()) { +main.setConnected(true); +} +} + synchronized(this) { do { if (reader) { String command; OutputStream output = getOutputStream(); -this.wait(); +wait(); command = main.getInputField().getText(); /* send command to stdin socket */ @@ -67,9 +82,8 @@ public class DebugSocket extends Socket implements Runnable { /* get data from stdout socket */ byte[] bytes = new byte[1]; do { -/* this is some of the laziest programming I ever done */ if (input.available() == 0) { -this.wait(400); +wait(400); continue; } diff --git a/tutorials/java/src/phpdbg/ui/JConsole.java b/tutorials/java/src/phpdbg/ui/JConsole.java index 08661bc..2958cb9 100644 --- a/tutorials/java/src/phpdbg/ui/JConsole.java +++ b/tutorials/java/src/phpdbg/ui/JConsole.java @@ -19,20 +19,6 @@ import javax.swing.JTextField; * @author krakjoe */ public class JConsole extends javax.swing.JDialog { -public enum MessageType { -INFO (JOptionPane.INFORMATION_MESSAGE), -WARN (JOptionPane.WARNING_MESSAGE), -ERROR (JOptionPane.ERROR_MESSAGE); - -private final Integer type; -private MessageType(Integer type) { -this.type = type; -} -public Integer getType() { return this.type; } -public Boolean equals(Integer other) { return this.type.equals(other); } -public Boolean equals(MessageType other) { return this.type.equals(other.getType()); } -} - /** * Creates user interface * @param parent @@ -197,38 +183,9 @@ public class JConsole extends javax.swing.JDialog { private void openButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_openButtonActionPerformed try { if (!connected) { -Integer ports[] = new Integer[2]; -String address = getHost(); - -if (address != null) { -ports[0] = stdinCheckBox.isSelected() ? getStdinPort() : -1; -ports[1] = stdoutCheckBox.isSelected() ? getStdoutPort() : -1; - -if (ports[0] != 0 ports[1] != 0) { -if (stdinCheckBox.isSelected()) { -if (ports[0] 0) { -in = new DebugSocket( -address, ports[0], this, true); -
[PHP-CVS] com php-src: ...: phpdbg_help.c phpdbg_print.c
Commit:83852d3bb775fd3555011e2cc1d5fdc9f418469e Author:krakjoe joe.watk...@live.co.uk Tue, 12 Nov 2013 08:28:03 + Parents: c00abb0e75628d2284f76098e43626266a440d3e Branches: PHP-5.6 Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=83852d3bb775fd3555011e2cc1d5fdc9f418469e Log: ... Changed paths: M phpdbg_help.c M phpdbg_print.c Diff: diff --git a/phpdbg_help.c b/phpdbg_help.c index b887380..21feb07 100644 --- a/phpdbg_help.c +++ b/phpdbg_help.c @@ -17,8 +17,6 @@ +--+ */ -#include stdio.h -#include zend.h #include phpdbg.h #include phpdbg_help.h diff --git a/phpdbg_print.c b/phpdbg_print.c index c167482..d49cc26 100644 --- a/phpdbg_print.c +++ b/phpdbg_print.c @@ -17,8 +17,6 @@ +--+ */ -#include stdio.h -#include zend.h #include phpdbg.h #include phpdbg_print.h -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: additional list option, class methods: phpdbg_help.c phpdbg_prompt.c
Commit:f566a6136bbd4fd4f3afeaeccb666bd7806562b8 Author:krakjoe joe.watk...@live.co.uk Tue, 12 Nov 2013 06:43:23 + Parents: a29c0e5c96be3d7414e8e541e1d3e7376f12cdb9 Branches: PHP-5.6 Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=f566a6136bbd4fd4f3afeaeccb666bd7806562b8 Log: additional list option, class methods Changed paths: M phpdbg_help.c M phpdbg_prompt.c Diff: diff --git a/phpdbg_help.c b/phpdbg_help.c index d942ebe..b887380 100644 --- a/phpdbg_help.c +++ b/phpdbg_help.c @@ -141,7 +141,9 @@ PHPDBG_HELP(list) /* {{{ */ printf(\tphpdbg list 2\n); printf(Will print next 2 lines from the current file\n); printf(\tphpdbg list func\n); - printf(Will print func source code\n); + printf(Will print the source of the global function \func\\n); + printf(\tphpdbg list .mine\n); + printf(Will print the source of the class method \mine\\n); printf(Note: before listing functions you must have a populated function table, try compile !!\n); return SUCCESS; } /* }}} */ diff --git a/phpdbg_prompt.c b/phpdbg_prompt.c index 72d9023..d42e638 100644 --- a/phpdbg_prompt.c +++ b/phpdbg_prompt.c @@ -547,22 +547,40 @@ static PHPDBG_COMMAND(list) /* {{{ */ phpdbg_list_file(filename, count, offset TSRMLS_CC); } else { + HashTable *func_table = EG(function_table); zend_function* fbc; +const char *func_name = expr; +size_t func_name_len = expr_len; - if (!EG(function_table)) { +/* search active scope if begins with period */ +if (func_name[0] == '.') { + if (EG(scope)) { + func_name++; + func_name_len--; + + func_table = EG(scope)-function_table; + } else { + printf( + %sNo active class%s\n, + PHPDBG_RED_LINE(TSRMLS_C), PHPDBG_END_LINE(TSRMLS_C)); + return FAILURE; + } +} else if (!EG(function_table)) { printf( %sNo function table loaded%s\n, PHPDBG_RED_LINE(TSRMLS_C), PHPDBG_END_LINE(TSRMLS_C)); return SUCCESS; + } else { + func_table = EG(function_table); } - - if (zend_hash_find(EG(function_table), expr, expr_len, + + if (zend_hash_find(func_table, func_name, func_name_len, (void**)fbc) == SUCCESS) { phpdbg_list_function(fbc TSRMLS_CC); } else { printf( %sFunction %s not found%s\n, - PHPDBG_RED_LINE(TSRMLS_C), expr, PHPDBG_END_LINE(TSRMLS_C)); + PHPDBG_RED_LINE(TSRMLS_C), func_name, PHPDBG_END_LINE(TSRMLS_C)); } } -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: more windows: phpdbg_list.c
Commit:3168b7b0574eff976dfb63aac43822db493b721a Author:krakjoe joe.watk...@live.co.uk Tue, 12 Nov 2013 12:38:04 + Parents: 9e47ce64acb74509a1c396f2b234a1b474028ce4 Branches: PHP-5.6 Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=3168b7b0574eff976dfb63aac43822db493b721a Log: more windows Changed paths: M phpdbg_list.c Diff: diff --git a/phpdbg_list.c b/phpdbg_list.c index fe14b1d..9f2c6a2 100644 --- a/phpdbg_list.c +++ b/phpdbg_list.c @@ -20,8 +20,10 @@ #include stdio.h #include string.h #include sys/stat.h -#include sys/mman.h -#include unistd.h +#ifndef _WIN32 +# include sys/mman.h +# include unistd.h +#endif #include fcntl.h #include phpdbg.h #include phpdbg_list.h @@ -30,14 +32,19 @@ void phpdbg_list_file(const char *filename, long count, long offset TSRMLS_DC) / { unsigned char *mem, *pos, *last_pos, *end_pos; struct stat st; - int fd, all_content = (count == 0); +#ifndef _WIN32 + int fd; +#else + HANDLE fd, map; +#endif + int all_content = (count == 0); unsigned int line = 0, displayed = 0; if (VCWD_STAT(filename, st) == -1) { printf([Failed to stat file %s]\n, filename); return; } - +#ifndef _WIN32 if ((fd = VCWD_OPEN(filename, O_RDONLY)) == -1) { printf([Failed to open file %s to list]\n, filename); return; @@ -45,7 +52,29 @@ void phpdbg_list_file(const char *filename, long count, long offset TSRMLS_DC) / last_pos = mem = mmap(0, st.st_size, PROT_READ, MAP_SHARED, fd, 0); end_pos = mem + st.st_size; +#else + fd = CreateFile(filename, GENERIC_READ, 0, NULL, OPEN_EXISTING, 0, NULL); + if (fd == INVALID_HANDLE_VALUE) { + printf([Failed to open file!]\n); + return; + } + + map = CreateFileMapping(fd, NULL, PAGE_EXECUTE_READ, 0, 0, 0); + if (map == NULL) { + printf([Failed to map file!]\n); + CloseHandle(fd); + return; + } + last_pos = mem = (char*) MapViewOfFile(map, FILE_MAP_READ, 0, 0, 0); + if (mem == NULL) { + printf([Failed to map file in memory]\n); + CloseHandle(map); + CloseHandle(fd); + return; + } + end_pos = mem + st.st_size; +#endif while (1) { pos = memchr(last_pos, '\n', end_pos - last_pos); @@ -70,9 +99,14 @@ void phpdbg_list_file(const char *filename, long count, long offset TSRMLS_DC) / } } +#ifndef _WIN32 munmap(mem, st.st_size); -out: close(fd); +#else + UnmapViewOfFile(mem); + CloseHandle(map); + CloseHandle(fd); +#endif } /* }}} */ void phpdbg_list_function(const zend_function *fbc TSRMLS_DC) /* {{{ */ @@ -88,3 +122,4 @@ void phpdbg_list_function(const zend_function *fbc TSRMLS_DC) /* {{{ */ phpdbg_list_file(ops-filename, ops-line_end - ops-line_start + 1, ops-line_start TSRMLS_CC); } /* }}} */ + -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: colourfulness: phpdbg.c phpdbg.h phpdbg_bp.c phpdbg_prompt.c
Commit:4112330bb5ba4e1a18191c7586a3567638b44a54 Author:krakjoe joe.watk...@live.co.uk Tue, 12 Nov 2013 06:03:37 + Parents: 12926b6aa998c37278cf21b9634c0c23d76fc935 Branches: PHP-5.6 Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=4112330bb5ba4e1a18191c7586a3567638b44a54 Log: colourfulness Changed paths: M phpdbg.c M phpdbg.h M phpdbg_bp.c M phpdbg_prompt.c diff --git a/phpdbg.c b/phpdbg.c index 52998a6..a83e492 100644 --- a/phpdbg.c +++ b/phpdbg.c @@ -35,7 +35,7 @@ static inline void php_phpdbg_globals_ctor(zend_phpdbg_globals *pg) /* {{{ */ pg-last = NULL; pg-last_params = NULL; pg-last_params_len = 0; -pg-flags = PHPDBG_IS_QUIET; +pg-flags = PHPDBG_DEFAULT_FLAGS; } /* }}} */ static PHP_MINIT_FUNCTION(phpdbg) /* {{{ */ @@ -266,6 +266,7 @@ const opt_struct OPTIONS[] = { /* {{{ */ {'e', 1, exec}, {'v', 0, verbose}, {'s', 0, step}, +{'b', 0, boring colours}, {'-', 0, NULL} }; /* }}} */ @@ -297,7 +298,7 @@ int main(int argc, char *argv[]) /* {{{ */ int ini_entries_len = 0; char *exec = NULL; size_t exec_len = 0L; - zend_ulong flags = PHPDBG_IS_QUIET; + zend_ulong flags = PHPDBG_DEFAULT_FLAGS; char *php_optarg = NULL; int php_optind = 1; int opt; @@ -377,6 +378,10 @@ int main(int argc, char *argv[]) /* {{{ */ case 's': /* set stepping on */ flags |= PHPDBG_IS_STEPPING; break; + +case 'b': /* set colours off */ +flags = ~PHPDBG_IS_COLOURED; +break; } } @@ -402,10 +407,6 @@ int main(int argc, char *argv[]) /* {{{ */ phpdbg-ini_entries = ini_entries; -printf([Welcome to phpdbg, the interactive PHP debugger, v%s]\n, PHPDBG_VERSION); -printf(To get help using phpdbg type \help\ and press enter\n); -printf([Please report bugs to %s]\n, PHPDBG_ISSUES); - if (phpdbg-startup(phpdbg) == SUCCESS) { zend_activate(TSRMLS_C); @@ -430,6 +431,16 @@ int main(int argc, char *argv[]) /* {{{ */ zend_try { zend_activate_modules(TSRMLS_C); } zend_end_try(); + + /* print blurb */ +printf( +%sWelcome to phpdbg, the interactive PHP debugger, v%s%s\n, +PHPDBG_BOLD_LINE(TSRMLS_C), PHPDBG_VERSION, PHPDBG_END_LINE(TSRMLS_C)); +printf( +[To get help using phpdbg type \help\ and press enter\n); +printf( +%sPlease report bugs to %s%s\n, +PHPDBG_BOLD_LINE(TSRMLS_C), PHPDBG_ISSUES, PHPDBG_END_LINE(TSRMLS_C)); do { zend_try { diff --git a/phpdbg.h b/phpdbg.h index 2a01829..34b2e56 100644 --- a/phpdbg.h +++ b/phpdbg.h @@ -66,7 +66,10 @@ #define PHPDBG_IS_STEPPING 0x0001 #define PHPDBG_IS_QUIET 0x0010 -#define PHPDBG_IS_QUITTING 0x0100 /* }}} */ +#define PHPDBG_IS_QUITTING 0x0100 +#define PHPDBG_IS_COLOURED 0x1000 + +#define PHPDBG_DEFAULT_FLAGS(PHPDBG_IS_QUIET|PHPDBG_IS_COLOURED) /* }}} */ /* {{{ strings */ #define PHPDBG_ISSUES http://github.com/krakjoe/phpdbg/issues; @@ -88,4 +91,14 @@ ZEND_BEGIN_MODULE_GLOBALS(phpdbg) zend_ulong flags; /* phpdbg flags */ ZEND_END_MODULE_GLOBALS(phpdbg) +/* {{{ colourful helpers */ +#define PHPDBG_RED_LINE(TSRMLS_D) \ +((PHPDBG_G(flags) PHPDBG_IS_COLOURED) ? \033[1;31m[ : [) +#define PHPDBG_BOLD_LINE(TSRMLS_D) \ +((PHPDBG_G(flags) PHPDBG_IS_COLOURED) ? \033[1;64m[ : [) +#define PHPDBG_END_LINE(TSRMLS_D) \ + ((PHPDBG_G(flags) PHPDBG_IS_COLOURED) ? ]\033[0m : ]) +#define PHPDBG_PROMPT_LINE(TSRMLS_D) \ +((PHPDBG_G(flags) PHPDBG_IS_COLOURED) ? \033[1;64mphpdbg\033[0m : phpdbg ) /* }}} */ + #endif /* PHPDBG_H */ diff --git a/phpdbg_bp.c b/phpdbg_bp.c index fef5775..8ce2edb 100644 --- a/phpdbg_bp.c +++ b/phpdbg_bp.c @@ -68,7 +68,10 @@ void phpdbg_set_breakpoint_file(const char *path, long line_num TSRMLS_DC) /* {{ zend_llist_add_element(break_files_ptr, new_break); printf( - [Breakpoint #%d added at %s:%ld]\n, new_break.id, new_break.filename, new_break.line); + %sBreakpoint #%d added at %s:%ld%s\n, + PHPDBG_BOLD_LINE(TSRMLS_C), + new_break.id, new_break.filename, new_break.line, + PHPDBG_END_LINE(TSRMLS_C)); } /* }}} */ void phpdbg_set_breakpoint_symbol(const char *name TSRMLS_DC) /* {{{ */ @@ -86,9 +89,15 @@ void phpdbg_set_breakpoint_symbol(const char *name TSRMLS_DC) /* {{{ */ zend_hash_update(PHPDBG_G(bp)[PHPDBG_BREAK_SYM], new_break.symbol, name_len, new_break, sizeof(phpdbg_breaksymbol_t), NULL); - printf([Breakpoint #%d added at %s]\n, new_break.id, new_break.symbol); + printf( +
[PHP-CVS] com php-src: blurb/version/issues string: phpdbg.c phpdbg.h phpdbg_prompt.c
Commit:d7e09f95646f74f47e2ff15f1ef9b78da2592dec Author:krakjoe joe.watk...@live.co.uk Tue, 12 Nov 2013 02:04:54 + Parents: fa3056c8332f6bc423b85cbf7312fb40a9f6023f Branches: PHP-5.6 Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=d7e09f95646f74f47e2ff15f1ef9b78da2592dec Log: blurb/version/issues string Changed paths: M phpdbg.c M phpdbg.h M phpdbg_prompt.c Diff: diff --git a/phpdbg.c b/phpdbg.c index 3cc4ba8..ca38078 100644 --- a/phpdbg.c +++ b/phpdbg.c @@ -379,6 +379,10 @@ int main(int argc, char *argv[]) /* {{{ */ ini_entries_len += sizeof(phpdbg_ini_hardcoded) - 2; phpdbg-ini_entries = ini_entries; + +printf([Welcome to phpdbg, the interactive PHP debugger, v%s]\n, PHPDBG_VERSION); +printf(To get help using phpdbg type \help\ and press enter\n); +printf([Please report bugs to %s]\n, PHPDBG_ISSUES); if (phpdbg-startup(phpdbg) == SUCCESS) { zend_activate(TSRMLS_C); diff --git a/phpdbg.h b/phpdbg.h index 908c1cc..446b067 100644 --- a/phpdbg.h +++ b/phpdbg.h @@ -63,6 +63,10 @@ #define PHPDBG_IS_QUIET 0x0010 #define PHPDBG_IS_QUITTING 0x0100 /* }}} */ +/* {{{ strings */ +#define PHPDBG_ISSUES http://github.com/krakjoe/phpdbg/issues; +#define PHPDBG_VERSION 0.0.0 /* }}} */ + typedef struct _phpdbg_command_t phpdbg_command_t; ZEND_BEGIN_MODULE_GLOBALS(phpdbg) diff --git a/phpdbg_prompt.c b/phpdbg_prompt.c index df0f21b..fb6ba7c 100644 --- a/phpdbg_prompt.c +++ b/phpdbg_prompt.c @@ -453,7 +453,7 @@ static PHPDBG_COMMAND(clear) /* {{{ */ static PHPDBG_COMMAND(help) /* {{{ */ { - printf([Welcome to phpdbg, the interactive PHP debugger.]\n); + printf([Welcome to phpdbg, the interactive PHP debugger, v%s]\n, PHPDBG_VERSION); if (!expr_len) { const phpdbg_command_t *prompt_command = phpdbg_prompt_commands; @@ -477,7 +477,7 @@ static PHPDBG_COMMAND(help) /* {{{ */ printf(failed to find help command: %s\n, expr); } } - printf([Please report bugs to https://github.com/krakjoe/phpdbg/issues]\n); + printf([Please report bugs to %s]\n, PHPDBG_ISSUES); return SUCCESS; } /* }}} */ -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: ...: README.md
Commit:a29c0e5c96be3d7414e8e541e1d3e7376f12cdb9 Author:krakjoe joe.watk...@live.co.uk Tue, 12 Nov 2013 06:31:29 + Parents: f4523640609690faf2495022be15af50c06efdd3 Branches: PHP-5.6 Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=a29c0e5c96be3d7414e8e541e1d3e7376f12cdb9 Log: ... Changed paths: M README.md Diff: diff --git a/README.md b/README.md index f9ae877..f6b6704 100644 --- a/README.md +++ b/README.md @@ -22,7 +22,7 @@ Features Planned === - - Mocking API for Server/Request Environments + - Pass JIT Super Globals to Userland (Mocking, Testing etc) - Improve Everything :) Installation -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: ...: README.md
Commit:fd0aeb5b536bf2af11107b2b895387955175729a Author:krakjoe joe.watk...@live.co.uk Tue, 12 Nov 2013 06:05:24 + Parents: 78418cc38c822cc915f23d6d3ffcd185daf29418 Branches: PHP-5.6 Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=fd0aeb5b536bf2af11107b2b895387955175729a Log: ... Changed paths: M README.md Diff: diff --git a/README.md b/README.md index be28150..bd06569 100644 --- a/README.md +++ b/README.md @@ -57,6 +57,7 @@ The following switches changes the default behaviour of phpdbg: - -v disables quietness - -s enabled stepping - -e sets execution context + - -b boring - disables use of colour on the console Screeny === -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: ...: phpdbg_prompt.c
Commit:277b10a5c059437754452b6de7e42aa6bde64e13 Author:krakjoe joe.watk...@live.co.uk Tue, 12 Nov 2013 13:21:55 + Parents: fe7a3ef5781cf92c7dc190c649a90452400782f1 Branches: PHP-5.6 Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=277b10a5c059437754452b6de7e42aa6bde64e13 Log: ... Changed paths: M phpdbg_prompt.c Diff: diff --git a/phpdbg_prompt.c b/phpdbg_prompt.c index 3040b80..6bfc16a 100644 --- a/phpdbg_prompt.c +++ b/phpdbg_prompt.c @@ -615,7 +615,11 @@ static const phpdbg_command_t phpdbg_prompt_commands[] = { int phpdbg_do_cmd(const phpdbg_command_t *command, char *cmd_line, size_t cmd_len TSRMLS_DC) /* {{{ */ { char *params = NULL; +#ifndef _WIN32 const char *cmd = strtok_r(cmd_line, , params); +#else + const char *cmd = strtok_s(cmd_line, , params); +#endif size_t expr_len = cmd != NULL ? strlen(cmd) : 0; while (command command-name) { -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: more help: phpdbg_help.c phpdbg_help.h
Commit:3097c36f3042fe3f49d80eed810197036f94ab66 Author:krakjoe joe.watk...@live.co.uk Tue, 12 Nov 2013 03:02:42 + Parents: ed690e1899fa1d9234961a9b1e077c5d6912dc74 Branches: PHP-5.6 Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=3097c36f3042fe3f49d80eed810197036f94ab66 Log: more help Changed paths: M phpdbg_help.c M phpdbg_help.h Diff: diff --git a/phpdbg_help.c b/phpdbg_help.c index eb59826..d942ebe 100644 --- a/phpdbg_help.c +++ b/phpdbg_help.c @@ -142,5 +142,6 @@ PHPDBG_HELP(list) /* {{{ */ printf(Will print next 2 lines from the current file\n); printf(\tphpdbg list func\n); printf(Will print func source code\n); + printf(Note: before listing functions you must have a populated function table, try compile !!\n); return SUCCESS; } /* }}} */ diff --git a/phpdbg_help.h b/phpdbg_help.h index ba79747..9c89f3d 100644 --- a/phpdbg_help.h +++ b/phpdbg_help.h @@ -64,7 +64,7 @@ static const phpdbg_command_t phpdbg_help_commands[] = { PHPDBG_HELP_D(clear,clearing breakpoints allows you to run code without interruption), PHPDBG_HELP_D(back, show debug backtrace information during execution), PHPDBG_HELP_D(quiet,be quiet during execution), - PHPDBG_HELP_D(list, list specified line or function), + PHPDBG_HELP_D(list, listing code gives you quick access to code while executing), {NULL, 0, 0} }; -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: readline: README.md
Commit:bf8a9c141fcad21738156349a9c2b2900ee2908a Author:krakjoe joe.watk...@live.co.uk Tue, 12 Nov 2013 04:22:33 + Parents: 33f0502f1978fc89fede8b5dd7a8ced79f95d115 Branches: PHP-5.6 Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=bf8a9c141fcad21738156349a9c2b2900ee2908a Log: readline Changed paths: M README.md Diff: diff --git a/README.md b/README.md index ba13c0d..1b03abe 100644 --- a/README.md +++ b/README.md @@ -16,6 +16,7 @@ Features - SAPI Agnostic - Easily Integrated - PHP Configuration File Support - JIT Super Globals - Set Your Own !! + - Optional readline Support - Comfortable Terminal Operation - Easy Operation - See Help :) Planned @@ -39,6 +40,8 @@ make -j8 make install-phpdbg ``` +*Note: php must be configured with the switch --with-readline for phpdbg to support history, autocompletion, tab-listing etc* + Command Line Options -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: always unset unclean_shutdown: phpdbg.c
Commit:f822764129e148bcca00a354b9ad68eea598b834 Author:krakjoe joe.watk...@live.co.uk Fri, 29 Nov 2013 02:42:34 + Parents: 734fe5508a96868a3e6c03c323f5fb436dc91aa0 Branches: PHP-5.6 Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=f822764129e148bcca00a354b9ad68eea598b834 Log: always unset unclean_shutdown Changed paths: M phpdbg.c Diff: diff --git a/phpdbg.c b/phpdbg.c index 6ae0347..f04d694 100644 --- a/phpdbg.c +++ b/phpdbg.c @@ -1046,9 +1046,10 @@ phpdbg_interact: /* set streams */ if (streams[0] streams[1]) { PHPDBG_G(flags) = ~PHPDBG_IS_QUITTING; - - CG(unclean_shutdown) = 0; } + + /* this must be forced */ + CG(unclean_shutdown) = 0; } #endif if (PHPDBG_G(flags) PHPDBG_IS_QUITTING) { @@ -1057,6 +1058,9 @@ phpdbg_interact: } zend_end_try(); } while(!(PHPDBG_G(flags) PHPDBG_IS_QUITTING)); + /* this must be forced */ + CG(unclean_shutdown) = 0; + phpdbg_out: #ifndef _WIN32 if (PHPDBG_G(flags) PHPDBG_IS_DISCONNECTED) { -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: Merge branch 'master' of https://github.com/krakjoe/phpdbg: phpdbg_list.c phpdbg_list.h phpdbg_prompt.c
Commit:8c91727484c6ed6af80fbe13f9076958450fe19b Author:krakjoe joe.watk...@live.co.uk Tue, 12 Nov 2013 02:35:07 + Parents: c7b51537a03734a3e0a8fbb9100840cd64a66d37 6aad2ee42c355934190a46f55b7f6633f9bea407 Branches: PHP-5.6 Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=8c91727484c6ed6af80fbe13f9076958450fe19b Log: Merge branch 'master' of https://github.com/krakjoe/phpdbg Changed paths: MM phpdbg_list.c MM phpdbg_list.h MM phpdbg_prompt.c Diff: diff --cc phpdbg_list.c index f4209e1,d5e07d4..3bfa214 --- a/phpdbg_list.c +++ b/phpdbg_list.c @@@ -74,3 -73,17 +74,17 @@@ void phpdbg_list_file(const char *filen out: close(fd); } /* }}} */ + -void phpdbg_list_function(const zend_function *fbc) /* {{{ */ ++void phpdbg_list_function(const zend_function *fbc TSRMLS_DC) /* {{{ */ + { + const zend_op_array *ops; + + if (fbc-type != ZEND_USER_FUNCTION) { + return; + } + + ops = (zend_op_array*)fbc; + + phpdbg_list_file(ops-filename, - ops-line_end - ops-line_start + 1, ops-line_start); ++ ops-line_end - ops-line_start + 1, ops-line_start TSRMLS_CC); + } /* }}} */ diff --cc phpdbg_list.h index 883f991,95cc06e..2a25875 --- a/phpdbg_list.h +++ b/phpdbg_list.h @@@ -20,6 -20,9 +20,7 @@@ #ifndef PHPDBG_LIST_H #define PHPDBG_LIST_H -#include zend_compile.h - -void phpdbg_list_file(const char*, long, long); -void phpdbg_list_function(const zend_function*); ++void phpdbg_list_function(const zend_function* TSRMLS_DC); +void phpdbg_list_file(const char*, long, long TSRMLS_DC); #endif /* PHPDBG_LIST_H */ diff --cc phpdbg_prompt.c index c30d155,f7ec941..11cc914 --- a/phpdbg_prompt.c +++ b/phpdbg_prompt.c @@@ -497,18 -498,32 +498,32 @@@ static PHPDBG_COMMAND(quiet) { /* {{{ * static PHPDBG_COMMAND(list) /* {{{ */ { - long offset = 0, count = strtol(expr, NULL, 0); - const char *filename = PHPDBG_G(exec); - - if (zend_is_executing(TSRMLS_C)) { - filename = zend_get_executed_filename(TSRMLS_C); - offset = zend_get_executed_lineno(TSRMLS_C); - } else if (!filename) { - printf([No file to list]\n); - return SUCCESS; - } + if (phpdbg_is_numeric(expr)) { + long offset = 0, count = strtol(expr, NULL, 0); + const char *filename = PHPDBG_G(exec); + + if (zend_is_executing(TSRMLS_C)) { + filename = zend_get_executed_filename(TSRMLS_C); + offset = zend_get_executed_lineno(TSRMLS_C); + } else if (!filename) { + printf([No file to list]\n); + return SUCCESS; + } - phpdbg_list_file(filename, count, offset TSRMLS_CC); - phpdbg_list_file(filename, count, offset); ++ phpdbg_list_file(filename, count, offset TSRMLS_CC); + } else { + zend_function* fbc; + + if (!EG(function_table)) { + printf([No function table loaded]\n); + return SUCCESS; + } + + if (zend_hash_find(EG(function_table), expr, strlen(expr)+1, + (void**)fbc) == SUCCESS) { - phpdbg_list_function(fbc); ++ phpdbg_list_function(fbc TSRMLS_CC); + } + } return SUCCESS; } /* }}} */ -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: Several fixes and cleanups on opline num support: phpdbg.c phpdbg.h phpdbg_bp.c phpdbg_bp.h
Commit:25f2d4eca166260bf5e47cbb274669c5d43a4e3c Author:Bob Weinand bobw...@hotmail.com Sun, 1 Dec 2013 15:58:59 +0100 Parents: 2e7c695c05a9de133bc9c0660ede968ce2e2dc5e Branches: PHP-5.6 Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=25f2d4eca166260bf5e47cbb274669c5d43a4e3c Log: Several fixes and cleanups on opline num support Changed paths: M phpdbg.c M phpdbg.h M phpdbg_bp.c M phpdbg_bp.h diff --git a/phpdbg.c b/phpdbg.c index 322d544..52efd43 100644 --- a/phpdbg.c +++ b/phpdbg.c @@ -135,6 +135,7 @@ static PHP_RINIT_FUNCTION(phpdbg) /* {{{ */ zend_hash_init(PHPDBG_G(bp)[PHPDBG_BREAK_SYM], 8, NULL, php_phpdbg_destroy_bp_symbol, 0); zend_hash_init(PHPDBG_G(bp)[PHPDBG_BREAK_FUNCTION_OPLINE], 8, NULL, php_phpdbg_destroy_bp_methods, 0); zend_hash_init(PHPDBG_G(bp)[PHPDBG_BREAK_METHOD_OPLINE], 8, NULL, php_phpdbg_destroy_bp_methods, 0); + zend_hash_init(PHPDBG_G(bp)[PHPDBG_BREAK_FILE_OPLINE], 8, NULL, php_phpdbg_destroy_bp_methods, 0); zend_hash_init(PHPDBG_G(bp)[PHPDBG_BREAK_OPLINE], 8, NULL, NULL, 0); zend_hash_init(PHPDBG_G(bp)[PHPDBG_BREAK_OPCODE], 8, NULL, php_phpdbg_destroy_bp_opcode, 0); zend_hash_init(PHPDBG_G(bp)[PHPDBG_BREAK_METHOD], 8, NULL, php_phpdbg_destroy_bp_methods, 0); @@ -150,6 +151,9 @@ static PHP_RSHUTDOWN_FUNCTION(phpdbg) /* {{{ */ { zend_hash_destroy(PHPDBG_G(bp)[PHPDBG_BREAK_FILE]); zend_hash_destroy(PHPDBG_G(bp)[PHPDBG_BREAK_SYM]); + zend_hash_destroy(PHPDBG_G(bp)[PHPDBG_BREAK_FUNCTION_OPLINE]); + zend_hash_destroy(PHPDBG_G(bp)[PHPDBG_BREAK_METHOD_OPLINE]); + zend_hash_destroy(PHPDBG_G(bp)[PHPDBG_BREAK_FILE_OPLINE]); zend_hash_destroy(PHPDBG_G(bp)[PHPDBG_BREAK_OPLINE]); zend_hash_destroy(PHPDBG_G(bp)[PHPDBG_BREAK_OPCODE]); zend_hash_destroy(PHPDBG_G(bp)[PHPDBG_BREAK_METHOD]); @@ -241,6 +245,9 @@ static PHP_FUNCTION(phpdbg_clear) { zend_hash_clean(PHPDBG_G(bp)[PHPDBG_BREAK_FILE]); zend_hash_clean(PHPDBG_G(bp)[PHPDBG_BREAK_SYM]); + zend_hash_clean(PHPDBG_G(bp)[PHPDBG_BREAK_FUNCTION_OPLINE]); + zend_hash_clean(PHPDBG_G(bp)[PHPDBG_BREAK_METHOD_OPLINE]); + zend_hash_clean(PHPDBG_G(bp)[PHPDBG_BREAK_FILE_OPLINE]); zend_hash_clean(PHPDBG_G(bp)[PHPDBG_BREAK_OPLINE]); zend_hash_clean(PHPDBG_G(bp)[PHPDBG_BREAK_METHOD]); zend_hash_clean(PHPDBG_G(bp)[PHPDBG_BREAK_COND]); diff --git a/phpdbg.h b/phpdbg.h index 628f38a..cd71cfd 100644 --- a/phpdbg.h +++ b/phpdbg.h @@ -88,37 +88,41 @@ #define PHPDBG_BREAK_OPCODE 5 #define PHPDBG_BREAK_FUNCTION_OPLINE 6 #define PHPDBG_BREAK_METHOD_OPLINE 7 -#define PHPDBG_BREAK_TABLES 8/* }}} */ +#define PHPDBG_BREAK_FILE_OPLINE 8 +#define PHPDBG_BREAK_TABLES 9 /* }}} */ /* {{{ flags */ -#define PHPDBG_HAS_FILE_BP (11) -#define PHPDBG_HAS_SYM_BP (12) -#define PHPDBG_HAS_OPLINE_BP(13) -#define PHPDBG_HAS_METHOD_BP(14) -#define PHPDBG_HAS_COND_BP (15) -#define PHPDBG_HAS_OPCODE_BP(16) -#define PHPDBG_BP_MASK (PHPDBG_HAS_FILE_BP|PHPDBG_HAS_SYM_BP|PHPDBG_HAS_METHOD_BP|PHPDBG_HAS_OPLINE_BP|PHPDBG_HAS_COND_BP|PHPDBG_HAS_OPCODE_BP) - -#define PHPDBG_IN_COND_BP (17) -#define PHPDBG_IN_EVAL (18) - -#define PHPDBG_IS_STEPPING (19) -#define PHPDBG_IS_QUIET (110) -#define PHPDBG_IS_QUITTING (111) -#define PHPDBG_IS_COLOURED (112) -#define PHPDBG_IS_CLEANING (113) - -#define PHPDBG_IN_UNTIL (114) -#define PHPDBG_IN_FINISH(115) -#define PHPDBG_IN_LEAVE (116) -#define PHPDBG_SEEK_MASK (PHPDBG_IN_UNTIL|PHPDBG_IN_FINISH|PHPDBG_IN_LEAVE) - -#define PHPDBG_IS_REGISTERED(117) -#define PHPDBG_IS_STEPONEVAL(118) -#define PHPDBG_IS_INITIALIZING (119) -#define PHPDBG_IS_SIGNALED (120) -#define PHPDBG_IS_INTERACTIVE (121) -#define PHPDBG_IS_BP_ENABLED(122) +#define PHPDBG_HAS_FILE_BP(11) +#define PHPDBG_HAS_SYM_BP (12) +#define PHPDBG_HAS_OPLINE_BP (13) +#define PHPDBG_HAS_METHOD_BP (14) +#define PHPDBG_HAS_COND_BP(15) +#define PHPDBG_HAS_OPCODE_BP (16) +#define PHPDBG_HAS_FUNCTION_OPLINE_BP (17) +#define PHPDBG_HAS_METHOD_OPLINE_BP (18) +#define PHPDBG_HAS_FILE_OPLINE_BP (19) +#define PHPDBG_BP_MASK (PHPDBG_HAS_FILE_BP|PHPDBG_HAS_SYM_BP|PHPDBG_HAS_METHOD_BP|PHPDBG_HAS_OPLINE_BP|PHPDBG_HAS_COND_BP|PHPDBG_HAS_OPCODE_BP|PHPDBG_HAS_FUNCTION_OPLINE_BP|PHPDBG_HAS_METHOD_OPLINE_BP|PHPDBG_HAS_FILE_OPLINE_BP) + +#define PHPDBG_IN_COND_BP (18) +#define PHPDBG_IN_EVAL(19) + +#define PHPDBG_IS_STEPPING(110) +#define PHPDBG_IS_QUIET (111) +#define PHPDBG_IS_QUITTING(112) +#define PHPDBG_IS_COLOURED(113) +#define PHPDBG_IS_CLEANING(114) + +#define PHPDBG_IN_UNTIL (115) +#define PHPDBG_IN_FINISH (116) +#define
[PHP-CVS] com php-src: ...: phpdbg.init.d
Commit:01ed1f436c4d306c316fc43e3f6b67d28b948027 Author:krakjoe joe.watk...@live.co.uk Sun, 1 Dec 2013 13:12:51 + Parents: 800ec7836b3a095869368fb60c81fbd7cf158337 Branches: PHP-5.6 Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=01ed1f436c4d306c316fc43e3f6b67d28b948027 Log: ... Changed paths: M phpdbg.init.d Diff: diff --git a/phpdbg.init.d b/phpdbg.init.d index 4b69260..1175044 100755 --- a/phpdbg.init.d +++ b/phpdbg.init.d @@ -10,10 +10,10 @@ PIDFILE=/var/run/phpdbg.pid STDIN=4000 STDOUT=8000 -# Either set path to phpdbg here or rely on phpdbg in PATH# +# Either set path to phpdbg here or rely on phpdbg in ENV/PATH # -if [ x$PHPDBG == x ]; then - PHPDBG=$(which phpdbg) +if [ x${PHPDBG} == x ]; then + PHPDBG=$(which phpdbg 2/dev/null) fi # Options to pass to phpdbg upon boot # @@ -26,9 +26,36 @@ LOGFILE=/var/log/phpdbg.log . /etc/rc.d/init.d/functions RETVAL=1 +insanity() +{ + if [ x${PHPDBG} == x ]; then + PHPDBG=$(which phpdbg 2/dev/null) + if [ $? != 0 ]; then + echo -n $Fatal: cannot find phpdbg ${PHPDBG} + echo_failure + echo + return 1 + fi + else + if [ ! -x ${PHPDBG} ]; then + echo -n $Fatal: cannot execute phpdbg ${PHPDBG} + echo_failure + echo + return 1 + fi + fi + + return 0 +} start() { + insanity + + if [ $? -eq 1 ]; then + return $RETVAL + fi + echo -n $Starting: phpdbg ${OPTIONS} on ${STDIN}/${STDOUT} nohup ${PHPDBG} -l${STDIN}/${STDOUT} ${OPTIONS} 2${LOGFILE} 1/dev/null /dev/null PID=$! @@ -43,8 +70,15 @@ start() [ $RETVAL = 0 ] touch ${LOCKFILE} return $RETVAL } + stop() { + insanity + + if [ $? -eq 1 ]; then + return $RETVAL + fi + if [ -f ${LOCKFILE} ] [ -f ${PIDFILE} ] then echo -n $Stopping: phpdbg ${OPTIONS} on ${STDIN}/${STDOUT} -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: ...: phpdbg_prompt.c
Commit:b9c1c872f6fcf99b0ba8e3f26a21814e475bd788 Author:krakjoe joe.watk...@live.co.uk Tue, 12 Nov 2013 02:50:24 + Parents: 79ab9a3f74e9ecb3d9acfc4a0050b491bda56185 Branches: PHP-5.6 Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=b9c1c872f6fcf99b0ba8e3f26a21814e475bd788 Log: ... Changed paths: M phpdbg_prompt.c Diff: diff --git a/phpdbg_prompt.c b/phpdbg_prompt.c index 5fd0712..7d8ed35 100644 --- a/phpdbg_prompt.c +++ b/phpdbg_prompt.c @@ -513,13 +513,13 @@ static PHPDBG_COMMAND(list) /* {{{ */ phpdbg_list_file(filename, count, offset TSRMLS_CC); } else { zend_function* fbc; - + if (!EG(function_table)) { printf([No function table loaded]\n); return SUCCESS; } - if (zend_hash_find(EG(function_table), expr, strlen(expr)+1, + if (zend_hash_find(EG(function_table), expr, expr_len, (void**)fbc) == SUCCESS) { phpdbg_list_function(fbc TSRMLS_CC); } -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: ...: phpdbg.png phpdbg_prompt.c
Commit:78418cc38c822cc915f23d6d3ffcd185daf29418 Author:krakjoe joe.watk...@live.co.uk Tue, 12 Nov 2013 06:04:32 + Parents: 4112330bb5ba4e1a18191c7586a3567638b44a54 Branches: PHP-5.6 Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=78418cc38c822cc915f23d6d3ffcd185daf29418 Log: ... Changed paths: M phpdbg.png M phpdbg_prompt.c Diff: diff --git a/phpdbg.png b/phpdbg.png index 403652b..829bbba 100644 Binary files a/phpdbg.png and b/phpdbg.png differ diff --git a/phpdbg_prompt.c b/phpdbg_prompt.c index 40db309..72d9023 100644 --- a/phpdbg_prompt.c +++ b/phpdbg_prompt.c @@ -491,7 +491,7 @@ static PHPDBG_COMMAND(help) /* {{{ */ printf(To get help regarding a specific command type \help command\\n); printf( - %sCommands:%s\n, + %sCommands%s\n, PHPDBG_BOLD_LINE(TSRMLS_C), PHPDBG_END_LINE(TSRMLS_C)); while (prompt_command prompt_command-name) { -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: printer commands: config.m4 phpdbg_print.c phpdbg_print.h phpdbg_prompt.c
Commit:c00abb0e75628d2284f76098e43626266a440d3e Author:krakjoe joe.watk...@live.co.uk Tue, 12 Nov 2013 08:26:11 + Parents: ff4c0c9397d7435ab8462fedd3e89fe2c9e3c4d4 Branches: PHP-5.6 Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=c00abb0e75628d2284f76098e43626266a440d3e Log: printer commands Changed paths: M config.m4 A phpdbg_print.c A phpdbg_print.h M phpdbg_prompt.c Diff: diff --git a/config.m4 b/config.m4 index df12708..92f626e 100644 --- a/config.m4 +++ b/config.m4 @@ -9,7 +9,7 @@ if test $PHP_PHPDBG != no; then AC_DEFINE(HAVE_PHPDBG, 1, [ ]) PHP_PHPDBG_CFLAGS=-I$abc_srcdir - PHP_PHPDBG_FILES=phpdbg.c phpdbg_prompt.c phpdbg_help.c phpdbg_bp.c phpdbg_opcode.c phpdbg_list.c phpdbg_utils.c + PHP_PHPDBG_FILES=phpdbg.c phpdbg_prompt.c phpdbg_help.c phpdbg_print.c phpdbg_bp.c phpdbg_opcode.c phpdbg_list.c phpdbg_utils.c PHP_SUBST(PHP_PHPDBG_CFLAGS) PHP_SUBST(PHP_PHPDBG_FILES) diff --git a/phpdbg_print.c b/phpdbg_print.c new file mode 100644 index 000..c167482 --- /dev/null +++ b/phpdbg_print.c @@ -0,0 +1,29 @@ +/* + +--+ + | PHP Version 5| + +--+ + | Copyright (c) 1997-2013 The PHP Group| + +--+ + | This source file is subject to version 3.01 of the PHP license, | + | that is bundled with this package in the file LICENSE, and is| + | available through the world-wide-web at the following url: | + | http://www.php.net/license/3_01.txt | + | If you did not receive a copy of the PHP license and are unable to | + | obtain it through the world-wide-web, please send a note to | + | lice...@php.net so we can mail you a copy immediately. | + +--+ + | Authors: Felipe Pena fel...@php.net| + | Authors: Joe Watkins joe.watk...@live.co.uk| + +--+ +*/ + +#include stdio.h +#include zend.h +#include phpdbg.h +#include phpdbg_print.h + +PHPDBG_PRINT(default) /* {{{ */ +{ + printf(in default printer\n); + return SUCCESS; +} /* }}} */ diff --git a/phpdbg_print.h b/phpdbg_print.h new file mode 100644 index 000..825316a --- /dev/null +++ b/phpdbg_print.h @@ -0,0 +1,47 @@ +/* + +--+ + | PHP Version 5| + +--+ + | Copyright (c) 1997-2013 The PHP Group| + +--+ + | This source file is subject to version 3.01 of the PHP license, | + | that is bundled with this package in the file LICENSE, and is| + | available through the world-wide-web at the following url: | + | http://www.php.net/license/3_01.txt | + | If you did not receive a copy of the PHP license and are unable to | + | obtain it through the world-wide-web, please send a note to | + | lice...@php.net so we can mail you a copy immediately. | + +--+ + | Authors: Felipe Pena fel...@php.net| + | Authors: Joe Watkins joe.watk...@live.co.uk| + +--+ +*/ + +#ifndef PHPDBG_PRINT_H +#define PHPDBG_PRINT_H + +#include TSRM.h +#include phpdbg_prompt.h + +/** + * Command Declarators + */ +#define PHPDBG_PRINT_D(name, tip) \ + {PHPDBG_STRL(#name), tip, sizeof(tip)-1, phpdbg_do_print_##name} +#define PHPDBG_PRINT(name) \ + int phpdbg_do_print_##name(const char *expr, size_t expr_len TSRMLS_DC) + +/** + * Printer Forward Declarations + */ +PHPDBG_PRINT(default); + +/** + * Commands + */ +static const phpdbg_command_t phpdbg_print_commands[] = { + PHPDBG_PRINT_D(default, the default print command), + {NULL, 0, 0} +}; + +#endif /* PHPDBG_PRINT_H */ diff --git a/phpdbg_prompt.c b/phpdbg_prompt.c index d42e638..dd225d6 100644 --- a/phpdbg_prompt.c +++ b/phpdbg_prompt.c @@ -23,6 +23,7 @@ #include zend_compile.h #include phpdbg.h #include phpdbg_help.h +#include phpdbg_print.h #include phpdbg_bp.h #include phpdbg_opcode.h #include phpdbg_list.h @@ -228,16 +229,22 @@ static PHPDBG_COMMAND(back) /* {{{ */ static PHPDBG_COMMAND(print) /* {{{ */ { - if (expr_len) { - printf(%s\n,
[PHP-CVS] com php-src: ...: web-bootstrap.php
Commit:6c5831aa09a85b069dfc0c9360547f960fb701e2 Author:krakjoe joe.watk...@live.co.uk Tue, 12 Nov 2013 07:08:00 + Parents: 25475ff95e1f1f30df22bc0d920692f92c199a2f Branches: PHP-5.6 Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=6c5831aa09a85b069dfc0c9360547f960fb701e2 Log: ... Changed paths: M web-bootstrap.php Diff: diff --git a/web-bootstrap.php b/web-bootstrap.php index fdb40f9..e6bea6b 100644 --- a/web-bootstrap.php +++ b/web-bootstrap.php @@ -31,14 +31,14 @@ $_SERVER = array 'SERVER_NAME' = 'localhost', 'SERVER_ADDR' = '127.0.0.1', 'SERVER_PORT' = '80', - 'REMOTE_ADDR' = '128.0.0.1', - 'DOCUMENT_ROOT' = dirname(__FILE__), + 'REMOTE_ADDR' = '127.0.0.1', + 'DOCUMENT_ROOT' = PHPDBG_BOOTPATH, 'REQUEST_SCHEME' = 'http', 'CONTEXT_PREFIX' = '', - 'CONTEXT_DOCUMENT_ROOT' = dirname(__FILE__), + 'CONTEXT_DOCUMENT_ROOT' = PHPDBG_BOOTPATH, 'SERVER_ADMIN' = '[no address given]', 'SCRIPT_FILENAME' = sprintf( -'%s/%s', dirname(__FILE__), PHPDBG_BOOTSTRAP +'%s/%s', PHPDBG_BOOTPATH, PHPDBG_BOOTSTRAP ), 'REMOTE_PORT' = '47931', 'GATEWAY_INTERFACE' = 'CGI/1.1', -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: update version: phpdbg.h
Commit:723b721fb9a703c4a67cf9afa322745ff797feb3 Author:krakjoe joe.watk...@live.co.uk Sun, 1 Dec 2013 10:23:37 + Parents: 083cce91624f676cf9d16537cc2050b6cfffb372 Branches: PHP-5.6 Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=723b721fb9a703c4a67cf9afa322745ff797feb3 Log: update version Changed paths: M phpdbg.h Diff: diff --git a/phpdbg.h b/phpdbg.h index 0ab9e60..0102892 100644 --- a/phpdbg.h +++ b/phpdbg.h @@ -137,7 +137,7 @@ /* {{{ strings */ #define PHPDBG_ISSUES http://github.com/krakjoe/phpdbg/issues; -#define PHPDBG_VERSION 0.2.0 +#define PHPDBG_VERSION 0.3.0-dev #define PHPDBG_INIT_FILENAME .phpdbginit /* }}} */ -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: - Removed name member to opline breakpoints: phpdbg.c phpdbg_bp.c phpdbg_bp.h phpdbg_prompt.c test.php
Commit:fdf26eaa0f7daaecfb05699e6012d140d1cdbaa8 Author:Felipe Pena felipe...@gmail.com Tue, 12 Nov 2013 11:07:35 -0200 Parents: fe7a3ef5781cf92c7dc190c649a90452400782f1 Branches: PHP-5.6 Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=fdf26eaa0f7daaecfb05699e6012d140d1cdbaa8 Log: - Removed name member to opline breakpoints Changed paths: M phpdbg.c M phpdbg_bp.c M phpdbg_bp.h M phpdbg_prompt.c M test.php diff --git a/phpdbg.c b/phpdbg.c index a83e492..bd756ee 100644 --- a/phpdbg.c +++ b/phpdbg.c @@ -58,11 +58,6 @@ static void php_phpdbg_destroy_bp_symbol(void *brake) /* {{{ */ efree((char*)((phpdbg_breaksymbol_t*)brake)-symbol); } /* }}} */ -static void php_phpdbg_destroy_bp_opline(void *brake) /* {{{ */ -{ - free((char*)((phpdbg_breakline_t*)brake)-name); -} /* }}} */ - static void php_phpdbg_destroy_bp_methods(void *brake) /* {{{ */ { zend_hash_destroy((HashTable*)brake); @@ -72,9 +67,9 @@ static PHP_RINIT_FUNCTION(phpdbg) /* {{{ */ { zend_hash_init(PHPDBG_G(bp)[PHPDBG_BREAK_FILE], 8, NULL, php_phpdbg_destroy_bp_file, 0); zend_hash_init(PHPDBG_G(bp)[PHPDBG_BREAK_SYM], 8, NULL, php_phpdbg_destroy_bp_symbol, 0); -zend_hash_init(PHPDBG_G(bp)[PHPDBG_BREAK_OPLINE], 8, NULL, php_phpdbg_destroy_bp_opline, 0); +zend_hash_init(PHPDBG_G(bp)[PHPDBG_BREAK_OPLINE], 8, NULL, NULL, 0); zend_hash_init(PHPDBG_G(bp)[PHPDBG_BREAK_METHOD], 8, NULL, php_phpdbg_destroy_bp_methods, 0); - + return SUCCESS; } /* }}} */ @@ -84,7 +79,7 @@ static PHP_RSHUTDOWN_FUNCTION(phpdbg) /* {{{ */ zend_hash_destroy(PHPDBG_G(bp)[PHPDBG_BREAK_SYM]); zend_hash_destroy(PHPDBG_G(bp)[PHPDBG_BREAK_OPLINE]); zend_hash_destroy(PHPDBG_G(bp)[PHPDBG_BREAK_METHOD]); - + if (PHPDBG_G(exec)) { efree(PHPDBG_G(exec)); } @@ -97,12 +92,12 @@ static PHP_RSHUTDOWN_FUNCTION(phpdbg) /* {{{ */ } /* }}} */ /* {{{ proto void phpdbg_break(void) -instructs phpdbg to insert a breakpoint at the next opcode */ +instructs phpdbg to insert a breakpoint at the next opcode */ static PHP_FUNCTION(phpdbg_break) { if (EG(current_execute_data) EG(active_op_array)) { zend_ulong opline_num = (EG(current_execute_data)-opline - EG(active_op_array)-opcodes); - + phpdbg_set_breakpoint_opline_ex( EG(active_op_array)-opcodes[opline_num+1] TSRMLS_CC); } @@ -206,7 +201,7 @@ static void php_sapi_phpdbg_register_vars(zval *track_vars_array TSRMLS_DC) /* { if (sapi_module.input_filter(PARSE_SERVER, SCRIPT_NAME, PHPDBG_G(exec), PHPDBG_G(exec_len), len TSRMLS_CC)) { php_register_variable(SCRIPT_NAME, PHPDBG_G(exec), track_vars_array TSRMLS_CC); } - + if (sapi_module.input_filter(PARSE_SERVER, SCRIPT_FILENAME, PHPDBG_G(exec), PHPDBG_G(exec_len), len TSRMLS_CC)) { php_register_variable(SCRIPT_FILENAME, PHPDBG_G(exec), track_vars_array TSRMLS_CC); } @@ -214,7 +209,7 @@ static void php_sapi_phpdbg_register_vars(zval *track_vars_array TSRMLS_DC) /* { php_register_variable(PATH_TRANSLATED, PHPDBG_G(exec), track_vars_array TSRMLS_CC); } } - + /* any old docroot will doo */ len = 0U; if (sapi_module.input_filter(PARSE_SERVER, DOCUMENT_ROOT, docroot, len, len TSRMLS_CC)) { @@ -302,7 +297,7 @@ int main(int argc, char *argv[]) /* {{{ */ char *php_optarg = NULL; int php_optind = 1; int opt; - + #ifdef ZTS void ***tsrm_ls; #endif @@ -319,7 +314,7 @@ int main(int argc, char *argv[]) /* {{{ */ tsrm_ls = ts_resource(0); #endif - + while ((opt = php_getopt(argc, argv, OPTIONS, php_optarg, php_optind, 0, 2)) != -1) { switch (opt) { case 'n': @@ -363,7 +358,7 @@ int main(int argc, char *argv[]) /* {{{ */ case 'z': zend_load_extension(php_optarg); break; - + case 'e': /* set execution context */ exec_len = strlen(php_optarg); if (exec_len) { @@ -374,11 +369,11 @@ int main(int argc, char *argv[]) /* {{{ */ case 'v': /* set quietness off */ flags = ~PHPDBG_IS_QUIET; break; - + case 's': /* set stepping on */ flags |= PHPDBG_IS_STEPPING; break; - + case 'b': /* set colours off */ flags = ~PHPDBG_IS_COLOURED; break; @@ -394,7 +389,7 @@ int main(int argc, char *argv[]) /* {{{ */ phpdbg-executable_location = argv[0]; phpdbg-phpinfo_as_text = 1; phpdbg-php_ini_ignore = 0; - + if (ini_entries) { ini_entries = realloc(ini_entries, ini_entries_len + sizeof(phpdbg_ini_hardcoded)); memmove(ini_entries + sizeof(phpdbg_ini_hardcoded) - 2, ini_entries, ini_entries_len + 1); @@ -404,9
[PHP-CVS] com php-src: ...: .gitignore tutorials/java/build/built-jar.properties tutorials/java/build/classes/.netbeans_automatic_build tutorials/java/build/classes/.netbeans_update_resources tutorial
Commit:3495e7827432a999af87cde91e773107694ac10a Author:krakjoe joe.watk...@live.co.uk Fri, 29 Nov 2013 09:38:00 + Parents: 216e3668d60429b32b4e01570af3377f00d6dfbb Branches: PHP-5.6 Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=3495e7827432a999af87cde91e773107694ac10a Log: ... Changed paths: M .gitignore M tutorials/java/build/built-jar.properties D tutorials/java/build/classes/.netbeans_automatic_build D tutorials/java/build/classes/.netbeans_update_resources M tutorials/java/build/classes/phpdbg/ui/CommandHistory.class M tutorials/java/build/classes/phpdbg/ui/DebugSocket.class M tutorials/java/build/classes/phpdbg/ui/JConsole$1.class M tutorials/java/build/classes/phpdbg/ui/JConsole$2.class M tutorials/java/build/classes/phpdbg/ui/JConsole$3.class M tutorials/java/build/classes/phpdbg/ui/JConsole$4$1.class M tutorials/java/build/classes/phpdbg/ui/JConsole$4.class M tutorials/java/build/classes/phpdbg/ui/JConsole$MessageType.class M tutorials/java/build/classes/phpdbg/ui/JConsole.class D tutorials/java/build/classes/phpdbg/ui/JConsole.form M tutorials/java/dist/phpdbg-ui.jar diff --git a/.gitignore b/.gitignore index a9e84f8..297efcb 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,5 @@ .libs/ -phpdbg +./phpdbg *.lo *.o - +build diff --git a/tutorials/java/build/built-jar.properties b/tutorials/java/build/built-jar.properties index e642ca0..0a4931e 100644 --- a/tutorials/java/build/built-jar.properties +++ b/tutorials/java/build/built-jar.properties @@ -1,4 +1,4 @@ -#Fri, 29 Nov 2013 09:01:15 + +#Fri, 29 Nov 2013 09:36:09 + /usr/src/phpdbg/tutorials/java= diff --git a/tutorials/java/build/classes/.netbeans_automatic_build b/tutorials/java/build/classes/.netbeans_automatic_build deleted file mode 100644 index e69de29..000 diff --git a/tutorials/java/build/classes/.netbeans_update_resources b/tutorials/java/build/classes/.netbeans_update_resources deleted file mode 100644 index e69de29..000 diff --git a/tutorials/java/build/classes/phpdbg/ui/CommandHistory.class b/tutorials/java/build/classes/phpdbg/ui/CommandHistory.class index 2e9bf45..c7683af 100644 Binary files a/tutorials/java/build/classes/phpdbg/ui/CommandHistory.class and b/tutorials/java/build/classes/phpdbg/ui/CommandHistory.class differ diff --git a/tutorials/java/build/classes/phpdbg/ui/DebugSocket.class b/tutorials/java/build/classes/phpdbg/ui/DebugSocket.class index af241d4..bd41313 100644 Binary files a/tutorials/java/build/classes/phpdbg/ui/DebugSocket.class and b/tutorials/java/build/classes/phpdbg/ui/DebugSocket.class differ diff --git a/tutorials/java/build/classes/phpdbg/ui/JConsole$1.class b/tutorials/java/build/classes/phpdbg/ui/JConsole$1.class index 6d8f361..4a79425 100644 Binary files a/tutorials/java/build/classes/phpdbg/ui/JConsole$1.class and b/tutorials/java/build/classes/phpdbg/ui/JConsole$1.class differ diff --git a/tutorials/java/build/classes/phpdbg/ui/JConsole$2.class b/tutorials/java/build/classes/phpdbg/ui/JConsole$2.class index 26f4b99..5803529 100644 Binary files a/tutorials/java/build/classes/phpdbg/ui/JConsole$2.class and b/tutorials/java/build/classes/phpdbg/ui/JConsole$2.class differ diff --git a/tutorials/java/build/classes/phpdbg/ui/JConsole$3.class b/tutorials/java/build/classes/phpdbg/ui/JConsole$3.class index e42eba1..5adbfa8 100644 Binary files a/tutorials/java/build/classes/phpdbg/ui/JConsole$3.class and b/tutorials/java/build/classes/phpdbg/ui/JConsole$3.class differ diff --git a/tutorials/java/build/classes/phpdbg/ui/JConsole$4$1.class b/tutorials/java/build/classes/phpdbg/ui/JConsole$4$1.class index f592992..4ef4d31 100644 Binary files a/tutorials/java/build/classes/phpdbg/ui/JConsole$4$1.class and b/tutorials/java/build/classes/phpdbg/ui/JConsole$4$1.class differ diff --git a/tutorials/java/build/classes/phpdbg/ui/JConsole$4.class b/tutorials/java/build/classes/phpdbg/ui/JConsole$4.class index 3447931..407f622 100644 Binary files a/tutorials/java/build/classes/phpdbg/ui/JConsole$4.class and b/tutorials/java/build/classes/phpdbg/ui/JConsole$4.class differ diff --git a/tutorials/java/build/classes/phpdbg/ui/JConsole$MessageType.class b/tutorials/java/build/classes/phpdbg/ui/JConsole$MessageType.class index 5fc8bd6..b9a864f 100644 Binary files a/tutorials/java/build/classes/phpdbg/ui/JConsole$MessageType.class and b/tutorials/java/build/classes/phpdbg/ui/JConsole$MessageType.class differ diff --git a/tutorials/java/build/classes/phpdbg/ui/JConsole.class b/tutorials/java/build/classes/phpdbg/ui/JConsole.class index 9c6715b..39129fe 100644 Binary files a/tutorials/java/build/classes/phpdbg/ui/JConsole.class and b/tutorials/java/build/classes/phpdbg/ui/JConsole.class differ diff --git a/tutorials/java/build/classes/phpdbg/ui/JConsole.form b/tutorials/java/build/classes/phpdbg/ui/JConsole.form deleted file mode 100644 index 4d43235..000 ---
[PHP-CVS] com php-src: I give up: phpdbg_bp.c
Commit:2e7c695c05a9de133bc9c0660ede968ce2e2dc5e Author:Bob Weinand bobw...@hotmail.com Fri, 29 Nov 2013 11:38:28 +0100 Parents: 24585722b1a9acd87387285a301a6c5e084d21bc Branches: PHP-5.6 Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=2e7c695c05a9de133bc9c0660ede968ce2e2dc5e Log: I give up Changed paths: M phpdbg_bp.c Diff: diff --git a/phpdbg_bp.c b/phpdbg_bp.c index 11f2754..d22233a 100644 --- a/phpdbg_bp.c +++ b/phpdbg_bp.c @@ -266,7 +266,7 @@ PHPDBG_API void phpdbg_set_breakpoint_method(const char* class_name, const char* PHPDBG_API void phpdbg_save_oplines(zend_op_array *op_array TSRMLS_DC) { phpdbg_btree **branch = PHPDBG_G(opline_btree); - int i = sizeof(zend_ulong) * 8 - 1; + int i = sizeof(void *) * 8 - 1; do { if (*branch == NULL) { @@ -276,11 +276,12 @@ PHPDBG_API void phpdbg_save_oplines(zend_op_array *op_array TSRMLS_DC) { } while (i--); if (*branch == NULL) { - phpdbg_btree *memory = *branch = emalloc(i * sizeof(phpdbg_btree)); - while (i--) { + phpdbg_btree *memory = *branch = emalloc((i + 2) * sizeof(phpdbg_btree)); + do { + (*branch)-branches[!(((zend_ulong)op_array-opcodes i) % 2)] = NULL; branch = (*branch)-branches[((zend_ulong)op_array-opcodes i) % 2]; *branch = ++memory; - } + } while (i--); } (*branch)-op_array = op_array; @@ -288,24 +289,32 @@ PHPDBG_API void phpdbg_save_oplines(zend_op_array *op_array TSRMLS_DC) { PHPDBG_API void phpdbg_set_breakpoint_opline(zend_ulong opline TSRMLS_DC) /* {{{ */ { + if (PHPDBG_G(opline_btree) == NULL) { + phpdbg_error(No oplines initialized yet); + return; + } + if (!zend_hash_index_exists(PHPDBG_G(bp)[PHPDBG_BREAK_OPLINE], opline)) { phpdbg_breakline_t new_break; phpdbg_breakopline_t opline_break; - int i = sizeof(zend_ulong) * 8 - 1, last_superior_i = -1; + int i = sizeof(void *) * 8 - 1, last_superior_i = -1; phpdbg_btree *branch = PHPDBG_G(opline_btree); HashTable *insert = PHPDBG_G(bp)[PHPDBG_BREAK_FUNCTION_OPLINE]; HashTable func_breaks, *func_table; do { if ((opline i) % 2 == 0 !branch-branches[0]) { - if (last_superior_i != -1) { - i = sizeof(zend_ulong) * 8 - 1; - do { - branch = branch-branches[(opline i) % 2 == 1 branch-branches[1]]; - } while (i-- last_superior_i); - do { - branch = branch-branches[!!branch-branches[1]]; - } while (i--); + if (last_superior_i == -1) { + goto error; + } + branch = PHPDBG_G(opline_btree); + i = sizeof(void *) * 8 - 1; + do { + branch = branch-branches[(opline i) % 2 == 1 branch-branches[1]]; + } while (i-- last_superior_i); + branch = branch-branches[0]; + while (i--) { + branch = branch-branches[branch-branches[1] != NULL]; } break; } @@ -317,11 +326,11 @@ PHPDBG_API void phpdbg_set_breakpoint_opline(zend_ulong opline TSRMLS_DC) /* {{{ } else { branch = branch-branches[0]; } - } while (--i); + } while (i--); - if (i || - (zend_ulong)(branch-op_array + branch-op_array-last) = opline || - (opline - (zend_ulong)branch-op_array) % sizeof(zend_op) 0) { + if ((zend_ulong)(branch-op_array-opcodes + branch-op_array-last) = opline || + (opline - (zend_ulong)branch-op_array-opcodes) % sizeof(zend_op) 0) { +error: phpdbg_error(No opline could be found at 0x%lx, opline); return; } @@ -421,7 +430,14 @@ PHPDBG_API void phpdbg_resolve_op_array_breaks(zend_op_array *op_array TSRMLS_DC for (zend_hash_internal_pointer_reset_ex(oplines_table, position); zend_hash_get_current_data_ex(oplines_table, (void**) brake, position) == SUCCESS; zend_hash_move_forward_ex(oplines_table, position)) { -
[PHP-CVS] com php-src: ...: README.md
Commit:97d4052bb85915016838f5fe5ed78c43ad7cf665 Author:krakjoe joe.watk...@live.co.uk Tue, 12 Nov 2013 03:14:56 + Parents: 08973a6bf5009dd14b2004259d0dd260726cd414 Branches: PHP-5.6 Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=97d4052bb85915016838f5fe5ed78c43ad7cf665 Log: ... Changed paths: M README.md Diff: diff --git a/README.md b/README.md index 580538f..ba13c0d 100644 --- a/README.md +++ b/README.md @@ -3,23 +3,26 @@ The interactive PHP debugger Implemented as a SAPI module, phpdbg can excerpt complete control over the environment without impacting the functionality or performance of your code. -phpdbg aims to be a lightweight, easy to use debugging platform for PHP5.5+ +phpdbg aims to be a lightweight, powerful, easy to use debugging platform for PHP5.5+ Features - - step through debugging - - break at method/function entry, file:line or address - - showing debug backtraces - - easy manipulation of the environment with built-in eval() - - userland API - - sapi agnositicism, easy integration + - Stepthrough Debugging + - Flexible Breakpoints (Class Method, Function, File:Line, internally Opline) + - Easy Access to PHP with built-in eval() + - Easy Access to Currently Executing Code + - Userland API + - SAPI Agnostic - Easily Integrated + - PHP Configuration File Support + - JIT Super Globals - Set Your Own !! + - Easy Operation - See Help :) Planned === - - mocking server environments/requests - - improve everything + - Mocking API for Server/Request Environments + - Improve Everything :) Installation -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: - Fix function: phpdbg_utils.c
Commit:6aad2ee42c355934190a46f55b7f6633f9bea407 Author:Felipe Pena felipe...@gmail.com Tue, 12 Nov 2013 00:28:52 -0200 Parents: 629b96295e1770afb94ed5f515a8f22fc3a11330 Branches: PHP-5.6 Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=6aad2ee42c355934190a46f55b7f6633f9bea407 Log: - Fix function Changed paths: M phpdbg_utils.c Diff: diff --git a/phpdbg_utils.c b/phpdbg_utils.c index 4b0c4a0..4991d3d 100644 --- a/phpdbg_utils.c +++ b/phpdbg_utils.c @@ -28,4 +28,5 @@ int phpdbg_is_numeric(const char *str) /* {{{ */ } return isdigit(*str); } + return 0; } /* }}} */ -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: update image with colours :): tutorials/java-example.png
Commit:28854065902b1b3b7c8c83c5b5dd7e486fe0e8b0 Author:krakjoe joe.watk...@live.co.uk Fri, 29 Nov 2013 09:46:20 + Parents: 921c73aeda37997e3e2f9c40369c219759d3540d Branches: PHP-5.6 Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=28854065902b1b3b7c8c83c5b5dd7e486fe0e8b0 Log: update image with colours :) Changed paths: M tutorials/java-example.png Diff: diff --git a/tutorials/java-example.png b/tutorials/java-example.png index 571b768..bb4a96a 100644 Binary files a/tutorials/java-example.png and b/tutorials/java-example.png differ -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: fix layout: tutorials/java/dist/phpdbg-ui.jar tutorials/java/src/phpdbg/ui/JConsole.form tutorials/java/src/phpdbg/ui/JConsole.java
Commit:921c73aeda37997e3e2f9c40369c219759d3540d Author:krakjoe joe.watk...@live.co.uk Fri, 29 Nov 2013 09:44:25 + Parents: 167f6e0c25ab1667131e58e248ac15c4c506462b Branches: PHP-5.6 Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=921c73aeda37997e3e2f9c40369c219759d3540d Log: fix layout Changed paths: M tutorials/java/dist/phpdbg-ui.jar M tutorials/java/src/phpdbg/ui/JConsole.form M tutorials/java/src/phpdbg/ui/JConsole.java Diff: diff --git a/tutorials/java/dist/phpdbg-ui.jar b/tutorials/java/dist/phpdbg-ui.jar index 725dad5..ca6b714 100644 Binary files a/tutorials/java/dist/phpdbg-ui.jar and b/tutorials/java/dist/phpdbg-ui.jar differ diff --git a/tutorials/java/src/phpdbg/ui/JConsole.form b/tutorials/java/src/phpdbg/ui/JConsole.form index 4d43235..69ab577 100644 --- a/tutorials/java/src/phpdbg/ui/JConsole.form +++ b/tutorials/java/src/phpdbg/ui/JConsole.form @@ -124,6 +124,14 @@ Layout class=org.netbeans.modules.form.compat2.layouts.support.JScrollPaneSupportLayout/ SubComponents Component class=phpdbg.ui.JTerminalPane name=output + Properties +Property name=font type=java.awt.Font editor=org.netbeans.beaninfo.editors.FontEditor + Font name=DialogInput size=12 style=0/ +/Property +Property name=componentPopupMenu type=javax.swing.JPopupMenu editor=org.netbeans.modules.form.ComponentChooserEditor + ComponentRef name=stdoutPopupMenu/ +/Property + /Properties /Component /SubComponents /Container diff --git a/tutorials/java/src/phpdbg/ui/JConsole.java b/tutorials/java/src/phpdbg/ui/JConsole.java index 0406e3c..08661bc 100644 --- a/tutorials/java/src/phpdbg/ui/JConsole.java +++ b/tutorials/java/src/phpdbg/ui/JConsole.java @@ -89,6 +89,8 @@ public class JConsole extends javax.swing.JDialog { }); mainSplit.setLeftComponent(input); +output.setFont(new java.awt.Font(DialogInput, 0, 12)); // NOI18N +output.setComponentPopupMenu(stdoutPopupMenu); outputScrollPane.setViewportView(output); mainSplit.setRightComponent(outputScrollPane); -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: add ANSI colour support to output pane: tutorials/java/build/built-jar.properties tutorials/java/build/classes/DBGThread.class tutorials/java/build/classes/Main$1.class tutorial
Commit:883f34f4870627eac2706c71b4880e4960bc5953 Author:krakjoe joe.watk...@live.co.uk Fri, 29 Nov 2013 08:57:29 + Parents: f822764129e148bcca00a354b9ad68eea598b834 Branches: PHP-5.6 Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=883f34f4870627eac2706c71b4880e4960bc5953 Log: add ANSI colour support to output pane Changed paths: M tutorials/java/build/built-jar.properties D tutorials/java/build/classes/DBGThread.class D tutorials/java/build/classes/Main$1.class D tutorials/java/build/classes/Main$2.class D tutorials/java/build/classes/Main$3$1.class D tutorials/java/build/classes/Main$3.class D tutorials/java/build/classes/Main$4.class D tutorials/java/build/classes/Main.class M tutorials/java/dist/phpdbg-ui.jar M tutorials/java/nbproject/project.properties D tutorials/java/src/DBGThread.java D tutorials/java/src/History.java D tutorials/java/src/Main.form D tutorials/java/src/Main.java diff --git a/tutorials/java/build/built-jar.properties b/tutorials/java/build/built-jar.properties index 79923e5..3a123e3 100644 --- a/tutorials/java/build/built-jar.properties +++ b/tutorials/java/build/built-jar.properties @@ -1,4 +1,4 @@ -#Thu, 28 Nov 2013 22:53:51 + +#Fri, 29 Nov 2013 08:22:06 + -/home/joe/NetBeansProjects/phpdbg-ui= +/usr/src/phpdbg/tutorials/java= diff --git a/tutorials/java/build/classes/DBGThread.class b/tutorials/java/build/classes/DBGThread.class deleted file mode 100644 index 4bf0a8f..000 Binary files a/tutorials/java/build/classes/DBGThread.class and /dev/null differ diff --git a/tutorials/java/build/classes/Main$1.class b/tutorials/java/build/classes/Main$1.class deleted file mode 100644 index 8e19c10..000 Binary files a/tutorials/java/build/classes/Main$1.class and /dev/null differ diff --git a/tutorials/java/build/classes/Main$2.class b/tutorials/java/build/classes/Main$2.class deleted file mode 100644 index df1dd09..000 Binary files a/tutorials/java/build/classes/Main$2.class and /dev/null differ diff --git a/tutorials/java/build/classes/Main$3$1.class b/tutorials/java/build/classes/Main$3$1.class deleted file mode 100644 index 6d285e6..000 Binary files a/tutorials/java/build/classes/Main$3$1.class and /dev/null differ diff --git a/tutorials/java/build/classes/Main$3.class b/tutorials/java/build/classes/Main$3.class deleted file mode 100644 index 4004150..000 Binary files a/tutorials/java/build/classes/Main$3.class and /dev/null differ diff --git a/tutorials/java/build/classes/Main$4.class b/tutorials/java/build/classes/Main$4.class deleted file mode 100644 index 0008d12..000 Binary files a/tutorials/java/build/classes/Main$4.class and /dev/null differ diff --git a/tutorials/java/build/classes/Main.class b/tutorials/java/build/classes/Main.class deleted file mode 100644 index 2d965ed..000 Binary files a/tutorials/java/build/classes/Main.class and /dev/null differ diff --git a/tutorials/java/dist/phpdbg-ui.jar b/tutorials/java/dist/phpdbg-ui.jar index fc4e9d1..c4dbea3 100644 Binary files a/tutorials/java/dist/phpdbg-ui.jar and b/tutorials/java/dist/phpdbg-ui.jar differ diff --git a/tutorials/java/nbproject/project.properties b/tutorials/java/nbproject/project.properties index c1f3c54..00f726c 100644 --- a/tutorials/java/nbproject/project.properties +++ b/tutorials/java/nbproject/project.properties @@ -55,7 +55,7 @@ javadoc.splitindex=true javadoc.use=true javadoc.version=false javadoc.windowtitle= -main.class=Main +main.class=phpdbg.ui.Main manifest.file=manifest.mf meta.inf.dir=${src.dir}/META-INF mkdist.disabled=false diff --git a/tutorials/java/src/DBGThread.java b/tutorials/java/src/DBGThread.java deleted file mode 100644 index 73e2dc4..000 --- a/tutorials/java/src/DBGThread.java +++ /dev/null @@ -1,90 +0,0 @@ - -import java.io.IOException; -import java.io.InputStream; -import java.io.OutputStream; -import java.net.Socket; - -/* - * To change this license header, choose License Headers in Project Properties. - * To change this template file, choose Tools | Templates - * and open the template in the editor. - */ - -/** - * Manage input and output data - * @author krakjoe - */ -public class DBGThread extends Socket implements Runnable { -private final Boolean reader; -private final Main main; -private Boolean quit; - -public DBGThread(final String host, final Integer port, final Main main, Boolean reader) throws IOException { -super(host, port); - -this.main = main; -this.reader = reader; -this.quit = false; - -main.setConnected(true); -} - -public void quit() { -synchronized(this) { -quit = true; -this.notifyAll(); -} -} - -@Override public void run() { -try { -synchronized(this) { -do { -if (reader) { -String command; -
[PHP-CVS] com php-src: fix windows build build shared on windows: config.w32 phpdbg.h phpdbg_set.c
Commit:bc7df607ab2d7771a3c2226b46598645e67e053f Author:krakjoe joe.watk...@live.co.uk Tue, 26 Nov 2013 07:53:08 + Parents: 2942caff29fc685a153cb8bf5f73f8a98ea6e2b1 Branches: PHP-5.6 Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=bc7df607ab2d7771a3c2226b46598645e67e053f Log: fix windows build build shared on windows Changed paths: M config.w32 M phpdbg.h M phpdbg_set.c Diff: diff --git a/config.w32 b/config.w32 index 89778a3..25458d5 100644 --- a/config.w32 +++ b/config.w32 @@ -1,7 +1,19 @@ ARG_ENABLE('phpdbg', 'Build phpdbg', 'yes'); +ARG_ENABLE('phpdbgs', 'Build phpdbg shared', 'no'); + +PHPDBG_SOURCES='phpdbg.c phpdbg_prompt.c phpdbg_cmd.c phpdbg_info.c phpdbg_help.c phpdbg_break.c phpdbg_print.c phpdbg_bp.c phpdbg_opcode.c phpdbg_list.c phpdbg_utils.c phpdbg_set.c'; +PHPDBG_DLL='php' + PHP_VERSION + 'phpdbg.dll'; +PHPDBG_EXE='phpdbg.exe'; if (PHP_PHPDBG == yes) { -SAPI('phpdbg', 'phpdbg.c phpdbg_prompt.c phpdbg_cmd.c phpdbg_info.c phpdbg_help.c phpdbg_break.c phpdbg_print.c phpdbg_bp.c phpdbg_opcode.c phpdbg_list.c phpdbg_utils.c phpdbg_set.c', 'phpdbg.exe'); + /* build phpdbg binary */ +SAPI('phpdbg', PHPDBG_SOURCES, PHPDBG_EXE); ADD_FLAG(LIBS_PHPDBG, ws2_32.lib user32.lib); } +if (PHP_PHPDBGS == yes) { + SAPI('phpdbgs', PHPDBG_SOURCES, PHPDBG_DLL, '/D PHP_PHPDBG_EXPORTS /I win32'); + ADD_FLAG(LIBS_PHPDBGS, ws2_32.lib user32.lib); +} + + diff --git a/phpdbg.h b/phpdbg.h index 6962cdb..7046ec3 100644 --- a/phpdbg.h +++ b/phpdbg.h @@ -44,6 +44,10 @@ #if defined(_WIN32) !defined(__MINGW32__) # include windows.h # include config.w32.h +# undef strcasecmp +# undef strncasecmp +# define strcasecmp _stricmp +# define strncasecmp _strnicmp #else # include php_config.h #endif diff --git a/phpdbg_set.c b/phpdbg_set.c index f326560..a0f5e74 100644 --- a/phpdbg_set.c +++ b/phpdbg_set.c @@ -53,7 +53,7 @@ PHPDBG_SET(break) /* {{{ */ if (strncasecmp(param-str, PHPDBG_STRL(on)) == 0) { PHPDBG_G(flags) |= PHPDBG_IS_BP_ENABLED; } else if (strncasecmp(param-str, PHPDBG_STRL(off)) == 0) { - PHPDBG_G(flags) ^= PHPDBG_IS_BP_ENABLED; + PHPDBG_G(flags) = ~PHPDBG_IS_BP_ENABLED; } break; -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: Merge branch 'master' of https://github.com/krakjoe/phpdbg: phpdbg_prompt.c
Commit:4269b29c03a5f4a30c02f79a8cad0550fc09c958 Author:krakjoe joe.watk...@live.co.uk Tue, 12 Nov 2013 13:23:54 + Parents: 277b10a5c059437754452b6de7e42aa6bde64e13 fdf26eaa0f7daaecfb05699e6012d140d1cdbaa8 Branches: PHP-5.6 Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=4269b29c03a5f4a30c02f79a8cad0550fc09c958 Log: Merge branch 'master' of https://github.com/krakjoe/phpdbg Changed paths: MM phpdbg_prompt.c Diff: -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: - Not needed strlen() here: phpdbg_prompt.c
Commit:f704fdea57d32cc8fa4bd98a208d9c8428bc05e4 Author:Felipe Pena felipe...@gmail.com Tue, 12 Nov 2013 00:54:22 -0200 Parents: 6658f58d4afcb80ffaeac460564aecb1591ecd93 Branches: PHP-5.6 Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=f704fdea57d32cc8fa4bd98a208d9c8428bc05e4 Log: - Not needed strlen() here Changed paths: M phpdbg_prompt.c Diff: diff --git a/phpdbg_prompt.c b/phpdbg_prompt.c index b71bd3d..4f5c6e0 100644 --- a/phpdbg_prompt.c +++ b/phpdbg_prompt.c @@ -519,7 +519,7 @@ static PHPDBG_COMMAND(list) /* {{{ */ return SUCCESS; } - if (zend_hash_find(EG(function_table), expr, strlen(expr)+1, + if (zend_hash_find(EG(function_table), expr, expr_len, (void**)fbc) == SUCCESS) { phpdbg_list_function(fbc TSRMLS_CC); } -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: ...: web-bootstrap.php
Commit:ff4c0c9397d7435ab8462fedd3e89fe2c9e3c4d4 Author:krakjoe joe.watk...@live.co.uk Tue, 12 Nov 2013 07:09:07 + Parents: 6c5831aa09a85b069dfc0c9360547f960fb701e2 Branches: PHP-5.6 Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=ff4c0c9397d7435ab8462fedd3e89fe2c9e3c4d4 Log: ... Changed paths: M web-bootstrap.php Diff: diff --git a/web-bootstrap.php b/web-bootstrap.php index e6bea6b..d50e1ea 100644 --- a/web-bootstrap.php +++ b/web-bootstrap.php @@ -8,9 +8,13 @@ * break ... * run */ -define(PHPDBG_BOOTPATH, /opt/php-zts/htdocs); -define(PHPDBG_BOOTSTRAP, index.php); -define(PHPDBG_BOOTSTRAPPED, sprintf(/%s, PHPDBG_BOOTSTRAP)); +if (!defined('PHPDBG_BOOTSTRAPPED')) +{ +/* define these once */ +define(PHPDBG_BOOTPATH, /opt/php-zts/htdocs); +define(PHPDBG_BOOTSTRAP, index.php); +define(PHPDBG_BOOTSTRAPPED, sprintf(/%s, PHPDBG_BOOTSTRAP)); +} /* * Superglobals are JIT, phpdbg will not over-write whatever you set during bootstrap -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: ...: tutorials/java/dist/phpdbg-ui.jar
Commit:e1af08c4e795009d8a4b80a3d2842e72dfa053cb Author:krakjoe joe.watk...@live.co.uk Fri, 29 Nov 2013 10:22:20 + Parents: 9b498765abd28e23f707a1a63dedb78527aab11e Branches: PHP-5.6 Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=e1af08c4e795009d8a4b80a3d2842e72dfa053cb Log: ... Changed paths: M tutorials/java/dist/phpdbg-ui.jar Diff: diff --git a/tutorials/java/dist/phpdbg-ui.jar b/tutorials/java/dist/phpdbg-ui.jar index ca6b714..9df8806 100644 Binary files a/tutorials/java/dist/phpdbg-ui.jar and b/tutorials/java/dist/phpdbg-ui.jar differ -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: Merge branch 'master' of https://github.com/krakjoe/phpdbg: phpdbg_prompt.c
Commit:79ab9a3f74e9ecb3d9acfc4a0050b491bda56185 Author:krakjoe joe.watk...@live.co.uk Tue, 12 Nov 2013 02:35:29 + Parents: 8c91727484c6ed6af80fbe13f9076958450fe19b bd432b995e30ad13f725c367960f5dc4f8776d81 Branches: PHP-5.6 Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=79ab9a3f74e9ecb3d9acfc4a0050b491bda56185 Log: Merge branch 'master' of https://github.com/krakjoe/phpdbg Changed paths: MM phpdbg_prompt.c Diff: -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: ...: tutorials/java/build/built-jar.properties tutorials/java/dist/phpdbg-ui.jar tutorials/java/src/phpdbg/ui/DBGThread.java tutorials/java/src/phpdbg/ui/History.java tutorials/
Commit:5f0a0f12e1e317d6ac2e053cea71925aedd3009c Author:krakjoe joe.watk...@live.co.uk Fri, 29 Nov 2013 09:16:07 + Parents: 883f34f4870627eac2706c71b4880e4960bc5953 Branches: PHP-5.6 Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=5f0a0f12e1e317d6ac2e053cea71925aedd3009c Log: ... Changed paths: M tutorials/java/build/built-jar.properties M tutorials/java/dist/phpdbg-ui.jar A tutorials/java/src/phpdbg/ui/DBGThread.java A tutorials/java/src/phpdbg/ui/History.java A tutorials/java/src/phpdbg/ui/JTerminalPane.java A tutorials/java/src/phpdbg/ui/Main.form A tutorials/java/src/phpdbg/ui/Main.java diff --git a/tutorials/java/build/built-jar.properties b/tutorials/java/build/built-jar.properties index 3a123e3..e642ca0 100644 --- a/tutorials/java/build/built-jar.properties +++ b/tutorials/java/build/built-jar.properties @@ -1,4 +1,4 @@ -#Fri, 29 Nov 2013 08:22:06 + +#Fri, 29 Nov 2013 09:01:15 + /usr/src/phpdbg/tutorials/java= diff --git a/tutorials/java/dist/phpdbg-ui.jar b/tutorials/java/dist/phpdbg-ui.jar index c4dbea3..a2c3c75 100644 Binary files a/tutorials/java/dist/phpdbg-ui.jar and b/tutorials/java/dist/phpdbg-ui.jar differ diff --git a/tutorials/java/src/phpdbg/ui/DBGThread.java b/tutorials/java/src/phpdbg/ui/DBGThread.java new file mode 100644 index 000..ee77825 --- /dev/null +++ b/tutorials/java/src/phpdbg/ui/DBGThread.java @@ -0,0 +1,99 @@ +package phpdbg.ui; + + +import java.io.IOException; +import java.io.InputStream; +import java.io.OutputStream; +import java.net.Socket; + +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ + +/** + * Manage input and output data + * @author krakjoe + */ +public class DBGThread extends Socket implements Runnable { +private final Boolean reader; +private final Main main; +private Boolean quit; + +public DBGThread(final String host, final Integer port, final Main main, Boolean reader) throws IOException { +super(host, port); + +this.main = main; +this.reader = reader; +this.quit = false; + +synchronized(main) { +if (!main.isConnected()) { +main.setConnected(true); +} +} +} + +public void quit() { +synchronized(this) { +quit = true; +this.notifyAll(); +} +} + +@Override public void run() { +try { +synchronized(this) { +do { +if (reader) { +String command; +OutputStream output = getOutputStream(); + +this.wait(); + +command = main.getInputField().getText(); +/* send command to stdin socket */ +if (command != null) { +output.write( + command.getBytes()); +output.write(\n.getBytes()); +output.flush(); +} +main.getInputField().setText(null); +} else { +InputStream input = getInputStream(); +/* get data from stdout socket */ +byte[] bytes = new byte[1]; +do { +/* this is some of the laziest programming I ever done */ +if (input.available() == 0) { +this.wait(400); +continue; +} + +if (input.read(bytes, 0, 1) -1) { +main.getOutputField() +.appendANSI(new String(bytes)); +} +} while (!quit); +} +} while(!quit); +} +} catch (IOException | InterruptedException ex) { +if (!quit) { +main.messageBox(ex.getMessage()); +} +} finally { +try { +close(); +} catch (IOException ex) { /* naughty me */ } finally { + synchronized(main) { + if (main.isConnected()) { + main.setConnected(false); + } + } +} +} +} +} diff --git a/tutorials/java/src/phpdbg/ui/History.java b/tutorials/java/src/phpdbg/ui/History.java new file mode 100644 index 000..2950087 --- /dev/null +++ b/tutorials/java/src/phpdbg/ui/History.java @@ -0,0 +1,49 @@ +package phpdbg.ui; + + +import java.util.ArrayList; + +/* + * To
[PHP-CVS] com php-src: more command line options: phpdbg.c phpdbg_prompt.c
Commit:6c317b771e5e342497a39e5610c8fe49cfd628a0 Author:krakjoe joe.watk...@live.co.uk Tue, 12 Nov 2013 04:53:04 + Parents: bf8a9c141fcad21738156349a9c2b2900ee2908a Branches: PHP-5.6 Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=6c317b771e5e342497a39e5610c8fe49cfd628a0 Log: more command line options Changed paths: M phpdbg.c M phpdbg_prompt.c Diff: diff --git a/phpdbg.c b/phpdbg.c index ca38078..52998a6 100644 --- a/phpdbg.c +++ b/phpdbg.c @@ -262,6 +262,10 @@ const opt_struct OPTIONS[] = { /* {{{ */ {'d', 1, define ini entry on command line}, {'n', 0, no php.ini}, {'z', 1, load zend_extension}, +/* phpdbg options */ +{'e', 1, exec}, +{'v', 0, verbose}, +{'s', 0, step}, {'-', 0, NULL} }; /* }}} */ @@ -291,6 +295,9 @@ int main(int argc, char *argv[]) /* {{{ */ sapi_module_struct *phpdbg = phpdbg_sapi_module; char *ini_entries = NULL; int ini_entries_len = 0; + char *exec = NULL; + size_t exec_len = 0L; + zend_ulong flags = PHPDBG_IS_QUIET; char *php_optarg = NULL; int php_optind = 1; int opt; @@ -311,7 +318,7 @@ int main(int argc, char *argv[]) /* {{{ */ tsrm_ls = ts_resource(0); #endif - + while ((opt = php_getopt(argc, argv, OPTIONS, php_optarg, php_optind, 0, 2)) != -1) { switch (opt) { case 'n': @@ -355,6 +362,21 @@ int main(int argc, char *argv[]) /* {{{ */ case 'z': zend_load_extension(php_optarg); break; + +case 'e': /* set execution context */ +exec_len = strlen(php_optarg); +if (exec_len) { +exec = strdup(php_optarg); +} +break; + +case 'v': /* set quietness off */ +flags = ~PHPDBG_IS_QUIET; +break; + +case 's': /* set stepping on */ +flags |= PHPDBG_IS_STEPPING; +break; } } @@ -395,6 +417,16 @@ int main(int argc, char *argv[]) /* {{{ */ PG(modules_activated) = 0; +if (exec) { /* set execution context */ +PHPDBG_G(exec) = estrndup(exec, exec_len); +PHPDBG_G(exec_len) = exec_len; + +free(exec); +} + +/* set flags from command line */ +PHPDBG_G(flags) = flags; + zend_try { zend_activate_modules(TSRMLS_C); } zend_end_try(); diff --git a/phpdbg_prompt.c b/phpdbg_prompt.c index e438072..d255a9d 100644 --- a/phpdbg_prompt.c +++ b/phpdbg_prompt.c @@ -604,7 +604,7 @@ phpdbg_interactive_enter: #ifdef HAVE_LIBREADLINE add_history(cmd); #endif - + switch (phpdbg_do_cmd(phpdbg_prompt_commands, cmd, cmd_len TSRMLS_CC)) { case FAILURE: if (!(PHPDBG_G(flags) PHPDBG_IS_QUITTING)) { -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: fix: phpdbg_list.c phpdbg_list.h phpdbg_prompt.c
Commit:c7b51537a03734a3e0a8fbb9100840cd64a66d37 Author:krakjoe joe.watk...@live.co.uk Tue, 12 Nov 2013 02:29:56 + Parents: d7e09f95646f74f47e2ff15f1ef9b78da2592dec Branches: PHP-5.6 Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=c7b51537a03734a3e0a8fbb9100840cd64a66d37 Log: fix Changed paths: M phpdbg_list.c M phpdbg_list.h M phpdbg_prompt.c Diff: diff --git a/phpdbg_list.c b/phpdbg_list.c index d460315..f4209e1 100644 --- a/phpdbg_list.c +++ b/phpdbg_list.c @@ -23,25 +23,26 @@ #include sys/mman.h #include unistd.h #include fcntl.h +#include phpdbg.h #include phpdbg_list.h -void phpdbg_list_file(const char *filename, long count, long offset) /* {{{ */ +void phpdbg_list_file(const char *filename, long count, long offset TSRMLS_DC) /* {{{ */ { unsigned char *mem, *pos, *last_pos, *end_pos; struct stat st; int fd, all_content = (count == 0); unsigned int line = 0, displayed = 0; - if ((fd = open(filename, O_RDONLY)) == -1) { - printf([Failed to open file %s to list]\n, filename); - return; - } - - if (fstat(fd, st) == -1) { +if (VCWD_STAT(filename, st) == -1) { printf([Failed to stat file %s]\n, filename); goto out; } + if ((fd = VCWD_OPEN(filename, O_RDONLY)) == -1) { + printf([Failed to open file %s to list]\n, filename); + return; + } + last_pos = mem = mmap(0, st.st_size, PROT_READ, MAP_SHARED, fd, 0); end_pos = mem + st.st_size; diff --git a/phpdbg_list.h b/phpdbg_list.h index 4531a65..883f991 100644 --- a/phpdbg_list.h +++ b/phpdbg_list.h @@ -20,6 +20,6 @@ #ifndef PHPDBG_LIST_H #define PHPDBG_LIST_H -void phpdbg_list_file(const char*, long, long); +void phpdbg_list_file(const char*, long, long TSRMLS_DC); #endif /* PHPDBG_LIST_H */ diff --git a/phpdbg_prompt.c b/phpdbg_prompt.c index fb6ba7c..c30d155 100644 --- a/phpdbg_prompt.c +++ b/phpdbg_prompt.c @@ -508,7 +508,7 @@ static PHPDBG_COMMAND(list) /* {{{ */ return SUCCESS; } - phpdbg_list_file(filename, count, offset); + phpdbg_list_file(filename, count, offset TSRMLS_CC); return SUCCESS; } /* }}} */ -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: updates to helpers: phpdbg_help.c phpdbg_print.c phpdbg_print.h phpdbg_prompt.c phpdbg_prompt.h
Commit:1d373be4fbaaf9878c4acb1afb21647651dbbbc4 Author:krakjoe joe.watk...@live.co.uk Tue, 12 Nov 2013 09:26:26 + Parents: 83852d3bb775fd3555011e2cc1d5fdc9f418469e Branches: PHP-5.6 Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=1d373be4fbaaf9878c4acb1afb21647651dbbbc4 Log: updates to helpers Changed paths: M phpdbg_help.c M phpdbg_print.c M phpdbg_print.h M phpdbg_prompt.c M phpdbg_prompt.h Diff: diff --git a/phpdbg_help.c b/phpdbg_help.c index 21feb07..1a78c69 100644 --- a/phpdbg_help.c +++ b/phpdbg_help.c @@ -19,6 +19,9 @@ #include phpdbg.h #include phpdbg_help.h +#include phpdbg_print.h + +ZEND_EXTERN_MODULE_GLOBALS(phpdbg); PHPDBG_HELP(exec) /* {{{ */ { @@ -31,7 +34,7 @@ PHPDBG_HELP(step) /* {{{ */ { printf(You can enable and disable stepping at any phpdbg prompt during execution\n); printf(For example:\n); -printf(\tphpdbg stepping 1\n); +printf(\t%sstepping 1\n, PHPDBG_PROMPT_LINE(TSRMLS_C)); printf(Will enable stepping\n); printf(While stepping is enabled you are presented with a prompt after the execution of each opcode\n); return SUCCESS; @@ -56,11 +59,16 @@ PHPDBG_HELP(compile) /* {{{ */ PHPDBG_HELP(print) /* {{{ */ { printf(By default, print will show information about the current execution environment\n); - printf(To show specific information pass an expression to print, for example:\n); - printf(\tphpdbg print opcodes[0]\n); - printf(Will show the opline @ 0\n); - printf(Available print commands:\n); - printf(\tNone\n); + printf(Specific printers loaded are show below:\n); + printf(%sCommands%s\n, PHPDBG_BOLD_LINE(TSRMLS_C), PHPDBG_END_LINE(TSRMLS_C)); + { + phpdbg_command_t *print_command = phpdbg_print_commands; + + while (print_command print_command-name) { + printf(\t%s\t%s\n, print_command-name, print_command-tip); + ++print_command; + } + } return SUCCESS; } /* }}} */ @@ -86,13 +94,13 @@ PHPDBG_HELP(break) /* {{{ */ printf(\t\\my\\class::method\n); printf(\t0x16\n); printf(For example:\n); - printf(\tphpdbg break test.php:1\n); + printf(\t%sbreak test.php:1\n, PHPDBG_PROMPT_LINE(TSRMLS_C)); printf(Will break execution on line 1 of test.php\n); - printf(\tphpdbg break my_function\n); + printf(\t%sbreak my_function\n, PHPDBG_PROMPT_LINE(TSRMLS_C)); printf(Will break execution on entry to my_function\n); - printf(\tphpdbg break \\my\\class::method\n); + printf(\t%sbreak \\my\\class::method\n, PHPDBG_PROMPT_LINE(TSRMLS_C)); printf(Will break execution on entry to \\my\\class::method\n); - printf(\tphpdbg break 0x7ff68f570e08\n); + printf(\t%sbreak 0x7ff68f570e08\n, PHPDBG_PROMPT_LINE(TSRMLS_C)); printf(Will break at the opline with the address provided (addresses are shown during execution)\n); printf(It is important to note, an address is only valid for the current compiled representation of the script\n); printf(If you have to clean the environment and recompile then your opline break points will be invalid\n); @@ -117,9 +125,9 @@ PHPDBG_HELP(quiet) /* {{{ */ { printf(Setting quietness on will stop the OPLINE output during execution\n); printf(For example:\n); -printf(\tphpdbg quiet 1\n); +printf(\t%squiet 1\n, PHPDBG_PROMPT_LINE(TSRMLS_C)); printf(Will silence OPLINE output, while\n); -printf(\tphpdbg quiet 0\n); +printf(\t%squiet 0\n, PHPDBG_PROMPT_LINE(TSRMLS_C)); printf(Will enable OPLINE output again\n); return SUCCESS; } /* }}} */ @@ -128,7 +136,7 @@ PHPDBG_HELP(back) /* {{{ */ { printf(The backtrace is gathered with the default debug_backtrace functionality.\n); printf(You can set the limit on the trace, for example:\n); - printf(\tphpdbg back 5\n); + printf(\t%sback 5\n, PHPDBG_PROMPT_LINE(TSRMLS_C)); printf(Will limit the number of frames to 5, the default is no limit\n); return SUCCESS; } /* }}} */ @@ -136,11 +144,11 @@ PHPDBG_HELP(back) /* {{{ */ PHPDBG_HELP(list) /* {{{ */ { printf(The list command displays N line from current context file.\n); - printf(\tphpdbg list 2\n); + printf(\t%slist 2\n, PHPDBG_PROMPT_LINE(TSRMLS_C)); printf(Will print next 2 lines from the current file\n); - printf(\tphpdbg list func\n); + printf(\t%slist func\n, PHPDBG_PROMPT_LINE(TSRMLS_C)); printf(Will print the source of the global function \func\\n); - printf(\tphpdbg list .mine\n); + printf(\t%slist .mine\n, PHPDBG_PROMPT_LINE(TSRMLS_C)); printf(Will print the source of the class method \mine\\n); printf(Note: before listing functions you must have a populated function table, try compile !!\n); return SUCCESS; diff --git
[PHP-CVS] com php-src: ...: phpdbg_prompt.c phpdbg_prompt.h
Commit:7f743e1fca1773a8e5deaac079386c9a8b731601 Author:krakjoe joe.watk...@live.co.uk Tue, 12 Nov 2013 09:52:59 + Parents: 1d373be4fbaaf9878c4acb1afb21647651dbbbc4 Branches: PHP-5.6 Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=7f743e1fca1773a8e5deaac079386c9a8b731601 Log: ... Changed paths: M phpdbg_prompt.c M phpdbg_prompt.h Diff: diff --git a/phpdbg_prompt.c b/phpdbg_prompt.c index 5fae155..a3eaacb 100644 --- a/phpdbg_prompt.c +++ b/phpdbg_prompt.c @@ -47,9 +47,8 @@ static PHPDBG_COMMAND(exec) /* {{{ */ printf( %sDestroying compiled opcodes%s\n, PHPDBG_BOLD_LINE(TSRMLS_C), PHPDBG_END_LINE(TSRMLS_C)); - destroy_op_array(PHPDBG_G(ops) TSRMLS_CC); - efree(PHPDBG_G(ops)); - PHPDBG_G(ops) = NULL; + + phpdbg_clean(0 TSRMLS_CC); } PHPDBG_G(exec) = estrndup(expr, PHPDBG_G(exec_len) = expr_len); @@ -99,9 +98,7 @@ static PHPDBG_COMMAND(compile) /* {{{ */ printf( %sDestroying previously compiled opcodes%s\n, PHPDBG_BOLD_LINE(TSRMLS_C), PHPDBG_END_LINE(TSRMLS_C)); - destroy_op_array(PHPDBG_G(ops) TSRMLS_CC); - efree(PHPDBG_G(ops)); - PHPDBG_G(ops)=NULL; + phpdbg_clean(0 TSRMLS_CC); } } @@ -184,6 +181,7 @@ static PHPDBG_COMMAND(eval) /* {{{ */ retval, eval()'d code TSRMLS_CC) == SUCCESS) { zend_print_zval_r( retval, 0 TSRMLS_CC); + zval_dtor(retval); printf(\n); } @@ -439,18 +437,7 @@ static PHPDBG_COMMAND(clean) /* {{{ */ printf([\tConstants: %d]\n, zend_hash_num_elements(EG(zend_constants))); printf([\tIncluded: %d]\n, zend_hash_num_elements(EG(included_files))); -/* this is implicitly required */ -if (PHPDBG_G(ops)) { -destroy_op_array( -PHPDBG_G(ops) TSRMLS_CC); -efree(PHPDBG_G(ops)); -PHPDBG_G(ops) = NULL; -} - -zend_hash_reverse_apply(EG(function_table), (apply_func_t) clean_non_persistent_function_full TSRMLS_CC); -zend_hash_reverse_apply(EG(class_table), (apply_func_t) clean_non_persistent_class_full TSRMLS_CC); -zend_hash_reverse_apply(EG(zend_constants), (apply_func_t) clean_non_persistent_constant_full TSRMLS_CC); -zend_hash_clean(EG(included_files)); +phpdbg_clean(1 TSRMLS_CC); printf([Clean Environment:]\n); printf([\tClasses: %d]\n, zend_hash_num_elements(EG(class_table))); @@ -702,13 +689,38 @@ phpdbg_interactive_enter: void phpdbg_print_opline(zend_execute_data *execute_data, zend_bool ignore_flags TSRMLS_DC) /* {{{ */ { /* force out a line while stepping so the user knows what is happening */ -if (ignore_flags || (!(PHPDBG_G(flags) PHPDBG_IS_QUIET) || (PHPDBG_G(flags) PHPDBG_IS_STEPPING))) { +if (ignore_flags || +(!(PHPDBG_G(flags) PHPDBG_IS_QUIET) || +(PHPDBG_G(flags) PHPDBG_IS_STEPPING))) { + zend_op *opline = execute_data-opline; printf( %sOPLINE: %p:%s%s\n, PHPDBG_BOLD_LINE(TSRMLS_C), -opline, phpdbg_decode_opcode(opline-opcode), PHPDBG_END_LINE(TSRMLS_C)); +opline, +phpdbg_decode_opcode(opline-opcode), +PHPDBG_END_LINE(TSRMLS_C)); +} +} /* }}} */ + +void phpdbg_clean(zend_bool full TSRMLS_DC) /* {{{ */ +{ +zend_objects_store_call_destructors(EG(objects_store) TSRMLS_CC); + +/* this is implicitly required */ +if (PHPDBG_G(ops)) { +destroy_op_array( +PHPDBG_G(ops) TSRMLS_CC); +efree(PHPDBG_G(ops)); +PHPDBG_G(ops) = NULL; +} + +if (full) { +zend_hash_reverse_apply(EG(function_table), (apply_func_t) clean_non_persistent_function_full TSRMLS_CC); +zend_hash_reverse_apply(EG(class_table), (apply_func_t) clean_non_persistent_class_full TSRMLS_CC); +zend_hash_reverse_apply(EG(zend_constants), (apply_func_t) clean_non_persistent_constant_full TSRMLS_CC); +zend_hash_clean(EG(included_files)); } } /* }}} */ diff --git a/phpdbg_prompt.h b/phpdbg_prompt.h index f9fd39d..2a4fa4b 100644 --- a/phpdbg_prompt.h +++ b/phpdbg_prompt.h @@ -61,5 +61,6 @@ int phpdbg_do_cmd(const phpdbg_command_t *command, char *cmd_line, size_t cmd_le int phpdbg_interactive(TSRMLS_D); void phpdbg_execute_ex(zend_execute_data *execute_data TSRMLS_DC); void phpdbg_print_opline(zend_execute_data *execute_data, zend_bool ignore_flags TSRMLS_DC); +void phpdbg_clean(zend_bool full TSRMLS_DC); #endif /* PHPDBG_PROMPT_H */ -- PHP CVS Mailing List (http://www.php.net/)
[PHP-CVS] com php-src: update java example: tutorials/java-example.png tutorials/java/dist/phpdbg-ui.jar tutorials/java/src/DBGThread.java tutorials/java/src/History.java tutorials/java/src/Main.form
Commit:734fe5508a96868a3e6c03c323f5fb436dc91aa0 Author:krakjoe joe.watk...@live.co.uk Fri, 29 Nov 2013 01:48:21 + Parents: 8a63a99d2ea348d653742b2729fd995fb74fe796 Branches: PHP-5.6 Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=734fe5508a96868a3e6c03c323f5fb436dc91aa0 Log: update java example Changed paths: M tutorials/java-example.png M tutorials/java/dist/phpdbg-ui.jar M tutorials/java/src/DBGThread.java A tutorials/java/src/History.java M tutorials/java/src/Main.form M tutorials/java/src/Main.java diff --git a/tutorials/java-example.png b/tutorials/java-example.png index 618882d..571b768 100644 Binary files a/tutorials/java-example.png and b/tutorials/java-example.png differ diff --git a/tutorials/java/dist/phpdbg-ui.jar b/tutorials/java/dist/phpdbg-ui.jar index 24dd4b9..fc4e9d1 100644 Binary files a/tutorials/java/dist/phpdbg-ui.jar and b/tutorials/java/dist/phpdbg-ui.jar differ diff --git a/tutorials/java/src/DBGThread.java b/tutorials/java/src/DBGThread.java index 9f00faa..73e2dc4 100644 --- a/tutorials/java/src/DBGThread.java +++ b/tutorials/java/src/DBGThread.java @@ -3,11 +3,6 @@ import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import java.net.Socket; -import java.util.logging.Level; -import java.util.logging.Logger; -import javax.swing.JScrollPane; -import javax.swing.JTextArea; -import javax.swing.JTextField; /* * To change this license header, choose License Headers in Project Properties. @@ -16,80 +11,52 @@ import javax.swing.JTextField; */ /** - * In a RUSH !!! - * @author joe + * Manage input and output data + * @author krakjoe */ public class DBGThread extends Socket implements Runnable { -private final String host; -private final Integer port; private final Boolean reader; -private final JTextField field; -private final JTextArea area; -private final JScrollPane pane; -private InputStream input; -private OutputStream output; -private String buffer; +private final Main main; private Boolean quit; -public DBGThread(final String host, final Integer port, final JTextField field) throws IOException { +public DBGThread(final String host, final Integer port, final Main main, Boolean reader) throws IOException { super(host, port); -this.host = host; -this.port = port; -this.reader = true; -this.field = field; -this.area = null; -this.pane = null; +this.main = main; +this.reader = reader; this.quit = false; -this.buffer = null; -} - -public DBGThread(final String host, final Integer port, final JTextArea area, JScrollPane pane) throws IOException { -super(host, port); -this.host = host; -this.port = port; -this.reader = false; -this.field = null; -this.area = area; -this.pane = pane; -this.quit = false; -this.buffer = null; -} - -public Boolean isReader() { -return this.reader; +main.setConnected(true); } public void quit() { synchronized(this) { -this.quit = true; +quit = true; this.notifyAll(); } } -@Override -public void run() { +@Override public void run() { try { -if (this.reader) { -output = this.getOutputStream(); -} else input = this.getInputStream(); - synchronized(this) { do { -if (this.reader) { +if (reader) { +String command; +OutputStream output = getOutputStream(); + this.wait(); +command = main.getInputField().getText(); /* send command to stdin socket */ -if (this.field.getText() != null) { +if (command != null) { output.write( - this.field.getText().getBytes()); + command.getBytes()); output.write(\n.getBytes()); output.flush(); } -this.field.setText(null); - +main.getInputField().setText(null); } else { +InputStream input = getInputStream(); /* get data from stdout socket */ byte[] bytes = new byte[1]; do { @@ -100,16 +67,24 @@ public class DBGThread extends Socket implements Runnable { } if
[PHP-CVS] com php-src: - Implemented break N where N is the line number on the current file: phpdbg_prompt.c phpdbg_utils.c phpdbg_utils.h
Commit:ffad3fa2119346e6735dda266f705fae68c1109c Author:Felipe Pena felipe...@gmail.com Tue, 12 Nov 2013 10:58:19 -0200 Parents: 7f743e1fca1773a8e5deaac079386c9a8b731601 Branches: PHP-5.6 Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=ffad3fa2119346e6735dda266f705fae68c1109c Log: - Implemented break N where N is the line number on the current file Changed paths: M phpdbg_prompt.c M phpdbg_utils.c M phpdbg_utils.h diff --git a/phpdbg_prompt.c b/phpdbg_prompt.c index a3eaacb..3040b80 100644 --- a/phpdbg_prompt.c +++ b/phpdbg_prompt.c @@ -37,7 +37,7 @@ static PHPDBG_COMMAND(exec) /* {{{ */ { if (PHPDBG_G(exec)) { printf( - %sUnsetting old execution context: %s%s\n, + %sUnsetting old execution context: %s%s\n, PHPDBG_BOLD_LINE(TSRMLS_C), PHPDBG_G(exec), PHPDBG_END_LINE(TSRMLS_C)); efree(PHPDBG_G(exec)); PHPDBG_G(exec) = NULL; @@ -47,14 +47,14 @@ static PHPDBG_COMMAND(exec) /* {{{ */ printf( %sDestroying compiled opcodes%s\n, PHPDBG_BOLD_LINE(TSRMLS_C), PHPDBG_END_LINE(TSRMLS_C)); - + phpdbg_clean(0 TSRMLS_CC); } PHPDBG_G(exec) = estrndup(expr, PHPDBG_G(exec_len) = expr_len); printf( - %sSet execution context: %s%s\n, + %sSet execution context: %s%s\n, PHPDBG_BOLD_LINE(TSRMLS_C), PHPDBG_G(exec), PHPDBG_END_LINE(TSRMLS_C)); return SUCCESS; @@ -73,17 +73,17 @@ static inline int phpdbg_compile(TSRMLS_D) /* {{{ */ fh, ZEND_INCLUDE TSRMLS_CC); zend_destroy_file_handle(fh TSRMLS_CC); printf( - %sSuccess%s\n, + %sSuccess%s\n, PHPDBG_BOLD_LINE(TSRMLS_C), PHPDBG_END_LINE(TSRMLS_C)); return SUCCESS; } else { printf( -%sCould not open file %s%s\n, +%sCould not open file %s%s\n, PHPDBG_RED_LINE(TSRMLS_C), PHPDBG_G(exec), PHPDBG_END_LINE(TSRMLS_C)); } } else { printf( - %sCannot compile while in execution%s\n, + %sCannot compile while in execution%s\n, PHPDBG_RED_LINE(TSRMLS_C), PHPDBG_END_LINE(TSRMLS_C)); } @@ -96,7 +96,7 @@ static PHPDBG_COMMAND(compile) /* {{{ */ if (!EG(in_execution)) { if (PHPDBG_G(ops)) { printf( - %sDestroying previously compiled opcodes%s\n, + %sDestroying previously compiled opcodes%s\n, PHPDBG_BOLD_LINE(TSRMLS_C), PHPDBG_END_LINE(TSRMLS_C)); phpdbg_clean(0 TSRMLS_CC); } @@ -120,11 +120,11 @@ static PHPDBG_COMMAND(step) /* {{{ */ } printf( - %sStepping %s%s\n, - PHPDBG_BOLD_LINE(TSRMLS_C), - (PHPDBG_G(flags) PHPDBG_IS_STEPPING) ? on : off, + %sStepping %s%s\n, + PHPDBG_BOLD_LINE(TSRMLS_C), + (PHPDBG_G(flags) PHPDBG_IS_STEPPING) ? on : off, PHPDBG_END_LINE(TSRMLS_C)); - + return SUCCESS; } /* }}} */ @@ -230,7 +230,7 @@ static PHPDBG_COMMAND(print) /* {{{ */ if (expr_len 0L) { if (phpdbg_do_cmd(phpdbg_print_commands, (char*)expr, expr_len TSRMLS_CC) == FAILURE) { printf( - %sFailed to find print command: %s/%lu%s\n, + %sFailed to find print command: %s/%lu%s\n, PHPDBG_RED_LINE(TSRMLS_C), expr, expr_len, PHPDBG_END_LINE(TSRMLS_C)); } return SUCCESS; @@ -382,22 +382,34 @@ static PHPDBG_COMMAND(break) /* {{{ */ } } } else { - if (expr_len 2 expr[0] == '0' expr[1] == 'x') { - phpdbg_set_breakpoint_opline(expr TSRMLS_CC); - } else { - char name[200]; - size_t name_len = strlen(expr); - - if (name_len) { - name_len = MIN(name_len, 200); - memcpy(name, expr, name_len); - name[name_len] = 0; + if (phpdbg_is_addr(expr)) { + phpdbg_set_breakpoint_opline(expr TSRMLS_CC); + } else if (phpdbg_is_numeric(expr)) { + const char *filename = zend_get_executed_filename(TSRMLS_C); + long line_num = strtol(expr, NULL, 0); + + if (!filename) { + printf(%sNo file context found%s\n, + PHPDBG_RED_LINE(TSRMLS_C), PHPDBG_END_LINE(TSRMLS_C));
[PHP-CVS] com php-src: ...: README.md
Commit:f4523640609690faf2495022be15af50c06efdd3 Author:krakjoe joe.watk...@live.co.uk Tue, 12 Nov 2013 06:29:54 + Parents: fd0aeb5b536bf2af11107b2b895387955175729a Branches: PHP-5.6 Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=f4523640609690faf2495022be15af50c06efdd3 Log: ... Changed paths: M README.md Diff: diff --git a/README.md b/README.md index bd06569..f9ae877 100644 --- a/README.md +++ b/README.md @@ -52,7 +52,7 @@ The following switchess are implemented (just like cli SAPI): - -z load zend extension - -d define php ini entry -The following switches changes the default behaviour of phpdbg: +The following switches change the default behaviour of phpdbg: - -v disables quietness - -s enabled stepping -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: ...: web-bootstrap.php
Commit:25475ff95e1f1f30df22bc0d920692f92c199a2f Author:krakjoe joe.watk...@live.co.uk Tue, 12 Nov 2013 07:01:28 + Parents: 4b2490426f46d360345d353b94c5b4a03c38a92a Branches: PHP-5.6 Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=25475ff95e1f1f30df22bc0d920692f92c199a2f Log: ... Changed paths: M web-bootstrap.php Diff: diff --git a/web-bootstrap.php b/web-bootstrap.php index c5802c1..fdb40f9 100644 --- a/web-bootstrap.php +++ b/web-bootstrap.php @@ -1,8 +1,21 @@ ?php +/** + * The following file shows how to bootstrap phpdbg so that you can mock specific server environments + * + * eval include(web-bootstrap.php) + * exec index.php + * compile + * break ... + * run + */ define(PHPDBG_BOOTPATH, /opt/php-zts/htdocs); define(PHPDBG_BOOTSTRAP, index.php); define(PHPDBG_BOOTSTRAPPED, sprintf(/%s, PHPDBG_BOOTSTRAP)); +/* + * Superglobals are JIT, phpdbg will not over-write whatever you set during bootstrap + */ + $_SERVER = array ( 'HTTP_HOST' = 'localhost', -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: - Update list cmd description: phpdbg_prompt.c
Commit:bd432b995e30ad13f725c367960f5dc4f8776d81 Author:Felipe Pena felipe...@gmail.com Tue, 12 Nov 2013 00:34:10 -0200 Parents: 6aad2ee42c355934190a46f55b7f6633f9bea407 Branches: PHP-5.6 Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=bd432b995e30ad13f725c367960f5dc4f8776d81 Log: - Update list cmd description Changed paths: M phpdbg_prompt.c Diff: diff --git a/phpdbg_prompt.c b/phpdbg_prompt.c index f7ec941..d87fd2b 100644 --- a/phpdbg_prompt.c +++ b/phpdbg_prompt.c @@ -538,7 +538,7 @@ static const phpdbg_command_t phpdbg_prompt_commands[] = { PHPDBG_COMMAND_D(print, print something), PHPDBG_COMMAND_D(break, set breakpoint), PHPDBG_COMMAND_D(back, show backtrace), - PHPDBG_COMMAND_D(list, list specified line), + PHPDBG_COMMAND_D(list, list specified line or function), PHPDBG_COMMAND_D(clean, clean the execution environment), PHPDBG_COMMAND_D(clear, clear breakpoints), PHPDBG_COMMAND_D(help, show help menu), -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: ...: phpdbg_list.c
Commit:32acf4736bc0d59a3d41d52244ace2ba62d7c958 Author:krakjoe joe.watk...@live.co.uk Tue, 12 Nov 2013 02:52:43 + Parents: 69a8403175d9af79c5880779b11e2dfa06ed641c Branches: PHP-5.6 Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=32acf4736bc0d59a3d41d52244ace2ba62d7c958 Log: ... Changed paths: M phpdbg_list.c Diff: diff --git a/phpdbg_list.c b/phpdbg_list.c index 3bfa214..fe14b1d 100644 --- a/phpdbg_list.c +++ b/phpdbg_list.c @@ -35,7 +35,7 @@ void phpdbg_list_file(const char *filename, long count, long offset TSRMLS_DC) / if (VCWD_STAT(filename, st) == -1) { printf([Failed to stat file %s]\n, filename); - goto out; + return; } if ((fd = VCWD_OPEN(filename, O_RDONLY)) == -1) { -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: readline support #6: phpdbg.h phpdbg_prompt.c
Commit:33f0502f1978fc89fede8b5dd7a8ced79f95d115 Author:krakjoe joe.watk...@live.co.uk Tue, 12 Nov 2013 04:20:14 + Parents: 97d4052bb85915016838f5fe5ed78c43ad7cf665 Branches: PHP-5.6 Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=33f0502f1978fc89fede8b5dd7a8ced79f95d115 Log: readline support #6 Bugs: https://bugs.php.net/6 Changed paths: M phpdbg.h M phpdbg_prompt.c Diff: diff --git a/phpdbg.h b/phpdbg.h index 446b067..2a01829 100644 --- a/phpdbg.h +++ b/phpdbg.h @@ -37,6 +37,11 @@ # include TSRM.h #endif +#ifdef HAVE_LIBREADLINE +# include readline/readline.h +# include readline/history.h +#endif + #ifdef ZTS # define PHPDBG_G(v) TSRMG(phpdbg_globals_id, zend_phpdbg_globals *, v) #else diff --git a/phpdbg_prompt.c b/phpdbg_prompt.c index 1042477..e438072 100644 --- a/phpdbg_prompt.c +++ b/phpdbg_prompt.c @@ -307,7 +307,7 @@ static PHPDBG_COMMAND(break) /* {{{ */ char *line_pos = NULL; char *func_pos = NULL; -if (!expr_len) { +if (expr_len = 0L) { printf( [No expression found]\n); return FAILURE; @@ -456,7 +456,11 @@ static PHPDBG_COMMAND(help) /* {{{ */ { printf([Welcome to phpdbg, the interactive PHP debugger, v%s]\n, PHPDBG_VERSION); - if (!expr_len) { + if (expr_len 0L) { + if (phpdbg_do_cmd(phpdbg_help_commands, (char*)expr, expr_len TSRMLS_CC) == FAILURE) { + printf(failed to find help command: %s/%d\n, expr, expr_len); + } + } else { const phpdbg_command_t *prompt_command = phpdbg_prompt_commands; const phpdbg_command_t *help_command = phpdbg_help_commands; @@ -473,11 +477,8 @@ static PHPDBG_COMMAND(help) /* {{{ */ printf(\t%s\t%s\n, help_command-name, help_command-tip); ++help_command; } - } else { - if (phpdbg_do_cmd(phpdbg_help_commands, (char*)expr, expr_len TSRMLS_CC) == FAILURE) { - printf(failed to find help command: %s\n, expr); - } } + printf([Please report bugs to %s]\n, PHPDBG_ISSUES); return SUCCESS; @@ -571,19 +572,39 @@ int phpdbg_do_cmd(const phpdbg_command_t *command, char *cmd_line, size_t cmd_le int phpdbg_interactive(TSRMLS_D) /* {{{ */ { - char cmd[PHPDBG_MAX_CMD]; - - printf(phpdbg ); - +size_t cmd_len; + +#ifndef HAVE_LIBREADLINE +char cmd[PHPDBG_MAX_CMD]; + +phpdbg_interactive_enter: +printf(phpdbg ); + while (!(PHPDBG_G(flags) PHPDBG_IS_QUITTING) fgets(cmd, PHPDBG_MAX_CMD, stdin) != NULL) { - size_t cmd_len = strlen(cmd) - 1; + cmd_len = strlen(cmd) - 1; +#else +char *cmd = NULL; - if (cmd[cmd_len] == '\n') { - cmd[cmd_len] = 0; - } +phpdbg_interactive_enter: +while (!(PHPDBG_G(flags) PHPDBG_IS_QUITTING)) { +cmd = readline(phpdbg ); + +cmd_len = strlen(cmd); +#endif + + /* trim space from end of input */ + while (isspace(cmd[cmd_len-1])) + cmd_len--; + + /* ensure string is null terminated */ + cmd[cmd_len] = '\0'; - if (cmd_len) { + if (cmd cmd_len 0L) { +#ifdef HAVE_LIBREADLINE +add_history(cmd); +#endif + switch (phpdbg_do_cmd(phpdbg_prompt_commands, cmd, cmd_len TSRMLS_CC)) { case FAILURE: if (!(PHPDBG_G(flags) PHPDBG_IS_QUITTING)) { @@ -598,8 +619,6 @@ int phpdbg_interactive(TSRMLS_D) /* {{{ */ } return PHPDBG_NEXT; } - - } } else if (PHPDBG_G(last)) { PHPDBG_G(last)-handler( @@ -607,9 +626,8 @@ int phpdbg_interactive(TSRMLS_D) /* {{{ */ } if (!(PHPDBG_G(flags) PHPDBG_IS_QUITTING)) { - printf(phpdbg ); +goto phpdbg_interactive_enter; } - } return SUCCESS; -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: ...: phpdbg.png
Commit:08973a6bf5009dd14b2004259d0dd260726cd414 Author:krakjoe joe.watk...@live.co.uk Tue, 12 Nov 2013 03:04:12 + Parents: 3097c36f3042fe3f49d80eed810197036f94ab66 Branches: PHP-5.6 Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=08973a6bf5009dd14b2004259d0dd260726cd414 Log: ... Changed paths: M phpdbg.png Diff: diff --git a/phpdbg.png b/phpdbg.png index 85f9815..403652b 100644 Binary files a/phpdbg.png and b/phpdbg.png differ -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: ws: phpdbg.init.d tutorials/java/dist/phpdbg-ui.jar
Commit:f6efce9f137a94a76cbf271aefcf530584e4e10d Author:krakjoe joe.watk...@live.co.uk Sun, 1 Dec 2013 13:17:54 + Parents: 01ed1f436c4d306c316fc43e3f6b67d28b948027 Branches: PHP-5.6 Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=f6efce9f137a94a76cbf271aefcf530584e4e10d Log: ws Changed paths: M phpdbg.init.d M tutorials/java/dist/phpdbg-ui.jar Diff: diff --git a/phpdbg.init.d b/phpdbg.init.d index 1175044..cc18957 100755 --- a/phpdbg.init.d +++ b/phpdbg.init.d @@ -50,73 +50,73 @@ insanity() start() { - insanity + insanity - if [ $? -eq 1 ]; then - return $RETVAL - fi + if [ $? -eq 1 ]; then + return $RETVAL + fi -echo -n $Starting: phpdbg ${OPTIONS} on ${STDIN}/${STDOUT} -nohup ${PHPDBG} -l${STDIN}/${STDOUT} ${OPTIONS} 2${LOGFILE} 1/dev/null /dev/null -PID=$! -RETVAL=$? -if [ $RETVAL -eq 0 ]; then -echo $PID $PIDFILE -echo_success -else -echo_failure -fi -echo -[ $RETVAL = 0 ] touch ${LOCKFILE} - return $RETVAL + echo -n $Starting: phpdbg ${OPTIONS} on ${STDIN}/${STDOUT} + nohup ${PHPDBG} -l${STDIN}/${STDOUT} ${OPTIONS} 2${LOGFILE} 1/dev/null /dev/null + PID=$! + RETVAL=$? + if [ $RETVAL -eq 0 ]; then + echo $PID $PIDFILE + echo_success + else + echo_failure + fi + echo + [ $RETVAL = 0 ] touch ${LOCKFILE} + return $RETVAL } stop() { - insanity + insanity - if [ $? -eq 1 ]; then - return $RETVAL + if [ $? -eq 1 ]; then + return $RETVAL + fi + + if [ -f ${LOCKFILE} ] [ -f ${PIDFILE} ] + then + echo -n $Stopping: phpdbg ${OPTIONS} on ${STDIN}/${STDOUT} + kill -s TERM $(cat $PIDFILE) + RETVAL=$? + if [ $RETVAL -eq 0 ]; then + echo_success + else + echo_failure fi - -if [ -f ${LOCKFILE} ] [ -f ${PIDFILE} ] -then -echo -n $Stopping: phpdbg ${OPTIONS} on ${STDIN}/${STDOUT} -kill -s TERM $(cat $PIDFILE) -RETVAL=$? -if [ $RETVAL -eq 0 ]; then -echo_success -else -echo_failure -fi -echo -[ $RETVAL = 0 ] rm -f ${LOCKFILE} ${PIDFILE} -else -echo -n $Error: phpdbg not running -echo_failure -echo -[ $RETVAL = 1 ] -fi -return $RETVAL + echo + [ $RETVAL = 0 ] rm -f ${LOCKFILE} ${PIDFILE} + else + echo -n $Error: phpdbg not running + echo_failure + echo + [ $RETVAL = 1 ] + fi + return $RETVAL } ## case $1 in -start) -start -;; -stop) -stop -;; -status) -status $PHPDBG -;; -restart) -$0 stop -$0 start -;; -*) -echo usage: $0 start|stop|restart|status -;; + start) + start + ;; + stop) + stop + ;; + status) + status $PHPDBG + ;; + restart) + $0 stop + $0 start + ;; + *) + echo usage: $0 start|stop|restart|status + ;; esac ### exit $RETVAL diff --git a/tutorials/java/dist/phpdbg-ui.jar b/tutorials/java/dist/phpdbg-ui.jar index 7850d33..bf98166 100644 Binary files a/tutorials/java/dist/phpdbg-ui.jar and b/tutorials/java/dist/phpdbg-ui.jar differ -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: windows: phpdbg.h
Commit:6cc7a5784eed6fe24e9fa4982d0c01cc463d8355 Author:krakjoe joe.watk...@live.co.uk Tue, 12 Nov 2013 12:10:53 + Parents: 7f743e1fca1773a8e5deaac079386c9a8b731601 Branches: PHP-5.6 Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=6cc7a5784eed6fe24e9fa4982d0c01cc463d8355 Log: windows Changed paths: M phpdbg.h Diff: diff --git a/phpdbg.h b/phpdbg.h index 34b2e56..83b93fe 100644 --- a/phpdbg.h +++ b/phpdbg.h @@ -30,7 +30,17 @@ #include zend_ini_scanner.h #include zend_stream.h #include SAPI.h -#include php_config.h +#include fcntl.h +#include sys/types.h +#if defined(_WIN32) !defined(__MINGW32__) +# include windows.h +# include config.w32.h +#else +# include php_config.h +#endif +#ifndef O_BINARY +# define O_BINARY 0 +#endif #include php_main.h #ifdef ZTS -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: - Added check for malformed class::method syntax: phpdbg_utils.c
Commit:2e14649c92fa441eb940093d68cd54ec2919b174 Author:Felipe Pena felipe...@gmail.com Tue, 12 Nov 2013 11:39:02 -0200 Parents: b133dbefe02ab717ac7a435ce16cc471fca06827 Branches: PHP-5.6 Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=2e14649c92fa441eb940093d68cd54ec2919b174 Log: - Added check for malformed class::method syntax Changed paths: M phpdbg_utils.c Diff: diff --git a/phpdbg_utils.c b/phpdbg_utils.c index cb864c0..b509900 100644 --- a/phpdbg_utils.c +++ b/phpdbg_utils.c @@ -54,7 +54,7 @@ int phpdbg_is_class_method(const char *str, size_t len, char **class, char **met const char *sep = strstr(str, ::); size_t class_len, method_len; - if (!sep) { + if (!sep || sep == str || sep+2 == str+len-1) { return 0; } -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: - Improved breakpoint code: phpdbg_bp.c phpdbg_bp.h phpdbg_prompt.c phpdbg_utils.c phpdbg_utils.h
Commit:af90b6d5c737646fa2b1f30d2f85a67fd8d770a7 Author:Felipe Pena felipe...@gmail.com Tue, 12 Nov 2013 11:33:51 -0200 Parents: fdf26eaa0f7daaecfb05699e6012d140d1cdbaa8 Branches: PHP-5.6 Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=af90b6d5c737646fa2b1f30d2f85a67fd8d770a7 Log: - Improved breakpoint code Changed paths: M phpdbg_bp.c M phpdbg_bp.h M phpdbg_prompt.c M phpdbg_utils.c M phpdbg_utils.h Diff: diff --git a/phpdbg_bp.c b/phpdbg_bp.c index aa7c630..43f5fa7 100644 --- a/phpdbg_bp.c +++ b/phpdbg_bp.c @@ -101,16 +101,15 @@ void phpdbg_set_breakpoint_symbol(const char *name TSRMLS_DC) /* {{{ */ } } /* }}} */ -void phpdbg_set_breakpoint_method(const char* class_name, - size_t class_len, - const char* func_name, - size_t func_len TSRMLS_DC) /* {{{ */ +void phpdbg_set_breakpoint_method(const char* class_name, const char* func_name TSRMLS_DC) /* {{{ */ { HashTable class_breaks, *class_table; +size_t class_len = strlen(class_name); +size_t func_len = strlen(func_name); -if (zend_hash_find(PHPDBG_G(bp)[PHPDBG_BREAK_METHOD], class_name, class_len, (void**)class_table) != SUCCESS) { -zend_hash_init( -class_breaks, 8, NULL, phpdbg_class_breaks_dtor, 0); +if (zend_hash_find(PHPDBG_G(bp)[PHPDBG_BREAK_METHOD], class_name, + class_len, (void**)class_table) != SUCCESS) { +zend_hash_init(class_breaks, 8, NULL, phpdbg_class_breaks_dtor, 0); zend_hash_update( PHPDBG_G(bp)[PHPDBG_BREAK_METHOD], class_name, class_len, @@ -128,7 +127,9 @@ void phpdbg_set_breakpoint_method(const char* class_name, new_break.func_len = func_len; new_break.id = PHPDBG_G(bp_count)++; -zend_hash_update(class_table, func_name, func_len, new_break, sizeof(phpdbg_breakmethod_t), NULL); +zend_hash_update(class_table, func_name, func_len, + new_break, sizeof(phpdbg_breakmethod_t), NULL); + printf( %sBreakpoint #%d added at %s::%s%s\n, PHPDBG_BOLD_LINE(TSRMLS_C), diff --git a/phpdbg_bp.h b/phpdbg_bp.h index 7636d8b..61d5004 100644 --- a/phpdbg_bp.h +++ b/phpdbg_bp.h @@ -62,7 +62,7 @@ typedef struct _phpdbg_breakline_t { void phpdbg_set_breakpoint_file(const char*, long TSRMLS_DC); void phpdbg_set_breakpoint_symbol(const char* TSRMLS_DC); -void phpdbg_set_breakpoint_method(const char*, size_t, const char*, size_t TSRMLS_DC); +void phpdbg_set_breakpoint_method(const char*, const char* TSRMLS_DC); void phpdbg_set_breakpoint_opline(zend_ulong TSRMLS_DC); void phpdbg_set_breakpoint_opline_ex(phpdbg_opline_ptr_t TSRMLS_DC); diff --git a/phpdbg_prompt.c b/phpdbg_prompt.c index 54be3aa..f12567c 100644 --- a/phpdbg_prompt.c +++ b/phpdbg_prompt.c @@ -329,8 +329,7 @@ static PHPDBG_COMMAND(print) /* {{{ */ static PHPDBG_COMMAND(break) /* {{{ */ { - char *line_pos = NULL; -char *func_pos = NULL; + char *line_pos; if (expr_len = 0L) { printf( @@ -338,10 +337,17 @@ static PHPDBG_COMMAND(break) /* {{{ */ return FAILURE; } -line_pos = strchr(expr, ':'); +line_pos = strchr(expr, ':'); if (line_pos) { - if (!(func_pos=strchr(line_pos+1, ':'))) { + char *class; + char *func; + + /* break class::method */ + if (phpdbg_is_class_method(expr, expr_len, class, func)) { + phpdbg_set_breakpoint_method(class, func TSRMLS_CC); + } else { + /* break file:line */ char path[MAXPATHLEN], resolved_name[MAXPATHLEN]; long line_num = strtol(line_pos+1, NULL, 0); @@ -350,43 +356,26 @@ static PHPDBG_COMMAND(break) /* {{{ */ path[line_pos - expr] = 0; if (expand_filepath(path, resolved_name TSRMLS_CC) == NULL) { - printf(%sFailed to expand path %s%s\n, PHPDBG_RED_LINE(TSRMLS_C), path, PHPDBG_END_LINE(TSRMLS_C)); + printf(%sFailed to expand path %s%s\n, + PHPDBG_RED_LINE(TSRMLS_C), path, PHPDBG_END_LINE(TSRMLS_C)); return FAILURE; } phpdbg_set_breakpoint_file(resolved_name, line_num TSRMLS_CC); } else { - printf(%sNo line specified in expression %s%s\n, PHPDBG_RED_LINE(TSRMLS_C), expr, PHPDBG_END_LINE(TSRMLS_C)); - return FAILURE; - } - } else { - char *class; - char *func; - - size_t func_len = strlen(func_pos+1), - class_len = (line_pos - expr); - - if (func_len) { -
[PHP-CVS] com php-src: init.d for redhat and derivatives: phpdbg.init.d
Commit:800ec7836b3a095869368fb60c81fbd7cf158337 Author:krakjoe joe.watk...@live.co.uk Sun, 1 Dec 2013 12:48:43 + Parents: 723b721fb9a703c4a67cf9afa322745ff797feb3 Branches: PHP-5.6 Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=800ec7836b3a095869368fb60c81fbd7cf158337 Log: init.d for redhat and derivatives Changed paths: A phpdbg.init.d Diff: diff --git a/phpdbg.init.d b/phpdbg.init.d new file mode 100755 index 000..4b69260 --- /dev/null +++ b/phpdbg.init.d @@ -0,0 +1,88 @@ + +# File: /etc/init.d/phpdbg # +# Author: krakjoe# +# Purpose: Daemonize phpdbg automatically on boot # +# chkconfig:234507 09 # +# description:Starts, stops and restarts phpdbg daemon # + +LOCKFILE=/var/lock/subsys/phpdbg +PIDFILE=/var/run/phpdbg.pid +STDIN=4000 +STDOUT=8000 + +# Either set path to phpdbg here or rely on phpdbg in PATH# + +if [ x$PHPDBG == x ]; then + PHPDBG=$(which phpdbg) +fi + +# Options to pass to phpdbg upon boot # + +OPTIONS= +LOGFILE=/var/log/phpdbg.log + +# STOP EDITING STOP EDITING STOP EDITING STOP EDITING # + +. /etc/rc.d/init.d/functions +RETVAL=1 + + +start() +{ +echo -n $Starting: phpdbg ${OPTIONS} on ${STDIN}/${STDOUT} +nohup ${PHPDBG} -l${STDIN}/${STDOUT} ${OPTIONS} 2${LOGFILE} 1/dev/null /dev/null +PID=$! +RETVAL=$? +if [ $RETVAL -eq 0 ]; then +echo $PID $PIDFILE +echo_success +else +echo_failure +fi +echo +[ $RETVAL = 0 ] touch ${LOCKFILE} + return $RETVAL +} +stop() +{ +if [ -f ${LOCKFILE} ] [ -f ${PIDFILE} ] +then +echo -n $Stopping: phpdbg ${OPTIONS} on ${STDIN}/${STDOUT} +kill -s TERM $(cat $PIDFILE) +RETVAL=$? +if [ $RETVAL -eq 0 ]; then +echo_success +else +echo_failure +fi +echo +[ $RETVAL = 0 ] rm -f ${LOCKFILE} ${PIDFILE} +else +echo -n $Error: phpdbg not running +echo_failure +echo +[ $RETVAL = 1 ] +fi +return $RETVAL +} +## +case $1 in +start) +start +;; +stop) +stop +;; +status) +status $PHPDBG +;; +restart) +$0 stop +$0 start +;; +*) +echo usage: $0 start|stop|restart|status +;; +esac +### +exit $RETVAL -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php