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

Fix issue #113 and #114 #121

Merged
merged 6 commits into from
Aug 7, 2023
Merged

Fix issue #113 and #114 #121

merged 6 commits into from
Aug 7, 2023

Conversation

kquick
Copy link
Member

@kquick kquick commented Aug 7, 2023

Contains a fix for the quoting of the DILabel name field bug identified in Issue #114 .

Contains a fix for the DICompileUnit rangesBaseAddress (and subsequent) fields which was added in LLVM 11 as noted in Issue #113. The fix does not switch the field type as proposed in the issue, but does update the pretty-printing.

Copy link
Collaborator

@RyanGlScott RyanGlScott left a comment

Choose a reason for hiding this comment

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

Hooray!

Comment on lines 1047 to 1054
++ if llvmVer < 11 then [] else
[ pure ("rangesBaseAddress:" <+> ppBool (dicuRangesBaseAddress cu))
, (("sysroot:" <+>) . doubleQuotes . text)
<$> (dicuSysRoot cu)
, (("sdk:" <+>) . doubleQuotes . text)
<$> (dicuSDK cu)
])
]
)
Copy link
Collaborator

Choose a reason for hiding this comment

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

I'd prefer llvmVer >= 11. Something like this, perhaps:

       [ pure ("rangesBaseAddress:"     <+> ppBool (dicuRangesBaseAddress cu))
       ,     (("sysroot:"               <+>) . doubleQuotes . text)
             <$> (dicuSysRoot cu)
       ,     (("sdk:"                   <+>) . doubleQuotes . text)
             <$> (dicuSDK cu)
       | llvmVer >= 11
       ]

@@ -1046,12 +1043,15 @@ ppDICompileUnit' pp cu = "!DICompileUnit"
, pure ("splitDebugInlining:" <+> ppBool (dicuSplitDebugInlining cu))
, pure ("debugInfoForProfiling:" <+> ppBool (dicuDebugInfoForProf cu))
, pure ("nameTableKind:" <+> integral (dicuNameTableKind cu))
, pure ("rangesBaseAddress:" <+> ppBool (dicuRangesBaseAddress cu))
]
++ if llvmVer < 11 then [] else
Copy link
Collaborator

Choose a reason for hiding this comment

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

Perhaps worth adding a Haddock comment to dicuRangesBaseAddress (here) that it is only pretty-printed with LLVM 11 or later, the version that it was added.

@@ -971,7 +968,7 @@ ppDIImportedEntity = ppDIImportedEntity' ppLabel
ppDILabel' :: Fmt i -> Fmt (DILabel' i)
ppDILabel' pp ie = "!DILabel"
<> parens (mcommas [ (("scope:" <+>) . ppValMd' pp) <$> dilScope ie
, pure ("name:" <+> text (dilName ie))
, pure ("name:" <+> doubleQuotes (text (dilName ie)))
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think this would be preferable:

Suggested change
, pure ("name:" <+> doubleQuotes (text (dilName ie)))
, pure ("name:" <+> ppStringLiteral (dilName ie))

As ppStringLiteral performs escaping of certain characters.

@kquick kquick merged commit 7f5631f into master Aug 7, 2023
1 check passed
@kquick kquick deleted the dgb_1691441044-0 branch August 7, 2023 23:50
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.

2 participants