mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 22:27:35 +00:00
LibDebug: Store LibDebug objects on the heap & make them non-copyable
This fixes an issue were some LibDebug objects (for example, Dwarf::CompilationUnit) held a reference to their parent Dwarf::DwarfInfo object, which was constructed on the stack and later moved to the heap.
This commit is contained in:
parent
edd79ddd00
commit
e9e4358a93
7 changed files with 19 additions and 10 deletions
|
@ -19,6 +19,9 @@
|
|||
namespace Debug::Dwarf {
|
||||
|
||||
class DwarfInfo {
|
||||
AK_MAKE_NONCOPYABLE(DwarfInfo);
|
||||
AK_MAKE_NONMOVABLE(DwarfInfo);
|
||||
|
||||
public:
|
||||
explicit DwarfInfo(const ELF::Image&);
|
||||
|
||||
|
@ -44,7 +47,7 @@ private:
|
|||
ReadonlyBytes m_debug_strings_data;
|
||||
ReadonlyBytes m_debug_line_strings_data;
|
||||
|
||||
Vector<Dwarf::CompilationUnit> m_compilation_units;
|
||||
NonnullOwnPtrVector<Dwarf::CompilationUnit> m_compilation_units;
|
||||
};
|
||||
|
||||
template<typename Callback>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue