View Issue Details

IDProjectCategoryView StatusLast Update
0036858LazarusDebuggerpublic2020-05-11 01:47
ReporterCyrax Assigned ToMartin Friebe  
PrioritynormalSeverityminorReproducibilityhave not tried
Status resolvedResolutionfixed 
PlatformLinux x86_64OSArch 
Product Version2.1 (SVN) 
Fixed in Version2.2 
Summary0036858: When dtTargetExtendedRemote is set in Debugger_Target_Mode at debugger options, IDE shows debugger error dialog.
DescriptionDebug output window shows these messages when the error happens :
(gdb) 
<target extended-remote 192.168.204.1>
&"target extended-remote 192.168.204.1\n"
&"192.168.204.1: No such file or directory.\n"
^error,msg="192.168.204.1: No such file or directory."
(gdb) 
<kill>
Additional InformationGDB is at version 9.1.
TagsNo tags attached.
Fixed in Revision63135
LazTarget2.2
WidgetsetGTK 2
Attached Files

Activities

Christo Crause

2020-04-02 13:39

reporter   ~0121841

A port number needs to be specified for TCP connections. Something along the lines of
192.168.204.1:1234

Obviously :1234 should be replaced with the actual port number where gdbserver is listening.

Cyrax

2020-04-02 14:55

reporter   ~0121845

Attached patch that will fix this bug.
gdbmiserverdebugger.pas.diff (2,023 bytes)   
diff --git a/components/lazdebuggergdbmi/gdbmiserverdebugger.pas b/components/lazdebuggergdbmi/gdbmiserverdebugger.pas
index 61aa905e6c..d637bfb92b 100644
--- a/components/lazdebuggergdbmi/gdbmiserverdebugger.pas
+++ b/components/lazdebuggergdbmi/gdbmiserverdebugger.pas
@@ -248,6 +248,7 @@ var
   ipkeep : Boolean;
   iperr  : string;
   srv    : TGDBMIServerDebugger;
+  ADebugger_Target_Mode : TDebugger_Target_Mode;
 begin
   Result := inherited DoExecute;
   if (not FSuccess) then exit;
@@ -312,17 +313,19 @@ begin
   if t >= 0 then
     ExecuteCommand(Format('set remotetimeout %d', [t]), R);
 
+  ADebugger_Target_Mode := TGDBMIServerDebuggerProperties(DebuggerProperties).Debugger_Target_Mode;
+
+  case ADebugger_Target_Mode of
+    dtTargetExtendedRemote : s := 'extended-remote';
+    dtTargetRemote : s := 'remote';
+  end;
+
   // TODO: Maybe should be done in CommandStart, But Filename, and Environment will be done before Start
-  if TGDBMIServerDebuggerProperties(DebuggerProperties).Debugger_Target_Mode = dtTargetExtendedRemote then
-    FSuccess := ExecuteCommand(Format('target extended-remote %s',
-                               [TGDBMIServerDebuggerProperties(DebuggerProperties).FDebugger_Remote_Hostname
-                                ]),
-                               R)
-  else
-    FSuccess := ExecuteCommand(Format('target remote %s:%s',
-                               [TGDBMIServerDebuggerProperties(DebuggerProperties).FDebugger_Remote_Hostname,
-                                TGDBMIServerDebuggerProperties(DebuggerProperties).Debugger_Remote_Port ]),
-                               R);
+  FSuccess := ExecuteCommand(Format('target %s %s:%s',
+                             [s,
+                              TGDBMIServerDebuggerProperties(DebuggerProperties).FDebugger_Remote_Hostname,
+                              TGDBMIServerDebuggerProperties(DebuggerProperties).Debugger_Remote_Port ]),
+                             R);
 
   FSuccess := FSuccess and (r.State <> dsError);
 
gdbmiserverdebugger.pas.diff (2,023 bytes)   

Christo Crause

2020-04-02 15:57

reporter   ~0121848

I guess you new about the port then...

Cyrax

2020-04-02 17:01

reporter   ~0121849

Yes, I found that few days ago but I didn't have time to report this. Also I just cooked the patch due to other remote debugging shenanigans going on and needing to clean up my work tree.

Martin Friebe

2020-05-11 01:47

manager   ~0122707

Fixed in 63135

A target can be either IP 1.2.3.4:1234
or local socket: /dev/foo

The debugger will now decide, depending on the presence of a port config.

It will do no checks on the format of the config. So IP:port can be written into the remote address, and the port left empty....

Please test, and close if ok

Issue History

Date Modified Username Field Change
2020-04-02 12:36 Cyrax New Issue
2020-04-02 12:36 Cyrax Status new => assigned
2020-04-02 12:36 Cyrax Assigned To => Martin Friebe
2020-04-02 13:39 Christo Crause Note Added: 0121841
2020-04-02 14:55 Cyrax File Added: gdbmiserverdebugger.pas.diff
2020-04-02 14:55 Cyrax Note Added: 0121845
2020-04-02 15:57 Christo Crause Note Added: 0121848
2020-04-02 17:01 Cyrax Note Added: 0121849
2020-05-11 01:47 Martin Friebe Status assigned => resolved
2020-05-11 01:47 Martin Friebe Resolution open => fixed
2020-05-11 01:47 Martin Friebe Fixed in Version => 2.2
2020-05-11 01:47 Martin Friebe Fixed in Revision => 63135
2020-05-11 01:47 Martin Friebe LazTarget => 2.2
2020-05-11 01:47 Martin Friebe Widgetset GTK 2 => GTK 2
2020-05-11 01:47 Martin Friebe Note Added: 0122707