fixed #207758 - gdbserver: support for extended remote protocol
authorEgor Ushakov <gorrus@netbeans.org>
Thu, 02 Feb 2012 20:25:39 +0400
changeset 177698b3118a7dd04
parent 17768 cdf4aa37244b
child 17770 5e0ab19dd6c8
fixed #207758 - gdbserver: support for extended remote protocol
cnd.debugger.gdbserver/nbproject/project.xml
cnd.debugger.gdbserver/src/org/netbeans/modules/cnd/debugger/gdbserver/Bundle.properties
cnd.debugger.gdbserver/src/org/netbeans/modules/cnd/debugger/gdbserver/GdbServerAttachPanel.form
cnd.debugger.gdbserver/src/org/netbeans/modules/cnd/debugger/gdbserver/GdbServerAttachPanel.java
     1.1 --- a/cnd.debugger.gdbserver/nbproject/project.xml	Wed Feb 01 16:27:01 2012 +0100
     1.2 +++ b/cnd.debugger.gdbserver/nbproject/project.xml	Thu Feb 02 20:25:39 2012 +0400
     1.3 @@ -38,7 +38,7 @@
     1.4                      <compile-dependency/>
     1.5                      <run-dependency>
     1.6                          <release-version>1</release-version>
     1.7 -                        <specification-version>1.1.0.1</specification-version>
     1.8 +                        <specification-version>1.5</specification-version>
     1.9                      </run-dependency>
    1.10                  </dependency>
    1.11                  <dependency>
     2.1 --- a/cnd.debugger.gdbserver/src/org/netbeans/modules/cnd/debugger/gdbserver/Bundle.properties	Wed Feb 01 16:27:01 2012 +0100
     2.2 +++ b/cnd.debugger.gdbserver/src/org/netbeans/modules/cnd/debugger/gdbserver/Bundle.properties	Thu Feb 02 20:25:39 2012 +0400
     2.3 @@ -6,6 +6,4 @@
     2.4  
     2.5  CTL_GdbServerAttachPanel_name=gdbserver
     2.6  GdbServerAttachPanel.projectLabel.text=Project:
     2.7 -GdbServerAttachPanel.jLabel1.text=Host:
     2.8 -GdbServerAttachPanel.jLabel2.text=Port:
     2.9 -GdbServerAttachPanel.portTF.text=
    2.10 +GdbServerAttachPanel.jLabel1.text=Target:
     3.1 --- a/cnd.debugger.gdbserver/src/org/netbeans/modules/cnd/debugger/gdbserver/GdbServerAttachPanel.form	Wed Feb 01 16:27:01 2012 +0100
     3.2 +++ b/cnd.debugger.gdbserver/src/org/netbeans/modules/cnd/debugger/gdbserver/GdbServerAttachPanel.form	Thu Feb 02 20:25:39 2012 +0400
     3.3 @@ -1,4 +1,4 @@
     3.4 -<?xml version="1.1" encoding="UTF-8" ?>
     3.5 +<?xml version="1.0" encoding="UTF-8" ?>
     3.6  
     3.7  <Form version="1.4" maxVersion="1.7" type="org.netbeans.modules.form.forminfo.JPanelFormInfo">
     3.8    <AuxValues>
     3.9 @@ -20,13 +20,11 @@
    3.10                <Group type="103" groupAlignment="0" attributes="0">
    3.11                    <Component id="projectLabel" alignment="0" min="-2" max="-2" attributes="0"/>
    3.12                    <Component id="jLabel1" alignment="0" min="-2" max="-2" attributes="0"/>
    3.13 -                  <Component id="jLabel2" alignment="0" min="-2" max="-2" attributes="0"/>
    3.14                </Group>
    3.15                <EmptySpace max="-2" attributes="0"/>
    3.16                <Group type="103" groupAlignment="0" attributes="0">
    3.17 -                  <Component id="portTF" alignment="0" pref="335" max="32767" attributes="0"/>
    3.18 -                  <Component id="hostTF" alignment="0" pref="335" max="32767" attributes="0"/>
    3.19 -                  <Component id="projectCB" alignment="0" pref="335" max="32767" attributes="0"/>
    3.20 +                  <Component id="targetTF" alignment="0" pref="395" max="32767" attributes="0"/>
    3.21 +                  <Component id="projectCB" alignment="0" pref="395" max="32767" attributes="0"/>
    3.22                </Group>
    3.23            </Group>
    3.24        </Group>
    3.25 @@ -36,18 +34,14 @@
    3.26            <Group type="102" alignment="0" attributes="0">
    3.27                <Group type="103" groupAlignment="3" attributes="0">
    3.28                    <Component id="jLabel1" alignment="3" min="-2" max="-2" attributes="0"/>
    3.29 -                  <Component id="hostTF" alignment="3" min="-2" max="-2" attributes="0"/>
    3.30 -              </Group>
    3.31 -              <EmptySpace max="-2" attributes="0"/>
    3.32 -              <Group type="103" groupAlignment="3" attributes="0">
    3.33 -                  <Component id="jLabel2" alignment="3" min="-2" max="-2" attributes="0"/>
    3.34 -                  <Component id="portTF" alignment="3" min="-2" max="-2" attributes="0"/>
    3.35 +                  <Component id="targetTF" alignment="3" min="-2" max="-2" attributes="0"/>
    3.36                </Group>
    3.37                <EmptySpace max="-2" attributes="0"/>
    3.38                <Group type="103" groupAlignment="3" attributes="0">
    3.39                    <Component id="projectLabel" alignment="3" min="-2" max="-2" attributes="0"/>
    3.40                    <Component id="projectCB" alignment="3" min="-2" max="-2" attributes="0"/>
    3.41                </Group>
    3.42 +              <EmptySpace max="-2" attributes="0"/>
    3.43            </Group>
    3.44        </Group>
    3.45      </DimensionLayout>
    3.46 @@ -56,7 +50,7 @@
    3.47      <Component class="javax.swing.JLabel" name="projectLabel">
    3.48        <Properties>
    3.49          <Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
    3.50 -          <ResourceString bundle="org/netbeans/modules/cnd/debugger/gdb/attach/Bundle.properties" key="GdbServerAttachPanel.projectLabel.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
    3.51 +          <ResourceString bundle="org/netbeans/modules/cnd/debugger/gdbserver/Bundle.properties" key="GdbServerAttachPanel.projectLabel.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
    3.52          </Property>
    3.53        </Properties>
    3.54      </Component>
    3.55 @@ -70,25 +64,11 @@
    3.56      <Component class="javax.swing.JLabel" name="jLabel1">
    3.57        <Properties>
    3.58          <Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
    3.59 -          <ResourceString bundle="org/netbeans/modules/cnd/debugger/gdb/attach/Bundle.properties" key="GdbServerAttachPanel.jLabel1.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
    3.60 +          <ResourceString bundle="org/netbeans/modules/cnd/debugger/gdbserver/Bundle.properties" key="GdbServerAttachPanel.jLabel1.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
    3.61          </Property>
    3.62        </Properties>
    3.63      </Component>
    3.64 -    <Component class="javax.swing.JTextField" name="hostTF">
    3.65 -    </Component>
    3.66 -    <Component class="javax.swing.JLabel" name="jLabel2">
    3.67 -      <Properties>
    3.68 -        <Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
    3.69 -          <ResourceString bundle="org/netbeans/modules/cnd/debugger/gdb/attach/Bundle.properties" key="GdbServerAttachPanel.jLabel2.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
    3.70 -        </Property>
    3.71 -      </Properties>
    3.72 -    </Component>
    3.73 -    <Component class="javax.swing.JTextField" name="portTF">
    3.74 -      <Properties>
    3.75 -        <Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
    3.76 -          <ResourceString bundle="org/netbeans/modules/cnd/debugger/gdb/attach/Bundle.properties" key="GdbServerAttachPanel.portTF.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
    3.77 -        </Property>
    3.78 -      </Properties>
    3.79 +    <Component class="javax.swing.JTextField" name="targetTF">
    3.80      </Component>
    3.81    </SubComponents>
    3.82  </Form>
     4.1 --- a/cnd.debugger.gdbserver/src/org/netbeans/modules/cnd/debugger/gdbserver/GdbServerAttachPanel.java	Wed Feb 01 16:27:01 2012 +0100
     4.2 +++ b/cnd.debugger.gdbserver/src/org/netbeans/modules/cnd/debugger/gdbserver/GdbServerAttachPanel.java	Thu Feb 02 20:25:39 2012 +0400
     4.3 @@ -49,6 +49,7 @@
     4.4  package org.netbeans.modules.cnd.debugger.gdbserver;
     4.5  
     4.6  import java.beans.PropertyChangeListener;
     4.7 +import javax.swing.JPanel;
     4.8  import org.netbeans.modules.cnd.api.remote.RemoteSyncSupport;
     4.9  import org.netbeans.modules.cnd.debugger.common2.debugger.DebuggerManager;
    4.10  import org.netbeans.modules.cnd.debugger.common2.debugger.actions.ExecutableProjectPanel;
    4.11 @@ -60,17 +61,17 @@
    4.12  import org.netbeans.modules.cnd.makeproject.api.configurations.MakeConfiguration;
    4.13  import org.netbeans.modules.nativeexecution.api.ExecutionEnvironment;
    4.14  import org.netbeans.spi.debugger.ui.Controller;
    4.15 +import org.openide.util.HelpCtx;
    4.16  import org.openide.util.NbPreferences;
    4.17  
    4.18  /**
    4.19   *
    4.20   * @author Egor Ushakov
    4.21   */
    4.22 -public class GdbServerAttachPanel extends javax.swing.JPanel {
    4.23 +public class GdbServerAttachPanel extends JPanel implements HelpCtx.Provider {
    4.24      private final Controller controller;
    4.25  
    4.26 -    private static final String HOST_KEY = "last-gdbserver-host"; //NOI18N
    4.27 -    private static final String PORT_KEY = "last-gdbserver-port"; //NOI18N
    4.28 +    private static final String TARGET_KEY = "last-gdbserver-target"; //NOI18N
    4.29  
    4.30      /** Creates new form GdbServerAttachPanel */
    4.31      public GdbServerAttachPanel() {
    4.32 @@ -78,8 +79,7 @@
    4.33          initComponents();
    4.34          // Fill the Projects combo box
    4.35          ExecutableProjectPanel.fillProjectsCombo(projectCB, null);
    4.36 -        hostTF.setText(NbPreferences.forModule(GdbServerAttachPanel.class).get(HOST_KEY, "")); //NOI18N
    4.37 -        portTF.setText(NbPreferences.forModule(GdbServerAttachPanel.class).get(PORT_KEY, "")); //NOI18N
    4.38 +        targetTF.setText(NbPreferences.forModule(GdbServerAttachPanel.class).get(TARGET_KEY, "remote host:port")); //NOI18N
    4.39      }
    4.40  
    4.41      Controller getController() {
    4.42 @@ -98,18 +98,12 @@
    4.43          projectLabel = new javax.swing.JLabel();
    4.44          projectCB = new javax.swing.JComboBox();
    4.45          jLabel1 = new javax.swing.JLabel();
    4.46 -        hostTF = new javax.swing.JTextField();
    4.47 -        jLabel2 = new javax.swing.JLabel();
    4.48 -        portTF = new javax.swing.JTextField();
    4.49 +        targetTF = new javax.swing.JTextField();
    4.50  
    4.51          projectLabel.setText(org.openide.util.NbBundle.getMessage(GdbServerAttachPanel.class, "GdbServerAttachPanel.projectLabel.text")); // NOI18N
    4.52  
    4.53          jLabel1.setText(org.openide.util.NbBundle.getMessage(GdbServerAttachPanel.class, "GdbServerAttachPanel.jLabel1.text")); // NOI18N
    4.54  
    4.55 -        jLabel2.setText(org.openide.util.NbBundle.getMessage(GdbServerAttachPanel.class, "GdbServerAttachPanel.jLabel2.text")); // NOI18N
    4.56 -
    4.57 -        portTF.setText(org.openide.util.NbBundle.getMessage(GdbServerAttachPanel.class, "GdbServerAttachPanel.portTF.text")); // NOI18N
    4.58 -
    4.59          javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
    4.60          this.setLayout(layout);
    4.61          layout.setHorizontalGroup(
    4.62 @@ -117,39 +111,32 @@
    4.63              .addGroup(layout.createSequentialGroup()
    4.64                  .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
    4.65                      .addComponent(projectLabel)
    4.66 -                    .addComponent(jLabel1)
    4.67 -                    .addComponent(jLabel2))
    4.68 +                    .addComponent(jLabel1))
    4.69                  .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
    4.70                  .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
    4.71 -                    .addComponent(portTF, javax.swing.GroupLayout.DEFAULT_SIZE, 335, Short.MAX_VALUE)
    4.72 -                    .addComponent(hostTF, javax.swing.GroupLayout.DEFAULT_SIZE, 335, Short.MAX_VALUE)
    4.73 -                    .addComponent(projectCB, 0, 335, Short.MAX_VALUE)))
    4.74 +                    .addComponent(targetTF, javax.swing.GroupLayout.DEFAULT_SIZE, 395, Short.MAX_VALUE)
    4.75 +                    .addComponent(projectCB, 0, 395, Short.MAX_VALUE)))
    4.76          );
    4.77          layout.setVerticalGroup(
    4.78              layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
    4.79              .addGroup(layout.createSequentialGroup()
    4.80                  .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
    4.81                      .addComponent(jLabel1)
    4.82 -                    .addComponent(hostTF, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
    4.83 -                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
    4.84 -                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
    4.85 -                    .addComponent(jLabel2)
    4.86 -                    .addComponent(portTF, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
    4.87 +                    .addComponent(targetTF, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
    4.88                  .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
    4.89                  .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
    4.90                      .addComponent(projectLabel)
    4.91 -                    .addComponent(projectCB, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
    4.92 +                    .addComponent(projectCB, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
    4.93 +                .addContainerGap())
    4.94          );
    4.95      }// </editor-fold>//GEN-END:initComponents
    4.96  
    4.97  
    4.98      // Variables declaration - do not modify//GEN-BEGIN:variables
    4.99 -    private javax.swing.JTextField hostTF;
   4.100      private javax.swing.JLabel jLabel1;
   4.101 -    private javax.swing.JLabel jLabel2;
   4.102 -    private javax.swing.JTextField portTF;
   4.103      private javax.swing.JComboBox projectCB;
   4.104      private javax.swing.JLabel projectLabel;
   4.105 +    private javax.swing.JTextField targetTF;
   4.106      // End of variables declaration//GEN-END:variables
   4.107  
   4.108      private class GdbServerAttachController implements Controller {
   4.109 @@ -161,18 +148,13 @@
   4.110  
   4.111          @Override
   4.112          public boolean ok() {
   4.113 -            String hostValue = hostTF.getText();
   4.114 -            if (hostValue.length() == 0) {
   4.115 -                return false;
   4.116 -            }
   4.117 -            String portValue = portTF.getText();
   4.118 -            if (portValue.length() == 0) {
   4.119 +            String targetValue = targetTF.getText();
   4.120 +            if (targetValue.length() == 0) {
   4.121                  return false;
   4.122              }
   4.123              
   4.124              //store last values
   4.125 -            NbPreferences.forModule(GdbServerAttachPanel.class).put(HOST_KEY, hostValue);
   4.126 -            NbPreferences.forModule(GdbServerAttachPanel.class).put(PORT_KEY, portValue);
   4.127 +            NbPreferences.forModule(GdbServerAttachPanel.class).put(TARGET_KEY, targetValue);
   4.128  
   4.129              ProjectCBItem pi = (ProjectCBItem) projectCB.getSelectedItem();
   4.130              if (pi != null) {
   4.131 @@ -191,7 +173,7 @@
   4.132                  gdi.setHostName(CndRemote.userhostFromConfiguration(conf));
   4.133                  gdi.setConfiguration(conf);
   4.134                  gdi.setAction(DebuggerManager.ATTACH);
   4.135 -                gdi.setRemoteTarget(hostValue + ':' + portValue);
   4.136 +                gdi.setTargetCommand(targetValue);
   4.137                  
   4.138                  DebuggerManager.get().debugNoAsk(gdi);
   4.139  //                try {
   4.140 @@ -219,4 +201,9 @@
   4.141          }
   4.142  
   4.143      }
   4.144 +
   4.145 +    @Override
   4.146 +    public HelpCtx getHelpCtx() {
   4.147 +        return new HelpCtx("gdbserver"); // NOI18N
   4.148 +    }
   4.149  }