Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there way to enable "Step into selection" for C++ in Eclipse?

There is very convenient "Step into specific" functionality in Visual Studio C++ on Windows. I have heard that a similar functionality "Step into selection" can be found for Java in Eclipse. Is there something similar for Eclipse CDT (C++) on Ubuntu?

like image 823
Sergiy Belozorov Avatar asked Jan 16 '23 01:01

Sergiy Belozorov


1 Answers

I am not so sure what you mean by 'step into selection', but I can tell you that Eclipse IDE (I use it for Java, but believe it offers the same functionality for C++) lets your perform the following during debug

  • Step over, so line by line. Note however that if you have a function call within a function call, this will count as to 'lines', so you step through twice, as you would expect
  • Step out of. Executes the rest of this block, usually resulting in executing the rest of the function
  • Step into. This is what I think you are on about, this will enter into a function call so you can step through the individual lines of that function
  • Run to selection. This lets you have the program execute as normal and stop again at where your cursor is (This one can be accessed via the right click menu)

I hope I have understood what you are asking for, leave a comment if you need me to explain anything better.

Based on the extra information from the OP, I believe the answer is no. Eclipse does not support this functionality in the debugger

There is functionality to navigate the code base, 'F3' is by default used to jump to the implementation of a function. Again, I am talking about Eclipse for Java here. Not sure if it works during debug, but you could use it to navigate to the source of the function in question, then right click and select 'run to here'. Whilst admittedly not as nice as it sounds like VS does it, it may just be the best option. Assuming it actually works that is

like image 100
thecoshman Avatar answered Jan 31 '23 07:01

thecoshman