-
-
Notifications
You must be signed in to change notification settings - Fork 774
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
GDB 11/12 compatibility #929
Comments
Do you think this is a problem of BMP? Did you report to GDB too? |
I don't know what and where exactly the problem is, but I can say that a plain ST-Link with I haven't reported to GDB yet, will probably do that next week. |
GDB does not report some invalid package but core dumps. Even when BMP sends something wrong, gdb should not core dump but report the problem and handle it gratefull. There is at least a problem with gdb, So report to gdb!. |
@arbrauns did you report this? I had a quick look but couldn't find anything. I've encountered this too, attaching to a STM32F4. Wanted to check before I do any more digging/report. For others on arch, one can roll back for now with |
No, I haven't found time yet. I also don't know how to make GDB spit out a trace of the remote protocol, which would probably be necessary to debug this further. |
set debug remote 1 |
I've created a bug report for gdb: https://sourceware.org/bugzilla/show_bug.cgi?id=28405 |
Hi.
Please find the log attached
thanks @tuna-f1sh for the archlinux fix
|
https://sourceware.org/bugzilla/show_bug.cgi?id=28405 has a fix for GDB and show a way to reproduce with other gdb servers,. The BMP server seems not at fault. Leaving the bug open until a fixed GDB11 is out |
Yes, the patch works so if one is super keen to use GDB11 one can compile with the patch in that bug report. As you say, was waiting until 11 is out to close this, just to ensure it captures others having the issue. |
According to the official website GDB V11.1 was released in September 2021. Are we waiting for V11.2? Just want to make sure when we can close this issue. :) |
That's correct, here's the latest mail for the patch in question, discussing if it should be included in 11.2: https://sourceware.org/pipermail/gdb-patches/2021-December/184171.html |
Thank you @arbrauns for clarification. I hope we will get that release soon and the patch is included. 🤞 :) |
Merged to master and 11-branch so should be in 11.2 release: https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=b622494ee378fd0a490c934c509364b4c7735273 |
Most excellent! We'll close this issue when 11.2 is released and we confirm that the patch is included and didn't get reverted, btu this is good news. |
Sorry to dampen your enthusiasm :/. I just tried a fresh build of gdb 11.2 on ArchLinux (built the pkgbuild by hand) and it didn't solve the issue for me. However, the error message changed to
This still seems related to the issue, just failing at a different location now. |
I'm seeing the same thing, using gdb 11.1 on void linux, trying to debug an Arduino Due with a "Jeff Probe". I applied the patch referenced above, and I see the same assertion as @Windfisch now. |
Weird, I did check the patch in the ticket thread I created fixed the issue I was having and worked with a target - now I'm wondering how this slipped through. Maybe something else in the merge? Haven't had time to check myself yet but otherwise, I guess we'll need to make another ticket. |
I had chance to check that the patched 11.1 does not have this issue (to confirm I wasn't going mad) and also capture the issue myself to create a new gdb bug for this problem: https://sourceware.org/bugzilla/show_bug.cgi?id=28874 |
Thank you all for all the extra info and testing - we'll keep the issue open till GDB sorts things out or we can find a workable way around it. |
Just to update this thread, I found what seems to be the issue that the 11.2 merge caused over the 11.1 patched. I've put a patch in that bugzilla thread (https://sourceware.org/bugzilla/show_bug.cgi?id=28874) and awaiting feedback. Hopefully this fix can be merged into 11.3... I've got a Github fork with the patched 11.2 here too: https://github.com/tuna-f1sh/binutils-gdb/tree/gdb-11.2-patch |
Let's hope they merge it soon and don't break it again this time |
This is still an issue in GDB 12.1...
|
How is it they keep breaking the same damn thing despite multiple bug reports 😔 ?! Ok, thank you for reporting in with that - one of the team will chase it up on their bug tracker and try.. again.. to get it fixed |
The commenters in my bug report (https://sourceware.org/bugzilla/show_bug.cgi?id=28874) agreed that it fixed it but it is hacky - essentially it reverts a function call back to how it worked in 11.1 for the (single threaded) embedded target use case. Apparently the whole thing came about to support multi-threaded embedded targets so I can see it’s not ideal from this standpoint. It went quiet from a merging point so I’m not surprised 12.1 still has the bug. The guy Andrew who merged the original bug and fix hasn’t chimed in. I think I’ll have to bring it up to date as a patch for 12.1 and then share it on the mailing list. |
There is a patch that fixes this issue that still needs to be merged by GDB developers. Not sure why it is still pending and not merged. https://sourceware.org/pipermail/gdb-patches/2022-April/188058.html |
Is there any debugger that the probe works with? |
Hi @bonidydy, yes - you can either grab the patch from their mailing list and use GDB 11 or 12 with it applied, or you can use GDB 10 (https://developer.arm.com/downloads/-/gnu-rm for a download) |
I'm using a patched mirror here for the lazy: https://github.com/tuna-f1sh/binutils-gdb/tree/gdb-12.1-bmppatch Also on Arch, this is the (last working) 10.1 PKGBUILD: https://github.com/archlinux/svntogit-community/blob/22d7668d2bfa4809296bd36cfb8bfc5e239f6611/repos/community-x86_64/PKGBUILD Might have to use |
Any help persuading the GDB folks that a nasty ugly bug that breaks their debugger for single-threaded targets is a bad thing would be greatly appreciated! As for Arch, that could work but we'd honestly recommend using the ARM built GDB from the toolchain linked above - it contains ARM-specific patches and does still run on Arch. |
That is the |
For those interested in testing and validating - please see the linked PR #1125 which contains our answer to the GDB folks blowing us off again. This should allow BMP to work out the box with GDB 11 and likewise 12. |
Just to clarify. The #1125 is only a work around. The underlying bug in GDB is not fixed, and "Fake Threads" might interfere with "sidecar" scripting that adds support for RTOS threads. I am opening this issue again, to track progress of GDB project on this topic. There was finally a reaction to an attempt to submit a patch to fix the GDB bug. We can only hope that they will eventually implement a proper fix. |
@tuna-f1sh your bug report to GDB says
Do you happen to have the commit hash you tested this on? I can't seem to find any commit where applying the fix for the original |
@Qyriad it would have been the gdb-11.1-release tag here: https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=c599303f92b1edd6ead3947737a8ae9e1c85e08c , the patch is from here https://sourceware.org/bugzilla/show_bug.cgi?id=28405 I also had a 11.2-release patched here: tuna-f1sh/binutils-gdb@5e714ea |
FWIW, this is still broken with GDB 13.1, when using a BMP running pre-#1125 firmware ( |
And it will likely stay broken forever as the GDB folks can't understand the issue and don't want to fix it. :( @martinling You will have to update your firmware sorry. :( To clarify: GDB briefly fixed the issue between releases, and then broke it before actually making a release. When we again brought this up the maintainers felt overwhelmed with their conflicting interests to implement either a temporary or a permanent fix on their end. |
Yeah I've updated that BMP to 1.9.1 so it's not a problem for me now. I just figured I'd update the issue here to confirm it's still broken in GDB 13. |
Mine is a bit different
GNU gdb (Arm GNU Toolchain 13.2.rel1 (Build arm-13.7)) 13.2.90.20231008-git
Target: F401 |
Ok, we can't even begin to support that version and working back through commit parents from the commit ID referenced by the binary in that repo shows that to be based on v1.8.0 - please use this repo's code and build with The version of the firmware you're trying to use, which has been custom patched, is old and predates the fix PR for this issue. Edit: Checking through their BMD fork, all the fixes they were applying for Blue Pill have been upstreamed to this repo from what we can tell and are all in current releases. |
Looks like that is enumerating, but possibly that's Windows 7 being silly about drivers - what does the Properties panel in Device Manager actually say, as that doesn't give us enough information to work from? |
Going at this on a slightly different tact given the info from those screenshots, is there a strong reason you're using W7 rather than any newer more supported OS? It's very difficult to know what could be going on when it's the hub or controller you're plugging the Blue Pill into that's getting mad, given Windows doesn't really give useful diagnostics short of running protocol analysers. Given that other firmware is so old and predates the fixes for this issue, please open a new issue ticket for your current problems so we can keep this issue specifically to the issues with GDB, which is a separate problem to getting W7 to play nice with the current firmware and any potential issues with the guides you followed to make your Blue Pill a BMP. |
With GDB 11.1, attaching to an STM32H7 target no longer works:
hosted log
I bisected this down to gdb commit
8f66807
("gdb: better handling of 'S' packets").Environment:
arm-none-eabi-gdb
11.1The text was updated successfully, but these errors were encountered: