Skip to content

Commit a4907af

Browse files
committed
jlink update for 4.80
- default enable semihosting console - log button style changed to save - gdb server command line using ArrayList - ‘-telnetport’ instead ‘-semiport’ - ‘-noreset’ ‘-noir’
1 parent 1e24c26 commit a4907af

File tree

2 files changed

+64
-26
lines changed

2 files changed

+64
-26
lines changed

ilg.gnuarmeclipse.debug.gdbjtag.jlink/src/ilg/gnuarmeclipse/debug/gdbjtag/jlink/ConfigurationAttributes.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ public interface ConfigurationAttributes {
9595

9696
public static final String DO_GDB_SERVER_ALLOCATE_SEMIHOSTING_CONSOLE = PREFIX
9797
+ ".doGdbServerAllocateSemihostingConsole"; //$NON-NLS-1$
98-
public static final boolean DO_GDB_SERVER_ALLOCATE_SEMIHOSTING_CONSOLE_DEFAULT = false;
98+
public static final boolean DO_GDB_SERVER_ALLOCATE_SEMIHOSTING_CONSOLE_DEFAULT = true;
9999

100100
public static final String GDB_CLIENT_EXECUTABLE_DEFAULT = "${cross_prefix}gdb${cross_suffix}";
101101

ilg.gnuarmeclipse.debug.gdbjtag.jlink/src/ilg/gnuarmeclipse/debug/gdbjtag/jlink/ui/TabDebugger.java

+63-25
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@
2727
import ilg.gnuarmeclipse.debug.gdbjtag.jlink.Utils;
2828

2929
import java.io.File;
30+
import java.util.ArrayList;
31+
import java.util.List;
3032

3133
import org.eclipse.cdt.debug.gdbjtag.core.IGDBJtagConstants;
3234
import org.eclipse.cdt.debug.gdbjtag.ui.GDBJtagImages;
@@ -202,6 +204,18 @@ private void browseButtonSelected(String title, Text text) {
202204
text.setText(str);
203205
}
204206

207+
private void browseSaveButtonSelected(String title, Text text) {
208+
FileDialog dialog = new FileDialog(getShell(), SWT.SAVE);
209+
dialog.setText(title);
210+
String str = text.getText().trim();
211+
int lastSeparatorIndex = str.lastIndexOf(File.separator);
212+
if (lastSeparatorIndex != -1)
213+
dialog.setFilterPath(str.substring(0, lastSeparatorIndex));
214+
str = dialog.open();
215+
if (str != null)
216+
text.setText(str);
217+
}
218+
205219
private void variablesButtonSelected(Text text) {
206220
StringVariableSelectionDialog dialog = new StringVariableSelectionDialog(
207221
getShell());
@@ -279,6 +293,7 @@ public void widgetSelected(SelectionEvent e) {
279293
public void widgetSelected(SelectionEvent e) {
280294
updateLaunchConfigurationDialog();
281295

296+
doConnectToRunningChanged();
282297
tabStartup.doConnectToRunningChanged(doConnectToRunning
283298
.getSelection());
284299
}
@@ -746,7 +761,7 @@ public void modifyText(ModifyEvent e) {
746761
gdbServerLogBrowse.addSelectionListener(new SelectionAdapter() {
747762
@Override
748763
public void widgetSelected(SelectionEvent e) {
749-
browseButtonSelected(Messages
764+
browseSaveButtonSelected(Messages
750765
.getString("DebuggerTab.gdbServerLogBrowse_Title"),
751766
gdbServerLog);
752767
}
@@ -962,6 +977,16 @@ private void doStartGdbServerChanged() {
962977
targetPortNumber.setEnabled(!enabled);
963978
}
964979

980+
private void doConnectToRunningChanged() {
981+
982+
if (doStartGdbServer.getSelection()) {
983+
984+
boolean enabled = doConnectToRunning.getSelection();
985+
986+
doGdbServerInitRegs.setEnabled(!enabled);
987+
}
988+
}
989+
965990
@Override
966991
public void initializeFrom(ILaunchConfiguration configuration) {
967992
try {
@@ -1163,6 +1188,7 @@ else if (ConfigurationAttributes.ENDIANNESS_BIG
11631188
}
11641189

11651190
doStartGdbServerChanged();
1191+
doConnectToRunningChanged();
11661192

11671193
// Force thread update
11681194
boolean updateThreadsOnSuspend = configuration
@@ -1552,8 +1578,9 @@ public static String getGdbServerCommand(ILaunchConfiguration configuration) {
15521578

15531579
public static String getGdbServerCommandLine(
15541580
ILaunchConfiguration configuration) {
1555-
StringBuffer sb = new StringBuffer();
15561581

1582+
List<String> lst = new ArrayList<String>();
1583+
15571584
try {
15581585
if (!configuration.getAttribute(
15591586
ConfigurationAttributes.DO_START_GDB_SERVER,
@@ -1567,43 +1594,43 @@ public static String getGdbServerCommandLine(
15671594
if (executable.length() == 0)
15681595
return null;
15691596

1570-
sb.append(executable);
1597+
lst.add(executable);
15711598

1572-
sb.append(" -if ");
1573-
sb.append(configuration.getAttribute(
1599+
lst.add("-if");
1600+
lst.add(configuration.getAttribute(
15741601
ConfigurationAttributes.INTERFACE,
15751602
ConfigurationAttributes.INTERFACE_DEFAULT));
15761603

15771604
String name = configuration.getAttribute(
15781605
ConfigurationAttributes.FLASH_DEVICE_NAME,
15791606
ConfigurationAttributes.FLASH_DEVICE_NAME_DEFAULT).trim();
15801607
if (name.length() > 0) {
1581-
sb.append(" -device ");
1582-
sb.append(name);
1608+
lst.add("-device");
1609+
lst.add(name);
15831610
}
15841611

1585-
sb.append(" -endian ");
1586-
sb.append(configuration.getAttribute(
1612+
lst.add("-endian");
1613+
lst.add(configuration.getAttribute(
15871614
ConfigurationAttributes.ENDIANNESS,
15881615
ConfigurationAttributes.ENDIANNESS_DEFAULT));
15891616

1590-
sb.append(" -speed ");
1591-
sb.append(configuration.getAttribute(
1617+
lst.add("-speed");
1618+
lst.add(configuration.getAttribute(
15921619
ConfigurationAttributes.GDB_SERVER_SPEED,
15931620
ConfigurationAttributes.GDB_SERVER_SPEED_DEFAULT));
15941621

1595-
sb.append(" -port ");
1596-
sb.append(Integer.toString(configuration.getAttribute(
1622+
lst.add("-port");
1623+
lst.add(Integer.toString(configuration.getAttribute(
15971624
ConfigurationAttributes.GDB_SERVER_GDB_PORT_NUMBER,
15981625
ConfigurationAttributes.GDB_SERVER_GDB_PORT_NUMBER_DEFAULT)));
15991626

1600-
sb.append(" -swoport ");
1601-
sb.append(Integer.toString(configuration.getAttribute(
1627+
lst.add("-swoport");
1628+
lst.add(Integer.toString(configuration.getAttribute(
16021629
ConfigurationAttributes.GDB_SERVER_SWO_PORT_NUMBER,
16031630
ConfigurationAttributes.GDB_SERVER_SWO_PORT_NUMBER_DEFAULT)));
16041631

1605-
sb.append(" -semiport ");
1606-
sb.append(Integer.toString(configuration
1632+
lst.add("-telnetport");
1633+
lst.add(Integer.toString(configuration
16071634
.getAttribute(
16081635
ConfigurationAttributes.GDB_SERVER_TELNET_PORT_NUMBER,
16091636
ConfigurationAttributes.GDB_SERVER_TELNET_PORT_NUMBER_DEFAULT)));
@@ -1612,52 +1639,63 @@ public static String getGdbServerCommandLine(
16121639
.getAttribute(
16131640
ConfigurationAttributes.DO_GDB_SERVER_VERIFY_DOWNLOAD,
16141641
ConfigurationAttributes.DO_GDB_SERVER_VERIFY_DOWNLOAD_DEFAULT)) {
1615-
sb.append(" -vd ");
1642+
lst.add("-vd");
16161643
}
16171644

1618-
if (!configuration.getAttribute(
1645+
if (configuration.getAttribute(
16191646
ConfigurationAttributes.DO_CONNECT_TO_RUNNING,
16201647
ConfigurationAttributes.DO_CONNECT_TO_RUNNING_DEFAULT)) {
1648+
lst.add("-noreset");
1649+
lst.add("-noir");
1650+
} else {
16211651
if (configuration
16221652
.getAttribute(
16231653
ConfigurationAttributes.DO_GDB_SERVER_INIT_REGS,
16241654
ConfigurationAttributes.DO_GDB_SERVER_INIT_REGS_DEFAULT)) {
1625-
sb.append(" -ir ");
1655+
lst.add("-ir");
1656+
} else {
1657+
lst.add("-noir");
16261658
}
16271659
}
16281660

16291661
if (configuration.getAttribute(
16301662
ConfigurationAttributes.DO_GDB_SERVER_LOCAL_ONLY,
16311663
ConfigurationAttributes.DO_GDB_SERVER_LOCAL_ONLY_DEFAULT)) {
1632-
sb.append(" -localhostonly ");
1664+
lst.add("-localhostonly");
16331665
}
16341666

16351667
if (configuration.getAttribute(
16361668
ConfigurationAttributes.DO_GDB_SERVER_SILENT,
16371669
ConfigurationAttributes.DO_GDB_SERVER_SILENT_DEFAULT)) {
1638-
sb.append(" -silent ");
1670+
lst.add("-silent");
16391671
}
16401672

16411673
String logFile = configuration.getAttribute(
16421674
ConfigurationAttributes.GDB_SERVER_LOG,
16431675
ConfigurationAttributes.GDB_SERVER_LOG_DEFAULT).trim();
16441676

16451677
if (logFile.length() > 0) {
1646-
sb.append(" -log ");
1647-
sb.append(logFile);
1678+
lst.add("-log");
1679+
lst.add(Utils.escapeWhitespaces(logFile));
16481680
}
16491681

16501682
String other = configuration.getAttribute(
16511683
ConfigurationAttributes.GDB_SERVER_OTHER,
16521684
ConfigurationAttributes.GDB_SERVER_OTHER_DEFAULT).trim();
16531685
if (other.length() > 0) {
1654-
sb.append(other);
1686+
lst.add(other);
16551687
}
16561688
} catch (CoreException e) {
16571689
Activator.log(e);
16581690
return null;
16591691
}
16601692

1693+
StringBuffer sb = new StringBuffer();
1694+
for (String item: lst) {
1695+
sb.append(item);
1696+
sb.append(' ');
1697+
}
1698+
16611699
String str = null;
16621700
try {
16631701
str = VariablesPlugin.getDefault().getStringVariableManager()

0 commit comments

Comments
 (0)