Hi thanks for your question.
Most of symptoms you have described could be part of you depression
. Stomach ulcer
occur due to increased acid production in the stomach and this increased acid can pass from lower esophageal opening into esophagus
and can cause what is called ass reflux esophagitis
.Reflux esophagitis can give rise to vomiting and constant gagging. Ulcer itself can give rise to vomiting. Tension is known cause for increased acid production, which can cause ulcer.
The bottom line for management your symptoms is anxiety that is tension and depression. Consult a psychiatrist
who may be able to manage your primary problem of depression, this will also relive you secondary symptoms of myalgia, headache and ulcer.
Hope this answers your question.