Skip to content
Permalink
Browse files

Fixed issue #1720: Remove superfluous xdebug.remote_handler setting

  • Loading branch information
derickr committed Dec 2, 2019
1 parent a330d7b commit 3e74cb6776bffd94a6636e6f76c39b8efad57789
@@ -52,6 +52,7 @@
#include "com.h"

#include "debugger_private.h"
#include "handler_dbgp.h"
#include "lib/private.h"

ZEND_EXTERN_MODULE_GLOBALS(xdebug)
@@ -348,11 +349,7 @@ static void xdebug_init_debugger()
xdebug_open_log();

/* Get handler from mode */
XG_DBG(context).handler = xdebug_handler_get(XINI_DBG(remote_handler));
if (!XG_DBG(context).handler) {
zend_error(E_WARNING, "The remote debug handler '%s' is not supported", XINI_DBG(remote_handler));
return;
}
XG_DBG(context).handler = &xdebug_handler_dbgp;

if (XINI_DBG(remote_connect_back)) {
zval *remote_addr = NULL;
@@ -475,20 +475,10 @@ void xdebug_debugger_minit(void)

void xdebug_debugger_minfo(void)
{
xdebug_remote_handler_info *ptr = xdebug_handlers_get();

php_info_print_table_start();
php_info_print_table_header(2, "Debugger", "enabled");
php_info_print_table_row(2, "IDE Key", XG_DBG(ide_key));
php_info_print_table_end();

php_info_print_table_start();
php_info_print_table_header(1, "Supported protocols");
while (ptr->name) {
php_info_print_table_row(1, ptr->description);
ptr++;
}
php_info_print_table_end();
}

void xdebug_debugger_rinit(void)
@@ -46,7 +46,6 @@ typedef struct _xdebug_debugger_settings_t {
zend_long remote_port; /* 9000 */
char *remote_host; /* localhost */
long remote_mode; /* XDEBUG_NONE, XDEBUG_JIT, XDEBUG_REQ */
char *remote_handler; /* php3, gdb, dbgp */
zend_bool remote_autostart; /* Disables the requirement for XDEBUG_SESSION_START */
zend_bool remote_connect_back; /* connect back to the HTTP requestor */
char *remote_log; /* Filename to log protocol communication to */
@@ -58,6 +58,19 @@

ZEND_EXTERN_MODULE_GLOBALS(xdebug)

xdebug_remote_handler xdebug_handler_dbgp = {
xdebug_dbgp_init,
xdebug_dbgp_deinit,
xdebug_dbgp_error,
xdebug_dbgp_break_on_line,
xdebug_dbgp_breakpoint,
xdebug_dbgp_resolve_breakpoints,
xdebug_dbgp_stream_output,
xdebug_dbgp_notification,
xdebug_dbgp_log,
xdebug_dbgp_register_eval_id,
};

static char *create_eval_key_file(char *filename, int lineno);
static char *create_eval_key_id(int id);
static void line_breakpoint_resolve_helper(xdebug_con *context, function_stack_entry *fse, xdebug_brk_info *brk_info);
@@ -110,17 +110,6 @@ int xdebug_dbgp_notification(xdebug_con *context, const char *file, long lineno,
void XDEBUG_ATTRIBUTE_FORMAT(printf, 2, 3) xdebug_dbgp_log(int log_level, const char *fmt, ...);
int xdebug_dbgp_register_eval_id(xdebug_con *context, function_stack_entry *fse);

#define xdebug_handler_dbgp { \
xdebug_dbgp_init, \
xdebug_dbgp_deinit, \
xdebug_dbgp_error, \
xdebug_dbgp_break_on_line, \
xdebug_dbgp_breakpoint, \
xdebug_dbgp_resolve_breakpoints, \
xdebug_dbgp_stream_output, \
xdebug_dbgp_notification, \
xdebug_dbgp_log, \
xdebug_dbgp_register_eval_id, \
}
extern xdebug_remote_handler xdebug_handler_dbgp;

#endif
@@ -22,29 +22,6 @@
#include "handler_dbgp.h"
#include "lib/mm.h"

xdebug_remote_handler_info handlers[] = {
{ "dbgp", "DBGp - Common DeBuGger Protocol", xdebug_handler_dbgp },
{ 0, NULL, { NULL, NULL, NULL, NULL, NULL, NULL, NULL } }
};

xdebug_remote_handler* xdebug_handler_get(char* mode)
{
xdebug_remote_handler_info *ptr = handlers;

while (ptr->name) {
if (strcmp(mode, ptr->name) == 0) {
return &ptr->handler;
}
ptr++;
}
return NULL;
}

xdebug_remote_handler_info* xdebug_handlers_get(void)
{
return handlers;
}

void xdebug_brk_info_dtor(xdebug_brk_info *brk_info)
{
if (brk_info->classname) {
@@ -151,15 +151,6 @@ struct _xdebug_remote_handler {
int (*register_eval_id)(xdebug_con *h, function_stack_entry *fse);
};

struct _xdebug_remote_handler_info {
const char *name;
const char *description;
xdebug_remote_handler handler;
};

xdebug_remote_handler* xdebug_handler_get(char* mode);
xdebug_remote_handler_info* xdebug_handlers_get(void);

void xdebug_brk_info_dtor(xdebug_brk_info *brk);
void xdebug_llist_brk_dtor(void *dummy, xdebug_brk_info *brk);
void xdebug_hash_brk_dtor(xdebug_brk_info *brk);

This file was deleted.

@@ -330,7 +330,6 @@ PHP_INI_BEGIN()

/* Remote debugger settings */
STD_PHP_INI_BOOLEAN("xdebug.remote_enable", "0", PHP_INI_SYSTEM|PHP_INI_PERDIR, OnUpdateBool, settings.debugger.remote_enable, zend_xdebug_globals, xdebug_globals)
STD_PHP_INI_ENTRY("xdebug.remote_handler", "dbgp", PHP_INI_ALL, OnUpdateString, settings.debugger.remote_handler, zend_xdebug_globals, xdebug_globals)
STD_PHP_INI_ENTRY("xdebug.remote_host", "localhost", PHP_INI_ALL, OnUpdateString, settings.debugger.remote_host, zend_xdebug_globals, xdebug_globals)
PHP_INI_ENTRY("xdebug.remote_mode", "req", PHP_INI_ALL, OnUpdateDebugMode)
STD_PHP_INI_ENTRY("xdebug.remote_port", "9000", PHP_INI_ALL, OnUpdateLong, settings.debugger.remote_port, zend_xdebug_globals, xdebug_globals)

0 comments on commit 3e74cb6

Please sign in to comment.
You can’t perform that action at this time.