[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
[
List Home]
Re: [cdt-dev] launching a gdb from inside a docker container using DSF/GDB
|
Hi Tim,
This sounds very interesting and I like the direction it is going in.
The environment-cd is done in the final launch sequence. The existing dsf-gdb code assumes that gdb is on the same machine as eclipse, and in the docker case while that is true in a physical world sense, it certainly isn't true in other senses. Therefore I think you'll have to update final launch sequence somewhere along the way.
The ~/.gdbinit is never used by Eclipse CDT as gdb is started with the -nx argument. You can explicitly pass in a full path to a gdbinit in the launch configuration dialog, but you'll still have the same Windows vs Linux path problems doing the source of that file. Also, even if you did pass in a gdbinit, that cannot override any of the commands that final launch sequence will do.
A few questions so I can understand and perhaps better share my thoughts.
1. Are you creating your own launch delegate and related dsf machinery?
2. In your use case presumably the build output, user source and tool chains are all in the docker container? How is Eclipse running on the Windows host accessing those files? Is there a path mapping or similar?
Jonah
On Thursday, 24 March 2016, Tim Orling <
ticotimo@xxxxxxxxx> wrote:
We were able to move forward by using "docker exec -i <container_id> gdb", where a symbolic link to the actual toolchain's gdb was put into the container's /usr/bin. (Using the toolchain actual path to <arch_prefix>-gdb failed because eclipse seems to be using OSString to coerce the path to use windows delimiters and the container baulks at that).
gdb version check now works. Yay!
The next problem is with the final launch sequence, as the path to the executable/application/binary is checked and validated to be a Windows path. The container path will differ (it is using a bind mount to access the host workspace).
Error in final launch sequence
Failed to execute MI command:
-environment-cd C:/Users/<username>/<workspace_loc>/<project>
Error message from debugger back end:
C:/Users/<username>/<workspace_loc>/<project>: No such file or directory.
C:/Users/<username>/<workspace_loc>/<project>: No such file or directory.
Ideas for next steps? We have been using "Local", when we might need to use "Remote" debugging, but then we get to questions of protocol for communicating to the container (SSH/TCP assumptions in Remote debugging don't apply here).
We also tried putting a .gdbinit in ~/ inside the container to override -environment-cd but the above error happens before .gdbinit is resolved. Somewhere in MI Session initialization. In our case "gdbserver" is OpenOCD running native on (Win/Mac/Linux) host and "gdb" is running inside the container...for the reasons Brian already mentioned.
Regards,
Tim (Intel)
--
~~~
Jonah Graham
Kichwa Coders Ltd.
www.kichwacoders.com