[Lldb-commits] [PATCH] D124198: [LLDB][Unwind] Add stack scanning as fallback unwind plan if no symbol file is available.

2022-04-28 Thread Zequan Wu via Phabricator via lldb-commits
zequanwu added inline comments. Comment at: lldb/include/lldb/Symbol/UnwindPlan.h:266 + int32_t GetRaSearchOffset() const { +return m_type == isRaSearch ? m_value.ra_search.search_offset & ~1 : 0; + } zequanwu wrote: > clayborg wrote: > > Are

[Lldb-commits] [PATCH] D124198: [LLDB][Unwind] Add stack scanning as fallback unwind plan if no symbol file is available.

2022-04-28 Thread Zequan Wu via Phabricator via lldb-commits
zequanwu updated this revision to Diff 425930. zequanwu added a comment. Use extra bool variable for is_first_search, because search_offset might be an odd number if parameter byte size in stack is an odd number. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION

[Lldb-commits] [PATCH] D124198: [LLDB][Unwind] Add stack scanning as fallback unwind plan if no symbol file is available.

2022-04-28 Thread Zequan Wu via Phabricator via lldb-commits
zequanwu added inline comments. Comment at: lldb/include/lldb/Symbol/UnwindPlan.h:225 + // Not the first search. + m_value.ra_search.search_offset |= 1; +} clayborg wrote: > What is this magic number/bit here? Is it ok to clobber bit

[Lldb-commits] [PATCH] D124198: [LLDB][Unwind] Add stack scanning as fallback unwind plan if no symbol file is available.

2022-04-28 Thread Zequan Wu via Phabricator via lldb-commits
zequanwu updated this revision to Diff 425928. zequanwu marked 4 inline comments as done. zequanwu added a comment. Update: address some inline comments. For testing, I don't know how to create minidump in yaml format like the one in

[Lldb-commits] [PATCH] D124198: [LLDB][Unwind] Add stack scanning as fallback unwind plan if no symbol file is available.

2022-04-28 Thread Pavel Labath via Phabricator via lldb-commits
labath added a comment. In D124198#3468039 , @clayborg wrote: > So there is real benefit to doing these checks IMHO as it can help us get > back on track in live debug sessions. Core file sessions results will vary > depending on it we actually have

[Lldb-commits] [PATCH] D124198: [LLDB][Unwind] Add stack scanning as fallback unwind plan if no symbol file is available.

2022-04-22 Thread Jim Ingham via Phabricator via lldb-commits
jingham added a comment. I also wonder if this shouldn't require a separate flag to turn on this search, or be a separate command in the way Greg did. People rely on backtraces being accurate. It's fine to add something more like a desperation play - something is sometimes better than

[Lldb-commits] [PATCH] D124198: [LLDB][Unwind] Add stack scanning as fallback unwind plan if no symbol file is available.

2022-04-22 Thread Greg Clayton via Phabricator via lldb-commits
clayborg added a comment. "sbt" == stack back trace Just looks at the stack for things that look like code and tries to make something that looks like a backtrace Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D124198/new/

[Lldb-commits] [PATCH] D124198: [LLDB][Unwind] Add stack scanning as fallback unwind plan if no symbol file is available.

2022-04-22 Thread Greg Clayton via Phabricator via lldb-commits
clayborg added a comment. If anyone wants to see the "sbt" python command, I am happy to share it Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D124198/new/ https://reviews.llvm.org/D124198 ___

[Lldb-commits] [PATCH] D124198: [LLDB][Unwind] Add stack scanning as fallback unwind plan if no symbol file is available.

2022-04-22 Thread Greg Clayton via Phabricator via lldb-commits
clayborg added a comment. In D124198#3466889 , @labath wrote: > The patch description could definitely use more details about the motivation > for the change, and a description of how it works. Apart from the fact that > it uses the raSearch feature I

[Lldb-commits] [PATCH] D124198: [LLDB][Unwind] Add stack scanning as fallback unwind plan if no symbol file is available.

2022-04-22 Thread Pavel Labath via Phabricator via lldb-commits
labath added a comment. The patch description could definitely use more details about the motivation for the change, and a description of how it works. Apart from the fact that it uses the raSearch feature I introduced a while back, I don't know much about how it works (and given the planned

[Lldb-commits] [PATCH] D124198: [LLDB][Unwind] Add stack scanning as fallback unwind plan if no symbol file is available.

2022-04-21 Thread Zequan Wu via Phabricator via lldb-commits
zequanwu planned changes to this revision. zequanwu added a comment. Thanks for the feedback. As you pointed out that stack scanning without symbol file info is fragile due to function pointers in stack and we don't know the parameter size pushed into the stack. Originally, I want lldb to do

[Lldb-commits] [PATCH] D124198: [LLDB][Unwind] Add stack scanning as fallback unwind plan if no symbol file is available.

2022-04-21 Thread Jason Molenda via Phabricator via lldb-commits
jasonmolenda added a comment. I guess the other comment I would make is whether we should have a new ivar, instead of using the unused 0th bit of search_offset. fwiw I wasn't real clear in my previous comment. As you say in the title of this, you're trying to backtrace through a case where

[Lldb-commits] [PATCH] D124198: [LLDB][Unwind] Add stack scanning as fallback unwind plan if no symbol file is available.

2022-04-21 Thread Jason Molenda via Phabricator via lldb-commits
jasonmolenda added a comment. This is obviously building on Pavel's work of https://reviews.llvm.org/D66638 for Win32 systems. What problem with that existing patchset is this addressing? Pavel's original patch assumes that we can retrieve a function's expected stack frame size, and the size

[Lldb-commits] [PATCH] D124198: [LLDB][Unwind] Add stack scanning as fallback unwind plan if no symbol file is available.

2022-04-21 Thread Greg Clayton via Phabricator via lldb-commits
clayborg added a comment. If we do find what looks like a return address, is there any validation done on the instruction before the return address to see if it is a function call instruction? That would be the best way to validate that something on the stack just doesn't look like a return

[Lldb-commits] [PATCH] D124198: [LLDB][Unwind] Add stack scanning as fallback unwind plan if no symbol file is available.

2022-04-21 Thread Greg Clayton via Phabricator via lldb-commits
clayborg added a comment. It is unclear how this patch works. Was there support for searching for the return address on the stack already? And this patch is just adding the a few register unwind rules for when/if the return address _is_ found for x86? This will need tests.

[Lldb-commits] [PATCH] D124198: [LLDB][Unwind] Add stack scanning as fallback unwind plan if no symbol file is available.

2022-04-21 Thread Zequan Wu via Phabricator via lldb-commits
zequanwu created this revision. zequanwu added reviewers: labath, clayborg, jasonmolenda. Herald added subscribers: atanasyan, jrtc27, kbarton, nemanjai, sdardis. Herald added a project: All. zequanwu requested review of this revision. Herald added a project: LLDB. Herald added a subscriber: