Skip to content

Improve error reporting when missing remote configurations#384

Merged
jreineckearm merged 15 commits intoeclipse-cdt-cloud:mainfrom
omarArm:improveLogging
Jul 14, 2025
Merged

Improve error reporting when missing remote configurations#384
jreineckearm merged 15 commits intoeclipse-cdt-cloud:mainfrom
omarArm:improveLogging

Conversation

@omarArm
Copy link
Contributor

@omarArm omarArm commented Jun 2, 2025

Context:

When using the extension for target debugging. If a user forgets to set the port number for the gdb connection, connection is definitely going to fail. However, the reported error by the extension was not clear enough about what is the cause of the error.

Previous behaviour:

The previous reported error message used to be a complete log of the debug-console, which obviously was not user friendly.

Current suggested behaviour:

An error message will now pop up with the value

Port number not specified, cannot connect

I also updated some launch related tests to accommodate the change.

@omarArm omarArm requested a review from jreineckearm June 2, 2025 14:04
Copy link
Contributor

@jonahgraham jonahgraham left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM - please ensure that this is squashed before or as part of the merge and the resulting commit message is a good summary, especially as some of the intermediary commits have merge markers (>>>>) in them

@jonahgraham
Copy link
Contributor

PS There are failing tests that should help guide you on getting the special cases resolved. Let me or @jreineckearm know if you need any additional input

@omarArm omarArm force-pushed the improveLogging branch 2 times, most recently from e1ea03f to 7d50edc Compare June 5, 2025 18:58
@omarArm
Copy link
Contributor Author

omarArm commented Jun 11, 2025

@jonahgraham Hi Jonah,

I am finally able to pass all of the PR tests, sorry for the insane amount of commits, but I had to update all existing test scripts so that they can follow the new infrastructure of my actual change

@omarArm omarArm force-pushed the improveLogging branch 2 times, most recently from eeb92ec to cafe35e Compare June 11, 2025 16:41
@omarArm omarArm requested a review from jonahgraham June 11, 2025 16:43
Copy link
Contributor

@jonahgraham jonahgraham left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@omarArm Sorry that there seems to be some misalignment here on the design and implementation. I hope we can come to a resolution.

I think one thing missing is a better problem statement, something that I (and others) can do to reproduce the bug that you are fixing here.

If you want to discuss further, such as have a zoom call about this, please drop me an email jonah (at) kichwacoders.com and we can perhaps discuss faster - perhaps when @jreineckearm is also available.

@jonahgraham
Copy link
Contributor

@omarArm and I had a good call about this and we identified a likely good solution involving a timeout if the port is not specified and the regexp isn't matched. I look forward to reviewing an updated PR from @omarArm in the coming days.

@omarArm omarArm requested a review from jonahgraham June 13, 2025 11:03
@omarArm
Copy link
Contributor Author

omarArm commented Jun 13, 2025

Hi @jonahgraham ,

I added the change and tested it manually. However, I don't know how can I come up with a test for the timeout routine, given that the current test framework will always generate a port to be caught by the default regex. Any ideas on that?

@jonahgraham
Copy link
Contributor

Quick answer to test question (I haven't looked at code yet)

Make the timeout configurable as waiting 10 seconds in a test is too long. Then, in a new test, make the regex something that won't match anything so that gdb server starts properly, but the port number is never detected.

HTH

Copy link
Contributor

@jonahgraham jonahgraham left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change looks correct, but I haven't tried to run it yet. When you have some new passing tests let me know and I can look again.

@jreineckearm
Copy link
Contributor

One mild concern is that this change leaves behind running GDB servers. When it ran indefinitely before, a user was forced to click the stop button which terminated the server.

This isn't the only scenario that can lead to this and I am planning to enhance the process management as part of #361.
I guess the main question is whether we can live with this until the process management rework happened.

Copy link
Contributor

@jreineckearm jreineckearm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes LGTM, but we probably should wait for a couple of days with merging. Hopefully getting something in for #361 quickly. Which should address the leftover GDB server processes for this scenario, too.

Copy link
Contributor

@jonahgraham jonahgraham left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jreineckearm I'll leave you to merge when it is convenient for you

@jreineckearm
Copy link
Contributor

About to merge #392 . Changes there should in theory help with the leftover processes I could see with this PR. Hence merging this PR here now.

@jreineckearm jreineckearm merged commit 90a317e into eclipse-cdt-cloud:main Jul 14, 2025
4 checks passed
@jreineckearm
Copy link
Contributor

Can confirm that the gdbserver gets terminated if used in combination with #392 .

@omarArm omarArm deleted the improveLogging branch July 15, 2025 08:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants