-
Notifications
You must be signed in to change notification settings - Fork 133
IEP-1265: Debug Process Hangs #1023
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
Changes from 11 commits
24988ac
d595bee
88a2c15
de00153
03c8344
2ac0d8a
e0fa1a5
a926bd6
d07c76f
2c91af0
63705af
abe20e5
122d853
f1d737c
ea0c653
9fde565
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -698,6 +698,19 @@ protected void handleCompleted() | |
| } | ||
| // -------------------------------------------------------------------- | ||
| } | ||
|
|
||
| @Override | ||
| /** | ||
| * This method takes care of cleaning up any resources allocated by the launch, as early as | ||
| * the call to getLaunch(), whenever the launch is cancelled or does not complete properly. | ||
| * @since 5.0 */ | ||
| protected void cleanupLaunch(ILaunch launch) throws DebugException | ||
| { | ||
| if (launch instanceof GdbLaunch) | ||
| { | ||
| launch.terminate(); | ||
| } | ||
| } | ||
|
||
|
|
||
| /** | ||
| * Perform some local validations before starting the debug session. | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Port handling logic needs improvement
The current implementation sets a fixed default port when the GDB server starts, but according to PR feedback, this doesn't handle port conflicts effectively. When the default port (3333) is occupied, the system should retry with alternative ports.
Consider implementing a more robust port selection mechanism:
if (Configuration.getDoStartGdbServer(config)) { - config.setAttribute(IGDBJtagConstants.ATTR_PORT_NUMBER, DefaultPreferences.GDB_SERVER_GDB_PORT_NUMBER_DEFAULT); + int port = PortChecker.findAvailablePort(DefaultPreferences.GDB_SERVER_GDB_PORT_NUMBER_DEFAULT); + if (port == -1) { + throw new CoreException(new Status(IStatus.ERROR, Activator.PLUGIN_ID, + "Unable to find available port for GDB server")); + } + config.setAttribute(IGDBJtagConstants.ATTR_PORT_NUMBER, port); }