View Issue Details

IDProjectCategoryView StatusLast Update
0031386LazarusDebuggerpublic2019-02-26 02:17
ReporterCyraxAssigned ToMartin Friebe 
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionfixed 
PlatformLinux x86_64OSArchOS Version3.17.4-1
Product Version1.7 (SVN)Product Buildr54151 
Target Version1.6.4Fixed in Version1.6.4 
Summary0031386: With GDB 7.12.x and newer, remote debugging will fail due to missing command "info pid".
DescriptionUndefined info command: "pid"

---
Output from Debug Output window:
<info pid>
&"info pid\n"
&"Undefined info command: \"pid\".  Try \"help info\".\n"
^error,msg="Undefined info command: \"pid\".  Try \"help info\"."
(gdb) 
<info proc>
&"info proc\n"
~"process 16768\n"
&"warning: target file /proc/16768/cmdline contained unexpected null characters\n"
~"cmdline = './debug-output-gtk2/lazarus'\n"
~"cwd = '/mnt/local/free_pascal_and_lazarus_3/lazarus_002/1.7.0/i386/trunk/trunk'\n"
~"exe = '/mnt/local/free_pascal_and_lazarus_3/lazarus_002/1.7.0/i386/trunk/trunk/debug-output-gtk2/lazarus'\n"
^done
(gdb) 
<info threads>
&"info threads\n"
~"  Id   Target Id         Frame \n"
~"* 1    Thread 16768.16768 \"lazarus\" _FPC_LIBC21_START () at i386/si_c21.inc:50\n"
^done
TagsNo tags attached.
Fixed in Revision54215
LazTarget1.6.4
WidgetsetGTK 2, QT
Attached Files
  • gdbmidebugger.pp.diff (1,237 bytes)
    diff --git components/lazdebuggergdbmi/gdbmidebugger.pp components/lazdebuggergdbmi/gdbmidebugger.pp
    index f5ef28e7f6..9704d520e6 100644
    --- components/lazdebuggergdbmi/gdbmidebugger.pp
    +++ components/lazdebuggergdbmi/gdbmidebugger.pp
    @@ -4988,6 +4988,14 @@ function TGDBMIDebuggerCommandStartDebugging.DoExecute: Boolean;
           if TargetInfo^.TargetPID <> 0 then exit;
         end;
     
    +    // gdb server
    +    if ExecuteCommand('info proc', [], R, [cfCheckState]) and (R.State <> dsError)
    +    then begin
    +      s := GetPart(['process '], [#10,#13#10], R.Values, True);
    +      TargetInfo^.TargetPID := StrToIntDef(s, 0);
    +      if TargetInfo^.TargetPID <> 0 then exit;
    +    end;
    +
         // apple / MacPort 7.1 / 32 bit dwarf
         if ExecuteCommand('info threads', [], R, [cfCheckState]) and (R.State <> dsError)
         then begin
    @@ -4996,7 +5004,7 @@ function TGDBMIDebuggerCommandStartDebugging.DoExecute: Boolean;
           if TargetInfo^.TargetPID <> 0 then exit;
     
           // returned by gdb server (maybe others)
    -      s := GetPart(['Thread '], [' '], R.Values, True);
    +      s := GetPart(['Thread '], [' ', '.'], R.Values, True);
           TargetInfo^.TargetPID := StrToIntDef(s, 0);
           if TargetInfo^.TargetPID <> 0 then exit;
         end;
    
    gdbmidebugger.pp.diff (1,237 bytes)

Activities

Cyrax

2017-02-15 19:29

reporter  

gdbmidebugger.pp.diff (1,237 bytes)
diff --git components/lazdebuggergdbmi/gdbmidebugger.pp components/lazdebuggergdbmi/gdbmidebugger.pp
index f5ef28e7f6..9704d520e6 100644
--- components/lazdebuggergdbmi/gdbmidebugger.pp
+++ components/lazdebuggergdbmi/gdbmidebugger.pp
@@ -4988,6 +4988,14 @@ function TGDBMIDebuggerCommandStartDebugging.DoExecute: Boolean;
       if TargetInfo^.TargetPID <> 0 then exit;
     end;
 
+    // gdb server
+    if ExecuteCommand('info proc', [], R, [cfCheckState]) and (R.State <> dsError)
+    then begin
+      s := GetPart(['process '], [#10,#13#10], R.Values, True);
+      TargetInfo^.TargetPID := StrToIntDef(s, 0);
+      if TargetInfo^.TargetPID <> 0 then exit;
+    end;
+
     // apple / MacPort 7.1 / 32 bit dwarf
     if ExecuteCommand('info threads', [], R, [cfCheckState]) and (R.State <> dsError)
     then begin
@@ -4996,7 +5004,7 @@ function TGDBMIDebuggerCommandStartDebugging.DoExecute: Boolean;
       if TargetInfo^.TargetPID <> 0 then exit;
 
       // returned by gdb server (maybe others)
-      s := GetPart(['Thread '], [' '], R.Values, True);
+      s := GetPart(['Thread '], [' ', '.'], R.Values, True);
       TargetInfo^.TargetPID := StrToIntDef(s, 0);
       if TargetInfo^.TargetPID <> 0 then exit;
     end;
gdbmidebugger.pp.diff (1,237 bytes)

Cyrax

2017-02-15 19:31

reporter   ~0098212

Attached diff that fixes this bug.

Martin Friebe

2017-02-21 01:46

manager   ~0098351

Thanks / Applied

Issue History

Date Modified Username Field Change
2017-02-14 16:06 Cyrax New Issue
2017-02-14 16:06 Cyrax Status new => assigned
2017-02-14 16:06 Cyrax Assigned To => Martin Friebe
2017-02-15 19:29 Cyrax File Added: gdbmidebugger.pp.diff
2017-02-15 19:31 Cyrax Note Added: 0098212
2017-02-21 01:46 Martin Friebe Fixed in Revision => 54215
2017-02-21 01:46 Martin Friebe LazTarget => 1.6.4
2017-02-21 01:46 Martin Friebe Note Added: 0098351
2017-02-21 01:46 Martin Friebe Status assigned => resolved
2017-02-21 01:46 Martin Friebe Fixed in Version => 1.6.4
2017-02-21 01:46 Martin Friebe Resolution open => fixed
2017-02-21 01:46 Martin Friebe Target Version => 1.6.4
2019-02-26 02:17 Cyrax Status resolved => closed