-
Notifications
You must be signed in to change notification settings - Fork 70
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[HELP] Cannot get GDB to work (Windows) #259
Comments
I suspect some issue with the windows specific socket handling. Can you capture the traffic with e.g. wireshark? |
You can also try |
This is the result I get:
|
I'm guessing the issue is that GDB tries to send a qSupported command to firebird, but firebird is unable to handle it. (core/gdbstub.c). But this is strange, as I've tried older versions of GDB with no luck, and other people have reported it working just fine. I'm not sure if this is a Windows only error, or if this is the same for all other versions. |
Can you get a packet dump? |
I'm not quite sure how to. I'm not very familiar with WireShark. I've been using burp suite recently but it doesn't seem to work for localhost. |
You could try something like https://www.netresec.com/?page=RawCap |
Oh, thanks! RawCap worked well. This is what it captured: dumpfile.pcap
|
Can you add that file as attachment? |
Sure: dumpfile.zip |
Looks like firebird terminates the connection after sending the empty reply to Can you build firebird from source? I currently don't have a windows build setup... |
Alright, I'll try to do so and I'll get back to you once it's done. |
Great! To confirm the theory, it should be enough to edit |
After I run
What should I do? Contents of build: build.zip |
It looks like you're building it with the msvc toolchain, you'll have to use GCC or clang. Additionally the generated Makefile seems to have issues with spaces... |
Ahh, that clears things up. I'm assuming you mean qmake? As for the Makefile having spaces, I'm guessing I can just run it through dos2unix, right? |
I may have screwed something up along the way during the process. When I run make this time, Makefile doesn't error. However, I get syntax errors while compiling:
(If it is important, To clarify, this is what I did:
|
You probably shouldn't try building this in Cygwin, it'll use a different runtime than the more native windows builds. Apparently Qt isn't compatible with that already. |
I see... What should I use to build it, MinGW, or is there a make that comes with Qt? |
The Qt installer for Windows comes with a MinGW toolchain. |
Ok, so this comment (yes this one) was supposed to be about how I couldn't build it in Qt Creator, but it turns out it was just because cygwin was interfering (somehow?) by being in the path. When I removed it from the path environment variable, it built just fine. Time to test! (Edit: After re-adding Cygwin to path, it seems to still work. So I have no idea what I was doing wrong.) |
Well this is awkward, not sure if it's something I've done wrong or if it was broken by a commit but it doesn't want to start the emulation. No errors in Application Output.
Compile output, if it really matters General messages has something interesting:
(Note: the errors about missing cygwin libraries disappear after re-adding cygwin to path, yet somehow this time it doesn't break?) |
Anything in the debugger output? If you enter the debugger, does that work? You could try to build the |
Well... I suppose it's confusing seen as there is two debuggers... I can debug with Qt just fine. This time, when I attempt to connect GDB, I no longer get "Broken pipe", instead I get "Remote communication error. Target disconnected.: Connection reset by peer." Which at least means we've made some progress, right? Anyway... There is nothing different in the debugger output of Firebird apart from the error about ndless:
Maybe it isn't working because there is nothing running?
I will try to do that now. I will let you know if anything changes. Once again, thank you very much for your help! |
Right, I meant Firebird's debugger in this case. If it can be entered, the emulation is at least trying to run...
Could also be a step backwards, hard to say.
If it gets that far it should complete the connection at least.
Thanks for doing the tests! |
Hmm... I ran the following commands:
and when I built, it still didn't work. It is likely something wrong with the I'm building it. |
Could be. Unfortunately I can't really tell what's going wrong. Could be a lot of things... I should get access to my Win dev env soon again, so I'll have a try as well. |
Sorry for not providing you with much info. Thanks for the help! |
The socket is set nonblocking unconditionally, so the missing code for polling made it close the connection prematurely. Fixes nspire-emus#259
I could reproduce the issue easily and my suspicion was correct, enabling blocking reads again made the connection work. To fix it properly, I implemented polling on Windows in #260. Here's a test build: firebird-emu.zip |
Yes! It worked! Thank you very much for all of your help! I am very appreciative! Have an awesome day! |
The socket is set nonblocking unconditionally, so the missing code for polling made it close the connection prematurely. Fixes #259
Thanks for testing, that was incredibly quick! |
Okay, so I am trying to debug my program using Firebird 1.5 on Windows using GDB and I'm running into this bug still. I first start Here is my GDB output
and here is the output in the firebird-emu console
So it seems like firebird is still prematurely closing sockets on Windows. I even tried the test build above and it still did not work. Here it says that all you have to do for unknown 'v' packets is to just return an empty string |
That looks like the original bug, but not totally the same. The
FB handles that correctly, which is visible in the Can you try one of the builds from https://github.com/nspire-emus/firebird/actions/runs/3795934362? |
It works! Thanks!!! |
Excuse me if this was already answered, could not find it with a google search/issue search.
Hello, I'm trying to debug on my app on firebird using GDB. However, I've found my attempts unsuccessful. Do you think you can help me?
System information
Running Windows 10 21H1 build 19043
Cygwin version 3.3.4(0.341/5/3)
GDB version 10.2
Latest firebird
Latest ndless-sdk
Problem
I cannot get GDB to debug in firebird. Whenever I type the following:
I get the following in the debugger tab of firebird:
Then GDB tells me:
What I've tried
The text was updated successfully, but these errors were encountered: