Bug 104360 - [DEBUG] current instruction pointer disappear, F5 and F6 do nothing
Summary: [DEBUG] current instruction pointer disappear, F5 and F6 do nothing
Status: REOPENED
Alias: None
Product: CDT
Classification: Tools
Component: cdt-debug (show other bugs)
Version: 3.0   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: cdt-debug-inbox@eclipse.org CLA
QA Contact: Jonah Graham CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-07-19 11:28 EDT by Nikolay CLA
Modified: 2020-09-04 15:22 EDT (History)
1 user (show)

See Also:


Attachments
How it looks like just before I press F6 (Step Over) (178.76 KB, image/png)
2005-07-22 05:47 EDT, Nikolay CLA
no flags Details
How it looks like just after I press F6 (Step Over) (165.35 KB, image/png)
2005-07-22 05:48 EDT, Nikolay CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Nikolay CLA 2005-07-19 11:28:17 EDT
First of all sorry for my english.
I create managed make c/c++ project. There is just one file - main.cpp:
#include "ace/Log_Msg.h"
#include "ace/SOCK_Acceptor.h"
#include "ace/SOCK_Stream.h"
#include "ace/INET_Addr.h"

class Class
{
public:
    Class (unsigned int portNo):
        m_addr (portNo),
        m_acceptor (m_addr)
    {}
    void handleInput ()
    {
        //...
    }
    void acceptConnection ()
    {
        ACE_INET_Addr remoteAddr;
        if (m_acceptor.accept (m_stream, &remoteAddr) != -1)
        {
            ACE_DEBUG (( LM_DEBUG, "Connection accepted:\n\tHost: %s .\n\tPort:
 %d .\n", remoteAddr.get_host_name (), remoteAddr.get_port_number () ));
//When current instruction pointer points to previous line and I press F6 (Step 
over)
//current instruction pointer (little arrow) disappear.
// gdb says:
// Warning:
//Cannot insert breakpoint 0.
//Error accessing memory address 0x1: Input/output error.
//
//Single stepping until exit from function _dl_debug_state, 
//which has no line number information.
            handleInput ();
//If I toggle breakpoint on previous line, after current instruction pointer has
//disappeared and press F8 (Continue) then it come back.
        }
    }
private:
    ACE_INET_Addr m_addr;
    ACE_SOCK_Acceptor m_acceptor;
    ACE_SOCK_Stream m_stream;
};

int main (int argc, char * argv [])
{
    const int PORT_NO = 50000;
    Class instance (PORT_NO);
    instance.acceptConnection();
    
    return 0;
}

EOF
When I try to debug Class::acceptConnection current instruction pointer 
disappear and F6, F5 does nothing. Please look at comments in source code.

To compile this project you need ACE library. I try hard, but I can not 
reproduce this bug whithout using ACE. ACE is free and open source. You can get 
it from http://www.cs.wustl.edu/~schmidt/ACE.html.
Comment 1 Nobody - feel free to take it CLA 2005-07-21 13:51:23 EDT
You are trying to step into a module with no debug information. In this case 
gdb doesn't know how to step, there is no line information. The instruction 
pointer disappears because the program is stepping (see the icon and label of 
the debug target in the Debug view). Same applies to F5 and F6 keys - they do 
nothing because the program is not suspended.
Comment 2 Nikolay CLA 2005-07-22 05:21:59 EDT
(In reply to comment #1)
> You are trying to step into a module with no debug information.
I am sure that this library was built with debug info (-g3 -O0), becouse when I 
meet this bug this was first what I done.
> In this case 
> gdb doesn't know how to step, there is no line information. The instruction 
> pointer disappears because the program is stepping (see the icon and label of 
> the debug target in the Debug view). Same applies to F5 and F6 keys - they do 
> nothing because the program is not suspended.
And anyway when I press _Step Over_ I expect that debugger go to next 
instruction in my programm not into library module.

Comment 3 Nikolay CLA 2005-07-22 05:47:44 EDT
Created attachment 25169 [details]
How it looks like just before I press F6 (Step Over)
Comment 4 Nikolay CLA 2005-07-22 05:48:51 EDT
Created attachment 25170 [details]
How it looks like just after I press F6 (Step Over)
Comment 5 Nikolay CLA 2005-07-22 05:51:37 EDT
Please take a look at screenshots.
Comment 6 Nobody - feel free to take it CLA 2005-07-22 14:36:24 EDT
Please, turn off the "Automatically load symbols" option and try it again. The 
option is located on the "Debugger" page of the launch configuration dialog 
under the "Shared Libraries" tab.
Comment 7 Nikolay CLA 2005-07-23 09:10:20 EDT
(In reply to comment #6)
> Please, turn off the "Automatically load symbols" option and try it again. The 
> option is located on the "Debugger" page of the launch configuration dialog 
> under the "Shared Libraries" tab.

It helps. Thank you!
Comment 8 Nobody - feel free to take it CLA 2005-07-25 14:08:59 EDT
Another (and better) workaround is to use the debug version of ACE. 
This bug would go away when we switch to deferred breakpoints in gdb. 
Comment 9 Axel CLA 2006-10-06 08:45:46 EDT
(In reply to comment #6)
> Please, turn off the "Automatically load symbols" option and try it again. The 
> option is located on the "Debugger" page of the launch configuration dialog 
> under the "Shared Libraries" tab.


The instruction pointer disappears even in the following simple case (with the "Automatically load symbols" option off):

1:	void f()
2:	{
3:		int a = 0;
4:		++a;
5:	}
6:
7:	int main( int argc, char** argv )
8:	{
9:		f();
10:
11:		return 0;
12:	}

- Place breakpoint on line 9
- Start debugging -> now the arrow is on line 9
- Step in (F5) -> now the arrow is on line 3
- Step over (F6) -> the arrow disappears

Clicking on the "Debug" view makes the arrow reappear (something I would like to avoid, of course :-).

I agree with what Nikolay said: "And anyway when I press _Step Over_ I expect that debugger go to next instruction in my programm not into library module."

I am using:
- Eclipse 3.2.0 M20060629-1905
- CDT 3.1.1.100609270800
Comment 10 Doug Schaefer CLA 2007-08-21 11:06:01 EDT
Future means you commit to fix it in the Future. Inboxes can't make committments. Moving to '--'.