Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Special case DUMMY_SP to emit line 0/column 0 locations on DWARF platforms. #128627

Merged
merged 5 commits into from
Aug 21, 2024

Commits on Aug 4, 2024

  1. Special case DUMMY_SP to emit line 0/column 0 locations on DWARF plat…

    …forms.
    
    Line 0 has a special meaning in DWARF. From the version 5 spec:
    
        The compiler may emit the value 0 in cases
        where an instruction cannot be attributed to any
        source line.
    
    DUMMY_SP spans cannot be attributed to any line. However, because rustc
    internally stores line numbers starting at zero, lookup_debug_loc() adjusts
    every line number by one. Special casing DUMMY_SP to actually emit line 0
    ensures rustc communicates to the debugger that there's no meaningful source
    code for this instruction, rather than telling the debugger to jump to line 1
    randomly.
    khuey committed Aug 4, 2024
    Configuration menu
    Copy the full SHA
    78caecf View commit details
    Browse the repository at this point in the history
  2. Use Span::is_dummy().

    khuey committed Aug 4, 2024
    Configuration menu
    Copy the full SHA
    e587855 View commit details
    Browse the repository at this point in the history
  3. Fix warning.

    khuey committed Aug 4, 2024
    Configuration menu
    Copy the full SHA
    5dc4a19 View commit details
    Browse the repository at this point in the history

Commits on Aug 20, 2024

  1. Add a test.

    khuey committed Aug 20, 2024
    Configuration menu
    Copy the full SHA
    3c735a0 View commit details
    Browse the repository at this point in the history
  2. Add a comment.

    khuey committed Aug 20, 2024
    Configuration menu
    Copy the full SHA
    4e9725c View commit details
    Browse the repository at this point in the history