+ struct stlink_libusb * const slu = sl->backend_data;
+ unsigned char* const cmd = sl->c_buf;
+ unsigned char* const data = sl->q_buf;
+ ssize_t size;
+ uint32_t rep_len = 84;
+ int i = fill_command(sl, SG_DXFER_FROM_DEV, rep_len);
+
+ cmd[i++] = STLINK_DEBUG_COMMAND;
+ cmd[i++] = STLINK_DEBUG_READALLREGS;
+ size = send_recv(slu, 1, cmd, slu->cmd_len, data, rep_len);
+ if (size == -1) {
+ printf("[!] send_recv\n");
+ return;
+ }
+ sl->q_len = (size_t) size;
+ stlink_print_data(sl);
+ for(i=0; i<16; i++)
+ regp->r[i]= read_uint32(sl->q_buf, i*4);
+ regp->xpsr = read_uint32(sl->q_buf, 64);
+ regp->main_sp = read_uint32(sl->q_buf, 68);
+ regp->process_sp = read_uint32(sl->q_buf, 72);
+ regp->rw = read_uint32(sl->q_buf, 76);
+ regp->rw2 = read_uint32(sl->q_buf, 80);
+ if (sl->verbose < 2)
+ return;
+
+ DLOG("xpsr = 0x%08x\n", read_uint32(sl->q_buf, 64));
+ DLOG("main_sp = 0x%08x\n", read_uint32(sl->q_buf, 68));
+ DLOG("process_sp = 0x%08x\n", read_uint32(sl->q_buf, 72));
+ DLOG("rw = 0x%08x\n", read_uint32(sl->q_buf, 76));
+ DLOG("rw2 = 0x%08x\n", read_uint32(sl->q_buf, 80));