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

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

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P1 P1
    • 9
    • 9
    • infrastructure
    • None
    • gcc 4.8.1

    • b24
    • x86_64
    • linux

        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.

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

                Created:
                Updated:
                Resolved: