This is the mail archive of the ecos-bugs@sources.redhat.com mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug 19971] New: gdb sets breakpoints wrong for funcs starting with inlines


http://bugs.ecos.sourceware.org/show_bug.cgi?id=19971

           Summary: gdb sets breakpoints wrong for funcs starting with
                    inlines
           Product: eCos
           Version: unknown
          Platform: Other
        OS/Version: Other
            Status: RESOLVED
          Severity: major
          Priority: low
         Component: Other
        AssignedTo: ebachalo at schuilenburg dot org
        ReportedBy: nobody at cygnus dot com
                CC: jifl at ecoscentric dot com


When setting a breakpoint in eCos on Cyg_Thread::exit(),
GDB claims to set the breakpoint in Cyg_Thread::self, which
is an inline function called as the first line in
Cyg_Thread::exit(). This is quite confusing indeed!

In addition in GDBtk's listing of Cyg_Thread::exit(), it normally
has a "-" beside every line that can have a break point on
it. But there are no "-"s beside any of the lines that call
inline functions so it appears that you cannot set breakpoints
there, even though they are perfectly valid source lines.

How-To-Repeat:
peshwari:~/ecc/doc/examples$ mips-tx39-elf-gdb -nw install/tests/kernel/thread1
GNU gdb 4.17-ecos-98r1p5
Copyright 1998 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.  This version of GDB is supported
for customers of Cygnus Solutions.  Type "show warranty" for details.
This GDB was configured as "--host=i686-pc-linux-gnu --target=mips-tx39-elf"...
(gdb) tsim
Connected to the simulator.
Loading section .rom_vectors, size 0x218 lma 0xbfc00000
Loading section .text, size 0x9710 lma 0xbfc00218
Loading section .rodata, size 0x798 lma 0xbfc09928
Loading section .data, size 0x2678 lma 0xbfc0a0c0
Start address 0xbfc00000
Transfer rate: 408000 bits in <1 sec.
Function "cyg_test_exit" not defined.
(gdb) b Cyg_Thread::exit
Breakpoint 1 at 0xbfc02f48: file /local/disk5/ecc-obj/install/include/cyg/kernel/thread.inl, line 223.
(gdb) list thread.inl:221
216     #endif    
217
218     //==========================================================================
219     // Inlines for Cyg_Thread class
220
221     inline Cyg_Thread *Cyg_Thread::self()
222     {
223         return Cyg_Scheduler::get_current_thread();
224     }
225
(gdb) list Cyg_Thread::exit
709     // -------------------------------------------------------------------------
710     // Exit thread. This puts the thread into EXITED state.
711
712     void
713     Cyg_Thread::exit()
714     {
715         // The thread should never return from this function.
716
717         Cyg_Thread *self = Cyg_Thread::self();
718
(gdb)

Cyg_Thread::exit is in thread.cxx.

The "thread1" program is a kernel test program that comes
with eCos.


---------------------------------------------------------------------------

Just to add some extra info, I have now found that one aspect of this isn't
MIPS specific. On the mn10300-elf toolchain, I find that when setting a
breakpoint on Cyg_Thread:exit(), it sets it relatively far down the function:

(gdb) b Cyg_Thread::exit
Breakpoint 1 at 0x400016b6: file /home/jlarmour/ecc/ecc/kernel/current/src/common/thread.cxx, line 724.
(gdb) list thread.cxx:710
705
706         CYG_REPORT_RETURN();
707     }
708
709     // -------------------------------------------------------------------------
710     // Exit thread. This puts the thread into EXITED state.
711
712     void
713     Cyg_Thread::exit()
714     {
(gdb) 
715         // The thread should never return from this function.
716
717         Cyg_Thread *self = Cyg_Thread::self();
718
719         Cyg_Scheduler::lock();
720
721         // clear the timer; if there was none, no worries.
722         clear_timer();
723
724         self->state = EXITED;

As you can see three inline functions have already been called before it
would hit the breakpoint - this is hardly setting a breakpoint on function
entry!

This is (surely) related to the MIPS problem. I'll let someone else decide
after its been analyzed closer - this aspect may want to be a separate PR.

Ta,

Jifl

---------------------------------------------------------------------------

Originator:
Jonathan Larmour

Organization:
cygnus

Audit-Trail:
Responsible-Changed-From-To: alexs->ebachalo 
Responsible-Changed-By: alexs 
Responsible-Changed-When: Tue Apr 27 06:26:14 PDT 1999 
Responsible-Changed-Why:  
Hi Eric 

Another problem thrown out by eCos QA. 

-- Alex

Unformatted:
Originator:  

page: www.cygnus.com/product/ecc-pr.html

Send_PR_form: Sent_from_www.cygnus.com

------- Additional Comments From alexs at ecoscentric dot com  2003-24-04 17:12 BST -------
Tools issue



------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]