Skip to content

Code in block passed to macro has line number of macro invocation #39153

Closed
@hsivonen

Description

@hsivonen

It appears that (at least on Linux) if you pass a block of code to a macro, the line numbers for code in the block become the line of the start of the macro invocation rather than the actual lines within the block. This makes debugging hard.

Consider:

call_macro_defined_somewhere!({
  one();
  two();
  three();
});

Line reported for one(), two() and three() is the line that call_macro_defined_somewhere!({ is on. Expected line number for one() to be the line number for call_macro_defined_somewhere!({ plus one, etc.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-debuginfoArea: Debugging information in compiled programs (DWARF, PDB, etc.)C-bugCategory: This is a bug.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions