rdhindsa added a comment.

Looking further as to why executable symbols are not loaded, it looks like when 
we read the link_map in lldb, AddSOEntries() is called for all the entries in 
link_map read from ld.so. The first entry's name(which corresponds to 
executable) is empty, which seems to be set by ld.so here 
(https://github.com/bminor/glibc/blob/master/elf/rtld.c#L1389). main_map at 
this location has the entry for respective executable, but its name is removed, 
hence lldb while going through entries can't read entry about main executable.

I verified that lldb does iterate through the link_map list with this patch, 
reading that file name as empty. I also verified that if respective line is 
commented in ld.so , and hence the name of executable is retained, lldb with 
this patch is able to set breakpoint on main as well. Hence, it would require 
change to glibc as well. Once that is in, we can add additional test for that 
feature later on as a follow-up patch. Does that sound okay?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D108061

_______________________________________________
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to