Skip to main content



      Home
Home » Language IDEs » C / C++ IDE (CDT) » View source of libstdc++ class while debugging program
View source of libstdc++ class while debugging program [message #84965] Mon, 03 November 2003 05:41 Go to next message
Eclipse UserFriend
Originally posted by: cclo.smeow.mine.nu

Dear all,

I use some classes in standard c++ library and I'd like to view the
source of it in debugging mode, just like viewing the source of my own
cpp files when I stepped into some method.

I've tried to add the path of gcc source (extracted from gcc tar ball)
into the "Additional Source Locations" of the Source Tab in the
debugging configuration for project. Could anybody tell me how to
configure CDT to do this?


best regards,

Cheng-Che Lo
Re: View source of libstdc++ class while debugging program [message #84999 is a reply to message #84965] Mon, 03 November 2003 10:34 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: mikhailk.qnx.com

Check:
- if your library contains the debug information,
- if the library symbols are loaded when you try to step into a library
function (use the Shared Libraries view or set the "Load shared library
symbols automatically" options of the launch configuration),
If your library is build in the different location you should use the
"Associate with" option of the "Add Directory Source Location" dialog.

"Cheng-Che Lo" <cclo@smeow.mine.nu> wrote in message
news:bo5bb6$sdo$1@eclipse.org...
> Dear all,
>
> I use some classes in standard c++ library and I'd like to view the
> source of it in debugging mode, just like viewing the source of my own
> cpp files when I stepped into some method.
>
> I've tried to add the path of gcc source (extracted from gcc tar ball)
> into the "Additional Source Locations" of the Source Tab in the
> debugging configuration for project. Could anybody tell me how to
> configure CDT to do this?
>
>
> best regards,
>
> Cheng-Che Lo
>
Re: View source of libstdc++ class while debugging program [message #85014 is a reply to message #84999] Tue, 04 November 2003 02:14 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: cclo.smeow.mine.nu

I've tried the following steps, am I doing the right thing for this ?

I'm not sure is the library contains debug information, so I get the
source of gcc and re-configure it (libstdc++-v3) with --enable-debug=yes
and put it under /usr/local/src/libstdc++

# ./configure --enable-debug=yes
# make
(have all object files with the source files)

which is the directory I wrote in "Shared Libraries" tab in "Debugger"
tab of the Debug launch configuration. Also, I checked the box with
"Load shared library symbols automatically", it's on.
Besides, in the "Source" tab, "Additional Source Locations" has
both location and association to have the directory
"/usr/local/src/gcc/libstdc++", in this case.

I guess these would let the project use the shared library libstdc++
by the copy I just made (with debugging information -O0 -ggdb3).
Now against the methods of the library, it still stepping over it, not
into it.

Did I get something wrong? Any instruction or suggestion is appreciated.
So much I want to migrate all my c++ programs into eclipse. It'd be
perfect for me is this can got working.

Sorry if this is too *newbie*...


Thanks a lot and a lot.


Cheng-Che Lo


Mikhail Khodjaiants wrote:
> Check:
> - if your library contains the debug information,
> - if the library symbols are loaded when you try to step into a library
> function (use the Shared Libraries view or set the "Load shared library
> symbols automatically" options of the launch configuration),
> If your library is build in the different location you should use the
> "Associate with" option of the "Add Directory Source Location" dialog.
>
> "Cheng-Che Lo" <cclo@smeow.mine.nu> wrote in message
> news:bo5bb6$sdo$1@eclipse.org...
>
>>Dear all,
>>
>> I use some classes in standard c++ library and I'd like to view the
>>source of it in debugging mode, just like viewing the source of my own
>>cpp files when I stepped into some method.
>>
>> I've tried to add the path of gcc source (extracted from gcc tar ball)
>>into the "Additional Source Locations" of the Source Tab in the
>>debugging configuration for project. Could anybody tell me how to
>>configure CDT to do this?
>>
>>
>>best regards,
>>
>>Cheng-Che Lo
>>
>
>
>
Re: View source of libstdc++ class while debugging program [message #85087 is a reply to message #85014] Tue, 04 November 2003 10:38 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: mikhailk.qnx.com

Check if gdb picks up the correct version of the library. You can do it by
opening the Shared Libraries view and checking if the full path of the
library is correct. The 'S' letter in the icon of the library means
indicates that library symbols are loaded.

"Cheng-Che Lo" <cclo@smeow.mine.nu> wrote in message
news:bo7jk2$82t$1@eclipse.org...
>
> I've tried the following steps, am I doing the right thing for this ?
>
> I'm not sure is the library contains debug information, so I get the
> source of gcc and re-configure it (libstdc++-v3) with --enable-debug=yes
> and put it under /usr/local/src/libstdc++
>
> # ./configure --enable-debug=yes
> # make
> (have all object files with the source files)
>
> which is the directory I wrote in "Shared Libraries" tab in "Debugger"
> tab of the Debug launch configuration. Also, I checked the box with
> "Load shared library symbols automatically", it's on.
> Besides, in the "Source" tab, "Additional Source Locations" has
> both location and association to have the directory
> "/usr/local/src/gcc/libstdc++", in this case.
>
> I guess these would let the project use the shared library libstdc++
> by the copy I just made (with debugging information -O0 -ggdb3).
> Now against the methods of the library, it still stepping over it, not
> into it.
>
> Did I get something wrong? Any instruction or suggestion is appreciated.
> So much I want to migrate all my c++ programs into eclipse. It'd be
> perfect for me is this can got working.
>
> Sorry if this is too *newbie*...
>
>
> Thanks a lot and a lot.
>
>
> Cheng-Che Lo
>
>
> Mikhail Khodjaiants wrote:
> > Check:
> > - if your library contains the debug information,
> > - if the library symbols are loaded when you try to step into a library
> > function (use the Shared Libraries view or set the "Load shared library
> > symbols automatically" options of the launch configuration),
> > If your library is build in the different location you should use the
> > "Associate with" option of the "Add Directory Source Location" dialog.
> >
> > "Cheng-Che Lo" <cclo@smeow.mine.nu> wrote in message
> > news:bo5bb6$sdo$1@eclipse.org...
> >
> >>Dear all,
> >>
> >> I use some classes in standard c++ library and I'd like to view the
> >>source of it in debugging mode, just like viewing the source of my own
> >>cpp files when I stepped into some method.
> >>
> >> I've tried to add the path of gcc source (extracted from gcc tar ball)
> >>into the "Additional Source Locations" of the Source Tab in the
> >>debugging configuration for project. Could anybody tell me how to
> >>configure CDT to do this?
> >>
> >>
> >>best regards,
> >>
> >>Cheng-Che Lo
> >>
> >
> >
> >
>
Re: View source of libstdc++ class while debugging program [message #85117 is a reply to message #85087] Tue, 04 November 2003 23:32 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: cclo.smeow.mine.nu

I got the full path, and I guess it's the problem.
It uses /usr/lib instead of the one I build in /usr/local/src,
shall I do something on system setting such as ldconfig, change
the order of path..something.. or I can just do it on the project
configuration?

About the 'S', I do got the small red 'S' letter on the icons of the
libraries. Then I guess the symbols are loaded, does that means I can
see the source when I stepped into the library? Don't really know what
to fix, right now I still cannot see the source.

Thanks so much for you patience.


Cheng-Che Lo



Mikhail Khodjaiants wrote:
> Check if gdb picks up the correct version of the library. You can do it by
> opening the Shared Libraries view and checking if the full path of the
> library is correct. The 'S' letter in the icon of the library means
> indicates that library symbols are loaded.
>
Re: View source of libstdc++ class while debugging program [message #85148 is a reply to message #85117] Wed, 05 November 2003 10:36 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: mikhailk.qnx.com

What is the full path of the source file that the debugger is looking for
when you step into a function from the library?
Try this. For example, the path is "/home/dir1/source.c" and the "source.c"
file is in the "/home/dir2/" directory. You can create an additional
directory source location for "/home/dir2" and associate it with
"/home/dir1".

"Cheng-Che Lo" <cclo@smeow.mine.nu> wrote in message
news:bo9uev$1q9$1@eclipse.org...
>
> I got the full path, and I guess it's the problem.
> It uses /usr/lib instead of the one I build in /usr/local/src,
> shall I do something on system setting such as ldconfig, change
> the order of path..something.. or I can just do it on the project
> configuration?
>
> About the 'S', I do got the small red 'S' letter on the icons of the
> libraries. Then I guess the symbols are loaded, does that means I can
> see the source when I stepped into the library? Don't really know what
> to fix, right now I still cannot see the source.
>
> Thanks so much for you patience.
>
>
> Cheng-Che Lo
>
>
>
> Mikhail Khodjaiants wrote:
> > Check if gdb picks up the correct version of the library. You can do it
by
> > opening the Shared Libraries view and checking if the full path of the
> > library is correct. The 'S' letter in the icon of the library means
> > indicates that library symbols are loaded.
> >
>
Re: View source of libstdc++ class while debugging program [message #85208 is a reply to message #85148] Thu, 06 November 2003 01:19 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: cclo.smeow.mine.nu

To be sure I didn't misunderstand your instructions,
I try to show the actual values here.

First, in the "Shared Library", I can see `/usr/lib/libstdc++.so.5'
(which I don't know how to change it to
/usr/local/src/gcc/libstdc++-v3/src/libstdc++.so.5 )

Second, the source of libstdc++ is under
/usr/local/src/gcc/libstdc++-v3/src ( source files and modules built
with debugging are all here)

Then, to use the additional source location,
I set the additional source location "/usr/local/src/gcc/libstdc++-v3/src"
and associate it with "/usr/lib"

Am I on the righ track ?

thanks very much for ur time



Cheng-Che Lo

Mikhail Khodjaiants wrote:
> What is the full path of the source file that the debugger is looking for
> when you step into a function from the library?
> Try this. For example, the path is "/home/dir1/source.c" and the "source.c"
> file is in the "/home/dir2/" directory. You can create an additional
> directory source location for "/home/dir2" and associate it with
> "/home/dir1".
>
Re: View source of libstdc++ class while debugging program [message #85238 is a reply to message #85208] Thu, 06 November 2003 13:06 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: mikhailk.qnx.com

"Cheng-Che Lo" <cclo@smeow.mine.nu> wrote in message
news:bocp40$ui4$1@eclipse.org...
>
> To be sure I didn't misunderstand your instructions,
> I try to show the actual values here.
>
> First, in the "Shared Library", I can see `/usr/lib/libstdc++.so.5'
> (which I don't know how to change it to
> /usr/local/src/gcc/libstdc++-v3/src/libstdc++.so.5 )
>
I could be a bug if you added the path of your library to the Shared
Libraries Directories and it still doesn't work.
Another way is to set LD_LIBRARY_PATH.

> Second, the source of libstdc++ is under
> /usr/local/src/gcc/libstdc++-v3/src ( source files and modules built
> with debugging are all here)
>
> Then, to use the additional source location,
> I set the additional source location "/usr/local/src/gcc/libstdc++-v3/src"
> and associate it with "/usr/lib"
>
> Am I on the righ track ?
>

What happens when you step into a function from the library? Do you see the
"File Not Found" message in the editor? If so what is the full path of file
that debugger is looking for?
You should put this path in the "Association" field.

> thanks very much for ur time
>
>
>
> Cheng-Che Lo
>
> Mikhail Khodjaiants wrote:
> > What is the full path of the source file that the debugger is looking
for
> > when you step into a function from the library?
> > Try this. For example, the path is "/home/dir1/source.c" and the
"source.c"
> > file is in the "/home/dir2/" directory. You can create an additional
> > directory source location for "/home/dir2" and associate it with
> > "/home/dir1".
> >
>
Re: View source of libstdc++ class while debugging program [message #85268 is a reply to message #85238] Thu, 06 November 2003 16:06 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: mikhailk.qnx.com

Sorry, for misinformation. It seems that gdb on Linux ignores the path set
by the "set solib-search-path" command and loads the symbols for system
libraries from the original location.

"Mikhail Khodjaiants" <mikhailk@qnx.com> wrote in message
news:boe32o$jha$1@eclipse.org...
>
> "Cheng-Che Lo" <cclo@smeow.mine.nu> wrote in message
> news:bocp40$ui4$1@eclipse.org...
> >
> > To be sure I didn't misunderstand your instructions,
> > I try to show the actual values here.
> >
> > First, in the "Shared Library", I can see `/usr/lib/libstdc++.so.5'
> > (which I don't know how to change it to
> > /usr/local/src/gcc/libstdc++-v3/src/libstdc++.so.5 )
> >
> I could be a bug if you added the path of your library to the Shared
> Libraries Directories and it still doesn't work.
> Another way is to set LD_LIBRARY_PATH.
>
> > Second, the source of libstdc++ is under
> > /usr/local/src/gcc/libstdc++-v3/src ( source files and modules built
> > with debugging are all here)
> >
> > Then, to use the additional source location,
> > I set the additional source location
"/usr/local/src/gcc/libstdc++-v3/src"
> > and associate it with "/usr/lib"
> >
> > Am I on the righ track ?
> >
>
> What happens when you step into a function from the library? Do you see
the
> "File Not Found" message in the editor? If so what is the full path of
file
> that debugger is looking for?
> You should put this path in the "Association" field.
>
> > thanks very much for ur time
> >
> >
> >
> > Cheng-Che Lo
> >
> > Mikhail Khodjaiants wrote:
> > > What is the full path of the source file that the debugger is looking
> for
> > > when you step into a function from the library?
> > > Try this. For example, the path is "/home/dir1/source.c" and the
> "source.c"
> > > file is in the "/home/dir2/" directory. You can create an additional
> > > directory source location for "/home/dir2" and associate it with
> > > "/home/dir1".
> > >
> >
>
>
Re: View source of libstdc++ class while debugging program [message #85283 is a reply to message #85268] Fri, 07 November 2003 01:29 Go to previous message
Eclipse UserFriend
Originally posted by: cclo.smeow.mine.nu

Maybe I could ask the maintainer if there's a workaround solution.
Don't know why, I'm quite glad that it's not Eclipse's problem.
Thanks for the information, it could make my life easier.

Thanks again!


Cheng-Che Lo

Mikhail Khodjaiants wrote:
> Sorry, for misinformation. It seems that gdb on Linux ignores the path set
> by the "set solib-search-path" command and loads the symbols for system
> libraries from the original location.
>
Previous Topic:Decorating labels in "C/C++ Projects" View
Next Topic:Filtering backup files from the Navigator view
Goto Forum:
  


Current Time: Sat May 10 18:51:38 EDT 2025

Powered by FUDForum. Page generated in 0.04262 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top