[lldb-dev] lldb 5.0 debugging a threaded C program on FreeBSD 11.1-RELEASE (x86-64)

Greg Clayton via lldb-dev lldb-dev at lists.llvm.org
Sun Nov 19 10:38:52 PST 2017


I wrote the "gui" mode many years ago in hope we would get people to work on it and improve it. No changes have been made since it was originally done. I would welcome any patches to help improve "gui" mode and make it great. I was never able to take the time to improve it to where it needs to be. 

That being said. I do believe selecting the single thread with a valid stop reason has been broken for a while. Not sure why it got worse in the latest release. I might more contribute that to changes in the FreeBSD codebase.

GUI mode needs the following fixes if anyone does want to help work on it:
- make sure correct thread is selected each time you stop. A few clarification on how this should work follows. If there is only one thread with a valid stop reason, that thread should be selected automatically. If there are more than one thread that have valid stop reasons, then keep the previous thread that was selected as the selected thread, or switch to the first thread with a stop reason if the previous stop was in another thread.
- we need a command line interpreter window that allows users to do command line commands. combining readline functionality with curses is tricky, especially with libedit as it is missing the functions that GDB uses to make the two work together (since GDB uses the real readline library)


> On Nov 16, 2017, at 12:18 PM, Dr. Rolf Jansen via lldb-dev <lldb-dev at lists.llvm.org> wrote:
> 
> Hello,
> 
> I am not sure whether this is an issue with FreeBSD or lldb, please point me into the right direction.
> 
> Recently I updated from FreeBSD 11 (system llvm/clang/lldb 4.0) to FreeBSD 11.1 (system llvm/clang/lldb 5.0). Now I am back working on one of my threaded server programs and in the past I happily used the ncurses GUI which is builtin to lldb for debugging.
> 
> Unfortunately, in my present setup, stepping over and into my code is quite cumbersome, because the GUI loses after each step the focus on the thread in which the step command was issued and switches the code window to another thread showing the assembly code of the accept() function in libc. In order to continue, I need to manually select the thread of my interest in the list of threads, and then I may issue the next step, which then lets the GUI lose its focus again and so on.
> 
> For the time being I step through my code without the GUI and then start the GUI only when I want to examine some variables.
> 
> I did not see this behaviour in FreeBSD 11 (system llvm/clang/lldb 4.0).
> 
> Any ideas, what is going on here? Any ideas for a workaround? In case this is a FreeBSD issue I would be glad to hear some keywords which I can use for a bug report.
> 
> Many thanks for any replies.
> 
> Best regards
> 
> Rolf
> _______________________________________________
> lldb-dev mailing list
> lldb-dev at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-dev



More information about the lldb-dev mailing list