8000 Cleanup Gdb Remote launch targets. · Issue #1232 · eclipse-cdt/cdt · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
Cleanup Gdb Remote launch targets. #1232
Open
@ewaterlander

Description

@ewaterlander

Originally posted by @betamaxbandit in #1207

The Gdb Remote launch targets need a clean up.

  1. Error shown immediately

When the new "GDB Remote TCP" launch target wizard is launched, it immediately shows the error message:
"Hostname or IP must be specified"
This is against Eclipse wizard design guidelines;
Guideline 5.3
Start the wizard with a prompt, not an error message.
https://eclipse-platform.github.io/ui-best-practices/#wizards

  1. Not allow invalid chars and spaces.

An error should be displayed if the user has chosen an invalid name.
A target name with invalid chars actually gets fixed in ICBuildConfigurationProvider.getCBuildConfigName(IProject, String, IToolChain, String, ILaunchTarget), by calling LaunchTargetUtils.sanitizeName(String).
However I think the launch target wizard should pick this up and not allow Finish until name is valid.

  1. Not allow duplicate names.

An error should be displayed if the user has chosen a name that already exists.
In my wizard, I handle this:

List fExistingRCarLaunchTargetNames;

In page constructor:
fExistingRCarLaunchTargetNames = getExistingLaunchTargetNames();

/**
 * Used to create a cache of existing launch target names so it is quick to check if a new name already exists.
 */
private List<String> getExistingLaunchTargetNames() {
	List<String> retVal = new ArrayList<>();
	ILaunchTargetManager manager = RcarLaunchTargetUIPlugin.getService(ILaunchTargetManager.class);
	if (manager != null) {
		retVal = Arrays.stream(manager.getLaunchTargetsOfType( LAUNCH_TARGET_TYPE_ID))
				.map(ILaunchTarget::getId)
				.collect(Collectors.toList());
	}
	return retVal;
}

where LAUNCH_TARGET_TYPE_ID is the type like GDBRemoteSerialLaunchTargetProvider.TYPE_ID or GDBRemoteTCPLaunchTargetProvider.TYPE_ID

and then in a validate method:

	if (fIsCreating && fExistingRCarLaunchTargetNames.contains(name)) {
		setErrorMessage("A launch target with that name already exists.");
		return false;
	}  
  1. Not possible to delete

In "GDB Remote Serial" launch target wizard lacks delete button, so once a target is created, it is not possible for the user to delete a target.
It is possible to delete the TCP target however.
I think if the user has the ability to choose a name for something, then they should be allowed to delete it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0