[xdebug-dev] xdebug xdebug/xdebug_handler_dbgp.c - Fixed bug #54: source command did not except missing -f parameter.

From: Derick Rethans <derick[@]derickrethans.nl>
Date: Thu, 8 Apr 2004 23:47:43 +0200

Date: Thu Apr 8 23:47:43 CEST 2004
User: Derick Rethans
Directory: xdebug

Log Message:
[0.25]
- Fixed bug #54: source command did not except missing -f parameter.

Modified files:
           xdebug/xdebug_handler_dbgp.c (version: 1.36)

[FILE: /xdebug/xdebug_handler_dbgp.c]

===================================================================
RCS file: cvstemp,v
retrieving revision 1.35
retrieving revision 1.36
diff -u -r1.35 -r1.36
--- xdebug/xdebug_handler_dbgp.c:1.35 Sun Apr 04 19:24:58 2004 GMT
+++ xdebug/xdebug_handler_dbgp.c Thu Apr 08 19:47:43 2004 GMT
@@ -810,15 +810,23 @@
 {
         char *source, *encoded_source;
         int new_len;
+ char *filename;
+ function_stack_entry *fse;
 
         if (!CMD_OPTION('f')) {
- RETURN_RESULT(XG(status), XG(reason), XDEBUG_ERROR_INVALID_ARGS);
+ if ((fse = xdebug_get_stack_tail(TSRMLS_C))) {
+ filename = fse->filename;
+ } else {
+ RETURN_RESULT(XG(status), XG(reason), XDEBUG_ERROR_STACK_DEPTH_INVALID);
+ }
+ } else {
+ filename = CMD_OPTION('f');
         }
 
         if (CMD_OPTION('b') && CMD_OPTION('e')) {
- source = return_source(CMD_OPTION('f'), strtol(CMD_OPTION('b'), NULL, 10), strtol(CMD_OPTION('e'), NULL, 10) TSRMLS_CC);
+ source = return_source(filename, strtol(CMD_OPTION('b'), NULL, 10), strtol(CMD_OPTION('e'), NULL, 10) TSRMLS_CC);
         } else {
- source = return_source(CMD_OPTION('f'), 0, 999999 TSRMLS_CC);
+ source = return_source(filename, 0, 999999 TSRMLS_CC);
         }
         if (!source) {
                 RETURN_RESULT(XG(status), XG(reason), XDEBUG_ERROR_CANT_OPEN_FILE);
@@ -1308,7 +1316,7 @@
 
 char *xdebug_dbgp_get_revision(void)
 {
- return "$Revision: 1.35 $";
+ return "$Revision: 1.36 $";
 }
 
 int xdebug_dbgp_cmdloop(xdebug_con *context TSRMLS_DC)
Received on Thu Apr 08 2004 - 23:47:40 BST

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