labath wrote:

FWIW, I completely agree @royitaqi. I'm not saying inter-plugin dependencies 
should be a free-for-all (*), but I think that some kinds of dependencies make 
sense and I definitely think this is one of them. The debug map format is 
intimately tied to the MachO and darwin ecosystems and I think there's 
approximately zero chance that it will be implemented elsewhere. Using the 
debug map requires MachO files, so why not just admit that?

This isn't the only example of that. For example, ProcessElfCore requires *elf* 
core files. ProcessMachCore requires MachO core files. And I think that's a 
perfectly natural state of the world and doing anything else would make things 
a lot more convoluted. I think something like `SupportsDebugMap` is a step in 
the wrong direction. It's true that removes the link time dependency but the 
moral dependency remains, and in fact this makes it worse, because now *every* 
object file plugin needs to know about the debug map. Why should 
ObjectFilePECOFF need to think about whether it supports a random symbol file 
plugin?

(*) I think that plugin dependencies should form a DAG. The fact that 
SymbolFileDWARFDebugMap depends on ObjectFileMachO means that ObjectFileMachO 
should not depend on SymbolFileDWARFDebugMap -- which I think is also perfectly 
natural restriction. And even if there is a reason why you might want to depend 
the other way, you can try to break it using the usual dependency reversal 
techniques, but you'd only need to touch these two plugins -- not every plugin 
of the two kinds.

I might also say that, for the sake of clarity, the dependency direction should 
be uniform across all plugins of the same type. So that SymbolFileDWARFDebugMap 
depends on ObjectFileMachO means that no other object file plugin can depend on 
any other symbol file plugin, which is, again, I think a reasonable 
requirement, and I would say that if we ever find a case where we have two 
plugin pairs which want to depend in the opposite directions, that this means 
that those plugin types are not designed properly (maybe they ought to be a 
single plugin?).

https://github.com/llvm/llvm-project/pull/139170
_______________________________________________
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to