[Lldb-commits] [PATCH] D120917: Make the breakpoint log channel more useful

Jim Ingham via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Thu Mar 3 11:01:39 PST 2022


jingham added inline comments.


================
Comment at: lldb/source/Breakpoint/Breakpoint.cpp:1063-1065
+  break_id_t bkpt_id = GetBreakpoint()->GetID();
+  s->Format("bkpt: {0} type: {1}", bkpt_id,
+      BreakpointEventTypeAsCString(event_type));
----------------
kastiglione wrote:
> For the location event types, should the location IDs be included?
Could be, or the number changed, etc.  I didn't need that so I didn't add it.


================
Comment at: lldb/source/Utility/Broadcaster.cpp:211-215
+  Log *log = GetLog(LLDBLog::Events);
+  if (!log && event_sp->GetData())
+    log = event_sp->GetData()->GetLogChannel();
+
+  if (log) {
----------------
kastiglione wrote:
> should this log to both channels? I find it slightly unexpected that an event wouldn't be printed to the events channel.
If the events log category is on, then you will get a non-null log and log to the events Log.  You only get another log if Events is off.  And if the event data returns a Log in the lldb channel it won't matter anyway, in that case this is just a fancy way of doing LogIfAnyCategory...

The only slight oddity here is that if an EventData chose to provide a Log not in the lldb channel (e.g. the gdb-remote channel), then if you did:

log enable -f /tmp/remote-log.txt gdb-remote packets

the events would go to the remote-log.txt, but then if you did:

log enable lldb event

the event traces would stop going to that log file.

Since the main point of this change is to be able to log X-type events when the X log channel/category is on, but the Events log is NOT on, I don't think that's a real problem.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D120917/new/

https://reviews.llvm.org/D120917



More information about the lldb-commits mailing list