[Lldb-commits] [lldb] Add SBDebugger::AddCreateCallback API (PR #111206)

Greg Clayton via lldb-commits lldb-commits at lists.llvm.org
Mon Oct 7 10:25:39 PDT 2024


https://github.com/clayborg commented:

As Jim was saying, we might be able to make something a bit more useful so that we can easily extend for other notifications of a debug session lifetime. Maybe instead of:
```
typedef void (*SBDebuggerCreateCallback)(lldb::SBDebugger &debugger, void *baton);
```
We can add something like:
```
enum NotificationType {
  eDebuggerWasCreated,
  eDebuggerWillBeDestroyed, // Call before debugger object is destroyed
  eTargetWasCreated, 
  eTargetWillBeDestroyed,
  eProcess...
};
typedef void (*SBNotificationCallback)(lldb::NotificationType type, lldb::SBDebugger &, lldb::SBExecutionContext &exe_ctx, void *baton);
```
Then we can easily add new registration callbacks that all use the same callback function. 

https://github.com/llvm/llvm-project/pull/111206


More information about the lldb-commits mailing list