Inspection of semiconductor device or printed circuit board