Many times during my recent activities I saw invalid frame error message. I found it totally useless - it does not give any clue why the error happened. It turned out that it can occur due to obvious reasons: no target selected, no process launched etc. With this patch it is easier to guess root cause of this error and save hours of unnecessary investigation.
Details
- Reviewers
- None
Diff Detail
Event Timeline
This looks like a good change, thank you for coming up with it. Could you put the statements on separate lines from the conditional expressions? Instead of
if (!m_exe_ctx.HasTargetScope()) result.AppendError (GetInvalidTargetDescription());
more like this -
if (!m_exe_ctx.HasTargetScope())
result.AppendError (GetInvalidTargetDescription());
or
if (!m_exe_ctx.HasTargetScope())
{
result.AppendError (GetInvalidTargetDescription());
}
(in this case I think not using the braces will look cleaner). I know we have a few examples of the if (cond) stmt; in lldb already but they are something we need to clean up at some point.
J
I applied the patch and was going to commit it, then I realized I don't clearly understand what behavior we're fixing. e.g. these commands all report a reasonable error msg when a thread/process/frame is missing before the patch is applied.
% lldb
(lldb) f
error: invalid thread
(lldb) bt
error: invalid process
(lldb) reg read pc
error: invalid frame
(lldb) c
error: invalid process
(lldb)