Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [cdt-dev] Remote GDB

HI Vishal,

I am not sure which path exactly you will get success on. But you
could try modifying
org.eclipse.cdt.dsf.mi.service.MIBreakpoints.formatLocation(Map<String,
Object>) to clean up the FILE_NAME attribute to be just the name with
no directory and see how far you get with that.

In (now defunct) CDI class, "Use full file path to set breakpoints"
was the setting that triggered the change. Of course it was dropped
because in the general case not using full paths causes issues.

Best of luck with that.
Jonah
~~~
Jonah Graham
Kichwa Coders Ltd.
www.kichwacoders.com


On 24 May 2016 at 18:53, Vishal Gupta <vishal.vit@xxxxxxxxx> wrote:
> Hello Jonah,
>
> It would take our project a little while (a year or two) to move to Neon.
> In the meantime if you can guide me to the CDT/Eclipse plugin which i need
> to modify to achieve the desired result of passing File Name to GDB in place
> of complete path.
> Then i can probably modify it and respin an eclipse product to achieve the
> desired result.
>
> Thanks,
> Vishal
>
>
> On Tue, May 24, 2016 at 11:11 PM, Jonah Graham <jonah@xxxxxxxxxxxxxxxx>
> wrote:
>>
>> Hi Vishal,
>>
>> Yes, there is a solution. It is to upgrade to CDT 9.0 (in upcoming
>> Eclipse Neon) as the ".." directory issue is one of the key ones I
>> fixed as part of https://bugs.eclipse.org/bugs/show_bug.cgi?id=472765.
>>
>> In the meantime, ensure you compile on the linux machine with no ".."
>> passed to GCC. i.e. instead of gcc -c ../src/main.c it need to be gcc
>> -c /files/project/src/main.c. This is not always straightforward,
>> especially if you are using CDT's internal builder/makefile generator.
>>
>> Jonah
>>
>>
>> ~~~
>> Jonah Graham
>> Kichwa Coders Ltd.
>> www.kichwacoders.com
>>
>>
>> On 24 May 2016 at 18:27, Vishal Gupta <vishal.vit@xxxxxxxxx> wrote:
>> > Hello Jonah,
>> >
>> > Yes i compile my code on Linux, and i develop on my local machine.
>> >
>> > When i try to insert break point on GDB prompt it shows this relative
>> > path.
>> >
>> > ~"Breakpoint 7 at 0x8667226: file    ../../src/externalControl.c, line
>> > 1182
>> >
>> > I have tried setting the compilation directory in the source lookup
>> > path.
>> > Which makes the breakpoint work for externalControl.c
>> > But the if i try to set breakpoint for another file which is present
>> > under
>> > different folder hirearchy   /src/flow/FlowControl.c
>> > In that case again i am unable to set the break point from C/C++ editor.
>> > Where as when i try again from the GDB prompt using file name
>> > FlowControl.c,
>> > i am able to set it successfully.
>> >
>> > ~"Breakpoint 8 at 0x8684226: file    ../../../src/flow/FlowControl.c,
>> > line
>> > 174
>> >
>> > The only difference is that the folder level it went up.
>> > In case of second file it's 3 level ../../../
>> > In case of first file it's 2 level ../../
>> >
>> > Hence i believe i need to set compilation directory for each and every
>> > file
>> > as per their location. This is quite troublesome, as the dependent code
>> > files are location under different folder hierarchy.
>> >
>> >
>> > Any solution for this ?
>> >
>> > Or if you can guide me about the plugin where this file path is formed,
>> > which is passed to GDB for setting breakpoint then probably i can
>> > override
>> > the code to make it pass only file name in my case.
>> >
>> > Thanks,
>> > Vishal
>> >
>> > I have tried putting the compilation
>> >
>> >
>> > On Tue, May 24, 2016 at 1:19 AM, Jonah Graham <jonah@xxxxxxxxxxxxxxxx>
>> > wrote:
>> >>
>> >> Hi Vishal,
>> >>
>> >> Sadly, contrary to expectations, Project does not mean what you expect
>> >> it to mean for source lookup. Once upon a time it did when everything
>> >> operated on file names with no paths. But as software grew bigger
>> >> everything has progressively moved from file names to full paths.
>> >>
>> >> Has your code been moved from where it was originally compiled? i.e.
>> >> does your compilation path match your local path? In other words what
>> >> was the full path to externalControl.c when you compiled it?
>> >>
>> >> If the full path when you compiled it was
>> >> /b/vishal/FlowControl/src/externalControl.c then you need to do is
>> >> create a "Path Mapping" from your compilation directory to where the
>> >> code is now.
>> >>
>> >> To help you figure it out, when you do  "break externalControl.c:1882"
>> >> what does GDB answer with, does it tell you the path it inserted on
>> >> (i.e .break inserted at /path/to/externalControl.c....)? In the GDB
>> >> traces may be extra info too, if you post that I can help.
>> >>
>> >> Thanks for taking the time to work with me on this. The more data
>> >> points I get on this, the better the end result.
>> >> https://bugs.eclipse.org/bugs/show_bug.cgi?id=491514
>> >>
>> >> Jonah
>> >> ~~~
>> >> Jonah Graham
>> >> Kichwa Coders Ltd.
>> >> www.kichwacoders.com
>> >>
>> >>
>> >> On 23 May 2016 at 19:47, Vishal Gupta <vishal.vit@xxxxxxxxx> wrote:
>> >> > Hello Jonah,
>> >> >
>> >> > I am still on Luna. I am using it on my MAC. In the source lookup, my
>> >> > project is configured as the first item.
>> >> > I am using Remote GDB session.
>> >> > In the GDB Trace Console, I can see that whenever is am trying to set
>> >> > a
>> >> > break point in the code file. (externalControl.c)
>> >> >
>> >> > 487,596 25-break-insert --thread-group i1 -f
>> >> > /b/vishal/FlowControl/src/externalControl.c:1882
>> >> >
>> >> > 487,709 &"No source file named
>> >> > /b/vishal/FlowControl/src/externalControl.c.\n"
>> >> >
>> >> > Where as if i try to set the breakpoint manually in the GDB console
>> >> > using
>> >> > the file name "break externalControl.c:1882" , I am able to set the
>> >> > break
>> >> > point.
>> >> >
>> >> > Hence i am looking towards an option where i can specify eclipse to
>> >> > use
>> >> > the
>> >> > file name in place of the complete file path while setting the break
>> >> > point.
>> >> >
>> >> > I tried looking into the org.eclipse.cdt.dsf.gdb plugin, but i was
>> >> > not
>> >> > able
>> >> > to figure out, how and where should this change be made/handled.
>> >> >
>> >> > Thanks,
>> >> >
>> >> > Vishal
>> >> >
>> >> >
>> >> > On Mon, May 23, 2016 at 11:51 PM, Jonah Graham
>> >> > <jonah@xxxxxxxxxxxxxxxx>
>> >> > wrote:
>> >> >>
>> >> >> Hi Vishal,
>> >> >>
>> >> >> Can you elaborate on the problem a little bit please?
>> >> >>
>> >> >> The basic idea is you configure the source lookup of the Launch
>> >> >> Configuration by choosing the Source tab in the launch
>> >> >> configuration.
>> >> >> Choose a Mapping source container type, enter the compilation path
>> >> >> and
>> >> >> the local path and launch your debug session.
>> >> >>
>> >> >> Are you using Eclipse Neon / CDT 9.0 (which is soon to be released)?
>> >> >> If so, there have been some improvements to source lookup to make it
>> >> >> handle more situations[1].
>> >> >>
>> >> >> Thanks,
>> >> >> Jonah
>> >> >>
>> >> >> [1]https://bugs.eclipse.org/bugs/show_bug.cgi?id=472765
>> >> >>
>> >> >> ~~~
>> >> >> Jonah Graham
>> >> >> Kichwa Coders Ltd.
>> >> >> www.kichwacoders.com
>> >> >>
>> >> >>
>> >> >> On 23 May 2016 at 18:49, Vishal Gupta <vishal.vit@xxxxxxxxx> wrote:
>> >> >> > Hello All,
>> >> >> >
>> >> >> > Could you please guide me how to make the GDB (DSF) Automatic
>> >> >> > Remote
>> >> >> > Debugger launcher to use the File name to set the break point.
>> >> >> > Currently
>> >> >> > it
>> >> >> > uses the complete file path to set the break point. Which is not
>> >> >> > getting
>> >> >> > resolved.
>> >> >> >
>> >> >> > Thanks,
>> >> >> > Vishal
>> >> >> >
>> >> >> > _______________________________________________
>> >> >> > cdt-dev mailing list
>> >> >> > cdt-dev@xxxxxxxxxxx
>> >> >> > To change your delivery options, retrieve your password, or
>> >> >> > unsubscribe
>> >> >> > from
>> >> >> > this list, visit
>> >> >> > https://dev.eclipse.org/mailman/listinfo/cdt-dev
>> >> >> _______________________________________________
>> >> >> cdt-dev mailing list
>> >> >> cdt-dev@xxxxxxxxxxx
>> >> >> To change your delivery options, retrieve your password, or
>> >> >> unsubscribe
>> >> >> from this list, visit
>> >> >> https://dev.eclipse.org/mailman/listinfo/cdt-dev
>> >> >
>> >> >
>> >> >
>> >> > _______________________________________________
>> >> > cdt-dev mailing list
>> >> > cdt-dev@xxxxxxxxxxx
>> >> > To change your delivery options, retrieve your password, or
>> >> > unsubscribe
>> >> > from
>> >> > this list, visit
>> >> > https://dev.eclipse.org/mailman/listinfo/cdt-dev
>> >> _______________________________________________
>> >> cdt-dev mailing list
>> >> cdt-dev@xxxxxxxxxxx
>> >> To change your delivery options, retrieve your password, or unsubscribe
>> >> from this list, visit
>> >> https://dev.eclipse.org/mailman/listinfo/cdt-dev
>> >
>> >
>> >
>> > _______________________________________________
>> > cdt-dev mailing list
>> > cdt-dev@xxxxxxxxxxx
>> > To change your delivery options, retrieve your password, or unsubscribe
>> > from
>> > this list, visit
>> > https://dev.eclipse.org/mailman/listinfo/cdt-dev
>> _______________________________________________
>> cdt-dev mailing list
>> cdt-dev@xxxxxxxxxxx
>> To change your delivery options, retrieve your password, or unsubscribe
>> from this list, visit
>> https://dev.eclipse.org/mailman/listinfo/cdt-dev
>
>
>
> _______________________________________________
> cdt-dev mailing list
> cdt-dev@xxxxxxxxxxx
> To change your delivery options, retrieve your password, or unsubscribe from
> this list, visit
> https://dev.eclipse.org/mailman/listinfo/cdt-dev


Back to the top