Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8047734

gcc/g++ -Og is harmful to the debugging experience.

    XMLWordPrintable

Details

    • Bug
    • Status: Resolved
    • P1
    • Resolution: Fixed
    • 9
    • 9
    • infrastructure
    • None
    • gcc 4.8.1

    • b24
    • x86_64
    • linux

    Backports

      Description

        Configure a slowdebug build on Linux with gcc 4.8.1
        Debug java, setting a breakpoint at (say) FieldReassigner::do_field
        run some complex piece of Java (it needs to do some deoptimization for this case;
        this example is listed because it is known-bad because that is what I was debugging
        when I hit this; I think I've seen others before) hit a breakpoint, go "up", and say:

        (gdb) p fields_sorted
        $3 = <optimized out>

        this is wrong for "slowdebug".
        If instead the code is compiled with -O0 instead of -Og, you will see

        (gdb) p fields_sorted
        $1 = (int *) 0x7fff000038d0

        Workaround: use find+grep to locate every instance of -Og in the .make, .sh, and .m4 files, replace with -O0, and reconfigure for a slowdebug build.

        Attachments

          Issue Links

            Activity

              People

                mduigou Mike Duigou
                drchase David Chase (Inactive)
                Votes:
                1 Vote for this issue
                Watchers:
                6 Start watching this issue

                Dates

                  Created:
                  Updated:
                  Resolved: