How to get gdb working with Eclipse CDT under windows (fails to find source code)

前端 未结 5 2057
孤城傲影
孤城傲影 2021-02-04 10:03

I installed cygwin (the latest 1.7.xx?), and then installed eclipse cdt (Juno).

When I tried to build a hello world project, despite eclipse identifying that cygwin was

5条回答
  •  情书的邮戳
    2021-02-04 10:26

    Although Above are given good answers but still it might not solve the problem sometimes phew!!!!

    Suppose you install Cygwin in C: but your eclipse workspace is in D: then there is a problem in your mounting

    all you should do is, open the cygwing shell & type "mount" to get the following :

      Ritvika@Ashutosh ~
      $ ls
    
      Ritvika@Ashutosh ~
      $ mount
      C:/cygwin64/bin on /usr/bin type ntfs (binary,auto)
      C:/cygwin64/lib on /usr/lib type ntfs (binary,auto)
      C:/cygwin64 on / type ntfs (binary,auto)
      C: on /cygdrive/c type ntfs (binary,posix=0,user,noumount,auto)
      D: on /cygdrive/d type ntfs (binary,posix=0,user,noumount,auto)
    
      Ritvika@Ashutosh ~
      $
    

    here my Projects are all under D:\ECWorkSpace, so my mapping needs to be present in Eclipse as: /cygdrive/d d:/

    Hence, now Armed with this knowledge do what PathM says

     1. goto Window ==> Preferences ==> C/C++ ==> Debug ==> Source Lookup Path
     2. Add a Path Mapping: Project Source
     3. On the left side put "cygdrive\d",  & on the right put : "D:\"
    

    This should work. ( It did for me :) ) You can Check this FAQ as well : https://wiki.eclipse.org/CDT/User/FAQ#I.27m_using_cygwin_and_when_launching_the_debugger.2C_it_complains_that_it_can.27t_find_the_source_file

提交回复
热议问题