Skip to content
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 for Windows does not work correctly in Eclipse plugin #501

Closed
kolerov opened this issue Dec 28, 2022 · 3 comments
Closed

GDB for Windows does not work correctly in Eclipse plugin #501

kolerov opened this issue Dec 28, 2022 · 3 comments
Assignees
Milestone

Comments

@kolerov
Copy link
Collaborator

kolerov commented Dec 28, 2022

On Windows 10 hosts Eclipse plugin for ARC cannot connect to any GDB server correctly. To reproduce it you can create a simple debug configuration for nSIM and try to debug an application. The problem is that Eclipse plugin sends to GDB this string:

arget remote ...

instead of this:

target remote ...

I've created a pull request with temporary fix (foss-for-synopsys-dwc-arc-processors/binutils-gdb#66). This pull request reverts commit d08cbc5d3203118da5583296e49273cf82378042 which introduced that bug. This revert is temporary since it's not clear what exactly leads to this error.

Note, on Linux hosts that problem is not happening.

@kolerov kolerov added the bug label Dec 28, 2022
@abrodkin abrodkin transferred this issue from foss-for-synopsys-dwc-arc-processors/binutils-gdb Dec 28, 2022
@abrodkin abrodkin added this to the 2022.09 milestone Dec 28, 2022
@shahab-vahedi shahab-vahedi removed their assignment Jan 13, 2023
@kolerov
Copy link
Collaborator Author

kolerov commented Jan 27, 2023

Seems like the problem is in GDB itself. Compare gdb/even-top.c in our repository and in upstream:

https://github.com/foss-for-synopsys-dwc-arc-processors/binutils-gdb/blob/arc64/gdb/event-top.c
https://github.com/bminor/binutils-gdb/commits/master/gdb/event-top.c

You will see that after bminor/binutils-gdb@d08cbc5 commit there is a series of other commits which related to input/output and buffering. I tried to cherry-pick some of them, build GDB and try to use it with Eclipse on Windows. Then everything worked fine. There is a list of commits which I got:

$ git log --oneline -n 10 gdb/event-top.c
3e6f0b82f9d (HEAD -> ykolerov-fix-win-rebase) gdb: remove static buffer in command_line_input
48df998111d [gdb] Handle pending ^C after rl_callback_read_char
974c80a52be gdb: move setbuf calls out of gdb_readline_no_editing_callback
1b991eb9d81 gdb: handle bracketed-paste-mode and EOF correctly
4a52ae68069 gdb: improved EOF handling when using readline 7
fa121beb516 gdb: work around prompt corruption caused by bracketed-paste-mode
d08cbc5d320 gdb: unbuffer all input streams when not using readline

Picking some of these commits to our current source tree leads to conflict thus it's necessary to do it carefully.

@abrodkin abrodkin assigned shahab-vahedi and unassigned abrodkin Jan 27, 2023
@abrodkin abrodkin modified the milestones: 2022.09, 2023.03 Jan 27, 2023
@shahab-vahedi
Copy link
Member

Thank you Yuriy for the inputs. I will make sure that the next cut out release of GDB will either have these commits naturally or cherry-picked.

@shahab-vahedi shahab-vahedi modified the milestones: 2023.03, 2023.0, 2023.09 Jan 27, 2023
@kolerov
Copy link
Collaborator Author

kolerov commented May 23, 2023

I confirm that all those commits are presented in our binutils-gdb repository now. The latest arc-2023.03-rc1 release is built without this issue.

@kolerov kolerov closed this as completed May 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants