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

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

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P1
    • Resolution: Fixed
    • Affects Version/s: 9
    • Fix Version/s: 9
    • Component/s: infrastructure
    • Labels:
      None
    • Environment:

      gcc 4.8.1

    • Subcomponent:
    • Resolved In Build:
      b24
    • CPU:
      x86_64
    • OS:
      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

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

                  Dates

                  • Created:
                    Updated:
                    Resolved: