How do I replace or repair a chipped P Trap PVC pipe?

The threaded nut is broken, and there is a chip at that end of the pipe, which prevents replacing just the nut. The other side of this portion connects to the wall, and appears to be glued.

Any suggestions? The pipe is about 6 inches from the coupling, then turns down for 3 inches. The broken portion is maybe a half inch for 30 degrees, the nut does not tighten onto this.

2019-11-30T19:17:43Z

Everyone is answering 'replace the P trap'.  I need help on that as well.  The broken pipe is not connected with a threaded nut to the wall pipe, but appears to be glued.
How do I replace in this situation? 

Anonymous2019-11-30T19:08:55Z

As others have said, replace the trap. Repairs are rarely effective and traps are cheap as chips.

Anonymous2019-11-30T04:31:45Z

Replace the whole assembly.  It is not expensive.

Edit:  Dude, it is time to call a plumber.  It looks like the job is over your skill set.  I do some small stuff in the house that I can fix but when there is something that I am clueless about, I call the professionals. 

Anonymous2019-11-30T00:29:12Z

Remove the p-trap and go to your local plumbing supply store and get a p-trap kit they don't cost but about $8.