SAN FRANCISCO — As the Senate voted on a landmark immigration bill that would let Silicon Valley companies import more foreign engineers, some Americans remain locked in a deeply emotional argument over whether outsiders are taking jobs away from people like Joey Doernberg.

Mr. Doernberg worked in chip design, before that industry shrank, and then for a solar energy company, before that industry shrank, and has been unemployed since the middle of last year. By his own account, his skills are not ideal for the current job market. Nor does it help, he says, that at 53, he looks older than he is; youth is at a premium in his industry. So, too, is optimism.

“It’s a question of convincing someone that with these skills, I can do this job, even though I haven’t done it before,” he said. “I’m very optimistic. I know I will find a job.”

The questions of skills, jobs and nationality are a combustible mix these days.

Silicon Valley companies, warning of an acute labor shortage, say it is too costly to retrain older workers like Mr. Doernberg, and that the country is not producing enough younger Americans with the precise skills the industry needs. Their arguments have persuaded a majority of senators to give them what they want: a provision in the immigration bill to let in many more foreign professionals.