This is an archive of the discontinued LLVM Phabricator instance.

[lldb] Add the ability to remove diagnostic callbacks
ClosedPublic

Authored by JDevlieghere on Feb 7 2023, 7:47 PM.

Details

Summary

Add the ability to remove diagnostic callbacks.

Diff Detail

Event Timeline

JDevlieghere created this revision.Feb 7 2023, 7:47 PM
Herald added a project: Restricted Project. · View Herald TranscriptFeb 7 2023, 7:47 PM
mib added a comment.Feb 8 2023, 12:20 PM

LGTM! Is there a simple way to test this ?

lldb/source/Utility/Diagnostics.cpp
55–58

nit: may be use llvm::remove_if instead ?

LGTM! Is there a simple way to test this ?

I considered a unit test, but that would require making everything protected and would basically boil down to testing the implementation of the underlying container, but I can add it if you think it's worthwhile. I think a better way to test this is through an integration test that exercises this code path. D143548 would indirectly test it (it doesn't crash but I assume ASAN would have caught it).

This revision is now accepted and ready to land.Feb 8 2023, 2:44 PM
This revision was automatically updated to reflect the committed changes.
Herald added a project: Restricted Project. · View Herald TranscriptFeb 9 2023, 1:20 PM