logo       

xdebug xdebug/xdebug_handler_dbgp.c - Implemented request #200: Add the ret: msg#00080

Subject: xdebug xdebug/xdebug_handler_dbgp.c - Implemented request #200: Add the retrieval of a file's execution lines in
Date:      Tue Jul 31 23:44:55 CEST 2007
User:      Derick Rethans
Directory: xdebug

Log Message:
[4.00]
- Implemented request #200: Add the retrieval of a file's execution lines in
  DBGp. I added a new un-official method called xcmd_get_executable_lines
  which requires the stack depth as argument (-d). You can only fetch
  this information for stack frames as it needs an available op-array which
  is only available when a function is executed.

Modified files:
           xdebug/xdebug_handler_dbgp.c     (version: 1.126)
[FILE: /xdebug/xdebug_handler_dbgp.c]

===================================================================
RCS file: cvstemp,v
retrieving revision 1.125
retrieving revision 1.126
diff -u -r1.125 -r1.126
--- xdebug/xdebug_handler_dbgp.c:1.125 Sun Jul 08 11:06:31 2007 GMT
+++ xdebug/xdebug_handler_dbgp.c Tue Jul 31 19:44:55 2007 GMT
@@ -33,6 +33,7 @@
 #include "php_globals.h"
 #include "php_xdebug.h"
 #include "xdebug_private.h"
+#include "xdebug_code_coverage.h"
 #include "xdebug_com.h"
 #include "xdebug_handler_dbgp.h"
 #include "xdebug_hash.h"
@@ -166,6 +167,7 @@
 
 /* Non standard comments */
 DBGP_FUNC(xcmd_profiler_name_get);
+DBGP_FUNC(xcmd_get_executable_lines);
 
 /*****************************************************************************
 ** Dispatcher tables for supported debug commands
@@ -207,7 +209,8 @@
        DBGP_CONT_FUNC_ENTRY(detach,       XDEBUG_DBGP_NONE)
 
        /* Non standard functions */
-       DBGP_FUNC_ENTRY(xcmd_profiler_name_get, XDEBUG_DBGP_POST_MORTEM)
+       DBGP_FUNC_ENTRY(xcmd_profiler_name_get,    XDEBUG_DBGP_POST_MORTEM)
+       DBGP_FUNC_ENTRY(xcmd_get_executable_lines, XDEBUG_DBGP_NONE)
        { NULL, NULL }
 };
 
@@ -1961,6 +1964,34 @@
        }
 }
 
+DBGP_FUNC(xcmd_get_executable_lines)
+{
+       function_stack_entry *fse;
+       int                   i, depth;
+       xdebug_xml_node      *lines, *line;
+
+       if (!CMD_OPTION('d')) {
+               RETURN_RESULT(XG(status), XG(reason), 
XDEBUG_ERROR_INVALID_ARGS);
+       }
+
+       depth = strtol(CMD_OPTION('d'), NULL, 10);
+       if (depth >= 0 && depth < XG(level)) {
+               fse = xdebug_get_stack_frame(depth TSRMLS_CC);
+       } else {
+               RETURN_RESULT(XG(status), XG(reason), 
XDEBUG_ERROR_STACK_DEPTH_INVALID);
+       }
+
+       lines = xdebug_xml_node_init("xdebug:lines");
+       for (i = 0; i < fse->op_array->size; i++ ) {
+               if (fse->op_array->opcodes[i].opcode == ZEND_EXT_STMT ) {
+                       line = xdebug_xml_node_init("xdebug:line");
+                       xdebug_xml_add_attribute_ex(line, "lineno", 
xdebug_sprintf("%lu", fse->op_array->opcodes[i].lineno), 0, 1);
+                       xdebug_xml_add_child(lines, line);
+               }
+       }
+       xdebug_xml_add_child(*retval, lines);
+}
+
 
 /*****************************************************************************
 ** Parsing functions
@@ -2197,7 +2228,7 @@
 
 char *xdebug_dbgp_get_revision(void)
 {
-       return "$Revision: 1.125 $";
+       return "$Revision: 1.126 $";
 }
 
 static int xdebug_dbgp_cmdloop(xdebug_con *context TSRMLS_DC)
<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

Recently Viewed:
audio.irate.dev...    yellowdog.gener...    ietf.ips/2002-0...    xfree86.fonts/2...    busybox/2003-07...    emacs.jdee/2004...    linux.mandrake....    hardware.microc...    user-groups.lin...    science.analysi...    version-control...    db.filemaker.de...    cluster.openmos...    mail.eyebrowse....    text.xml.xerces...    kde.devel.kwrit...    finance.moneyda...    gcc.regression/...    network.routing...    os.freebsd.deve...    recreation.radi...    qnx.openqnx.dev...    python.xml/2002...   
Home | blog view | USPTO Patent Archive | advertise | OSDir is an inevitable website. super tiny logo

Free Magazines

Cisco News
Receive a free quarterly e-newsletter with exclusive articles on how Cisco IT uses its own products and solutions to enable the business.
subscribe

Systems Management News, the newspaper for IT systems administration and data center managers! Each issue of Systems Management News is chock-full of news and analysis to help you understand what's happening in your field.
subscribe

The Enterprise Newsweekly eWeek is the essential technology information source for builders of e-business.
subscribe

Oracle Magazine Oracle Magazine contains technology strategy articles, sample code, tips, Oracle and partner news, how to articles for developers and DBAs, and more. Oracle (NASDAQ: ORCL) is the world's largest enterprise software company.
subscribe

Total Telecom Total Telecom is "The Economist of the communications industry".
subscribe