[Lldb-commits] [PATCH] D108061: [lldb] Add support for shared library load when executable called through ld.

2021-09-10 Thread Rumeet Dhindsa via Phabricator via lldb-commits
rdhindsa added a comment. With this patch, it looks like the test added in this patch fails for lldb-arm-ubuntu: https://lab.llvm.org/buildbot/#/builders/17/builds/10498 Everything passes on these buildbots: lldb-aarch64-ubuntu, lldb-x64-windows-ninja, lldb-x86_64-debian. The test logic check

[Lldb-commits] [PATCH] D108061: [lldb] Add support for shared library load when executable called through ld.

2021-09-10 Thread Rumeet Dhindsa via Phabricator via lldb-commits
This revision was not accepted when it landed; it landed in state "Needs Review". This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. Closed by commit rG03df97101287: [lldb] Add support for debugging via the dynamic lin

[Lldb-commits] [PATCH] D108061: [lldb] Add support for shared library load when executable called through ld.

2021-09-10 Thread Rumeet Dhindsa via Phabricator via lldb-commits
rdhindsa added a comment. @teemperor: I believe I have addressed your comments. If there is any other concern, I can address it post-commit. Thank you everyone for the review and help with the patch! Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D1

[Lldb-commits] [PATCH] D108061: [lldb] Add support for shared library load when executable called through ld.

2021-09-10 Thread Greg Clayton via Phabricator via lldb-commits
clayborg added a comment. Thanks Pavel for figuring out the XML issue. I will need to add that to my box of tricks when buildbots fail! I look forward to seeing this patch go in Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D108061/new/ https://rev

[Lldb-commits] [PATCH] D108061: [lldb] Add support for shared library load when executable called through ld.

2021-09-10 Thread Pavel Labath via Phabricator via lldb-commits
labath accepted this revision. labath added a comment. Ok, let's give this one more shot. Thanks. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D108061/new/ https://reviews.llvm.org/D108061 ___ lldb-comm

[Lldb-commits] [PATCH] D108061: [lldb] Add support for shared library load when executable called through ld.

2021-09-09 Thread Rumeet Dhindsa via Phabricator via lldb-commits
rdhindsa updated this revision to Diff 371644. rdhindsa marked 6 inline comments as done. rdhindsa added a comment. Thanks Pavel for investigating and figuring out that the upstream failing test had libxml support disabled. I was able to reproduce the failure locally by adding -DLLDB_ENABLE_LIBX

[Lldb-commits] [PATCH] D108061: [lldb] Add support for shared library load when executable called through ld.

