I found a Samuel Shaw 1841 census Scotland with place of birth as Kirkcudbrightshire. county Kirkcudbrightshire, estimated birth 1791,parish Kirkpatrick Durham.
Also found Mary Shaw, born Scotland,parish Kirkmabreck, county Kirkcudbrightshire and estimated birth 1792.
Could these two be the parents of James Shaw.