Definitions for "Son of a gun"
Naval Although frequently used as meaning a "good fellow", this is really an old naval expression casting aspersions on a man's parentage. In the days when women were allowed on board during a ship's stay in port, the gun decks were often the scenes of debauchery; and if a male child was born he was called a Son of a Gun.
The space between the guns was used as a semi-private place for trysts with prostitutes and wives, which sometimes lead to pregnancies.
Son of a gun is a slang term present in American and British English.