Bug 522719 - C/C++ transparent remote debugging works for Postmortem and Attach, but fails for StartProcess
Summary: C/C++ transparent remote debugging works for Postmortem and Attach, but fails...
Status: NEW
Alias: None
Product: CDT
Classification: Tools
Component: cdt-debug (show other bugs)
Version: Next   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: cdt-debug-inbox@eclipse.org CLA
QA Contact: Jonah Graham CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-09-25 06:45 EDT by Frank Bergemann CLA
Modified: 2020-09-04 15:22 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Frank Bergemann CLA 2017-09-25 06:45:47 EDT
I want to remotely debug a C/C++ application in docker with 'eclipse'.
For this i use a wrapper script for 'gdb', that does 'ssh' into some docker image and start gdb there ("transparent").
This pretty good works for "C/C++ Postmortem Debugger" (core file analysis) and for "C/C++ Attach to Application".
But it fails for "C/C++ Application" (to start a program).
I used strace to monitor the activities between 'eclipse' and 'gdb' in docker.
And i found out, that "C/C++ Application" (start a program) uses some --interpreter mi2 --nx command:

   inferior-tty-set --thread-group i1 /dev/pts/27

This of course does not work for "transparent" remote debugging.

It causes error:

 'Launching ###' has encountered a problem.
 Error in final launch sequence.
 Details:
  Error in final launch sequence
  Failed to execute MI command:
  -exec-run
  Error message from debugger back end:
  During startup program exited with code 1.
  During startup program exited with code 1.

Is there any good reason for using 'inferior-tty-set' for starting an application?
Because the other #2 modes - PostMortem and Attach - don't use that command. But even though they don't use this command they provide a gdb console.

- thanks!

regards,
Frank
Comment 1 Frank Bergemann CLA 2017-09-27 07:43:57 EDT
The charm of "transparent" remote debugging is: it does NOT require
(ftp://ftp.gnu.org/old-gnu/Manuals/gdb/html_node/gdb_130.html) 
--------------------------------------------------------------
 On the GDB host machine,
    you need an unstripped copy of your program, 
    since GDB needs symbols and debugging information. 
--------------------------------------------------------------

Correct me if i am wrong - but using a 

  Debug Configuration
    C/C++ Remote Application

- which seems to be the "natural way"(?) for remote debugging -
actually requires "you need an unstripped copy of your program" 

right?

regards,
Frank
Comment 2 Frank Bergemann CLA 2017-10-06 08:43:49 EDT
May i ask for feedback here?
I can understand, that other things are more important.
But just a comment, if my request is reasonable or not would be helpful - independent if/when it could be addressed.
- thanks!
best regards,
Frank