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


Joined: 30 May 2005
Posts: 7
Reply with quote
Here's a patch to make dbg-cli listen on 64 bit linux machines.

In dgbase_globals.h change:

Code:

typedef long HRESULT;


Into this:
Code:

    #include <inttypes.h>
    typedef int32_t HRESULT;


Otherwise, the SUCCEEDED and FAILED macros will not function correctly.

Using this I am able to make the client listen and connect. Beyond that I have not used the debugger much so other things could be broken. Just wanted to share it.

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

Joined: 13 Jul 2003
Posts: 8342
Reply with quote
thanks.
actually simply int would be sufficient.
when I started writing dbg there were no 64bit machines around me Smile and I thought that long will remain 32bit... I was wrong.

the same way, dbgint should be declared as int in dbg_net.h while initially it was long too. I noticed this problem under 64bit Sun ~ 2y ago
View user's profileFind all posts by dmitriSend private messageVisit poster's website


Joined: 30 May 2005
Posts: 7
Reply with quote
ddmitrie wrote:

actually simply int would be sufficient.

as it happens, int would work, because my system happens to have 32 bit ints. But on some 128 bit or more system of the future, int may have more. It's better to be specific and use int32_t. Considering that your macros define HRESULTS to be 32 bit and test for negative values, you have to have exactly 32 bits.


Quote:

the same way, dbgint should be declared as int in dbg_net.h while initially it was long too. I noticed this problem under 64bit Sun ~ 2y ago


Why doesn't a patch like that make it into the code base?

BTW, I encountered a crash while testing the client on my machine. I submitted a fix here: patch-for-std-sprintf-crash-t1851.html#7118#7118
I don't think its specific to 64 bit machines.[/quote]
View user's profileFind all posts by dcohenSend private message


Joined: 30 May 2005
Posts: 7
Reply with quote
ddmitrie wrote:
dbgint should be declared as int in dbg_net.h


Apparently what matters is size of this variable must be identical between client and server. In my case the server was compiled long, so the client must also be compiled long.
I haven't tried recompiling the server, but it sounds like I will have to if I ever want to connect from a 32-bit machine.
View user's profileFind all posts by dcohenSend private message
Site Admin

Joined: 13 Jul 2003
Posts: 8342
Reply with quote
Quote:
Why doesn't a patch like that make it into the code base?

Looks like it's time to make changes Smile

Quote:
BTW, I encountered a crash while testing the client on my machine. I submitted a fix here: patch-for-std-sprintf-crash-t1851.html#7118#7118

Thanks.
It looks a little tricky. Why it does not crash with args copy?
View user's profileFind all posts by dmitriSend private messageVisit poster's website


Joined: 30 May 2005
Posts: 7
Reply with quote
ddmitrie wrote:

It looks a little tricky. Why it does not crash with args copy?


If you don't use a copy of the args, then the second time through that loop, the args structure has been altered by the first loop, and there's no knowing what it now points to. You should be able to reproduce by printing a single variable which is a string of more than 512 chars.
View user's profileFind all posts by dcohenSend private message
Site Admin

Joined: 13 Jul 2003
Posts: 8342
Reply with quote
Thanks. Fix will be added to the next free version of the debugger.
View user's profileFind all posts by dmitriSend private messageVisit poster's website
dbg-cli not listening on x86_64
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