NuSphere Forums Forum Index
NuSphere Forums
Reply to topic
dbg-cli not listening


Joined: 15 Apr 2005
Posts: 2
Reply with quote
First of all, many thanks for the PHP debugger. It looks like exactly what I need to sort out some performance problems with our complex PHP application.

We're a Linux shop, and so I'm trying to get dbg-cli to listen for dbg module connections, both running on the same machine.

I type `show port', and get 10001. When I type `listen', though and then `netstat -ntl' on the same machine, there's no listening port displayed in the output. Of course, when I try to browse to (not publically accessible) I get:

Code:

Failed to start debug session

reason:
failed to establish connection to client host on 127.0.0.1:10001


This is with dbg-cli 2.11.32. I looked through the sources to see what happens when `listen' is issued, but there wasn't anything that looked obvious to me.

I'd greatly appreciate any help you can offer,
Gord.

[BTW, I'm the original author of Libtool, and it's always nice to see a cool free software project that uses it. Smile]
View user's profileFind all posts by gord-figSend private message
Site Admin

Joined: 13 Jul 2003
Posts: 8342
Reply with quote
please check compiler (and configure) output... Probably something wrong went on. I believe it should listen as it does in my environment:

View user's profileFind all posts by dmitriSend private messageVisit poster's website
I found it...


Joined: 15 Apr 2005
Posts: 2
Reply with quote
After some quality time with GDB, I found the problem:

Code:

--- dbg_client-2.11.32/dbg/command.cpp~   Sun Jan 30 19:05:22 2005
+++ dbg_client-2.11.32/dbg/command.cpp   Mon Apr 18 12:44:40 2005
@@ -941,7 +941,7 @@
        return cprFailed;
    }
 
-   cfg.port = port;
+   cfg.port = port ? port : DEFAULT_REQ_PORT;
    cfg.breakonload = 1;
    cfg.breakonfinish = 1;


I was using the default port (not setting one with the `set port' command), so cfg.port was actually 0, which caused the socket to fail to bind without any error.

Now everything seems to work just fine.

Thanks,
Gord.
View user's profileFind all posts by gord-figSend private message


Joined: 30 May 2005
Posts: 7
Reply with quote
I have the problem described in the original post, and I'm unable to get around it. Explicitly calling 'set port' has no effect. The listen command returns immediately and without any error message, even if I specify a number of seconds to listen.

I've looked through the configure and compile output, but I see nothing unusual. Although I am compiling on a 64 bit machine (Gentoo on AMD64). Here's the final output of configure:
Code:

   Source code location:       .
    Compiler CC, CXX:           gcc, c++
    Compiler flags:             -g -O2, -g -O2
    Linker:                     /usr/x86_64-pc-linux-gnu/bin/ld
    Host System Type:           x86_64-unknown-linux-gnu
    Install path:               /usr/local


Also, DEFAULT_REQ_PORT is defined for me as 10001. Should the code change to command.cpp refer to DEFAULT_LSTNR_PORT (which is 7869)?

Thanks for any help.

-Dave
View user's profileFind all posts by dcohenSend private message
Site Admin

Joined: 13 Jul 2003
Posts: 8342
Reply with quote
probably the problem is in dbg under linux_64.
I'll investigate the problem as soons as I get an access to this platform.
View user's profileFind all posts by dmitriSend private messageVisit poster's website


Joined: 30 May 2005
Posts: 7
Reply with quote
Dmitri,

I'm happy to help diagnose the problem. It's been a while since I've messed around with C++ code and debuggers, but if you have anything you'd like me to try, just let me know.

I could give you ssh access to a linux_64 machine if necessary.

There is a gentoo ebuild for dbg on 64 bit as well as other platforms, but surprisingly it does not include the client.

-Dave
View user's profileFind all posts by dcohenSend private message


Joined: 15 Aug 2005
Posts: 1
Reply with quote
Today I compiled the dbg-cli 2.11.32 on my x86-32 mashine with a Linux 2.6.11.4 kernel. It does not bind to any address at all, even if I apply the patch as described above. I tried as user and root, no difference. I'm in java and php, not C, so I'm not sure if I could find the problem myself.

During compilation there were some warnings (gcc 3.3.5):

dbg_net.c: In function `dbg_packet_nextframe':
dbg_net.c:179: warning: use of cast expressions as lvalues is deprecated
dbg_net.c: In function `dbg_packet_findfirstframe':
dbg_net.c:197: warning: use of cast expressions as lvalues is deprecated
dbg_net.c: In function `dbg_packet_send':
dbg_net.c:240: warning: use of cast expressions as lvalues is deprecated
dbg_net.c:245: warning: use of cast expressions as lvalues is deprecated
dbg_net.c:259: warning: use of cast expressions as lvalues is deprecated
dbg_net.c: In function `dbg_packet_recv_body':
dbg_net.c:316: warning: use of cast expressions as lvalues is deprecated
dbg_net.c:322: warning: use of cast expressions as lvalues is deprecated
dbg_net.c:338: warning: use of cast expressions as lvalues is deprecated

Maybe this will help. I'm patient. Once I will be able to use this debugger, I'm sure since years...
View user's profileFind all posts by isterorgSend private message
Site Admin

Joined: 13 Jul 2003
Posts: 8342
Reply with quote
Quote:
dbg_net.c: In function `dbg_packet_nextframe':
dbg_net.c:179: warning: use of cast expressions as lvalues is deprecated

It's not a problem, really and has not relation to the listener's part of dbg-cli. Try to compile with debug logging enabled (see configure options) and show me the log.
TIA.
View user's profileFind all posts by dmitriSend private messageVisit poster's website
dbg-cli not listening
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