[Lldb-commits] [PATCH] D47991: Improve SBThread's stepping API using SBError parameter.

Greg Clayton via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Thu Jun 21 07:13:57 PDT 2018


clayborg added a comment.

In https://reviews.llvm.org/D47991#1137834, @aprantl wrote:

> This patch is adding new overloads to SBAPI calls that don't return an SBError, such as:
>
>   // Old:
>   void StepOutOfFrame(SBFrame &frame);
>   // New:
>   void StepOutOfFrame(SBFrame &frame, SBError &error);
>   
>
> I wonder if it would be easier to use and more consistent with the rest of the API if we instead added an overload that returns an SBError, like this:
>
>   // New:
>   SBError StepOutOfFrameWithError(SBFrame &frame);
>   // Alternative names that are just as ugly.
>   SBError StepOutOfFrameE(SBFrame &frame);
>   SBError StepOutOfFrame2(SBFrame &frame);
>   
>
> @clayborg, @jingham: What do you think?


that is the right way to do it, but we can't overload on return type only. We will need the old version of the code to be in the API for compatibility. Overloading by return type will result is two symbols with the same name. If we change the API over to return an SBError, we will crash programs that linked against the old API as it now becomes returns something, possibly a struct return type, so it will crash older programs.


Repository:
  rL LLVM

https://reviews.llvm.org/D47991





More information about the lldb-commits mailing list