NuSphere Forums Forum Index
NuSphere Forums
Reply to topic
listener.startsession(...) returns hresult = DBGSE_WRONGREQ


Joined: 16 Aug 2004
Posts: 13
Reply with quote
Hi Folks,

I built dbg-cli and I'm steping through with gdb. I'm running on the same box as php. I've entered the following to dbg-cli:
Quote:
set mode on
set port 7869
set mapurlroot http://localhost
set maplocalroot /var/www/html
set mapremoteroot /var/www/html
file /var/www/html/index.php
run


I set a break at do_run(); command.cpp:629 which is the call to listener.startsession(...) but this call returns hresult = DBGSE_WRONGREQ.

I haven't been able to determine what he wants to be happy.

Any thoughts?

Thanks,

Chris.

_________________
Chris.

Life is a journey ...
Not a destination.
View user's profileFind all posts by cjm1956Send private message


Joined: 16 Aug 2004
Posts: 13
Reply with quote
Hi Folks,

The failure seems to be in open_dbg_session() and it appears to have something to do with parsing a regular expression, but it is not clear to me what is wrong.

I have found other posts that indicated that both dbg and dbg-cli need to use the same dbg_net.[ch] and I have done that, but I haven't found anything discussing this parsing problem. Anybody have any ideas?

Thanks,

_________________
Chris.

Life is a journey ...
Not a destination.
View user's profileFind all posts by cjm1956Send private message


Joined: 16 Aug 2004
Posts: 13
Reply with quote
Hi Folks,

More specifically, it is an open_http_session ...

_________________
Chris.

Life is a journey ...
Not a destination.
View user's profileFind all posts by cjm1956Send private message


Joined: 16 Aug 2004
Posts: 13
Reply with quote
Hi Folks,

Regcomp is returning 0 while trying to compile the regular expression during the first invocation. I have NO idea what is wrong with it and I don't seem to be able to step through it, since I apparently don't have my libc compiled with symbols. Confused

More to the point, I don't know how to get around this...

_________________
Chris.

Life is a journey ...
Not a destination.
View user's profileFind all posts by cjm1956Send private message
Site Admin

Joined: 13 Jul 2003
Posts: 8342
Reply with quote
did you compile with regexp library that comes with dbg-cli or with system supplied ? Please check gcc logs.
View user's profileFind all posts by dmitriSend private messageVisit poster's website


Joined: 16 Aug 2004
Posts: 13
Reply with quote
I ran "make clean; make > make.log 2>&1" and I investigated.

I see explicit -I../pcre in the compilation lines and I see -L/usr/local/src/dbg-cli-2.11.0/pcre. So I conclude that I am using the supplied code and not the system default code.

Does this answer your question sufficiently?

I also believe that the error is in regexec, not regcomp, but I am only confident and not certain. I will need to refresh a lot of old knowledge to get a more precise answer, but I am eager to do that.

_________________
Chris.

Life is a journey ...
Not a destination.
View user's profileFind all posts by cjm1956Send private message
Site Admin

Joined: 13 Jul 2003
Posts: 8342
Reply with quote
right.
well let's trace what's there.
open UrlParse.cpp and replace the following code
Code:
   if (ferr)
      return;

with
Code:

   if (ferr) {
      DBGTRACE(("regexec for \"%s\" failed with %d\n", url.c_str(), ferr));
      return;
   }

and add the following lines onto the top of this file
Code:
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif

#include "dbg_net.h"
#include "dbgbase_globals.h"
#include "dbgbase_classes.h"
View user's profileFind all posts by dmitriSend private messageVisit poster's website


Joined: 16 Aug 2004
Posts: 13
Reply with quote
I assumed that in addition to the changes, I needed to define _TRACE, which I did but this exposes a problem. I get an error on line 51 of dbgbase_globales.cpp:

Quote:
char buf[1024];
vsnprintf(buf, sizeof(buf), str, args);
cerr << buf; <======================
if (tracelogger!=NULL)
tracelogger(buf);


Quote:
dbgbase_globals.cpp:51: `cerr' undeclared (first use this function)


Any help here?

_________________
Chris.

Life is a journey ...
Not a destination.
View user's profileFind all posts by cjm1956Send private message


Joined: 16 Aug 2004
Posts: 13
Reply with quote
I added #include <iostream> and changed cerr to std::cerr and I was able to complete make. I ran with the following commands:
Quote:
set mode on
set port 7869
set mapurlroot http://localhost
set maplocalroot /var/www/html
set mapremoteroot /var/www/html
file /var/www/html/index.php

and I got the following results:
Quote:
dbg>run
ThreadBase::ThreadBase
regexec for "http://localhost/index.php" failed with 1
Segmentation fault


Does this provide any elightnement?

_________________
Chris.

Life is a journey ...
Not a destination.
View user's profileFind all posts by cjm1956Send private message
Site Admin

Joined: 13 Jul 2003
Posts: 8342
Reply with quote
looks like gcc 3.x "feature"...
with 2.96 this code worked for years.
View user's profileFind all posts by dmitriSend private messageVisit poster's website


Joined: 16 Aug 2004
Posts: 13
Reply with quote
Can you offer any more? For example, what is happening and how do I prevent it or work around it?

_________________
Chris.

Life is a journey ...
Not a destination.
View user's profileFind all posts by cjm1956Send private message
Site Admin

Joined: 13 Jul 2003
Posts: 8342
Reply with quote
one guy posted there that he has successfully compiled with system supplied pcre. Please walk through the forums for the post.
View user's profileFind all posts by dmitriSend private messageVisit poster's website
listener.startsession(...) returns hresult = DBGSE_WRONGREQ
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 2  

  
  
 Reply to topic