2021-09-09 Thread Pavel Labath via Phabricator via lldb-commits
labath added inline comments. Comment at: lldb/source/Plugins/DynamicLoader/POSIX-DYLD/DYLDRendezvous.cpp:153 +cursor = info_addr = +ResolveRendezvousAddress(m_process, m_executable_interpreter); else At this point, you can just make `ResolveRendez

[Lldb-commits] [PATCH] D108061: [lldb] Add support for shared library load when executable called through ld.

2021-09-08 Thread Rumeet Dhindsa via Phabricator via lldb-commits
rdhindsa updated this revision to Diff 371425. rdhindsa marked 2 inline comments as done. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D108061/new/ https://reviews.llvm.org/D108061 Files: lldb/source/Plugins/DynamicLoader/POSIX-DYLD/DYLDRendezvous

[Lldb-commits] [PATCH] D108061: [lldb] Add support for shared library load when executable called through ld.

2021-09-07 Thread Pavel Labath via Phabricator via lldb-commits
labath added inline comments. Comment at: lldb/source/Plugins/DynamicLoader/POSIX-DYLD/DYLDRendezvous.cpp:571-579 + + // ld.so saves empty file name for the executable file in the link map. + // When argv[0] is ld.so, we need to be update executable path. + if (file_path.empt

[Lldb-commits] [PATCH] D108061: [lldb] Add support for shared library load when executable called through ld.

2021-09-02 Thread Rumeet Dhindsa via Phabricator via lldb-commits
rdhindsa added a comment. Thank you for suggestion to try! After adding the assertions in memory region info trick, 3 testcases from only one test failed because of assertion : lldb/test/API/functionalities/load_unload/TestLoadUnload.py test_lldb_process_load_and_unload_commands test_load_unlo

[Lldb-commits] [PATCH] D108061: [lldb] Add support for shared library load when executable called through ld.

2021-09-01 Thread Greg Clayton via Phabricator via lldb-commits
clayborg accepted this revision. clayborg added a comment. Lets try again with the buildbots. The only way I can think that this would happen is if we have rendezvous entries with no names that happens in other debug sessions and that is causing new files to be loaded that we don't expect. To f

[Lldb-commits] [PATCH] D108061: [lldb] Add support for shared library load when executable called through ld.

2021-09-01 Thread Rumeet Dhindsa via Phabricator via lldb-commits
rdhindsa added a comment. Thank you for giving it a try! It passes for me for both Release and RelWithDebInfo along with asserts enabled in each case. I can give it a try by recommitting and checking the status, this patch is in `Needs Review` status presently. Hence, requesting for a review.

[Lldb-commits] [PATCH] D108061: [lldb] Add support for shared library load when executable called through ld.

2021-08-31 Thread Greg Clayton via Phabricator via lldb-commits
clayborg added a comment. I tried with RelWithDebInfo and it failed, but it was because it wasn't building: devvm1358:~/local/llvm/main/Release $ ./bin/llvm-lit -sv ../llvm-project/lldb/test/API/api/multithreaded/TestMultithreaded.py llvm-lit: /home/gclayton/local/llvm/main/llvm-project/ll

[Lldb-commits] [PATCH] D108061: [lldb] Add support for shared library load when executable called through ld.

2021-08-31 Thread Greg Clayton via Phabricator via lldb-commits
clayborg added a comment. In D108061#2973624 , @rdhindsa wrote: > For me, this test passes every time. I have tried multiple times with > instructions from failing bot, but haven't been able to reproduce the failure > locally yet. A few things you can

[Lldb-commits] [PATCH] D108061: [lldb] Add support for shared library load when executable called through ld.

2021-08-31 Thread Greg Clayton via Phabricator via lldb-commits
clayborg added a comment. In D108061#2973624 , @rdhindsa wrote: > For me, this test passes every time. I have tried multiple times with > instructions from failing bot, but haven't been able to reproduce the failure > locally yet. I will patch this int

[Lldb-commits] [PATCH] D108061: [lldb] Add support for shared library load when executable called through ld.

2021-08-30 Thread Rumeet Dhindsa via Phabricator via lldb-commits
rdhindsa added a comment. For me, this test passes every time. I have tried multiple times with instructions from failing bot, but haven't been able to reproduce the failure locally yet. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D108061/new/ h

[Lldb-commits] [PATCH] D108061: [lldb] Add support for shared library load when executable called through ld.

2021-08-30 Thread Greg Clayton via Phabricator via lldb-commits
clayborg added a comment. the multi-threaded test often times out for me. I wonder if it is timing out for you as well when you run the test suite locally? Maybe this is covering up the crash because the crash doesn't happen before the test times out for you? Repository: rG LLVM Github Monor

[Lldb-commits] [PATCH] D108061: [lldb] Add support for shared library load when executable called through ld.

2021-08-26 Thread Rumeet Dhindsa via Phabricator via lldb-commits
rdhindsa marked 2 inline comments as done and an inline comment as not done. rdhindsa added a comment. This patch caused a test failure when it was submitted two days ago, so I reverted it that day. However, I have not been able to reproduce the failure locally even using the cmake config from b

[Lldb-commits] [PATCH] D108061: [lldb] Add support for shared library load when executable called through ld.

2021-08-26 Thread Rumeet Dhindsa via Phabricator via lldb-commits
rdhindsa updated this revision to Diff 368988. rdhindsa marked 6 inline comments as done. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D108061/new/ https://reviews.llvm.org/D108061 Files: lldb/source/Plugins/DynamicLoader/POSIX-DYLD/DYLDRendezvous

[Lldb-commits] [PATCH] D108061: [lldb] Add support for shared library load when executable called through ld.

2021-08-26 Thread Raphael Isemann via Phabricator via lldb-commits
teemperor requested changes to this revision. teemperor added inline comments. This revision now requires changes to proceed. Comment at: lldb/test/API/functionalities/dyld-launch-linux/TestDyldLaunchLinux.py:13 + +def test(self): +self.build() Could

[Lldb-commits] [PATCH] D108061: [lldb] Add support for shared library load when executable called through ld.

2021-08-25 Thread Fangrui Song via Phabricator via lldb-commits
MaskRay added inline comments. Comment at: lldb/source/Plugins/DynamicLoader/POSIX-DYLD/DYLDRendezvous.cpp:293 + // ld.so saves empty file name for the executable file in the link map. + // When executable is run using ld.so, we need to be update executable path. + if (name.em

[Lldb-commits] [PATCH] D108061: [lldb] Add support for shared library load when executable called through ld.

2021-08-25 Thread Fangrui Song via Phabricator via lldb-commits
MaskRay added inline comments. Comment at: lldb/test/API/functionalities/dyld-launch-linux/TestDyldLaunchLinux.py:16 +exe = "/lib64/ld-linux-x86-64.so.2" +if(os.path.exists(exe)): +target = self.dbg.CreateTarget(exe) ==

[Lldb-commits] [PATCH] D108061: [lldb] Add support for shared library load when executable called through ld.

2021-08-25 Thread Fangrui Song via Phabricator via lldb-commits
MaskRay added inline comments. Comment at: lldb/test/API/functionalities/dyld-launch-linux/Makefile:1 +CXX_SOURCES := main.cpp +LD_EXTRAS := -Wl,-rpath "-Wl,$(shell pwd)" ``` CXX_SOURCES := main.cpp DYLIB_NAME := signal_file DYLIB_CXX_SOURCES := signal_file.cpp

[Lldb-commits] [PATCH] D108061: [lldb] Add support for shared library load when executable called through ld.

2021-08-24 Thread Rumeet Dhindsa via Phabricator via lldb-commits
This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. Closed by commit rG1cbdc07ec015: [lldb] Add support for debugging via the dynamic linker. (authored by rdhindsa). Repository: rG LLVM Github Monorepo CHANGES SINCE

[Lldb-commits] [PATCH] D108061: [lldb] Add support for shared library load when executable called through ld.

2021-08-24 Thread Rumeet Dhindsa via Phabricator via lldb-commits
rdhindsa added a comment. Thank you for the review and suggestion to check memory region. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D108061/new/ https://reviews.llvm.org/D108061 ___ lldb-commits maili

[Lldb-commits] [PATCH] D108061: [lldb] Add support for shared library load when executable called through ld.

2021-08-23 Thread Greg Clayton via Phabricator via lldb-commits
clayborg accepted this revision. clayborg added a comment. This revision is now accepted and ready to land. I am so happy that the memory region trick worked! Thanks for working on this and trying out the extra fixes, we now have great support for debugging via the dynamic linker! Repository:

[Lldb-commits] [PATCH] D108061: [lldb] Add support for shared library load when executable called through ld.

2021-08-19 Thread Rumeet Dhindsa via Phabricator via lldb-commits
rdhindsa updated this revision to Diff 367715. rdhindsa added a comment. Updated to extract executable file name using GetMemoryRegionInfo since ld.so returns empty file name for executable file name. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D1

[Lldb-commits] [PATCH] D108061: [lldb] Add support for shared library load when executable called through ld.

2021-08-19 Thread Greg Clayton via Phabricator via lldb-commits
clayborg added a comment. The code to get a memory region is on the process: virtual Status Process::GetMemoryRegionInfo(lldb::addr_t load_addr, MemoryRegionInfo &range_info); Then the memory region info might have a valid name: ConstString region_name = range_info.GetName(); My guess in

[Lldb-commits] [PATCH] D108061: [lldb] Add support for shared library load when executable called through ld.

2021-08-19 Thread Greg Clayton via Phabricator via lldb-commits
clayborg added a comment. In D108061#2955707 , @rdhindsa wrote: > 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.

[Lldb-commits] [PATCH] D108061: [lldb] Add support for shared library load when executable called through ld.

2021-08-19 Thread Rumeet Dhindsa via Phabricator via lldb-commits
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 s

[Lldb-commits] [PATCH] D108061: [lldb] Add support for shared library load when executable called through ld.

2021-08-18 Thread Rumeet Dhindsa via Phabricator via lldb-commits
rdhindsa added a comment. I checked the status with both gdb and lldb using test case added here. It looks like breakpoint on main doesn't get hit even for gdb when called through ld.so. However, breakpoint on shared library functions is supported by gdb. With this patch, we are now able to set

[Lldb-commits] [PATCH] D108061: [lldb] Add support for shared library load when executable called through ld.

2021-08-17 Thread Greg Clayton via Phabricator via lldb-commits
clayborg added a comment. In D108061#2950858 , @rdhindsa wrote: > Updated the test to check for the respective function name from the shared > library in the frames. > I didn't add run_to_source_breakpoint since we can't set a breakpoint on main > initi

[Lldb-commits] [PATCH] D108061: [lldb] Add support for shared library load when executable called through ld.

2021-08-17 Thread Rumeet Dhindsa via Phabricator via lldb-commits
rdhindsa marked an inline comment as done. rdhindsa added a comment. Updated the test to check for the respective function name from the shared library in the frames. I didn't add run_to_source_breakpoint since we can't set a breakpoint on main initially before running the program. Hence it wou

[Lldb-commits] [PATCH] D108061: [lldb] Add support for shared library load when executable called through ld.

2021-08-17 Thread Rumeet Dhindsa via Phabricator via lldb-commits
rdhindsa updated this revision to Diff 367047. rdhindsa marked an inline comment as done. rdhindsa added a comment. Updated the test to check for the respective function name from the shared library in the frames. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://review

[Lldb-commits] [PATCH] D108061: [lldb] Add support for shared library load when executable called through ld.

2021-08-16 Thread Greg Clayton via Phabricator via lldb-commits
clayborg requested changes to this revision. clayborg added a comment. This revision now requires changes to proceed. In D108061#2947526 , @rdhindsa wrote: > Reverted code changes from ObjectFileELF as suggested and added directly to > DYLDRendezvous.cpp

[Lldb-commits] [PATCH] D108061: [lldb] Add support for shared library load when executable called through ld.

2021-08-16 Thread Rumeet Dhindsa via Phabricator via lldb-commits
rdhindsa updated this revision to Diff 366692. rdhindsa added a comment. Reverted code changes from ObjectFileELF as suggested and added directly to DYLDRendezvous.cpp. Is there a better place to place the test, or is it okay to keep under ObjectFile. Repository: rG LLVM Github Monorepo CH

[Lldb-commits] [PATCH] D108061: [lldb] Add support for shared library load when executable called through ld.

2021-08-16 Thread Greg Clayton via Phabricator via lldb-commits
clayborg requested changes to this revision. clayborg added a comment. This revision now requires changes to proceed. Thanks for getting to this. I had a diff going a few weeks ago, but never got things fully working! Comment at: lldb/include/lldb/Symbol/ObjectFile.h:465-479 +

[Lldb-commits] [PATCH] D108061: [lldb] Add support for shared library load when executable called through ld.

2021-08-13 Thread Rumeet Dhindsa via Phabricator via lldb-commits
rdhindsa created this revision. rdhindsa added reviewers: labath, clayborg. Herald added a subscriber: emaste. rdhindsa requested review of this revision. Herald added a subscriber: MaskRay. Herald added a project: LLDB. Add support for shared library load when executable called through ld. Curre