#1655 Stepping over GL function brings to bad line/file

OTHER
pending
gdb (39)
Bug
none
Unknown
False
2014-08-17
2012-07-10
No

When stepping over a call to glFramebufferTexture2D, GDB ends up at a totally unrelated location.

This only happens when a valid GL context is active. Testing on a eVGA nVidia GeForce 570 GTX HD, with drivers v.301.42, although it happened on many other driver versions. Not sure if this happens with non-nVidia cards.

This problem started happening from GCC 7.2.
Tested with various MinGW GDB / GCC combinations:
Ran into problems mixing various GDB/GCC versions, where breakpoints won't even hit (Testing through Ecere IDE GDB integration).
GDB 7.1 does not seem to hit any breakpoint.
Here's the full table of results:

    gdb 6.8 + gcc 4.4.0: works fine
    gdb 6.8 + gcc 4.6.2: breakpoints doesn't even hit
    gdb 7.0 + gcc 4.4.0: works fine
    gdb 7.0 + gcc 4.6.2: works fine
    gdb 7.1 + gcc 4.4.0: breakpoints doesn't even hit
    gdb 7.1 + gcc 4.6.2: breakpoints doesn't even hit
    gdb 7.2 + gcc 4.6.2: broken \(stepping over brings to bad line\)
    gdb 7.2 + gcc 4.4.0: broken \(stepping over brings to bad line\)
    gdb 7.3 + gcc 4.6.2: broken \(stepping over brings to bad line\)
    gdb 7.3 + gcc 4.4.0: broken \(stepping over brings to bad line\)
    gdb 7.4 + gcc 4.4.0: broken \(stepping over brings to bad line\)
    gdb 7.4 + gcc 4.6.2: broken \(stepping over brings to bad line\)

This bug report supersedes #3304426 where I was saying gdb 6.8 doesn't work with GCC 4.5.0+

I'll be sticking with GDB 7.0 (which luckily works with newer GCCs) until this is resolved.

See sample attached code which demonstrates the problem (using Ecere ( http://ecere.com/ ) to set up the OpenGL context and GLee ( http://elf-stone.com/getfile.php?title=GleeSrcTar ) to resolve glFramebufferTexture2D). Please use your favorite way to set up an OpenGL context if you don't wish to install Ecere .
You put a breakpoint on line 15, hit F10 (Step Over), and you end up with this call stack:

0 inside ??, C:\Windows\SysWOW64\nvoglv32.dll
1 inside __ecereMethod___ecereNameSpace__ecere__gui__Window_LoadGraphics, C:\Program Files (x86)\ECERE SDK\bin\ecere.dll
2 inside __ecereMethod___ecereNameSpace__ecere__gui__Window_Create, C:\Program Files (x86)\ECERE SDK\bin\ecere.dll
3 inside __ecereMethod___ecereNameSpace__ecere__gui__GuiApplication_Main, C:\Program Files (x86)\ECERE SDK\bin\ecere.dll
4 WinMain Function, obj\debug.win32\gdbGLTest.main.ec:101

Thanks!

-Jerome

Discussion

  • Jerome St-Louis

    Jerome St-Louis - 2012-07-10
     
    Attachments
  • Jerome St-Louis

    Jerome St-Louis - 2012-07-10

    Sorry it should read "This problem started happening from ***GDB*** 7.2".

     
  • Earnie Boyd

    Earnie Boyd - 2012-07-10
    • milestone: --> 519164
    • status: open --> pending
     
  • Earnie Boyd

    Earnie Boyd - 2012-07-10

    Are your libraries and programs you want to debug compiled without optimization, -O0 with GCC/G++? If not, what you describe is a direct result of optimization.

     
  • Jerome St-Louis

    Jerome St-Louis - 2012-07-10

    Hi Earnie. Thanks for getting back to me quickly!
    All my code is compiled with debug information and no optimization.
    As we discussed before, -O0 is default for GCC. I'm specifying -g, and no -O.

    I can place breakpoints and step over most function calls in my code.
    I can even step over other OpenGL calls fine.
    glFramebufferTexture2D in particular is problematic with 7.1+, but works with 7.0

    There might have been other few specific calls over which I had trouble, I can't recall.

    Regards,

    Jerome

     
  • Jerome St-Louis

    Jerome St-Louis - 2012-07-10
    • status: pending --> open
     
  • Jerome St-Louis

    Jerome St-Louis - 2012-07-11
    • milestone: 519164 -->
     
  • Earnie Boyd

    Earnie Boyd - 2012-10-24

    Since this appears to be a problem with GDB you'll need to file a bug report with them. Please update this issue with the GDB bug id.

     
  • Earnie Boyd

    Earnie Boyd - 2012-10-24
    • assigned_to: nobody --> ir0nh34d
    • status: open --> pending
     
  • Earnie Boyd

    Earnie Boyd - 2013-02-11
    • milestone: --> OTHER
    • type: --> Bug
    • resolution: --> none
    • category: --> Unknown
    • patch_attached: --> False
     

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks