[xdebug-dev] svn: /xdebug/trunk/ xdebug.c xdebug_handler_dbgp.c xdebug_handlers.h

From: Derick Rethans <derick[@]derickrethans.nl>
Date: Tue, 29 Dec 2009 21:28:30 +0000

derick Tue, 29 Dec 2009 21:28:30 +0000

Revision: http://svn.php.net/viewvc?view=revision&revision=3180

Log:
- Fixed bug #411: Class/function breakpoint setting does not follow the specs.

Changed paths:
    U xdebug/trunk/xdebug.c
    U xdebug/trunk/xdebug_handler_dbgp.c
    U xdebug/trunk/xdebug_handlers.h

Modified: xdebug/trunk/xdebug.c
===================================================================
--- xdebug/trunk/xdebug.c 2009-12-29 17:41:37 UTC (rev 3179)
+++ xdebug/trunk/xdebug.c 2009-12-29 21:28:30 UTC (rev 3180)
@@ -1541,9 +1541,13 @@
         }
         /* class->function breakpoints */
         else if (fse->function.type == XFUNC_MEMBER || fse->function.type == XFUNC_STATIC_MEMBER) {
- tmp_name = xdebug_sprintf("%s::%s", fse->function.class, fse->function.function);
+ if (fse->function.type == XFUNC_MEMBER) {
+ tmp_name = xdebug_sprintf("%s->%s", fse->function.class, fse->function.function);
+ } else if( fse->function.type == XFUNC_STATIC_MEMBER) {
+ tmp_name = xdebug_sprintf("%s::%s", fse->function.class, fse->function.function);
+ }

- if (xdebug_hash_find(XG(context).class_breakpoints, tmp_name, strlen(tmp_name), (void *) &extra_brk_info)) {
+ if (xdebug_hash_find(XG(context).function_breakpoints, tmp_name, strlen(tmp_name), (void *) &extra_brk_info)) {
                         /* Yup, breakpoint found, call handler if the breakpoint is not
                          * disabled AND handle_hit_value is happy */
                         if (!extra_brk_info->disabled && (extra_brk_info->function_break_type == breakpoint_type)) {

Modified: xdebug/trunk/xdebug_handler_dbgp.c
===================================================================
--- xdebug/trunk/xdebug_handler_dbgp.c 2009-12-29 17:41:37 UTC (rev 3179)
+++ xdebug/trunk/xdebug_handler_dbgp.c 2009-12-29 21:28:30 UTC (rev 3180)
@@ -860,12 +860,6 @@
                         }
                         break;

- case BREAKPOINT_TYPE_METHOD:
- if (xdebug_hash_find(XG(context).class_breakpoints, hkey, strlen(hkey), (void *) &brk)) {
- return brk;
- }
- break;
-
                 case BREAKPOINT_TYPE_EXCEPTION:
                         if (xdebug_hash_find(XG(context).exception_breakpoints, hkey, strlen(hkey), (void *) &brk)) {
                                 return brk;
@@ -909,12 +903,6 @@
                         }
                         break;

- case BREAKPOINT_TYPE_METHOD:
- if (xdebug_hash_delete(XG(context).class_breakpoints, hkey, strlen(hkey))) {
- return SUCCESS;
- }
- break;
-
                 case BREAKPOINT_TYPE_EXCEPTION:
                         if (xdebug_hash_delete(XG(context).exception_breakpoints, hkey, strlen(hkey))) {
                                 return SUCCESS;
@@ -1136,8 +1124,8 @@

                         brk_info->classname = xdstrdup(CMD_OPTION('a'));
                         tmp_name = xdebug_sprintf("%s::%s", CMD_OPTION('a'), CMD_OPTION('m'));
- res = xdebug_hash_add(context->class_breakpoints, tmp_name, strlen(tmp_name), (void*) brk_info);
- brk_id = breakpoint_admin_add(context, BREAKPOINT_TYPE_METHOD, tmp_name);
+ res = xdebug_hash_add(context->function_breakpoints, tmp_name, strlen(tmp_name), (void*) brk_info);
+ brk_id = breakpoint_admin_add(context, BREAKPOINT_TYPE_FUNCTION, tmp_name);
                         xdfree(tmp_name);

                         if (!res) {
@@ -2419,7 +2407,6 @@
         context->breakpoint_list = xdebug_hash_alloc(64, (xdebug_hash_dtor) xdebug_hash_admin_dtor);
         context->function_breakpoints = xdebug_hash_alloc(64, (xdebug_hash_dtor) xdebug_hash_brk_dtor);
         context->exception_breakpoints = xdebug_hash_alloc(64, (xdebug_hash_dtor) xdebug_hash_brk_dtor);
- context->class_breakpoints = xdebug_hash_alloc(64, (xdebug_hash_dtor) xdebug_hash_brk_dtor);
         context->line_breakpoints = xdebug_llist_alloc((xdebug_llist_dtor) xdebug_llist_brk_dtor);
         context->eval_id_lookup = xdebug_hash_alloc(64, (xdebug_hash_dtor) xdebug_hash_eval_info_dtor);
         context->eval_id_sequence = 0;
@@ -2468,7 +2455,6 @@
         xdfree(context->options);
         xdebug_hash_destroy(context->function_breakpoints);
         xdebug_hash_destroy(context->exception_breakpoints);
- xdebug_hash_destroy(context->class_breakpoints);
         xdebug_hash_destroy(context->eval_id_lookup);
         xdebug_llist_destroy(context->line_breakpoints, NULL);
         xdebug_hash_destroy(context->breakpoint_list);

Modified: xdebug/trunk/xdebug_handlers.h
===================================================================
--- xdebug/trunk/xdebug_handlers.h 2009-12-29 17:41:37 UTC (rev 3179)
+++ xdebug/trunk/xdebug_handlers.h 2009-12-29 21:28:30 UTC (rev 3180)
@@ -41,7 +41,6 @@

 #define BREAKPOINT_TYPE_LINE 1
 #define BREAKPOINT_TYPE_FUNCTION 2
-#define BREAKPOINT_TYPE_METHOD 3
 #define BREAKPOINT_TYPE_EXCEPTION 4

 struct _xdebug_brk_admin {
@@ -58,7 +57,6 @@
         char *program_name;
         xdebug_hash *breakpoint_list;
         xdebug_hash *function_breakpoints;
- xdebug_hash *class_breakpoints;
         xdebug_hash *eval_id_lookup;
         int eval_id_sequence;
         xdebug_llist *line_breakpoints;
Received on Tue Dec 29 2009 - 21:28:30 GMT

This archive was generated by hypermail 2.2.0 : Sun Jun 24 2018 - 04:00:03 BST