- frame_unwind_register (next_frame, M68K_SP_REGNUM, buf);
- sp = extract_unsigned_integer (buf, 4);
+ if (target_is_uclinux == -1)
+ {
+ /* Determine whether we are running on a uClinux or normal GNU/Linux
+ target so we can use the correct sigcontext layouts. */
+ CORE_ADDR dummy;
+
+ target_is_uclinux
+ = (target_auxv_search (¤t_target, AT_NULL, &dummy) > 0
+ && target_auxv_search (¤t_target, AT_PAGESZ, &dummy) == 0);
+ }
+
+ sp = get_frame_register_unsigned (this_frame, M68K_SP_REGNUM);