NuSphere Forums Forum Index
NuSphere Forums
Reply to topic
DBG-CLI 2.11.30 - regexec is broken


Joined: 27 Jan 2005
Posts: 1
Reply with quote
After much pulling out of hair trying to get this thing to work, I decided to run dbg-cli itself through DDD and find the following...

Platform:
Linux FC1
DBG 2.11.30
DBG-CLI 2.11.30 (built with tracing on)
PHP 4.3.4
Apache 1.3.31

All running on the same linux box

In UrlParse.cpp, line 34, regexec() returns ferr = 1 resulting in the following from dbg-cli

I added an extra line of debug print to make things clearer...
Code:

UrlParse::UrlParse(const std::string& url) : ferr(0), fport(0) {
   regex_t re;
   regmatch_t match[11];
   int len = url.length();

   ferr = regcomp(&re, "^(([^:/?#]+):)?(//([^/?#]*))?([^?#]*)(\\?([^#]*))?(#(.*))?", REG_EXTENDED);
   if (ferr)
      return;
   ferr = regexec(&re, url.c_str(), 10, match, 0);
+   fprintf(stderr, "UrlParse::UrlParse\n URL='%s'\n after regexec ferr=%d\n", url.c_str(), ferr);


I put this expression into perl and it worked there. Transcript of entire session follows:

Code:

[root@cerberus abm]# dbg-cli
ListenerBase::ListenerBase
DBG php debugger, version 2.11.30, Copyright 2001, 2004, Dmitri Dmitrienko, www.nusphere.com
dbg>set mode on
dbg>set mapurlroot http://rdftest/
dbg>set maplocalroot /usr/local/apache/devel/rdftest/htdocs
dbg>set mapremoteroot /usr/local/apache/devel/rdftest/htdocs
dbg>file /usr/local/apache/devel/rdftest/htdocs/index.php
Reading symbols from /usr/local/apache/devel/rdftest/htdocs/index.php...done.
dbg>run
ListenerBase::startsession
ThreadBase::ThreadBase
dbh_create_listen_socket(, 10001)
socket=4
open_dbg_session
UrlParse::UrlParse
 URL='http://rdftest/index.php'
 after regexec ferr=1
open_http_session
ThreadBase::close()

Program exited.
Wrong session request passed
Program is not being run.
dbg>q
ListenerBase::~ListenerBase
ListenerBase::stop
ListenerBase::stopJIT
stopping clients
[root@cerberus abm]# cat dbg-re.pl
#!/usr/bin/perl

my $url = 'http://rdftest/index.php';

if ($url =~ m!^(([^:/?#]+):)?(//([^/?#]*))?([^?#]*)(\\?([^#]*))?(#(.*))?!)
{
        print "$1\n$2\n$3\n$4\n$5\n$6\n$7\n$8\n$9\n$10\n";
}
else
{
        print "No match\n";
}
[root@cerberus abm]# perl dbg-re.pl
http:
http
//rdftest
rdftest
/index.php





[root@cerberus abm]#

Er, what now? Confused
View user's profileFind all posts by amackaySend private message
DBG-CLI 2.11.30 - regexec is broken
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
All times are GMT - 5 Hours  
Page 1 of 1  

  
  
 Reply to topic