Skip to content

Conversation

@StanHash
Copy link
Contributor

@StanHash StanHash commented Mar 2, 2022

Sometimes when using tools for reading line number information out of objects generated by agbcc, you'd get the follwing error:

DWARF error: mangled line number section

This is presumably caused by the function size_of_line_info (in gcc/dwarf2out.c) sometimes mispredicting the actual size of the rest of the .debug_line section. This was fixed here by generating label deltas instead of using that function (as is done in more recent versions of GCC).

The optional -ffix-debug-line flag enables this new behavior.

Note: that fix probably needs to eventually be ported to agbcc_arm as well as any fork featuring agbcp.


I'm only now seeing that there's another debug info related PR in (#49) featuring the addition of a new flag. Perhaps it would be interesting to merge the flags into an unified one that either updates/fixes debug info generation or restores the old buggy one.

@laqieer
Copy link

laqieer commented Mar 3, 2022

gcc-mirror/gcc@14a774a
reference for code review

@StanHash
Copy link
Contributor Author

StanHash commented Apr 4, 2023

Updated this to not enable new fixed behavior by default.

gcc/toplev.c Outdated
Comment on lines 588 to 589
/* Use old (buggy) DWARF line info generator. */
int flag_fixed_debug_line_info = 0;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fix comment

@luckytyphlosion luckytyphlosion merged commit c2e57ee into pret:master Apr 5, 2023
laqieer added a commit to laqieer/fireemblem8u that referenced this pull request Apr 5, 2023
Add `-ffix-debug-line` option to fix bug of `.debug_line` section
@StanHash StanHash deleted the fix-dwarf-debug-line branch April 5, 2023 15:01
jiangzhengwenjz added a commit to jiangzhengwenjz/katam that referenced this pull request Apr 5, 2023
jiangzhengwenjz added a commit to jiangzhengwenjz/csm3 that referenced this pull request Apr 5, 2023
jiangzhengwenjz added a commit to jiangzhengwenjz/totkol that referenced this pull request Apr 5, 2023
jiangzhengwenjz added a commit to jiangzhengwenjz/auroraticket that referenced this pull request Apr 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants