Skip to content

Commit dd18a0f

Browse files
committed
Add --enable-phpdbg-debug option on Windows
This enables outputting additional debugging messages when running phpdbg for developing and troubleshooting phpdbg itself. Option was already added in Autotools and this adds it also to Windows build system.
1 parent 3b951e7 commit dd18a0f

File tree

4 files changed

+18
-6
lines changed

4 files changed

+18
-6
lines changed

UPGRADING.INTERNALS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,7 @@ PHP 8.4 INTERNALS UPGRADE NOTES
159159
- The HAVE_OPENSSL symbol has been removed.
160160
- The HAVE_OPENSSL_EXT symbol is now consistently defined to value 1 whether
161161
the openssl extension is available either as shared or built statically.
162+
- Added configure option --enable-phpdbg-debug to build phpdbg in debug mode.
162163

163164
========================
164165
3. Module changes

sapi/phpdbg/config.m4

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@ PHP_ARG_ENABLE([phpdbg],
88
PHP_ARG_ENABLE([phpdbg-debug],
99
[for phpdbg debug build],
1010
[AS_HELP_STRING([--enable-phpdbg-debug],
11-
[Build phpdbg in debug mode])],
11+
[Build phpdbg in debug mode to enable additional diagnostic output for
12+
developing and troubleshooting phpdbg itself])],
1213
[no],
1314
[no])
1415

@@ -23,11 +24,8 @@ if test "$PHP_PHPDBG" != "no"; then
2324
AC_HEADER_TIOCGWINSZ
2425
AC_DEFINE(HAVE_PHPDBG, 1, [ ])
2526

26-
if test "$PHP_PHPDBG_DEBUG" != "no"; then
27-
AC_DEFINE(PHPDBG_DEBUG, 1, [ ])
28-
else
29-
AC_DEFINE(PHPDBG_DEBUG, 0, [ ])
30-
fi
27+
AS_VAR_IF([PHP_PHPDBG_DEBUG], [no],,
28+
[PHP_PHPDBG_CFLAGS="$PHP_PHPDBG_CFLAGS -DPHPDBG_DEBUG=1"])
3129

3230
PHP_PHPDBG_CFLAGS="-DZEND_ENABLE_STATIC_TSRMLS_CACHE=1"
3331
PHP_PHPDBG_FILES="phpdbg.c phpdbg_parser.c phpdbg_lexer.c phpdbg_prompt.c phpdbg_help.c phpdbg_break.c phpdbg_print.c phpdbg_bp.c phpdbg_list.c phpdbg_utils.c phpdbg_info.c phpdbg_cmd.c phpdbg_set.c phpdbg_frame.c phpdbg_watch.c phpdbg_btree.c phpdbg_sigsafe.c phpdbg_io.c phpdbg_out.c"

sapi/phpdbg/config.w32

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
ARG_ENABLE('phpdbg', 'Build phpdbg', 'no');
22
ARG_ENABLE('phpdbgs', 'Build phpdbg shared', 'no');
3+
ARG_ENABLE('phpdbg-debug', 'Build phpdbg in debug mode for phpdbg development', 'no');
34

45
PHPDBG_SOURCES='phpdbg.c phpdbg_prompt.c phpdbg_cmd.c phpdbg_info.c phpdbg_help.c phpdbg_break.c ' +
56
'phpdbg_print.c phpdbg_bp.c phpdbg_list.c phpdbg_utils.c ' +
@@ -17,10 +18,18 @@ if (PHP_PHPDBG == "yes") {
1718
ADD_FLAG("LIBS_PHPDBG", "ws2_32.lib user32.lib");
1819
ADD_FLAG("CFLAGS_PHPDBG", "/D YY_NO_UNISTD_H");
1920
ADD_FLAG("LDFLAGS_PHPDBG", "/stack:8388608");
21+
22+
if(PHP_PHPDBG_DEBUG == "yes") {
23+
ADD_FLAG("CFLAGS_PHPDBG", "/D PHPDBG_DEBUG=1");
24+
}
2025
}
2126

2227
if (PHP_PHPDBGS == "yes") {
2328
SAPI('phpdbgs', PHPDBG_SOURCES, PHPDBG_DLL, '/D PHP_PHPDBG_EXPORTS /I win32');
2429
ADD_FLAG("LIBS_PHPDBGS", "ws2_32.lib user32.lib");
2530
ADD_FLAG("CFLAGS_PHPDBGS", "/D YY_NO_UNISTD_H");
31+
32+
if(PHP_PHPDBG_DEBUG == "yes") {
33+
ADD_FLAG("CFLAGS_PHPDBGS", "/D PHPDBG_DEBUG=1");
34+
}
2635
}

sapi/phpdbg/phpdbg_out.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,10 @@
1919
#ifndef PHPDBG_OUT_H
2020
#define PHPDBG_OUT_H
2121

22+
#ifndef PHPDBG_DEBUG
23+
# define PHPDBG_DEBUG 0
24+
#endif
25+
2226
/**
2327
* Error/notice/formatting helpers
2428
*/

0 commit comments

Comments
 (0)