Would you please add a textual mark or colorize the current line in `list` command? For example: 102 printf(...) 103 -> int a = 1; // arrow? 104 return 0; 105 } Thanks.
In the TUI (try "tui enable"), we already highlight the current line. For "list", I agree that'd be really nice. (I've wanted it for a long while.) lldb does that, and puts the arrow before the line numbers, which I think is more visible: 102 printf(...) -> 103 int a = 1; // arrow? 104 return 0; 105 } This shouldn't be hard to implement if someone wants to take a stab at it. Note we already print the current instruction in the output of the "disassemble" command: 0x00000000004009d3 <+12>: mov %rsi,-0x30(%rbp) => 0x00000000004009d7 <+16>: mov $0x400c62,%edi 0x00000000004009dc <+21>: callq 0x400760 <objc_get_class@plt> 0x00000000004009e1 <+26>: mov %rax,%rbx In the TUI, you'll notice that we also indicate which lines have breakpoints, with "b+". That's something that I've wanted for "list" and "disassemble" too.
(In reply to Pedro Alves from comment #1) > In the TUI (try "tui enable"), we already highlight the current line. > > For "list", I agree that'd be really nice. (I've wanted it for a long > while.) > > lldb does that, and puts the arrow before the line numbers, which I think is > more visible: > > 102 printf(...) > -> 103 int a = 1; // arrow? > 104 return 0; > 105 } > > This shouldn't be hard to implement if someone wants to take a stab at it. > > Note we already print the current instruction in the output of the > "disassemble" command: > > 0x00000000004009d3 <+12>: mov %rsi,-0x30(%rbp) > => 0x00000000004009d7 <+16>: mov $0x400c62,%edi > 0x00000000004009dc <+21>: callq 0x400760 <objc_get_class@plt> > 0x00000000004009e1 <+26>: mov %rax,%rbx > > In the TUI, you'll notice that we also indicate which lines have > breakpoints, with "b+". That's something that I've wanted for "list" and > "disassemble" too. Really fast reply... Thanks for your tips. I've never used "tui" before. I tried it just now and discovered it's quite similar to "layout" command (or are they the same?) And I totally agree with your idea putting arrow before line count. Anyway thanks for viewing the bug.
I really want this, especially with a full line color highlight like TUI. TUI breaks when you have large stdout, and with vim bindings. I'm currently using GDB dashboard just for this feature basically: https://github.com/cyrus-and/gdb-dashboard The problem is that requires Python scripting, which is not available on some targets. If the highlight were possible natively, I would just put a list on hook-stop, and everything would be perfect. Another advantage over TUI is that the shell history keeps the debug path if you want to scroll up. Then just use the "edit" command as well to make things even better.