let me repeat my question that I asked here https://physics.stackexchange.com/questions/319298/sokhotski-plemelj-theorem
The question is : " What is the value of $\int_{-\infty}^{\infty} \frac{1}{x + i0}$ ?"
On the one hand, Sokhotski formula says that $\frac{1}{x + i0} = \text{P} \frac 1 x - i \pi \delta(x)$. Therefore, $\int_{-\infty}^{\infty} \frac{1}{x + i0} = - i \pi$. On the other hand, we seemingly can compute this integral using the residue theorem. We can regularise it by adding $\lim_{\varepsilon \rightarrow 0} e^{- i \varepsilon x}$, so we can close the contour in the lower half plane and get $- 2 \pi i$
Integral regularization is certainly quite artificial trick. However, it is commonly and successfully used in quantum mechanics as well as Sokhotski formula. If I just put $\int_{-\infty}^{\infty} \frac{1}{x + i0}$ into Mathematica, I get $- 2 \pi i$. So, I can't see how to resolve this contradiction.
I just came up with this question myself yesterday! Nice timing. Not sure if what I'm going to say here suffices as an answer but it doesn't fit in a comment so I'll put it here since I'm interested to hear more on this question as well.
It strikes me that you are taking two limits. $$\lim_{a \rightarrow 0} \lim_{b \rightarrow 0} \int_C \frac{e^{-ibx}}{x+ia}dx$$ where $C=C_1+C_2$ is the contour of integration with $C_1$ along the real line and $C_2$ closing in the lower half plane.
The Sokhotski formula tells us the value of the integral on $C_1$ is $-i\pi$ as we take the $a$ limit and presumably doesn't care much about the presence of $b$ (since $\text{Im}(x)$ is small there). so the question is whether the integral on $C_2$ is zero or non-zero. As you have pointed out, for the case that $b>0$ we can argue that the integral on $C_2$ is zero. However, when $b$ is actually equal to zero then none of the theorems for that integral vanishing apply and it is clear that the value of the integral on $C_2$ must be non-zero. In fact, the result of your analysis would say the value of the integral on $C_2$ must balance the difference between the Shokhotski result and the residue theorem result so it must be $-i\pi$.
In other words, it seems like the value of the integral on $C_2$ is not a continuous function of $b$, it does not equal its limit as $b\rightarrow 0$ so maybe this tells us that for this function, the type of regularization you have chosen should not be expected to give us a well-behaved answer.
Also I'm not sure how you put $\int_{-\infty}^{+\infty} \frac{1}{x+i0}dx$ into mathematica. In mathematica I was able to find $$\int_{-x_0}^{+x_0} \frac{1}{x+i\epsilon} dx = log(x_0+i\epsilon) - log(-x_0+i\epsilon)$$
which equals $-i\pi$ in the limit that $x_0\rightarrow \infty$.
Like I said before, I'm not sure if this is a complete answer to the question but I would like to hear other's thoughts.