According to a recent bankruptcy court case in Houston, the amount of the student loan used for living expenses may count as a "consumer" debt for purposes of qualifying to file chapter 7 bankruptcy and the means test.
But the amount of it used for tuition, books, fees, and school materials should be considered a "non-consumer" debt in computing if your debts are "primarily consumer debts," at least if was for pursuing a professional degree such as a degree in dentistry, which was what was involved in the Houston case.
If over 50% of your debts are non-consumer, you do not have to undergo the "means test" contained in Sec. 707(b)(2) of the Bankruptcy Code. In re De Cunae, Case No. 12-37424, in the U.S. Bankruptcy Court for the Southern District of Texas, Houston Division.