backtrace.c 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686
  1. /*
  2. * Copyright 2010 Tilera Corporation. All Rights Reserved.
  3. *
  4. * This program is free software; you can redistribute it and/or
  5. * modify it under the terms of the GNU General Public License
  6. * as published by the Free Software Foundation, version 2.
  7. *
  8. * This program is distributed in the hope that it will be useful, but
  9. * WITHOUT ANY WARRANTY; without even the implied warranty of
  10. * MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE, GOOD TITLE or
  11. * NON INFRINGEMENT. See the GNU General Public License for
  12. * more details.
  13. */
  14. #include <linux/kernel.h>
  15. #include <linux/string.h>
  16. #include <asm/backtrace.h>
  17. #include <arch/chip.h>
  18. #include <asm/opcode-tile.h>
  19. #define TREG_SP 54
  20. #define TREG_LR 55
  21. #if TILE_CHIP >= 10
  22. #define tile_bundle_bits tilegx_bundle_bits
  23. #define TILE_MAX_INSTRUCTIONS_PER_BUNDLE TILEGX_MAX_INSTRUCTIONS_PER_BUNDLE
  24. #define TILE_BUNDLE_ALIGNMENT_IN_BYTES TILEGX_BUNDLE_ALIGNMENT_IN_BYTES
  25. #define tile_decoded_instruction tilegx_decoded_instruction
  26. #define tile_mnemonic tilegx_mnemonic
  27. #define parse_insn_tile parse_insn_tilegx
  28. #define TILE_OPC_IRET TILEGX_OPC_IRET
  29. #define TILE_OPC_ADDI TILEGX_OPC_ADDI
  30. #define TILE_OPC_ADDLI TILEGX_OPC_ADDLI
  31. #define TILE_OPC_INFO TILEGX_OPC_INFO
  32. #define TILE_OPC_INFOL TILEGX_OPC_INFOL
  33. #define TILE_OPC_JRP TILEGX_OPC_JRP
  34. #define TILE_OPC_MOVE TILEGX_OPC_MOVE
  35. #define OPCODE_STORE TILEGX_OPC_ST
  36. typedef long long bt_int_reg_t;
  37. #else
  38. #define OPCODE_STORE TILE_OPC_SW
  39. typedef int bt_int_reg_t;
  40. #endif
  41. /** A decoded bundle used for backtracer analysis. */
  42. struct BacktraceBundle {
  43. tile_bundle_bits bits;
  44. int num_insns;
  45. struct tile_decoded_instruction
  46. insns[TILE_MAX_INSTRUCTIONS_PER_BUNDLE];
  47. };
  48. /* This implementation only makes sense for native tools. */
  49. /** Default function to read memory. */
  50. static bool bt_read_memory(void *result, VirtualAddress addr,
  51. unsigned int size, void *extra)
  52. {
  53. /* FIXME: this should do some horrible signal stuff to catch
  54. * SEGV cleanly and fail.
  55. *
  56. * Or else the caller should do the setjmp for efficiency.
  57. */
  58. memcpy(result, (const void *)addr, size);
  59. return true;
  60. }
  61. /** Locates an instruction inside the given bundle that
  62. * has the specified mnemonic, and whose first 'num_operands_to_match'
  63. * operands exactly match those in 'operand_values'.
  64. */
  65. static const struct tile_decoded_instruction *find_matching_insn(
  66. const struct BacktraceBundle *bundle,
  67. tile_mnemonic mnemonic,
  68. const int *operand_values,
  69. int num_operands_to_match)
  70. {
  71. int i, j;
  72. bool match;
  73. for (i = 0; i < bundle->num_insns; i++) {
  74. const struct tile_decoded_instruction *insn =
  75. &bundle->insns[i];
  76. if (insn->opcode->mnemonic != mnemonic)
  77. continue;
  78. match = true;
  79. for (j = 0; j < num_operands_to_match; j++) {
  80. if (operand_values[j] != insn->operand_values[j]) {
  81. match = false;
  82. break;
  83. }
  84. }
  85. if (match)
  86. return insn;
  87. }
  88. return NULL;
  89. }
  90. /** Does this bundle contain an 'iret' instruction? */
  91. static inline bool bt_has_iret(const struct BacktraceBundle *bundle)
  92. {
  93. return find_matching_insn(bundle, TILE_OPC_IRET, NULL, 0) != NULL;
  94. }
  95. /** Does this bundle contain an 'addi sp, sp, OFFSET' or
  96. * 'addli sp, sp, OFFSET' instruction, and if so, what is OFFSET?
  97. */
  98. static bool bt_has_addi_sp(const struct BacktraceBundle *bundle, int *adjust)
  99. {
  100. static const int vals[2] = { TREG_SP, TREG_SP };
  101. const struct tile_decoded_instruction *insn =
  102. find_matching_insn(bundle, TILE_OPC_ADDI, vals, 2);
  103. if (insn == NULL)
  104. insn = find_matching_insn(bundle, TILE_OPC_ADDLI, vals, 2);
  105. #if TILE_CHIP >= 10
  106. if (insn == NULL)
  107. insn = find_matching_insn(bundle, TILEGX_OPC_ADDXLI, vals, 2);
  108. if (insn == NULL)
  109. insn = find_matching_insn(bundle, TILEGX_OPC_ADDXI, vals, 2);
  110. #endif
  111. if (insn == NULL)
  112. return false;
  113. *adjust = insn->operand_values[2];
  114. return true;
  115. }
  116. /** Does this bundle contain any 'info OP' or 'infol OP'
  117. * instruction, and if so, what are their OP? Note that OP is interpreted
  118. * as an unsigned value by this code since that's what the caller wants.
  119. * Returns the number of info ops found.
  120. */
  121. static int bt_get_info_ops(const struct BacktraceBundle *bundle,
  122. int operands[MAX_INFO_OPS_PER_BUNDLE])
  123. {
  124. int num_ops = 0;
  125. int i;
  126. for (i = 0; i < bundle->num_insns; i++) {
  127. const struct tile_decoded_instruction *insn =
  128. &bundle->insns[i];
  129. if (insn->opcode->mnemonic == TILE_OPC_INFO ||
  130. insn->opcode->mnemonic == TILE_OPC_INFOL) {
  131. operands[num_ops++] = insn->operand_values[0];
  132. }
  133. }
  134. return num_ops;
  135. }
  136. /** Does this bundle contain a jrp instruction, and if so, to which
  137. * register is it jumping?
  138. */
  139. static bool bt_has_jrp(const struct BacktraceBundle *bundle, int *target_reg)
  140. {
  141. const struct tile_decoded_instruction *insn =
  142. find_matching_insn(bundle, TILE_OPC_JRP, NULL, 0);
  143. if (insn == NULL)
  144. return false;
  145. *target_reg = insn->operand_values[0];
  146. return true;
  147. }
  148. /** Does this bundle modify the specified register in any way? */
  149. static bool bt_modifies_reg(const struct BacktraceBundle *bundle, int reg)
  150. {
  151. int i, j;
  152. for (i = 0; i < bundle->num_insns; i++) {
  153. const struct tile_decoded_instruction *insn =
  154. &bundle->insns[i];
  155. if (insn->opcode->implicitly_written_register == reg)
  156. return true;
  157. for (j = 0; j < insn->opcode->num_operands; j++)
  158. if (insn->operands[j]->is_dest_reg &&
  159. insn->operand_values[j] == reg)
  160. return true;
  161. }
  162. return false;
  163. }
  164. /** Does this bundle modify sp? */
  165. static inline bool bt_modifies_sp(const struct BacktraceBundle *bundle)
  166. {
  167. return bt_modifies_reg(bundle, TREG_SP);
  168. }
  169. /** Does this bundle modify lr? */
  170. static inline bool bt_modifies_lr(const struct BacktraceBundle *bundle)
  171. {
  172. return bt_modifies_reg(bundle, TREG_LR);
  173. }
  174. /** Does this bundle contain the instruction 'move fp, sp'? */
  175. static inline bool bt_has_move_r52_sp(const struct BacktraceBundle *bundle)
  176. {
  177. static const int vals[2] = { 52, TREG_SP };
  178. return find_matching_insn(bundle, TILE_OPC_MOVE, vals, 2) != NULL;
  179. }
  180. /** Does this bundle contain a store of lr to sp? */
  181. static inline bool bt_has_sw_sp_lr(const struct BacktraceBundle *bundle)
  182. {
  183. static const int vals[2] = { TREG_SP, TREG_LR };
  184. return find_matching_insn(bundle, OPCODE_STORE, vals, 2) != NULL;
  185. }
  186. #if TILE_CHIP >= 10
  187. /** Track moveli values placed into registers. */
  188. static inline void bt_update_moveli(const struct BacktraceBundle *bundle,
  189. int moveli_args[])
  190. {
  191. int i;
  192. for (i = 0; i < bundle->num_insns; i++) {
  193. const struct tile_decoded_instruction *insn =
  194. &bundle->insns[i];
  195. if (insn->opcode->mnemonic == TILEGX_OPC_MOVELI) {
  196. int reg = insn->operand_values[0];
  197. moveli_args[reg] = insn->operand_values[1];
  198. }
  199. }
  200. }
  201. /** Does this bundle contain an 'add sp, sp, reg' instruction
  202. * from a register that we saw a moveli into, and if so, what
  203. * is the value in the register?
  204. */
  205. static bool bt_has_add_sp(const struct BacktraceBundle *bundle, int *adjust,
  206. int moveli_args[])
  207. {
  208. static const int vals[2] = { TREG_SP, TREG_SP };
  209. const struct tile_decoded_instruction *insn =
  210. find_matching_insn(bundle, TILEGX_OPC_ADDX, vals, 2);
  211. if (insn) {
  212. int reg = insn->operand_values[2];
  213. if (moveli_args[reg]) {
  214. *adjust = moveli_args[reg];
  215. return true;
  216. }
  217. }
  218. return false;
  219. }
  220. #endif
  221. /** Locates the caller's PC and SP for a program starting at the
  222. * given address.
  223. */
  224. static void find_caller_pc_and_caller_sp(CallerLocation *location,
  225. const VirtualAddress start_pc,
  226. BacktraceMemoryReader read_memory_func,
  227. void *read_memory_func_extra)
  228. {
  229. /* Have we explicitly decided what the sp is,
  230. * rather than just the default?
  231. */
  232. bool sp_determined = false;
  233. /* Has any bundle seen so far modified lr? */
  234. bool lr_modified = false;
  235. /* Have we seen a move from sp to fp? */
  236. bool sp_moved_to_r52 = false;
  237. /* Have we seen a terminating bundle? */
  238. bool seen_terminating_bundle = false;
  239. /* Cut down on round-trip reading overhead by reading several
  240. * bundles at a time.
  241. */
  242. tile_bundle_bits prefetched_bundles[32];
  243. int num_bundles_prefetched = 0;
  244. int next_bundle = 0;
  245. VirtualAddress pc;
  246. #if TILE_CHIP >= 10
  247. /* Naively try to track moveli values to support addx for -m32. */
  248. int moveli_args[TILEGX_NUM_REGISTERS] = { 0 };
  249. #endif
  250. /* Default to assuming that the caller's sp is the current sp.
  251. * This is necessary to handle the case where we start backtracing
  252. * right at the end of the epilog.
  253. */
  254. location->sp_location = SP_LOC_OFFSET;
  255. location->sp_offset = 0;
  256. /* Default to having no idea where the caller PC is. */
  257. location->pc_location = PC_LOC_UNKNOWN;
  258. /* Don't even try if the PC is not aligned. */
  259. if (start_pc % TILE_BUNDLE_ALIGNMENT_IN_BYTES != 0)
  260. return;
  261. for (pc = start_pc;; pc += sizeof(tile_bundle_bits)) {
  262. struct BacktraceBundle bundle;
  263. int num_info_ops, info_operands[MAX_INFO_OPS_PER_BUNDLE];
  264. int one_ago, jrp_reg;
  265. bool has_jrp;
  266. if (next_bundle >= num_bundles_prefetched) {
  267. /* Prefetch some bytes, but don't cross a page
  268. * boundary since that might cause a read failure we
  269. * don't care about if we only need the first few
  270. * bytes. Note: we don't care what the actual page
  271. * size is; using the minimum possible page size will
  272. * prevent any problems.
  273. */
  274. unsigned int bytes_to_prefetch = 4096 - (pc & 4095);
  275. if (bytes_to_prefetch > sizeof prefetched_bundles)
  276. bytes_to_prefetch = sizeof prefetched_bundles;
  277. if (!read_memory_func(prefetched_bundles, pc,
  278. bytes_to_prefetch,
  279. read_memory_func_extra)) {
  280. if (pc == start_pc) {
  281. /* The program probably called a bad
  282. * address, such as a NULL pointer.
  283. * So treat this as if we are at the
  284. * start of the function prolog so the
  285. * backtrace will show how we got here.
  286. */
  287. location->pc_location = PC_LOC_IN_LR;
  288. return;
  289. }
  290. /* Unreadable address. Give up. */
  291. break;
  292. }
  293. next_bundle = 0;
  294. num_bundles_prefetched =
  295. bytes_to_prefetch / sizeof(tile_bundle_bits);
  296. }
  297. /* Decode the next bundle. */
  298. bundle.bits = prefetched_bundles[next_bundle++];
  299. bundle.num_insns =
  300. parse_insn_tile(bundle.bits, pc, bundle.insns);
  301. num_info_ops = bt_get_info_ops(&bundle, info_operands);
  302. /* First look at any one_ago info ops if they are interesting,
  303. * since they should shadow any non-one-ago info ops.
  304. */
  305. for (one_ago = (pc != start_pc) ? 1 : 0;
  306. one_ago >= 0; one_ago--) {
  307. int i;
  308. for (i = 0; i < num_info_ops; i++) {
  309. int info_operand = info_operands[i];
  310. if (info_operand < CALLER_UNKNOWN_BASE) {
  311. /* Weird; reserved value, ignore it. */
  312. continue;
  313. }
  314. if (info_operand & ENTRY_POINT_INFO_OP) {
  315. /* This info op is ignored by the backtracer. */
  316. continue;
  317. }
  318. /* Skip info ops which are not in the
  319. * "one_ago" mode we want right now.
  320. */
  321. if (((info_operand & ONE_BUNDLE_AGO_FLAG) != 0)
  322. != (one_ago != 0))
  323. continue;
  324. /* Clear the flag to make later checking
  325. * easier. */
  326. info_operand &= ~ONE_BUNDLE_AGO_FLAG;
  327. /* Default to looking at PC_IN_LR_FLAG. */
  328. if (info_operand & PC_IN_LR_FLAG)
  329. location->pc_location =
  330. PC_LOC_IN_LR;
  331. else
  332. location->pc_location =
  333. PC_LOC_ON_STACK;
  334. switch (info_operand) {
  335. case CALLER_UNKNOWN_BASE:
  336. location->pc_location = PC_LOC_UNKNOWN;
  337. location->sp_location = SP_LOC_UNKNOWN;
  338. return;
  339. case CALLER_SP_IN_R52_BASE:
  340. case CALLER_SP_IN_R52_BASE | PC_IN_LR_FLAG:
  341. location->sp_location = SP_LOC_IN_R52;
  342. return;
  343. default:
  344. {
  345. const unsigned int val = info_operand
  346. - CALLER_SP_OFFSET_BASE;
  347. const unsigned int sp_offset =
  348. (val >> NUM_INFO_OP_FLAGS) * 8;
  349. if (sp_offset < 32768) {
  350. /* This is a properly encoded
  351. * SP offset. */
  352. location->sp_location =
  353. SP_LOC_OFFSET;
  354. location->sp_offset =
  355. sp_offset;
  356. return;
  357. } else {
  358. /* This looked like an SP
  359. * offset, but it's outside
  360. * the legal range, so this
  361. * must be an unrecognized
  362. * info operand. Ignore it.
  363. */
  364. }
  365. }
  366. break;
  367. }
  368. }
  369. }
  370. if (seen_terminating_bundle) {
  371. /* We saw a terminating bundle during the previous
  372. * iteration, so we were only looking for an info op.
  373. */
  374. break;
  375. }
  376. if (bundle.bits == 0) {
  377. /* Wacky terminating bundle. Stop looping, and hope
  378. * we've already seen enough to find the caller.
  379. */
  380. break;
  381. }
  382. /*
  383. * Try to determine caller's SP.
  384. */
  385. if (!sp_determined) {
  386. int adjust;
  387. if (bt_has_addi_sp(&bundle, &adjust)
  388. #if TILE_CHIP >= 10
  389. || bt_has_add_sp(&bundle, &adjust, moveli_args)
  390. #endif
  391. ) {
  392. location->sp_location = SP_LOC_OFFSET;
  393. if (adjust <= 0) {
  394. /* We are in prolog about to adjust
  395. * SP. */
  396. location->sp_offset = 0;
  397. } else {
  398. /* We are in epilog restoring SP. */
  399. location->sp_offset = adjust;
  400. }
  401. sp_determined = true;
  402. } else {
  403. if (bt_has_move_r52_sp(&bundle)) {
  404. /* Maybe in prolog, creating an
  405. * alloca-style frame. But maybe in
  406. * the middle of a fixed-size frame
  407. * clobbering r52 with SP.
  408. */
  409. sp_moved_to_r52 = true;
  410. }
  411. if (bt_modifies_sp(&bundle)) {
  412. if (sp_moved_to_r52) {
  413. /* We saw SP get saved into
  414. * r52 earlier (or now), which
  415. * must have been in the
  416. * prolog, so we now know that
  417. * SP is still holding the
  418. * caller's sp value.
  419. */
  420. location->sp_location =
  421. SP_LOC_OFFSET;
  422. location->sp_offset = 0;
  423. } else {
  424. /* Someone must have saved
  425. * aside the caller's SP value
  426. * into r52, so r52 holds the
  427. * current value.
  428. */
  429. location->sp_location =
  430. SP_LOC_IN_R52;
  431. }
  432. sp_determined = true;
  433. }
  434. }
  435. #if TILE_CHIP >= 10
  436. /* Track moveli arguments for -m32 mode. */
  437. bt_update_moveli(&bundle, moveli_args);
  438. #endif
  439. }
  440. if (bt_has_iret(&bundle)) {
  441. /* This is a terminating bundle. */
  442. seen_terminating_bundle = true;
  443. continue;
  444. }
  445. /*
  446. * Try to determine caller's PC.
  447. */
  448. jrp_reg = -1;
  449. has_jrp = bt_has_jrp(&bundle, &jrp_reg);
  450. if (has_jrp)
  451. seen_terminating_bundle = true;
  452. if (location->pc_location == PC_LOC_UNKNOWN) {
  453. if (has_jrp) {
  454. if (jrp_reg == TREG_LR && !lr_modified) {
  455. /* Looks like a leaf function, or else
  456. * lr is already restored. */
  457. location->pc_location =
  458. PC_LOC_IN_LR;
  459. } else {
  460. location->pc_location =
  461. PC_LOC_ON_STACK;
  462. }
  463. } else if (bt_has_sw_sp_lr(&bundle)) {
  464. /* In prolog, spilling initial lr to stack. */
  465. location->pc_location = PC_LOC_IN_LR;
  466. } else if (bt_modifies_lr(&bundle)) {
  467. lr_modified = true;
  468. }
  469. }
  470. }
  471. }
  472. void backtrace_init(BacktraceIterator *state,
  473. BacktraceMemoryReader read_memory_func,
  474. void *read_memory_func_extra,
  475. VirtualAddress pc, VirtualAddress lr,
  476. VirtualAddress sp, VirtualAddress r52)
  477. {
  478. CallerLocation location;
  479. VirtualAddress fp, initial_frame_caller_pc;
  480. if (read_memory_func == NULL) {
  481. read_memory_func = bt_read_memory;
  482. }
  483. /* Find out where we are in the initial frame. */
  484. find_caller_pc_and_caller_sp(&location, pc,
  485. read_memory_func, read_memory_func_extra);
  486. switch (location.sp_location) {
  487. case SP_LOC_UNKNOWN:
  488. /* Give up. */
  489. fp = -1;
  490. break;
  491. case SP_LOC_IN_R52:
  492. fp = r52;
  493. break;
  494. case SP_LOC_OFFSET:
  495. fp = sp + location.sp_offset;
  496. break;
  497. default:
  498. /* Give up. */
  499. fp = -1;
  500. break;
  501. }
  502. /* If the frame pointer is not aligned to the basic word size
  503. * something terrible happened and we should mark it as invalid.
  504. */
  505. if (fp % sizeof(bt_int_reg_t) != 0)
  506. fp = -1;
  507. /* -1 means "don't know initial_frame_caller_pc". */
  508. initial_frame_caller_pc = -1;
  509. switch (location.pc_location) {
  510. case PC_LOC_UNKNOWN:
  511. /* Give up. */
  512. fp = -1;
  513. break;
  514. case PC_LOC_IN_LR:
  515. if (lr == 0 || lr % TILE_BUNDLE_ALIGNMENT_IN_BYTES != 0) {
  516. /* Give up. */
  517. fp = -1;
  518. } else {
  519. initial_frame_caller_pc = lr;
  520. }
  521. break;
  522. case PC_LOC_ON_STACK:
  523. /* Leave initial_frame_caller_pc as -1,
  524. * meaning check the stack.
  525. */
  526. break;
  527. default:
  528. /* Give up. */
  529. fp = -1;
  530. break;
  531. }
  532. state->pc = pc;
  533. state->sp = sp;
  534. state->fp = fp;
  535. state->initial_frame_caller_pc = initial_frame_caller_pc;
  536. state->read_memory_func = read_memory_func;
  537. state->read_memory_func_extra = read_memory_func_extra;
  538. }
  539. /* Handle the case where the register holds more bits than the VA. */
  540. static bool valid_addr_reg(bt_int_reg_t reg)
  541. {
  542. return ((VirtualAddress)reg == reg);
  543. }
  544. bool backtrace_next(BacktraceIterator *state)
  545. {
  546. VirtualAddress next_fp, next_pc;
  547. bt_int_reg_t next_frame[2];
  548. if (state->fp == -1) {
  549. /* No parent frame. */
  550. return false;
  551. }
  552. /* Try to read the frame linkage data chaining to the next function. */
  553. if (!state->read_memory_func(&next_frame, state->fp, sizeof next_frame,
  554. state->read_memory_func_extra)) {
  555. return false;
  556. }
  557. next_fp = next_frame[1];
  558. if (!valid_addr_reg(next_frame[1]) ||
  559. next_fp % sizeof(bt_int_reg_t) != 0) {
  560. /* Caller's frame pointer is suspect, so give up. */
  561. return false;
  562. }
  563. if (state->initial_frame_caller_pc != -1) {
  564. /* We must be in the initial stack frame and already know the
  565. * caller PC.
  566. */
  567. next_pc = state->initial_frame_caller_pc;
  568. /* Force reading stack next time, in case we were in the
  569. * initial frame. We don't do this above just to paranoidly
  570. * avoid changing the struct at all when we return false.
  571. */
  572. state->initial_frame_caller_pc = -1;
  573. } else {
  574. /* Get the caller PC from the frame linkage area. */
  575. next_pc = next_frame[0];
  576. if (!valid_addr_reg(next_frame[0]) || next_pc == 0 ||
  577. next_pc % TILE_BUNDLE_ALIGNMENT_IN_BYTES != 0) {
  578. /* The PC is suspect, so give up. */
  579. return false;
  580. }
  581. }
  582. /* Update state to become the caller's stack frame. */
  583. state->pc = next_pc;
  584. state->sp = state->fp;
  585. state->fp = next_fp;
  586. return true;
  587. }