Let $X_k=X_{k-1}\cup_{\chi} H^{\gamma_k}$ be a $\dim X_{k-1}$-manifold with a $\gamma_k$-handle $H^{\gamma_k}=D^{\dim X_{k-1}-\gamma_k}\times D^{\gamma_k}$ attached along the embedding map $\chi:S^{\gamma_k-1}\times D^{\dim X_{k-1}-\gamma_k}\to\partial X_{k-1}$ with $X_0:=D^m$ (an $m$-ball), $X:=X_N$ for $1\le k\le N$.
Then, how do we compute the $n$-th homology group of $X$ for all $n\ge 0$ (via cellular homology for CW complexes) in $\mathbb{Q}$-coefficients, i.e. $H_n(X;\mathbb{Q})=H_n(D^m\cup_{\chi} H^{\gamma_1}\cup_{\chi}\dots\cup_{\chi} H^{\gamma_N};\mathbb{Q})$? In short, how do we compute homology of a handle decomposition?
There is a deformation retraction of $M\cup H^k$ onto the core $M\cup_{S^{k−1}}(D^k\times 0)$, so homotopically attaching a $k$-handle is the same as attaching a $k$-cell. Thus, we may use cellular homology of the CW complex $X'$ given by collapsing each handle $D^k\times D^{n−k}$ to $D^k$.
Any help would be much appreciated. Thanks in advance!