• R/O
  • HTTP
  • SSH
  • HTTPS

コミット

タグ
未設定

よく使われているワード(クリックで追加)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

GNU Binutils with patches for OS216


コミットメタ情報

リビジョンfc0a0c004a22e83600f3ecfe343fd6683fb70a7b (tree)
日時2018-03-13 23:31:59
作者Yao Qi <yao.qi@lina...>
コミッターYao Qi

ログメッセージ

Throw exception in amd64 unwinders

This patch changes amd64 unwinders not to throw exceptions.

gdb:

2017-07-31 Yao Qi <yao.qi@linaro.org>

* amd64-tdep.c (amd64_frame_cache) <base_p>: Remove.
(amd64_init_frame_cache): Update.
(amd64_frame_cache_1): Update.
(amd64_frame_unwind_stop_reason): Don't check cache->base_p.
(amd64_frame_this_id): Likewise.
(amd64_sigtramp_frame_cache): Don't catch exception.
(amd64_sigtramp_frame_unwind_stop_reason): Don't check
cache->base_p.
(amd64_sigtramp_frame_this_id): Likewise.
(amd64_epilogue_frame_cache): Don't catch exception.
(amd64_epilogue_frame_unwind_stop_reason): Don't check
cache->base_p.
(amd64_epilogue_frame_this_id): Likewise.

変更サマリ

差分

