Page MenuHomePhabricator

[LLDB] Avoid triple corruption while merging core info from platform and target triples

Authored by omjavaid on Nov 12 2019, 6:14 PM.



This patch fixes a bug where when target triple created from elf information is arm-*-linux-eabihf and platform triple is armv8l-*-linux-gnueabihf. Merging both triple results in armv8l--unknown-unknown.

This happens because we order a triple update while calling CoreUpdated and CoreUpdated creates a new triple with no vendor or environment information.

Making sure we do not update triple and just update to more specific core fixes the issue.

Diff Detail

Event Timeline

omjavaid created this revision.Nov 12 2019, 6:14 PM

Can you add a test case for this? I assuming it could be similar to one of the existing ArchSpec::MergeFrom tests in

omjavaid updated this revision to Diff 229971.Nov 18 2019, 9:18 PM

Added a unittest as suggested by @labath.

Thanks. This behavior makes sense to me. @jasonmolenda, @clayborg, do you see any problems with this?

Ping @jasonmolenda

Any comments or LGTM?

jasonmolenda accepted this revision.Dec 4 2019, 12:36 PM

Thanks for the ping, yes this looks good to me.

This revision is now accepted and ready to land.Dec 4 2019, 12:36 PM
omjavaid added a project: Restricted Project.Dec 4 2019, 10:59 PM
This revision was automatically updated to reflect the committed changes.