I would carry pepper spray (not mace). They make a kind that is specifically for wild animals/dogs. Usually the regular kind will work as well. You can put it in a jacket pocket, stick it in the edge of sports bra or get necklace with a clip-on thing. Make sure you can unclip it quickly or get a pull-string clip-on so you can pull it away from you before spraying.
If a dog is attacking your child he is up close and personal. I would be afraid to fire a gun that close to my child. If pepper spray gets on your child then you can flush the eyes with water and you can apply whole milk to any skin that is irritated. Don't rub irritated skin. Flush first and when the burning stops then you can get in the shower to wash.
And on dogs you have to hit the nostrils (pretty small target) or the eyes. I would start out spraying at the eyes and move it down towards nose. It should start to work in 3-5 seconds. When he lets go of your child, kick him like your a football star. lol