--- a/gdb/amd64-tdep.c
+++ b/gdb/amd64-tdep.c
@@ -1905,7 +1905,6 @@ struct amd64_frame_cache
19051905 {
19061906 /* Base address. */
19071907 CORE_ADDR base;
1908- int base_p;
19091908 CORE_ADDR sp_offset;
19101909 CORE_ADDR pc;
19111910
@@ -1927,7 +1926,6 @@ amd64_init_frame_cache (struct amd64_frame_cache *cache)
19271926
19281927 /* Base address. */
19291928 cache->base = 0;
1930- cache->base_p = 0;
19311929 cache->sp_offset = -8;
19321930 cache->pc = 0;
19331931
@@ -2560,8 +2558,6 @@ amd64_frame_cache_1 (struct frame_info *this_frame,
25602558 for (i = 0; i < AMD64_NUM_SAVED_REGS; i++)
25612559 if (cache->saved_regs[i] != -1)
25622560 cache->saved_regs[i] += cache->base;
2563-
2564- cache->base_p = 1;
25652561 }
25662562
25672563 static struct amd64_frame_cache *
@@ -2575,16 +2571,7 @@ amd64_frame_cache (struct frame_info *this_frame, void **this_cache)
25752571 cache = amd64_alloc_frame_cache ();
25762572 *this_cache = cache;
25772573
2578- TRY
2579- {
2580- amd64_frame_cache_1 (this_frame, cache);
2581- }
2582- CATCH (ex, RETURN_MASK_ERROR)
2583- {
2584- if (ex.error != NOT_AVAILABLE_ERROR)
2585- throw_exception (ex);
2586- }
2587- END_CATCH
2574+ amd64_frame_cache_1 (this_frame, cache);
25882575
25892576 return cache;
25902577 }
@@ -2596,9 +2583,6 @@ amd64_frame_unwind_stop_reason (struct frame_info *this_frame,
25962583 struct amd64_frame_cache *cache =
25972584 amd64_frame_cache (this_frame, this_cache);
25982585
2599- if (!cache->base_p)
2600- return UNWIND_UNAVAILABLE;
2601-
26022586 /* This marks the outermost frame. */
26032587 if (cache->base == 0)
26042588 return UNWIND_OUTERMOST;
@@ -2613,9 +2597,7 @@ amd64_frame_this_id (struct frame_info *this_frame, void **this_cache,
26132597 struct amd64_frame_cache *cache =
26142598 amd64_frame_cache (this_frame, this_cache);
26152599
2616- if (!cache->base_p)
2617- (*this_id) = frame_id_build_unavailable_stack (cache->pc);
2618- else if (cache->base == 0)
2600+ if (cache->base == 0)
26192601 {
26202602 /* This marks the outermost frame. */
26212603 return;
@@ -2693,26 +2675,15 @@ amd64_sigtramp_frame_cache (struct frame_info *this_frame, void **this_cache)
26932675
26942676 cache = amd64_alloc_frame_cache ();
26952677
2696- TRY
2697- {
2698- get_frame_register (this_frame, AMD64_RSP_REGNUM, buf);
2699- cache->base = extract_unsigned_integer (buf, 8, byte_order) - 8;
2700-
2701- addr = tdep->sigcontext_addr (this_frame);
2702- gdb_assert (tdep->sc_reg_offset);
2703- gdb_assert (tdep->sc_num_regs <= AMD64_NUM_SAVED_REGS);
2704- for (i = 0; i < tdep->sc_num_regs; i++)
2705- if (tdep->sc_reg_offset[i] != -1)
2706- cache->saved_regs[i] = addr + tdep->sc_reg_offset[i];
2678+ get_frame_register (this_frame, AMD64_RSP_REGNUM, buf);
2679+ cache->base = extract_unsigned_integer (buf, 8, byte_order) - 8;
27072680
2708- cache->base_p = 1;
2709- }
2710- CATCH (ex, RETURN_MASK_ERROR)
2711- {
2712- if (ex.error != NOT_AVAILABLE_ERROR)
2713- throw_exception (ex);
2714- }
2715- END_CATCH
2681+ addr = tdep->sigcontext_addr (this_frame);
2682+ gdb_assert (tdep->sc_reg_offset);
2683+ gdb_assert (tdep->sc_num_regs <= AMD64_NUM_SAVED_REGS);
2684+ for (i = 0; i < tdep->sc_num_regs; i++)
2685+ if (tdep->sc_reg_offset[i] != -1)
2686+ cache->saved_regs[i] = addr + tdep->sc_reg_offset[i];
27162687
27172688 *this_cache = cache;
27182689 return cache;
@@ -2725,9 +2696,6 @@ amd64_sigtramp_frame_unwind_stop_reason (struct frame_info *this_frame,
27252696 struct amd64_frame_cache *cache =
27262697 amd64_sigtramp_frame_cache (this_frame, this_cache);
27272698
2728- if (!cache->base_p)
2729- return UNWIND_UNAVAILABLE;
2730-
27312699 return UNWIND_NO_REASON;
27322700 }
27332701
@@ -2738,9 +2706,7 @@ amd64_sigtramp_frame_this_id (struct frame_info *this_frame,
27382706 struct amd64_frame_cache *cache =
27392707 amd64_sigtramp_frame_cache (this_frame, this_cache);
27402708
2741- if (!cache->base_p)
2742- (*this_id) = frame_id_build_unavailable_stack (get_frame_pc (this_frame));
2743- else if (cache->base == 0)
2709+ if (cache->base == 0)
27442710 {
27452711 /* This marks the outermost frame. */
27462712 return;
@@ -2870,30 +2836,19 @@ amd64_epilogue_frame_cache (struct frame_info *this_frame, void **this_cache)
28702836 cache = amd64_alloc_frame_cache ();
28712837 *this_cache = cache;
28722838
2873- TRY
2874- {
2875- /* Cache base will be %esp plus cache->sp_offset (-8). */
2876- get_frame_register (this_frame, AMD64_RSP_REGNUM, buf);
2877- cache->base = extract_unsigned_integer (buf, 8,
2878- byte_order) + cache->sp_offset;
2839+ /* Cache base will be %esp plus cache->sp_offset (-8). */
2840+ get_frame_register (this_frame, AMD64_RSP_REGNUM, buf);
2841+ cache->base = extract_unsigned_integer (buf, 8,
2842+ byte_order) + cache->sp_offset;
28792843
2880- /* Cache pc will be the frame func. */
2881- cache->pc = get_frame_pc (this_frame);
2844+ /* Cache pc will be the frame func. */
2845+ cache->pc = get_frame_pc (this_frame);
28822846
2883- /* The saved %esp will be at cache->base plus 16. */
2884- cache->saved_sp = cache->base + 16;
2847+ /* The saved %esp will be at cache->base plus 16. */
2848+ cache->saved_sp = cache->base + 16;
28852849
2886- /* The saved %eip will be at cache->base plus 8. */
2887- cache->saved_regs[AMD64_RIP_REGNUM] = cache->base + 8;
2888-
2889- cache->base_p = 1;
2890- }
2891- CATCH (ex, RETURN_MASK_ERROR)
2892- {
2893- if (ex.error != NOT_AVAILABLE_ERROR)
2894- throw_exception (ex);
2895- }
2896- END_CATCH
2850+ /* The saved %eip will be at cache->base plus 8. */
2851+ cache->saved_regs[AMD64_RIP_REGNUM] = cache->base + 8;
28972852
28982853 return cache;
28992854 }
@@ -2905,9 +2860,6 @@ amd64_epilogue_frame_unwind_stop_reason (struct frame_info *this_frame,
29052860 struct amd64_frame_cache *cache
29062861 = amd64_epilogue_frame_cache (this_frame, this_cache);
29072862
2908- if (!cache->base_p)
2909- return UNWIND_UNAVAILABLE;
2910-
29112863 return UNWIND_NO_REASON;
29122864 }
29132865
@@ -2919,10 +2871,7 @@ amd64_epilogue_frame_this_id (struct frame_info *this_frame,
29192871 struct amd64_frame_cache *cache = amd64_epilogue_frame_cache (this_frame,
29202872 this_cache);
29212873
2922- if (!cache->base_p)
2923- (*this_id) = frame_id_build_unavailable_stack (cache->pc);
2924- else
2925- (*this_id) = frame_id_build (cache->base + 8, cache->pc);
2874+ (*this_id) = frame_id_build (cache->base + 8, cache->pc);
29262875 }
29272876
29282877 static const struct frame_unwind amd64_epilogue_frame_unwind =