Skip to content

Add --enable-phpdbg-debug option on Windows #14568

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jun 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions UPGRADING.INTERNALS
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,7 @@ PHP 8.4 INTERNALS UPGRADE NOTES
- The HAVE_OPENSSL symbol has been removed.
- The HAVE_OPENSSL_EXT symbol is now consistently defined to value 1 whether
the openssl extension is available either as shared or built statically.
- Added configure option --enable-phpdbg-debug to build phpdbg in debug mode.

========================
3. Module changes
Expand Down
12 changes: 5 additions & 7 deletions sapi/phpdbg/config.m4
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ PHP_ARG_ENABLE([phpdbg],
PHP_ARG_ENABLE([phpdbg-debug],
[for phpdbg debug build],
[AS_HELP_STRING([--enable-phpdbg-debug],
[Build phpdbg in debug mode])],
[Build phpdbg in debug mode to enable additional diagnostic output for
developing and troubleshooting phpdbg itself])],
[no],
[no])

Expand All @@ -23,13 +24,10 @@ if test "$PHP_PHPDBG" != "no"; then
AC_HEADER_TIOCGWINSZ
AC_DEFINE(HAVE_PHPDBG, 1, [ ])

if test "$PHP_PHPDBG_DEBUG" != "no"; then
AC_DEFINE(PHPDBG_DEBUG, 1, [ ])
else
AC_DEFINE(PHPDBG_DEBUG, 0, [ ])
fi

PHP_PHPDBG_CFLAGS="-DZEND_ENABLE_STATIC_TSRMLS_CACHE=1"
AS_VAR_IF([PHP_PHPDBG_DEBUG], [no],,
[AS_VAR_APPEND([PHP_PHPDBG_CFLAGS], [" -DPHPDBG_DEBUG=1"])])

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"

AC_MSG_CHECKING([for phpdbg and readline integration])
Expand Down
10 changes: 10 additions & 0 deletions sapi/phpdbg/config.w32
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
ARG_ENABLE('phpdbg', 'Build phpdbg', 'no');
ARG_ENABLE('phpdbgs', 'Build phpdbg shared', 'no');
ARG_ENABLE('phpdbg-debug', 'Build phpdbg in debug mode to enable additional \
diagnostic output for developing and troubleshooting phpdbg itself', '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_list.c phpdbg_utils.c ' +
Expand All @@ -17,10 +19,18 @@ if (PHP_PHPDBG == "yes") {
ADD_FLAG("LIBS_PHPDBG", "ws2_32.lib user32.lib");
ADD_FLAG("CFLAGS_PHPDBG", "/D YY_NO_UNISTD_H");
ADD_FLAG("LDFLAGS_PHPDBG", "/stack:8388608");

if(PHP_PHPDBG_DEBUG == "yes") {
ADD_FLAG("CFLAGS_PHPDBG", "/D PHPDBG_DEBUG=1");
}
}

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");
ADD_FLAG("CFLAGS_PHPDBGS", "/D YY_NO_UNISTD_H");

if(PHP_PHPDBG_DEBUG == "yes") {
ADD_FLAG("CFLAGS_PHPDBGS", "/D PHPDBG_DEBUG=1");
}
}
4 changes: 4 additions & 0 deletions sapi/phpdbg/phpdbg_out.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@
#ifndef PHPDBG_OUT_H
#define PHPDBG_OUT_H

#ifndef PHPDBG_DEBUG
# define PHPDBG_DEBUG 0
#endif

/**
* Error/notice/formatting helpers
*/
Expand Down
3 changes: 2 additions & 1 deletion win32/build/confutils.js
Original file line number Diff line number Diff line change
Expand Up @@ -455,7 +455,8 @@ can be built that way. \

var snapshot_build_exclusions = new Array(
'debug', 'lzf-better-compression', 'php-build', 'snapshot-template', 'zts',
'ipv6', 'fd-setsize', 'pgi', 'pgo', 'all-shared', 'config-profile', 'sanitizer'
'ipv6', 'fd-setsize', 'pgi', 'pgo', 'all-shared', 'config-profile', 'sanitizer',
'phpdbg-debug'
);
var force;

Expand Down
Loading