To know if you will take a loss or gain use the following formula that I modified just for you.
Capital gains 1099-a = Box 4 - (orignal cost, + improvements, + major repairs) - costs incurred by you for the abandonment.
Note; there are usually no costs associated with this type of transfer of property unless the bank asseses them to you.
If box 4 is greater than box 2, you do not normally have cancellation debt income.
If box 4 is less than box 2, then you may be subject to receiving a form 1099-C and having cancellation debt income.