Suppose one has an integral of a real (or complex) function that has at least one pole that lies on the contour of integration, for example: $$\int_{-a}^{a}\frac{f(x)}{x}dx$$ Clearly such an integral is undefined in the normal sense.
My question is, how does one deal with such integrals in general? I've heard of the notion of a Cauchy Principal value, but not sure I fully understand the method. Does one deform the contour slightly to avoid the pole(s) and then take the limit as this deformation tends to zero, i.e. $$\mathcal{P}\int_{-a}^{a}\frac{f(x)}{x}dx=\lim_{\delta\rightarrow 0}\left(\int_{-a}^{-\delta}\frac{f(x)}{x}dx+\int_{\delta}^{a}\frac{f(x)}{x}dx\right)\;\text{?}$$
I'm approaching this from a physicist's perspective, in particular in relation to the Feynman propagator, which as an integral along the real axis is not well-defined since the integrand has two poles lying on the real axis. In the standard approach the contour is deformed such that it does not pass through the poles, and then the residue theorem is applied. However, the issue of whether this converges to the actual integral once the limit is taken is usually glossed over. In a more technical approach, is one technically taking the Cauchy principal value of the original integral?