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