|
Lines 15-21
Link Here
|
| 15 |
|
15 |
|
| 16 |
import java.io.File; |
16 |
import java.io.File; |
| 17 |
|
17 |
|
| 18 |
import org.eclipse.cdt.debug.core.ICDTLaunchConfigurationConstants; |
18 |
import org.eclipse.cdt.debug.core.CDebugUtils; |
| 19 |
import org.eclipse.cdt.debug.gdbjtag.core.IGDBJtagConstants; |
19 |
import org.eclipse.cdt.debug.gdbjtag.core.IGDBJtagConstants; |
| 20 |
import org.eclipse.core.resources.IResource; |
20 |
import org.eclipse.core.resources.IResource; |
| 21 |
import org.eclipse.core.resources.ResourcesPlugin; |
21 |
import org.eclipse.core.resources.ResourcesPlugin; |
|
Lines 33-38
Link Here
|
| 33 |
import org.eclipse.swt.events.ModifyListener; |
33 |
import org.eclipse.swt.events.ModifyListener; |
| 34 |
import org.eclipse.swt.events.SelectionAdapter; |
34 |
import org.eclipse.swt.events.SelectionAdapter; |
| 35 |
import org.eclipse.swt.events.SelectionEvent; |
35 |
import org.eclipse.swt.events.SelectionEvent; |
|
|
36 |
import org.eclipse.swt.events.SelectionListener; |
| 36 |
import org.eclipse.swt.events.VerifyEvent; |
37 |
import org.eclipse.swt.events.VerifyEvent; |
| 37 |
import org.eclipse.swt.events.VerifyListener; |
38 |
import org.eclipse.swt.events.VerifyListener; |
| 38 |
import org.eclipse.swt.graphics.Image; |
39 |
import org.eclipse.swt.graphics.Image; |
|
Lines 82-87
Link Here
|
| 82 |
boolean resume = false; |
83 |
boolean resume = false; |
| 83 |
|
84 |
|
| 84 |
Text runCommands; |
85 |
Text runCommands; |
|
|
86 |
|
| 87 |
// New GUI added to address bug 310304 |
| 88 |
private Button useProjectBinaryForImage; |
| 89 |
private Button useFileForImage; |
| 90 |
private Button useProjectBinaryForSymbols; |
| 91 |
private Button useFileForSymbols; |
| 92 |
private Label imageOffsetLabel; |
| 93 |
private Label symbolsOffsetLabel; |
| 94 |
private Label projBinaryLabel1; |
| 95 |
private Label projBinaryLabel2; |
| 85 |
|
96 |
|
| 86 |
public String getName() { |
97 |
public String getName() { |
| 87 |
return TAB_NAME; |
98 |
return TAB_NAME; |
|
Lines 170-176
Link Here
|
| 170 |
}); |
181 |
}); |
| 171 |
delay.addModifyListener(new ModifyListener() { |
182 |
delay.addModifyListener(new ModifyListener() { |
| 172 |
public void modifyText(ModifyEvent e) { |
183 |
public void modifyText(ModifyEvent e) { |
| 173 |
updateLaunchConfigurationDialog(); |
184 |
scheduleUpdateJob(); |
| 174 |
} |
185 |
} |
| 175 |
}); |
186 |
}); |
| 176 |
|
187 |
|
|
Lines 197-203
Link Here
|
| 197 |
initCommands.setLayoutData(gd); |
208 |
initCommands.setLayoutData(gd); |
| 198 |
initCommands.addModifyListener(new ModifyListener() { |
209 |
initCommands.addModifyListener(new ModifyListener() { |
| 199 |
public void modifyText(ModifyEvent evt) { |
210 |
public void modifyText(ModifyEvent evt) { |
| 200 |
updateLaunchConfigurationDialog(); |
211 |
scheduleUpdateJob(); |
| 201 |
} |
212 |
} |
| 202 |
}); |
213 |
}); |
| 203 |
|
214 |
|
|
Lines 231-245
Link Here
|
| 231 |
comp.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); |
242 |
comp.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); |
| 232 |
comp.setLayout(layout); |
243 |
comp.setLayout(layout); |
| 233 |
|
244 |
|
| 234 |
Label imageLabel = new Label(comp, SWT.NONE); |
245 |
SelectionListener radioButtonListener = new SelectionListener() { |
| 235 |
imageLabel.setText(Messages.getString("GDBJtagStartupTab.imageLabel_Text")); |
246 |
public void widgetSelected(SelectionEvent e) { |
|
|
247 |
updateLaunchConfigurationDialog(); |
| 248 |
updateUseFileEnablement(); |
| 249 |
} |
| 250 |
public void widgetDefaultSelected(SelectionEvent e) { |
| 251 |
} |
| 252 |
}; |
| 253 |
|
| 254 |
useProjectBinaryForImage = new Button(comp, SWT.RADIO); |
| 255 |
useProjectBinaryForImage.setText(Messages.getString("GDBJtagStartupTab.useProjectBinary_Label")); |
| 256 |
useProjectBinaryForImage.setToolTipText(Messages.getString("GDBJtagStartupTab.useProjectBinary_ToolTip")); |
| 257 |
gd = new GridData(); |
| 258 |
gd.horizontalSpan = 1; |
| 259 |
useProjectBinaryForImage.setLayoutData(gd); |
| 260 |
useProjectBinaryForImage.addSelectionListener(radioButtonListener); |
| 261 |
|
| 262 |
projBinaryLabel1 = new Label(comp, SWT.NONE); |
| 263 |
gd = new GridData(GridData.FILL_HORIZONTAL); |
| 264 |
gd.horizontalSpan = 3; |
| 265 |
projBinaryLabel1.setLayoutData(gd); |
| 266 |
|
| 267 |
useFileForImage = new Button(comp, SWT.RADIO); |
| 268 |
useFileForImage.setText(Messages.getString("GDBJtagStartupTab.useFile_Label")); |
| 269 |
gd = new GridData(); |
| 270 |
gd.horizontalSpan = 1; |
| 271 |
useFileForImage.setLayoutData(gd); |
| 272 |
useFileForImage.addSelectionListener(radioButtonListener); |
| 273 |
|
| 236 |
imageFileName = new Text(comp, SWT.BORDER); |
274 |
imageFileName = new Text(comp, SWT.BORDER); |
| 237 |
gd = new GridData(GridData.FILL_HORIZONTAL); |
275 |
gd = new GridData(GridData.FILL_HORIZONTAL); |
| 238 |
gd.horizontalSpan = 1; |
276 |
gd.horizontalSpan = 1; |
| 239 |
imageFileName.setLayoutData(gd); |
277 |
imageFileName.setLayoutData(gd); |
| 240 |
imageFileName.addModifyListener(new ModifyListener() { |
278 |
imageFileName.addModifyListener(new ModifyListener() { |
| 241 |
public void modifyText(ModifyEvent e) { |
279 |
public void modifyText(ModifyEvent e) { |
| 242 |
updateLaunchConfigurationDialog(); |
280 |
scheduleUpdateJob(); |
| 243 |
} |
281 |
} |
| 244 |
}); |
282 |
}); |
| 245 |
|
283 |
|
|
Lines 257-263
Link Here
|
| 257 |
} |
295 |
} |
| 258 |
}); |
296 |
}); |
| 259 |
|
297 |
|
| 260 |
Label imageOffsetLabel = new Label(comp, SWT.NONE); |
298 |
imageOffsetLabel = new Label(comp, SWT.NONE); |
| 261 |
imageOffsetLabel.setText(Messages.getString("GDBJtagStartupTab.imageOffsetLabel_Text")); |
299 |
imageOffsetLabel.setText(Messages.getString("GDBJtagStartupTab.imageOffsetLabel_Text")); |
| 262 |
imageOffset = new Text(comp, SWT.BORDER); |
300 |
imageOffset = new Text(comp, SWT.BORDER); |
| 263 |
gd = new GridData(); |
301 |
gd = new GridData(); |
|
Lines 271-280
Link Here
|
| 271 |
}); |
309 |
}); |
| 272 |
imageOffset.addModifyListener(new ModifyListener() { |
310 |
imageOffset.addModifyListener(new ModifyListener() { |
| 273 |
public void modifyText(ModifyEvent e) { |
311 |
public void modifyText(ModifyEvent e) { |
| 274 |
updateLaunchConfigurationDialog(); |
312 |
scheduleUpdateJob(); |
| 275 |
} |
313 |
} |
| 276 |
}); |
314 |
}); |
| 277 |
|
315 |
|
|
|
316 |
|
| 278 |
loadSymbols = new Button(group, SWT.CHECK); |
317 |
loadSymbols = new Button(group, SWT.CHECK); |
| 279 |
loadSymbols.setText(Messages.getString("GDBJtagStartupTab.loadSymbols_Text")); |
318 |
loadSymbols.setText(Messages.getString("GDBJtagStartupTab.loadSymbols_Text")); |
| 280 |
gd = new GridData(); |
319 |
gd = new GridData(); |
|
Lines 292-307
Link Here
|
| 292 |
layout.numColumns = 4; |
331 |
layout.numColumns = 4; |
| 293 |
comp.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); |
332 |
comp.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); |
| 294 |
comp.setLayout(layout); |
333 |
comp.setLayout(layout); |
|
|
334 |
|
| 335 |
useProjectBinaryForSymbols = new Button(comp, SWT.RADIO); |
| 336 |
useProjectBinaryForSymbols.setText(Messages.getString("GDBJtagStartupTab.useProjectBinary_Label")); |
| 337 |
useProjectBinaryForSymbols.setToolTipText(Messages.getString("GDBJtagStartupTab.useProjectBinary_ToolTip")); |
| 338 |
gd = new GridData(); |
| 339 |
gd.horizontalSpan = 1; |
| 340 |
useProjectBinaryForSymbols.setLayoutData(gd); |
| 341 |
useProjectBinaryForSymbols.addSelectionListener(radioButtonListener); |
| 342 |
|
| 343 |
projBinaryLabel2 = new Label(comp, SWT.NONE); |
| 344 |
gd = new GridData(GridData.FILL_HORIZONTAL); |
| 345 |
gd.horizontalSpan = 3; |
| 346 |
projBinaryLabel2.setLayoutData(gd); |
| 347 |
|
| 348 |
useFileForSymbols = new Button(comp, SWT.RADIO); |
| 349 |
useFileForSymbols.setText(Messages.getString("GDBJtagStartupTab.useFile_Label")); |
| 350 |
gd = new GridData(); |
| 351 |
gd.horizontalSpan = 1; |
| 352 |
useFileForSymbols.setLayoutData(gd); |
| 353 |
useFileForSymbols.addSelectionListener(radioButtonListener); |
| 295 |
|
354 |
|
| 296 |
Label symbolLabel = new Label(comp, SWT.NONE); |
|
|
| 297 |
symbolLabel.setText(Messages.getString("GDBJtagStartupTab.symbolsLabel_Text")); |
| 298 |
symbolsFileName = new Text(comp, SWT.BORDER); |
355 |
symbolsFileName = new Text(comp, SWT.BORDER); |
| 299 |
gd = new GridData(GridData.FILL_HORIZONTAL); |
356 |
gd = new GridData(GridData.FILL_HORIZONTAL); |
| 300 |
gd.horizontalSpan = 1; |
357 |
gd.horizontalSpan = 1; |
| 301 |
symbolsFileName.setLayoutData(gd); |
358 |
symbolsFileName.setLayoutData(gd); |
| 302 |
symbolsFileName.addModifyListener(new ModifyListener() { |
359 |
symbolsFileName.addModifyListener(new ModifyListener() { |
| 303 |
public void modifyText(ModifyEvent e) { |
360 |
public void modifyText(ModifyEvent e) { |
| 304 |
updateLaunchConfigurationDialog(); |
361 |
scheduleUpdateJob(); |
| 305 |
} |
362 |
} |
| 306 |
}); |
363 |
}); |
| 307 |
|
364 |
|
|
Lines 319-325
Link Here
|
| 319 |
} |
376 |
} |
| 320 |
}); |
377 |
}); |
| 321 |
|
378 |
|
| 322 |
Label symbolsOffsetLabel = new Label(comp, SWT.NONE); |
379 |
symbolsOffsetLabel = new Label(comp, SWT.NONE); |
| 323 |
symbolsOffsetLabel.setText(Messages.getString("GDBJtagStartupTab.symbolsOffsetLabel_Text")); |
380 |
symbolsOffsetLabel.setText(Messages.getString("GDBJtagStartupTab.symbolsOffsetLabel_Text")); |
| 324 |
symbolsOffset = new Text(comp, SWT.BORDER); |
381 |
symbolsOffset = new Text(comp, SWT.BORDER); |
| 325 |
gd = new GridData(); |
382 |
gd = new GridData(); |
|
Lines 333-344
Link Here
|
| 333 |
}); |
390 |
}); |
| 334 |
symbolsOffset.addModifyListener(new ModifyListener() { |
391 |
symbolsOffset.addModifyListener(new ModifyListener() { |
| 335 |
public void modifyText(ModifyEvent e) { |
392 |
public void modifyText(ModifyEvent e) { |
| 336 |
updateLaunchConfigurationDialog(); |
393 |
scheduleUpdateJob(); |
| 337 |
} |
394 |
} |
| 338 |
}); |
395 |
}); |
| 339 |
|
396 |
|
| 340 |
} |
397 |
} |
| 341 |
|
398 |
|
|
|
399 |
private void updateUseFileEnablement() { |
| 400 |
boolean enabled = loadImage.getSelection() && useFileForImage.getSelection(); |
| 401 |
imageFileName.setEnabled(enabled); |
| 402 |
imageFileBrowseWs.setEnabled(enabled); |
| 403 |
imageFileBrowse.setEnabled(enabled); |
| 404 |
|
| 405 |
enabled = loadSymbols.getSelection() && useFileForSymbols.getSelection(); |
| 406 |
symbolsFileName.setEnabled(enabled); |
| 407 |
symbolsFileBrowseWs.setEnabled(enabled); |
| 408 |
symbolsFileBrowse.setEnabled(enabled); |
| 409 |
} |
| 410 |
|
| 342 |
public void createRunOptionGroup(Composite parent) { |
411 |
public void createRunOptionGroup(Composite parent) { |
| 343 |
Group group = new Group(parent, SWT.NONE); |
412 |
Group group = new Group(parent, SWT.NONE); |
| 344 |
GridLayout layout = new GridLayout(); |
413 |
GridLayout layout = new GridLayout(); |
|
Lines 373-379
Link Here
|
| 373 |
}); |
442 |
}); |
| 374 |
pcRegister.addModifyListener(new ModifyListener() { |
443 |
pcRegister.addModifyListener(new ModifyListener() { |
| 375 |
public void modifyText(ModifyEvent e) { |
444 |
public void modifyText(ModifyEvent e) { |
| 376 |
updateLaunchConfigurationDialog(); |
445 |
scheduleUpdateJob(); |
| 377 |
} |
446 |
} |
| 378 |
}); |
447 |
}); |
| 379 |
|
448 |
|
|
Lines 396-402
Link Here
|
| 396 |
stopAt.setLayoutData(gd); |
465 |
stopAt.setLayoutData(gd); |
| 397 |
stopAt.addModifyListener(new ModifyListener() { |
466 |
stopAt.addModifyListener(new ModifyListener() { |
| 398 |
public void modifyText(ModifyEvent e) { |
467 |
public void modifyText(ModifyEvent e) { |
| 399 |
updateLaunchConfigurationDialog(); |
468 |
scheduleUpdateJob(); |
| 400 |
} |
469 |
} |
| 401 |
}); |
470 |
}); |
| 402 |
|
471 |
|
|
Lines 419-436
Link Here
|
| 419 |
|
488 |
|
| 420 |
private void loadImageChanged() { |
489 |
private void loadImageChanged() { |
| 421 |
boolean enabled = loadImage.getSelection(); |
490 |
boolean enabled = loadImage.getSelection(); |
| 422 |
imageFileName.setEnabled(enabled); |
491 |
useProjectBinaryForImage.setEnabled(enabled); |
| 423 |
imageFileBrowseWs.setEnabled(enabled); |
492 |
useFileForImage.setEnabled(enabled); |
| 424 |
imageFileBrowse.setEnabled(enabled); |
|
|
| 425 |
imageOffset.setEnabled(enabled); |
493 |
imageOffset.setEnabled(enabled); |
|
|
494 |
imageOffsetLabel.setEnabled(enabled); |
| 495 |
updateUseFileEnablement(); |
| 426 |
} |
496 |
} |
| 427 |
|
497 |
|
| 428 |
private void loadSymbolsChanged() { |
498 |
private void loadSymbolsChanged() { |
| 429 |
boolean enabled = loadSymbols.getSelection(); |
499 |
boolean enabled = loadSymbols.getSelection(); |
| 430 |
symbolsFileName.setEnabled(enabled); |
500 |
useProjectBinaryForSymbols.setEnabled(enabled); |
| 431 |
symbolsFileBrowseWs.setEnabled(enabled); |
501 |
useFileForSymbols.setEnabled(enabled); |
| 432 |
symbolsFileBrowse.setEnabled(enabled); |
|
|
| 433 |
symbolsOffset.setEnabled(enabled); |
502 |
symbolsOffset.setEnabled(enabled); |
|
|
503 |
symbolsOffsetLabel.setEnabled(enabled); |
| 504 |
updateUseFileEnablement(); |
| 434 |
} |
505 |
} |
| 435 |
|
506 |
|
| 436 |
private void pcRegisterChanged() { |
507 |
private void pcRegisterChanged() { |
|
Lines 459-465
Link Here
|
| 459 |
runCommands.setLayoutData(gd); |
530 |
runCommands.setLayoutData(gd); |
| 460 |
runCommands.addModifyListener(new ModifyListener() { |
531 |
runCommands.addModifyListener(new ModifyListener() { |
| 461 |
public void modifyText(ModifyEvent evt) { |
532 |
public void modifyText(ModifyEvent evt) { |
| 462 |
updateLaunchConfigurationDialog(); |
533 |
scheduleUpdateJob(); |
| 463 |
} |
534 |
} |
| 464 |
}); |
535 |
}); |
| 465 |
} |
536 |
} |
|
Lines 474-513
Link Here
|
| 474 |
setMessage(null); |
545 |
setMessage(null); |
| 475 |
|
546 |
|
| 476 |
if (loadImage.getSelection()) { |
547 |
if (loadImage.getSelection()) { |
| 477 |
if (imageFileName.getText().trim().length() == 0) { |
548 |
if (!useProjectBinaryForImage.getSelection()) { |
| 478 |
setErrorMessage(Messages.getString("GDBJtagStartupTab.imageFileName_not_specified")); |
549 |
if (imageFileName.getText().trim().length() == 0) { |
| 479 |
return false; |
550 |
setErrorMessage(Messages.getString("GDBJtagStartupTab.imageFileName_not_specified")); |
| 480 |
} |
551 |
return false; |
| 481 |
|
552 |
} |
| 482 |
String path; |
553 |
|
| 483 |
try { |
554 |
try { |
| 484 |
path = VariablesPlugin.getDefault().getStringVariableManager().performStringSubstitution(imageFileName.getText().trim()); |
555 |
String path = VariablesPlugin.getDefault().getStringVariableManager().performStringSubstitution(imageFileName.getText().trim()); |
| 485 |
IPath filePath = new Path(path); |
556 |
IPath filePath = new Path(path); |
| 486 |
if (!filePath.toFile().exists()) { |
557 |
if (!filePath.toFile().exists()) { |
|
|
558 |
setErrorMessage(Messages.getString("GDBJtagStartupTab.imageFileName_does_not_exist")); |
| 559 |
return false; |
| 560 |
} |
| 561 |
} catch (CoreException e) { // string substitution throws this if expression doesn't resolve |
| 487 |
setErrorMessage(Messages.getString("GDBJtagStartupTab.imageFileName_does_not_exist")); |
562 |
setErrorMessage(Messages.getString("GDBJtagStartupTab.imageFileName_does_not_exist")); |
| 488 |
return false; |
563 |
return false; |
| 489 |
} |
564 |
} |
| 490 |
} catch (CoreException e) { |
|
|
| 491 |
Activator.getDefault().getLog().log(e.getStatus()); |
| 492 |
} |
565 |
} |
| 493 |
} else { |
566 |
} else { |
| 494 |
setErrorMessage(null); |
567 |
setErrorMessage(null); |
| 495 |
} |
568 |
} |
| 496 |
if (loadSymbols.getSelection()) { |
569 |
if (loadSymbols.getSelection()) { |
| 497 |
if (symbolsFileName.getText().trim().length() == 0) { |
570 |
if (!useProjectBinaryForSymbols.getSelection()) { |
| 498 |
setErrorMessage(Messages.getString("GDBJtagStartupTab.symbolsFileName_not_specified")); |
571 |
if (symbolsFileName.getText().trim().length() == 0) { |
| 499 |
return false; |
572 |
setErrorMessage(Messages.getString("GDBJtagStartupTab.symbolsFileName_not_specified")); |
| 500 |
} |
573 |
return false; |
| 501 |
String path; |
574 |
} |
| 502 |
try { |
575 |
|
| 503 |
path = VariablesPlugin.getDefault().getStringVariableManager().performStringSubstitution(symbolsFileName.getText().trim()); |
576 |
try { |
| 504 |
IPath filePath = new Path(path); |
577 |
String path = VariablesPlugin.getDefault().getStringVariableManager().performStringSubstitution(symbolsFileName.getText().trim()); |
| 505 |
if (!filePath.toFile().exists()) { |
578 |
IPath filePath = new Path(path); |
|
|
579 |
if (!filePath.toFile().exists()) { |
| 580 |
setErrorMessage(Messages.getString("GDBJtagStartupTab.symbolsFileName_does_not_exist")); |
| 581 |
return false; |
| 582 |
} |
| 583 |
} catch (CoreException e) { // string substitution throws this if expression doesn't resolve |
| 506 |
setErrorMessage(Messages.getString("GDBJtagStartupTab.symbolsFileName_does_not_exist")); |
584 |
setErrorMessage(Messages.getString("GDBJtagStartupTab.symbolsFileName_does_not_exist")); |
| 507 |
return false; |
585 |
return false; |
| 508 |
} |
586 |
} |
| 509 |
} catch (CoreException e) { |
|
|
| 510 |
Activator.getDefault().getLog().log(e.getStatus()); |
| 511 |
} |
587 |
} |
| 512 |
} else { |
588 |
} else { |
| 513 |
setErrorMessage(null); |
589 |
setErrorMessage(null); |
|
Lines 540-611
Link Here
|
| 540 |
} |
616 |
} |
| 541 |
|
617 |
|
| 542 |
/* (non-Javadoc) |
618 |
/* (non-Javadoc) |
| 543 |
* @see org.eclipse.debug.ui.AbstractLaunchConfigurationTab#updateLaunchConfigurationDialog() |
619 |
* @see org.eclipse.debug.ui.ILaunchConfigurationTab#initializeFrom(org.eclipse.debug.core.ILaunchConfiguration) |
| 544 |
*/ |
620 |
*/ |
| 545 |
// protected void updateLaunchConfigurationDialog() { |
|
|
| 546 |
// super.updateLaunchConfigurationDialog(); |
| 547 |
// isValid(getLaunchConfigurationDialog()); |
| 548 |
// } |
| 549 |
|
| 550 |
public void initializeFrom(ILaunchConfiguration configuration) { |
621 |
public void initializeFrom(ILaunchConfiguration configuration) { |
| 551 |
try { |
622 |
try { |
| 552 |
initCommands.setText(configuration.getAttribute(IGDBJtagConstants.ATTR_INIT_COMMANDS, "")); //$NON-NLS-1$ |
623 |
// Initialization Commands |
| 553 |
doReset.setSelection(configuration.getAttribute(IGDBJtagConstants.ATTR_DO_RESET, IGDBJtagConstants.DEFAULT_DO_RESET)); |
624 |
doReset.setSelection(configuration.getAttribute(IGDBJtagConstants.ATTR_DO_RESET, IGDBJtagConstants.DEFAULT_DO_RESET)); |
| 554 |
doResetChanged(); |
|
|
| 555 |
doHalt.setSelection(configuration.getAttribute(IGDBJtagConstants.ATTR_DO_HALT, IGDBJtagConstants.DEFAULT_DO_HALT)); |
| 556 |
delay.setText(String.valueOf(configuration.getAttribute(IGDBJtagConstants.ATTR_DELAY, IGDBJtagConstants.DEFAULT_DELAY))); |
625 |
delay.setText(String.valueOf(configuration.getAttribute(IGDBJtagConstants.ATTR_DELAY, IGDBJtagConstants.DEFAULT_DELAY))); |
|
|
626 |
doHalt.setSelection(configuration.getAttribute(IGDBJtagConstants.ATTR_DO_HALT, IGDBJtagConstants.DEFAULT_DO_HALT)); |
| 627 |
initCommands.setText(configuration.getAttribute(IGDBJtagConstants.ATTR_INIT_COMMANDS, IGDBJtagConstants.DEFAULT_INIT_COMMANDS)); |
| 628 |
|
| 629 |
// Load Image... |
| 557 |
loadImage.setSelection(configuration.getAttribute(IGDBJtagConstants.ATTR_LOAD_IMAGE, IGDBJtagConstants.DEFAULT_LOAD_IMAGE)); |
630 |
loadImage.setSelection(configuration.getAttribute(IGDBJtagConstants.ATTR_LOAD_IMAGE, IGDBJtagConstants.DEFAULT_LOAD_IMAGE)); |
| 558 |
loadImageChanged(); |
631 |
useProjectBinaryForImage.setSelection(configuration.getAttribute(IGDBJtagConstants.ATTR_USE_PROJ_BINARY_FOR_IMAGE, IGDBJtagConstants.DEFAULT_USE_PROJ_BINARY_FOR_IMAGE)); |
| 559 |
String defaultImageFileName = configuration.getAttribute(IGDBJtagConstants.ATTR_IMAGE_FILE_NAME, ""); //$NON-NLS-1$ |
632 |
useFileForImage.setSelection(configuration.getAttribute(IGDBJtagConstants.ATTR_USE_FILE_FOR_IMAGE, IGDBJtagConstants.DEFAULT_USE_FILE_FOR_IMAGE)); |
| 560 |
if (defaultImageFileName.equals("")) { |
633 |
imageFileName.setText(configuration.getAttribute(IGDBJtagConstants.ATTR_IMAGE_FILE_NAME, IGDBJtagConstants.DEFAULT_IMAGE_FILE_NAME)); |
| 561 |
defaultImageFileName = configuration.getWorkingCopy().getAttribute(ICDTLaunchConfigurationConstants.ATTR_PROGRAM_NAME, ""); //$NON-NLS-1$ |
634 |
imageOffset.setText(configuration.getAttribute(IGDBJtagConstants.ATTR_IMAGE_OFFSET, IGDBJtagConstants.DEFAULT_IMAGE_OFFSET)); |
| 562 |
} |
635 |
|
| 563 |
imageFileName.setText(defaultImageFileName); |
636 |
//.. and Symbols |
| 564 |
imageOffset.setText(configuration.getAttribute(IGDBJtagConstants.ATTR_IMAGE_OFFSET, "")); //$NON-NLS-1$ |
|
|
| 565 |
loadSymbols.setSelection(configuration.getAttribute(IGDBJtagConstants.ATTR_LOAD_SYMBOLS, IGDBJtagConstants.DEFAULT_LOAD_SYMBOLS)); |
637 |
loadSymbols.setSelection(configuration.getAttribute(IGDBJtagConstants.ATTR_LOAD_SYMBOLS, IGDBJtagConstants.DEFAULT_LOAD_SYMBOLS)); |
| 566 |
loadSymbolsChanged(); |
638 |
useProjectBinaryForSymbols.setSelection(configuration.getAttribute(IGDBJtagConstants.ATTR_USE_PROJ_BINARY_FOR_SYMBOLS, IGDBJtagConstants.DEFAULT_USE_PROJ_BINARY_FOR_SYMBOLS)); |
| 567 |
symbolsFileName.setText(configuration.getAttribute(IGDBJtagConstants.ATTR_SYMBOLS_FILE_NAME, "")); //$NON-NLS-1$ |
639 |
useFileForSymbols.setSelection(configuration.getAttribute(IGDBJtagConstants.ATTR_USE_FILE_FOR_SYMBOLS, IGDBJtagConstants.DEFAULT_USE_FILE_FOR_SYMBOLS)); |
| 568 |
symbolsOffset.setText(configuration.getAttribute(IGDBJtagConstants.ATTR_SYMBOLS_OFFSET, "")); //$NON-NLS-1$ |
640 |
symbolsFileName.setText(configuration.getAttribute(IGDBJtagConstants.ATTR_SYMBOLS_FILE_NAME, IGDBJtagConstants.DEFAULT_SYMBOLS_FILE_NAME)); |
|
|
641 |
symbolsOffset.setText(configuration.getAttribute(IGDBJtagConstants.ATTR_SYMBOLS_OFFSET, IGDBJtagConstants.DEFAULT_SYMBOLS_OFFSET)); |
| 642 |
|
| 643 |
// Runtime Options |
| 569 |
setPcRegister.setSelection(configuration.getAttribute(IGDBJtagConstants.ATTR_SET_PC_REGISTER, IGDBJtagConstants.DEFAULT_SET_PC_REGISTER)); |
644 |
setPcRegister.setSelection(configuration.getAttribute(IGDBJtagConstants.ATTR_SET_PC_REGISTER, IGDBJtagConstants.DEFAULT_SET_PC_REGISTER)); |
| 570 |
pcRegisterChanged(); |
645 |
pcRegister.setText(configuration.getAttribute(IGDBJtagConstants.ATTR_PC_REGISTER, IGDBJtagConstants.DEFAULT_PC_REGISTER)); |
| 571 |
pcRegister.setText(configuration.getAttribute(IGDBJtagConstants.ATTR_PC_REGISTER, "")); //$NON-NLS-1$ |
|
|
| 572 |
setStopAt.setSelection(configuration.getAttribute(IGDBJtagConstants.ATTR_SET_STOP_AT, IGDBJtagConstants.DEFAULT_SET_STOP_AT)); |
646 |
setStopAt.setSelection(configuration.getAttribute(IGDBJtagConstants.ATTR_SET_STOP_AT, IGDBJtagConstants.DEFAULT_SET_STOP_AT)); |
| 573 |
stopAtChanged(); |
647 |
stopAt.setText(configuration.getAttribute(IGDBJtagConstants.ATTR_STOP_AT, IGDBJtagConstants.DEFAULT_STOP_AT)); |
| 574 |
stopAt.setText(configuration.getAttribute(IGDBJtagConstants.ATTR_STOP_AT, "")); //$NON-NLS-1$ |
|
|
| 575 |
setResume.setSelection(configuration.getAttribute(IGDBJtagConstants.ATTR_SET_RESUME, IGDBJtagConstants.DEFAULT_SET_RESUME)); |
648 |
setResume.setSelection(configuration.getAttribute(IGDBJtagConstants.ATTR_SET_RESUME, IGDBJtagConstants.DEFAULT_SET_RESUME)); |
|
|
649 |
|
| 650 |
// Run Commands |
| 651 |
runCommands.setText(configuration.getAttribute(IGDBJtagConstants.ATTR_RUN_COMMANDS, IGDBJtagConstants.DEFAULT_RUN_COMMANDS)); |
| 652 |
|
| 653 |
String programName = CDebugUtils.getProgramName(configuration); |
| 654 |
if (programName != null) { |
| 655 |
int lastSlash = programName.indexOf('\\'); |
| 656 |
if (lastSlash >= 0) { |
| 657 |
programName = programName.substring(lastSlash + 1); |
| 658 |
} |
| 659 |
lastSlash = programName.indexOf('/'); |
| 660 |
if (lastSlash >= 0) { |
| 661 |
programName = programName.substring(lastSlash + 1); |
| 662 |
} |
| 663 |
projBinaryLabel1.setText(programName); |
| 664 |
projBinaryLabel2.setText(programName); |
| 665 |
} |
| 666 |
|
| 667 |
doResetChanged(); |
| 668 |
loadImageChanged(); |
| 669 |
loadSymbolsChanged(); |
| 670 |
pcRegisterChanged(); |
| 671 |
stopAtChanged(); |
| 576 |
resumeChanged(); |
672 |
resumeChanged(); |
| 577 |
runCommands.setText(configuration.getAttribute(IGDBJtagConstants.ATTR_RUN_COMMANDS, "")); //$NON-NLS-1$) |
673 |
updateUseFileEnablement(); |
|
|
674 |
|
| 578 |
} catch (CoreException e) { |
675 |
} catch (CoreException e) { |
| 579 |
Activator.getDefault().getLog().log(e.getStatus()); |
676 |
Activator.getDefault().getLog().log(e.getStatus()); |
| 580 |
} |
677 |
} |
| 581 |
} |
678 |
} |
| 582 |
|
679 |
|
|
|
680 |
/* (non-Javadoc) |
| 681 |
* @see org.eclipse.debug.ui.ILaunchConfigurationTab#performApply(org.eclipse.debug.core.ILaunchConfigurationWorkingCopy) |
| 682 |
*/ |
| 583 |
public void performApply(ILaunchConfigurationWorkingCopy configuration) { |
683 |
public void performApply(ILaunchConfigurationWorkingCopy configuration) { |
| 584 |
configuration.setAttribute(IGDBJtagConstants.ATTR_INIT_COMMANDS, initCommands.getText()); |
684 |
|
| 585 |
configuration.setAttribute(IGDBJtagConstants.ATTR_DELAY, Integer.parseInt(delay.getText())); |
685 |
// Initialization Commands |
| 586 |
configuration.setAttribute(IGDBJtagConstants.ATTR_DO_RESET, doReset.getSelection()); |
686 |
configuration.setAttribute(IGDBJtagConstants.ATTR_DO_RESET, doReset.getSelection()); |
|
|
687 |
configuration.setAttribute(IGDBJtagConstants.ATTR_DELAY, Integer.parseInt(delay.getText())); |
| 587 |
configuration.setAttribute(IGDBJtagConstants.ATTR_DO_HALT, doHalt.getSelection()); |
688 |
configuration.setAttribute(IGDBJtagConstants.ATTR_DO_HALT, doHalt.getSelection()); |
|
|
689 |
configuration.setAttribute(IGDBJtagConstants.ATTR_INIT_COMMANDS, initCommands.getText()); |
| 690 |
|
| 691 |
// Load Image... |
| 588 |
configuration.setAttribute(IGDBJtagConstants.ATTR_LOAD_IMAGE, loadImage.getSelection()); |
692 |
configuration.setAttribute(IGDBJtagConstants.ATTR_LOAD_IMAGE, loadImage.getSelection()); |
|
|
693 |
configuration.setAttribute(IGDBJtagConstants.ATTR_USE_PROJ_BINARY_FOR_IMAGE, useProjectBinaryForImage.getSelection()); |
| 694 |
configuration.setAttribute(IGDBJtagConstants.ATTR_USE_FILE_FOR_IMAGE, useFileForImage.getSelection()); |
| 589 |
configuration.setAttribute(IGDBJtagConstants.ATTR_IMAGE_FILE_NAME, imageFileName.getText().trim()); |
695 |
configuration.setAttribute(IGDBJtagConstants.ATTR_IMAGE_FILE_NAME, imageFileName.getText().trim()); |
| 590 |
configuration.setAttribute(IGDBJtagConstants.ATTR_IMAGE_OFFSET, imageOffset.getText()); |
696 |
configuration.setAttribute(IGDBJtagConstants.ATTR_IMAGE_OFFSET, imageOffset.getText()); |
|
|
697 |
|
| 698 |
//.. and Symbols |
| 591 |
configuration.setAttribute(IGDBJtagConstants.ATTR_LOAD_SYMBOLS, loadSymbols.getSelection()); |
699 |
configuration.setAttribute(IGDBJtagConstants.ATTR_LOAD_SYMBOLS, loadSymbols.getSelection()); |
| 592 |
configuration.setAttribute(IGDBJtagConstants.ATTR_SYMBOLS_OFFSET, symbolsOffset.getText()); |
700 |
configuration.setAttribute(IGDBJtagConstants.ATTR_USE_PROJ_BINARY_FOR_SYMBOLS, useProjectBinaryForSymbols.getSelection()); |
|
|
701 |
configuration.setAttribute(IGDBJtagConstants.ATTR_USE_FILE_FOR_SYMBOLS, useFileForSymbols.getSelection()); |
| 593 |
configuration.setAttribute(IGDBJtagConstants.ATTR_SYMBOLS_FILE_NAME, symbolsFileName.getText().trim()); |
702 |
configuration.setAttribute(IGDBJtagConstants.ATTR_SYMBOLS_FILE_NAME, symbolsFileName.getText().trim()); |
|
|
703 |
configuration.setAttribute(IGDBJtagConstants.ATTR_SYMBOLS_OFFSET, symbolsOffset.getText()); |
| 704 |
|
| 705 |
// Runtime Options |
| 594 |
configuration.setAttribute(IGDBJtagConstants.ATTR_SET_PC_REGISTER, setPcRegister.getSelection()); |
706 |
configuration.setAttribute(IGDBJtagConstants.ATTR_SET_PC_REGISTER, setPcRegister.getSelection()); |
| 595 |
configuration.setAttribute(IGDBJtagConstants.ATTR_PC_REGISTER, pcRegister.getText()); |
707 |
configuration.setAttribute(IGDBJtagConstants.ATTR_PC_REGISTER, pcRegister.getText()); |
| 596 |
configuration.setAttribute(IGDBJtagConstants.ATTR_SET_STOP_AT, setStopAt.getSelection()); |
708 |
configuration.setAttribute(IGDBJtagConstants.ATTR_SET_STOP_AT, setStopAt.getSelection()); |
| 597 |
configuration.setAttribute(IGDBJtagConstants.ATTR_STOP_AT, stopAt.getText()); |
709 |
configuration.setAttribute(IGDBJtagConstants.ATTR_STOP_AT, stopAt.getText()); |
| 598 |
configuration.setAttribute(IGDBJtagConstants.ATTR_SET_RESUME, setResume.getSelection()); |
710 |
configuration.setAttribute(IGDBJtagConstants.ATTR_SET_RESUME, setResume.getSelection()); |
|
|
711 |
|
| 712 |
// Run Commands |
| 599 |
configuration.setAttribute(IGDBJtagConstants.ATTR_RUN_COMMANDS, runCommands.getText()); |
713 |
configuration.setAttribute(IGDBJtagConstants.ATTR_RUN_COMMANDS, runCommands.getText()); |
| 600 |
} |
714 |
} |
| 601 |
|
715 |
|
|
|
716 |
/* (non-Javadoc) |
| 717 |
* @see org.eclipse.debug.ui.ILaunchConfigurationTab#setDefaults(org.eclipse.debug.core.ILaunchConfigurationWorkingCopy) |
| 718 |
*/ |
| 602 |
public void setDefaults(ILaunchConfigurationWorkingCopy configuration) { |
719 |
public void setDefaults(ILaunchConfigurationWorkingCopy configuration) { |
| 603 |
configuration.setAttribute(IGDBJtagConstants.ATTR_INIT_COMMANDS, ""); //$NON-NLS-1$ |
720 |
// Initialization Commands |
|
|
721 |
configuration.setAttribute(IGDBJtagConstants.ATTR_DO_RESET, IGDBJtagConstants.DEFAULT_DO_RESET); |
| 722 |
configuration.setAttribute(IGDBJtagConstants.ATTR_DELAY, IGDBJtagConstants.DEFAULT_DELAY); |
| 723 |
configuration.setAttribute(IGDBJtagConstants.ATTR_DO_HALT, IGDBJtagConstants.DEFAULT_DO_HALT); |
| 724 |
configuration.setAttribute(IGDBJtagConstants.ATTR_INIT_COMMANDS, IGDBJtagConstants.DEFAULT_INIT_COMMANDS); |
| 725 |
|
| 726 |
// Load Image... |
| 604 |
configuration.setAttribute(IGDBJtagConstants.ATTR_LOAD_IMAGE, IGDBJtagConstants.DEFAULT_LOAD_IMAGE); |
727 |
configuration.setAttribute(IGDBJtagConstants.ATTR_LOAD_IMAGE, IGDBJtagConstants.DEFAULT_LOAD_IMAGE); |
| 605 |
configuration.setAttribute(IGDBJtagConstants.ATTR_IMAGE_FILE_NAME, ""); //$NON-NLS-1$ |
728 |
configuration.setAttribute(IGDBJtagConstants.ATTR_USE_PROJ_BINARY_FOR_IMAGE, IGDBJtagConstants.DEFAULT_USE_PROJ_BINARY_FOR_IMAGE); |
| 606 |
configuration.setAttribute(IGDBJtagConstants.ATTR_RUN_COMMANDS, ""); //$NON-NLS-1$ |
729 |
configuration.setAttribute(IGDBJtagConstants.ATTR_USE_FILE_FOR_IMAGE, IGDBJtagConstants.DEFAULT_USE_FILE_FOR_IMAGE); |
| 607 |
configuration.setAttribute(IGDBJtagConstants.ATTR_DO_RESET, true); |
730 |
configuration.setAttribute(IGDBJtagConstants.ATTR_IMAGE_FILE_NAME, IGDBJtagConstants.DEFAULT_IMAGE_FILE_NAME); |
| 608 |
configuration.setAttribute(IGDBJtagConstants.ATTR_DO_HALT, true); |
731 |
configuration.setAttribute(IGDBJtagConstants.ATTR_IMAGE_OFFSET, IGDBJtagConstants.DEFAULT_IMAGE_OFFSET); |
| 609 |
} |
732 |
|
|
|
733 |
//.. and Symbols |
| 734 |
configuration.setAttribute(IGDBJtagConstants.ATTR_LOAD_SYMBOLS, IGDBJtagConstants.DEFAULT_LOAD_SYMBOLS); |
| 735 |
configuration.setAttribute(IGDBJtagConstants.ATTR_USE_PROJ_BINARY_FOR_SYMBOLS, IGDBJtagConstants.DEFAULT_USE_PROJ_BINARY_FOR_SYMBOLS); |
| 736 |
configuration.setAttribute(IGDBJtagConstants.ATTR_USE_FILE_FOR_SYMBOLS, IGDBJtagConstants.DEFAULT_USE_FILE_FOR_SYMBOLS); |
| 737 |
configuration.setAttribute(IGDBJtagConstants.ATTR_SYMBOLS_FILE_NAME, IGDBJtagConstants.DEFAULT_SYMBOLS_FILE_NAME); |
| 738 |
configuration.setAttribute(IGDBJtagConstants.ATTR_SYMBOLS_OFFSET, IGDBJtagConstants.DEFAULT_SYMBOLS_OFFSET); |
| 739 |
|
| 740 |
// Runtime Options |
| 741 |
configuration.setAttribute(IGDBJtagConstants.ATTR_SET_PC_REGISTER, IGDBJtagConstants.DEFAULT_SET_PC_REGISTER); |
| 742 |
configuration.setAttribute(IGDBJtagConstants.ATTR_PC_REGISTER, IGDBJtagConstants.DEFAULT_PC_REGISTER); |
| 743 |
configuration.setAttribute(IGDBJtagConstants.ATTR_SET_STOP_AT, IGDBJtagConstants.DEFAULT_SET_STOP_AT); |
| 744 |
configuration.setAttribute(IGDBJtagConstants.ATTR_STOP_AT, IGDBJtagConstants.DEFAULT_STOP_AT); |
| 745 |
configuration.setAttribute(IGDBJtagConstants.ATTR_SET_RESUME, IGDBJtagConstants.DEFAULT_SET_RESUME); |
| 610 |
|
746 |
|
|
|
747 |
// Run Commands |
| 748 |
configuration.setAttribute(IGDBJtagConstants.ATTR_RUN_COMMANDS, IGDBJtagConstants.DEFAULT_RUN_COMMANDS); |
| 749 |
} |
| 611 |
} |
750 |
} |