Skip to main content



      Home
Home » Language IDEs » C / C++ IDE (CDT) » How to set / option ( perspective ?) to debug C code (Debugging crosscompled application )
How to set / option ( perspective ?) to debug C code [message #1846960] Sun, 10 October 2021 12:33 Go to next message
Eclipse UserFriend
index.php/fa/41119/0/


I set a break point and "Run configuration -=>TCF -> Debug .
My "Run" stops at the breakpoints and opens "assembly "(perspective ?) ...

How do I option for C code display ?
I do not want to step thru assembly , I want to step thru C code lines.

I can stop and step thru C code when running local NOT crosscompiled application - without any extra / specific setting.

[Updated on: Sun, 10 October 2021 12:37] by Moderator

Re: How to set / option ( perspective ?) to debug C code [message #1846966 is a reply to message #1846960] Sun, 10 October 2021 16:38 Go to previous messageGo to next message
Eclipse UserFriend
Usually means the debugger couldn't find the source or the debug information is
missing (stripped or never generated). Either supply the source (if available) or
don't step into this part of the code. If you do accidentally enter it just hit the
return from call button to get back to the caller.
Re: How to set / option ( perspective ?) to debug C code [message #1846995 is a reply to message #1846966] Mon, 11 October 2021 11:57 Go to previous messageGo to next message
Eclipse UserFriend
" do not stop at that code..."
really does not solve the issue.

When (local) code is executed as "Run as -> Local C/.C++ application " the execution stops on breakpoint
and I can step thru the source code . ( I do not have an example to show this )

The problem is with "Run as -> Run configuration " when code is executed on the remote / target system. It stops on breakpoint but the perspective displays assembly code , not the source code .

Ideally I am looking for remote /target source code perspective.

Maybe it is technically impossible for Eclipse to display BOTH perspectives - source code and assembly code.
Re: How to set / option ( perspective ?) to debug C code [message #1846998 is a reply to message #1846995] Mon, 11 October 2021 14:16 Go to previous messageGo to next message
Eclipse UserFriend
Quote:
The problem is with "Run as -> Run configuration " when code is executed on the remote / target system.
It stops on breakpoint but the perspective displays assembly code , not the source code .


Yes because it's not finding the source code.

A perspective is just a set of windows and views.
A "remote /target source code perspective" would just be a different arrangement of the same
windows and views found in the "Debug perspective".

Try setting the Source tab in the Debug Configuration.
I don't know where your sources are and I don't know what the remote configuration is
so I can't tell you much more. A lot depends on how the source locations are specified
in the code to be debugged.

This may help
https://www.eclipse.org/forums/index.php/t/165884/

There are quite a few pages on Google about setting up Eclipse for remote
debugging and linking in the source. Most are using Java but it's unlikely to
be much different that with C/C++.

UPDATE:

You have stopped at the beginning of ld-2.28.so
That's a dynamic linker used to load shared libraries.
https://man7.org/linux/man-pages/man8/ld.so.8.html

Do you have its source?
Was it compiled with debug info?
I'm guessing it wasn't otherwise you would have been asked for the source
or at the least told it couldn't be found.




[Updated on: Mon, 11 October 2021 18:14] by Moderator

Re: How to set / option ( perspective ?) to debug C code [message #1847008 is a reply to message #1846998] Mon, 11 October 2021 22:52 Go to previous message
Eclipse UserFriend
Does this makes sense?
When run using "Debug as -> Debug configuration - > Target Communication Framework -> (project ) Debug
the project stops at start of main - that is normal behavior to stop at the start of application being run in debug mode
"main" source file opens - in disassembly perspective- at first line . With exception of disassembly perspective all normal,


The stopping point is highlighted and I use an option to "Run to line " which

opens "main" source file - highlight first SOURCE line - and I can step thru the project source files as "normal " local application .

Basically does what I was asking for , albeit not to intuitively and round about way .
Previous Topic:Updates
Next Topic: Anyone use Eclipse CDT to develop on FreeBSD?
Goto Forum:
  


Current Time: Sat Jul 05 07:32:35 EDT 2025

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

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

Back to the top