Re: [Lldb-commits] [lldb] r296495 - Fix incorrect logic in StackFrame::Disassemble.

2017-02-28 Thread Jim Ingham via lldb-commits
> On Feb 28, 2017, at 4:15 PM, Zachary Turner wrote: > > > > On Tue, Feb 28, 2017 at 3:49 PM Jim Ingham wrote: > > > On Feb 28, 2017, at 3:36 PM, Zachary Turner wrote: > > > > That patch was not really about early returns, it was about using > > StringRef. So my comment about the aestheti

Re: [Lldb-commits] [lldb] r296495 - Fix incorrect logic in StackFrame::Disassemble.

2017-02-28 Thread Zachary Turner via lldb-commits
On Tue, Feb 28, 2017 at 4:09 PM Jason Molenda wrote: > > You mentioned that this kind of mechanical churn of the code is something > everyone else in the LLVM/LLDB community supports. I don't know about the > LLVM community, but I strongly argue that this is the wrong way to develop > a stable,

Re: [Lldb-commits] [lldb] r296495 - Fix incorrect logic in StackFrame::Disassemble.

2017-02-28 Thread Zachary Turner via lldb-commits
On Tue, Feb 28, 2017 at 3:49 PM Jim Ingham wrote: > > > On Feb 28, 2017, at 3:36 PM, Zachary Turner wrote: > > > > That patch was not really about early returns, it was about using > StringRef. So my comment about the aesthetics was referring to the patch > in general. The early return was mor

Re: [Lldb-commits] [lldb] r296495 - Fix incorrect logic in StackFrame::Disassemble.

2017-02-28 Thread Jason Molenda via lldb-commits
It makes me uncomfortable to have these whole-project-ranging change sets going into the source, one example being const char * -> StringRef) for such small benefit. Yes there were a few methods where we were doing string parsing and tokenizing which became much smaller and easier to understand

Re: [Lldb-commits] [lldb] r296495 - Fix incorrect logic in StackFrame::Disassemble.

2017-02-28 Thread Jim Ingham via lldb-commits
> On Feb 28, 2017, at 3:36 PM, Zachary Turner wrote: > > That patch was not really about early returns, it was about using StringRef. > So my comment about the aesthetics was referring to the patch in general. > The early return was more of a drive by, since I was already touching the > cod

Re: [Lldb-commits] [lldb] r296495 - Fix incorrect logic in StackFrame::Disassemble.

2017-02-28 Thread Zachary Turner via lldb-commits
That patch was not really about early returns, it was about using StringRef. So my comment about the aesthetics was referring to the patch in general. The early return was more of a drive by, since I was already touching the code. In that respect I was just following the well documented and wide

Re: [Lldb-commits] [lldb] r296495 - Fix incorrect logic in StackFrame::Disassemble.

2017-02-28 Thread Jim Ingham via lldb-commits
Another principle that seems useful here is not to make this sort of logic change unless this is code you are currently working on. When you have the actual purpose of the code in your head, it is fairly easy to make this sort of change correctly. You know what the code is supposed to be doing

Re: [Lldb-commits] [lldb] r296495 - Fix incorrect logic in StackFrame::Disassemble.

2017-02-28 Thread Jim Ingham via lldb-commits
> On Feb 28, 2017, at 3:14 PM, Zachary Turner wrote: > > On Tue, Feb 28, 2017 at 3:07 PM Jason Molenda wrote: > At it's core, lldb is a real world tool that thousands of people depend on; > breaking it or introducing bugs for little gain beyond aesthetics is a very > poor tradeoff. > > Ju

Re: [Lldb-commits] [lldb] r296495 - Fix incorrect logic in StackFrame::Disassemble.

2017-02-28 Thread Zachary Turner via lldb-commits
On Tue, Feb 28, 2017 at 3:07 PM Jason Molenda wrote: > At it's core, lldb is a real world tool that thousands of people depend > on; breaking it or introducing bugs for little gain beyond aesthetics is a > very poor tradeoff. > Just for the record, I disagree with this assertion that there is li

Re: [Lldb-commits] [lldb] r296495 - Fix incorrect logic in StackFrame::Disassemble.

2017-02-28 Thread Jason Molenda via lldb-commits
Writing SB API tests for the disassembler is easy, as Jim notes there is an SBFrame::Disassemble() method that maps directly on to this call. I've written unit tests that create a disassembler -- I do it for the unwind tests. It's easy when you have an array of bytes to feed directly into the

Re: [Lldb-commits] [lldb] r296495 - Fix incorrect logic in StackFrame::Disassemble.

2017-02-28 Thread Jim Ingham via lldb-commits
Make that SBFrame::Disassemble... Jim > On Feb 28, 2017, at 10:21 AM, Jim Ingham wrote: > > SBStackFrame::Disassemble calls StackFrame::Disassemble to do its job. From > the looks of it, your goof would cause lldb never to return any instructions > when asked to disassemble a stack frame, si

Re: [Lldb-commits] [lldb] r296495 - Fix incorrect logic in StackFrame::Disassemble.

2017-02-28 Thread Jim Ingham via lldb-commits
SBStackFrame::Disassemble calls StackFrame::Disassemble to do its job. From the looks of it, your goof would cause lldb never to return any instructions when asked to disassemble a stack frame, since StackFrame does the work lazily and the error was to NOT do the work when the disassembly is em

Re: [Lldb-commits] [lldb] r296495 - Fix incorrect logic in StackFrame::Disassemble.

2017-02-28 Thread Zachary Turner via lldb-commits
I'm not even sure how to exercise this code path. Granted, the reason it broke at all is because of no test case, but I feel like someone who understands this code should probably prepare a test case for it. (I know in the past Jason has said that it was notoriously hard to write test cases for d

Re: [Lldb-commits] [lldb] r296495 - Fix incorrect logic in StackFrame::Disassemble.

2017-02-28 Thread Jim Ingham via lldb-commits
No test case? Jim > On Feb 28, 2017, at 9:59 AM, Zachary Turner via lldb-commits > wrote: > > Author: zturner > Date: Tue Feb 28 11:59:59 2017 > New Revision: 296495 > > URL: http://llvm.org/viewvc/llvm-project?rev=296495&view=rev > Log: > Fix incorrect logic in StackFrame::Disassemble. > >

[Lldb-commits] [lldb] r296495 - Fix incorrect logic in StackFrame::Disassemble.

2017-02-28 Thread Zachary Turner via lldb-commits
Author: zturner Date: Tue Feb 28 11:59:59 2017 New Revision: 296495 URL: http://llvm.org/viewvc/llvm-project?rev=296495&view=rev Log: Fix incorrect logic in StackFrame::Disassemble. This had broken as the result of some previous cleanup. Modified: lldb/trunk/source/Target/StackFrame.cpp Mod