Skip to content

log: filtering output by domain

Ghost User requested to merge wip/albfan/log-filter-domain into master

Allow log to be filter by domain.

Use case I'm debugging gdb communication and I'm only interested on gbp-gdb-debugger log domain (after adding this patch)

Author: Alberto Fanjul <albertofanjul@gmail.com>
Date:   Tue Aug 7 19:00:50 2018 +0200

    gdb: show gdb communication

diff --git a/src/plugins/gdb/gbp-gdb-debugger.c b/src/plugins/gdb/gbp-gdb-debugger.c
index aaeaca0be..ec16266fe 100644
--- a/src/plugins/gdb/gbp-gdb-debugger.c
+++ b/src/plugins/gdb/gbp-gdb-debugger.c
@@ -1170,6 +1170,8 @@ gbp_gdb_debugger_insert_breakpoint_cb (GObject      *object,
       return;
     }
 
+  g_debug ("gdb response: %s", output->line);
+
   if (output->kind == GDBWIRE_MI_OUTPUT_RESULT &&
       output->variant.result_record != NULL &&
       output->variant.result_record->result != NULL)
@@ -2774,6 +2776,8 @@ gbp_gdb_debugger_exec_async (GbpGdbDebugger      *self,
   g_return_if_fail (!thread || IDE_IS_DEBUGGER_THREAD (thread));
   g_return_if_fail (!cancellable || G_IS_CANCELLABLE (cancellable));
 
+  g_debug("gdb command: %s", command);
+
   /* Wrap at 10,000, but steal 9999 to use for thread switching */
   id = ++self->cmdseq;
   if (id == 9999)

Now I can debug with pleasure using:

$ flatpak-builder --run builder build-aux/flatpak/org.gnome.Builder.json /bin/bash
(flatpak)$ IDE_MESSAGES_TRACE=none IDE_MESSAGES_INFO=none IDE_MESSAGES_MESSAGE=none IDE_MESSAGES_DEBUG=gbp-gdb-debugger gdb --args gnome-builder -vvv

because log is only:

19:09:17.0701                          gbp-gdb-debugger[  199]:    DEBUG: gdb command: -gdb-set mi-async on
19:09:17.0701                          gbp-gdb-debugger[  199]:    DEBUG: gdb command: -break-list
19:09:17.0702                          gbp-gdb-debugger[  199]:    DEBUG: gdb command: -gdb-set inferior-tty /proc/self/fd/3
19:09:17.0702                          gbp-gdb-debugger[  199]:    DEBUG: gdb command: -exec-run --all --start
19:09:17.0702                          gbp-gdb-debugger[  199]:    DEBUG: gdb command: -data-list-register-names
19:09:17.0719                                       Ide[  199]:  WARNING: Failed to parse gdb communication: (flatpak build:19070): flatpak-DEBUG: 19:09:17.718: Opening user flatpak installation at path /home/alberto/.local/share/flatpak
19:09:17.0719                                       Ide[  199]:  WARNING: Failed to parse gdb communication: (flatpak build:19070): flatpak-DEBUG: 19:09:17.718: No installations directory in /etc/flatpak/installations.d. Skipping
19:09:17.0719                                       Ide[  199]:  WARNING: There was a communication failure
19:09:17.0719                                       Ide[  199]:  WARNING: There was a communication failure
19:09:17.0723                                       Ide[  199]:  WARNING: Failed to parse gdb communication: (flatpak build:19070): flatpak-DEBUG: 19:09:17.723: Allocated instance id 1785157566
19:09:17.0723                                       Ide[  199]:  WARNING: Failed to parse gdb communication: (flatpak build:19070): flatpak-DEBUG: 19:09:17.723: Allowing host-fs access
19:09:17.0723                                       Ide[  199]:  WARNING: Failed to parse gdb communication: (flatpak build:19070): flatpak-DEBUG: 19:09:17.723: Allowing wayland access
19:09:17.0723                                       Ide[  199]:  WARNING: Failed to parse gdb communication: (flatpak build:19070): flatpak-DEBUG: 19:09:17.723: Allowing x11 access
19:09:17.0726                                       Ide[  199]:  WARNING: Failed to parse gdb communication: (flatpak build:19070): flatpak-DEBUG: 19:09:17.726: Failed to run in transient scope: In WaitingForReject: Expected 'REJECTED am1 am2 ... amN', got 'ERROR'
19:09:17.0726                                       Ide[  199]:  WARNING: Failed to parse gdb communication: 19:09:18.0000                                       Ide[  199]:  WARNING: gdb: No reply found for: 001^done
19:09:18.0000                                       Ide[  199]:  WARNING: gdb: No reply found for: 002^done,BreakpointTable={nr_rows="0",nr_cols="6",hdr=[{width="7",alignment="-1",col_name="number",colhdr="Num"},{width="14",alignment="-1",col_name="type",colhdr="Type"},{width="4",alignment="-1",col_name="disp",colhdr="Disp"},{width="3",alignment="-1",col_name="enabled",colhdr="Enb"},{width="10",alignment="-1",col_name="addr",colhdr="Address"},{width="40",alignment="2",col_name="what",colhdr="What"}],body=[]}
19:09:18.0000                                       Ide[  199]:  WARNING: gdb: No reply found for: 003^done
19:09:18.0040                                       Ide[  199]:  WARNING: gdb: No reply found for: 004^running
19:09:18.0051                                       Ide[  199]:  WARNING: gdb: No reply found for: 005^done,register-names=["rax","rbx","rcx","rdx","rsi","rdi","rbp","rsp","r8","r9","r10","r11","r12","r13","r14","r15","rip","eflags","cs","ss","ds","es","fs","gs","st0","st1","st2","st3","st4","st5","st6","st7","fctrl","fstat","ftag","fiseg","fioff","foseg","fooff","fop","xmm0","xmm1","xmm2","xmm3","xmm4","xmm5","xmm6","xmm7","xmm8","xmm9","xmm10","xmm11","xmm12","xmm13","xmm14","xmm15","mxcsr","ymm0h","ymm1h","ymm2h","ymm3h","ymm4h","ymm5h","ymm6h","ymm7h","ymm8h","ymm9h","ymm10h","ymm11h","ymm12h","ymm13h","ymm14h","ymm15h","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","orig_rax","al","bl","cl","dl","sil","dil","bpl","spl","r8l","r9l","r10l","r11l","r12l","r13l","r14l","r15l","ah","bh","ch","dh","ax","bx","cx","dx","si","di","bp","","r8w","r9w","r10w","r11w","r12w","r13w","r14w","r15w","eax","ebx","ecx","edx","esi","edi","ebp","esp","r8d","r9d","r10d","r11d","r12d","r13d","r14d","r15d","ymm0","ymm1","ymm2","ymm3","ymm4","ymm5","ymm6","ymm7","ymm8","ymm9","ymm10","ymm11","ymm12","ymm13","ymm14","ymm15"]
19:09:19.0531                                    (null)[  208]:  WARNING: ide-vala-service.vala:90: Error opening directory '/home/alberto/jhbuild/checkout/gitg/flatpak-gitg/var/run/media/alberto/06095c1f-7f67-444b-87f8-0f5185a7cfd5/lost+found': Permission denied
19:09:21.0060                          gbp-gdb-debugger[  199]:    DEBUG: gdb command: -break-list
19:09:21.0066                          gbp-gdb-debugger[  199]:    DEBUG: gdb command: -data-list-register-values x
19:09:21.0067                          gbp-gdb-debugger[  199]:    DEBUG: gdb command: -stack-list-frames
19:09:21.0359                    ide-editor-perspective[  199]:  WARNING: The file is already loading
19:09:21.0444                                       Ide[  199]:  WARNING: There was a failure while calculating line changes from git. The exact error was: File is not under control of git working directory.
19:09:21.0449                          gbp-gdb-debugger[  199]:    DEBUG: gdb command: -stack-list-arguments --simple-values 0 0
19:09:21.0449                          gbp-gdb-debugger[  199]:    DEBUG: gdb command: 9999-stack-select-frame 0
@@@@-stack-list-locals --simple-values
9999-stack-select-frame
Warning: disabling gigacage because GIGACAGE_ENABLED=0!
19:09:26.0187                          gbp-gdb-debugger[  199]:    DEBUG: gdb command: -exec-step
19:09:26.0187                          gbp-gdb-debugger[  199]:    DEBUG: gdb command: -data-list-register-names
19:09:26.0194                          gbp-gdb-debugger[  199]:    DEBUG: gdb command: -break-list
19:09:26.0196                          gbp-gdb-debugger[  199]:    DEBUG: gdb command: -data-list-register-values x
19:09:26.0197                          gbp-gdb-debugger[  199]:    DEBUG: gdb command: -stack-list-frames
19:09:26.0201                    ide-editor-perspective[  199]:  WARNING: The file is already loading
19:09:26.0417                          gbp-gdb-debugger[  199]:    DEBUG: gdb command: -stack-list-arguments --simple-values 0 0
19:09:26.0417                          gbp-gdb-debugger[  199]:    DEBUG: gdb command: 9999-stack-select-frame 0
@@@@-stack-list-locals --simple-values
9999-stack-select-frame
sys:1: Warning: g_mapped_file_get_length: assertion 'file != NULL' failed
19:09:29.0199                          gbp-gdb-debugger[  199]:    DEBUG: gdb command: -break-insert --source /home/alberto/jhbuild/checkout/gitg/gitg/gitg-application.vala --line 34
19:09:29.0214                          gbp-gdb-debugger[  199]:    DEBUG: gdb response: 018^done,bkpt={number="2",type="breakpoint",disp="keep",enabled="y",addr="<MULTIPLE>",times="0",original-location="-source /home/alberto/jhbuild/checkout/gitg/gitg/gitg-application.vala -line 34"},{number="2.1",enabled="y",addr="0x0000000000450850",func="gitg_application_construct",file="/home/alberto/jhbuild/checkout/gitg/gitg/gitg-application.vala",fullname="/home/alberto/jhbuild/checkout/gitg/gitg/gitg-application.vala",line="34",thread-groups=["i1"]},{number="2.2",enabled="y",addr="0x0000000000450929",func="gitg_application_new",file="/home/alberto/jhbuild/checkout/gitg/gitg/gitg-application.vala",fullname="/home/alberto/jhbuild/checkout/gitg/gitg/gitg-application.vala",line="34",thread-groups=["i1"]}

So something like domain filtering would be really appreciated

Merge request reports