• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
No Tags

Frequently used words (click to add to your profile)

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

GNU Binutils with patches for OS216


Commit MetaInfo

Revisiona11bf1279d0663741015f64238b3394081d463fb (tree)
Time2018-03-13 23:31:59
AuthorYao Qi <yao.qi@lina...>
CommiterYao Qi

Log Message

Throw exception in i386 unwinders

This patch changes i386 unwinders not to throw exceptions.

gdb:

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

* i386-tdep.c (i386_frame_cache) <base_p>: Remove.
(i386_alloc_frame_cache): Update.
(i386_frame_cache_1): Likewise.
(i386_frame_cache): Don't catch exceptions.
(i386_frame_this_id): Don't check cache->base_p.
(i386_frame_unwind_stop_reason): Likewise.
(i386_epilogue_frame_cache): Don't catch exceptions.
(i386_epilogue_frame_unwind_stop_reason): Don't check
cache->base_p.
(i386_epilogue_frame_this_id): Likewise.
(i386_sigtramp_frame_cache): Don't catch exceptions.
(i386_sigtramp_frame_unwind_stop_reason): Don't check
cache->base_p.
(i386_sigtramp_frame_this_id): Likewise.

Change Summary

Incremental Difference

--- a/gdb/i386-tdep.c
+++ b/gdb/i386-tdep.c
@@ -1069,7 +1069,6 @@ struct i386_frame_cache
10691069 {
10701070 /* Base address. */
10711071 CORE_ADDR base;
1072- int base_p;
10731072 LONGEST sp_offset;
10741073 CORE_ADDR pc;
10751074
@@ -1094,7 +1093,6 @@ i386_alloc_frame_cache (void)
10941093 cache = FRAME_OBSTACK_ZALLOC (struct i386_frame_cache);
10951094
10961095 /* Base address. */
1097- cache->base_p = 0;
10981096 cache->base = 0;
10991097 cache->sp_offset = -4;
11001098 cache->pc = 0;
@@ -1992,10 +1990,7 @@ i386_frame_cache_1 (struct frame_info *this_frame,
19921990 get_frame_register (this_frame, I386_EBP_REGNUM, buf);
19931991 cache->base = extract_unsigned_integer (buf, 4, byte_order);
19941992 if (cache->base == 0)
1995- {
1996- cache->base_p = 1;
1997- return;
1998- }
1993+ return;
19991994
20001995 /* For normal frames, %eip is stored at 4(%ebp). */
20011996 cache->saved_regs[I386_EIP_REGNUM] = 4;
@@ -2066,8 +2061,6 @@ i386_frame_cache_1 (struct frame_info *this_frame,
20662061 for (i = 0; i < I386_NUM_SAVED_REGS; i++)
20672062 if (cache->saved_regs[i] != -1)
20682063 cache->saved_regs[i] += cache->base;
2069-
2070- cache->base_p = 1;
20712064 }
20722065
20732066 static struct i386_frame_cache *
@@ -2081,16 +2074,7 @@ i386_frame_cache (struct frame_info *this_frame, void **this_cache)
20812074 cache = i386_alloc_frame_cache ();
20822075 *this_cache = cache;
20832076
2084- TRY
2085- {
2086- i386_frame_cache_1 (this_frame, cache);
2087- }
2088- CATCH (ex, RETURN_MASK_ERROR)
2089- {
2090- if (ex.error != NOT_AVAILABLE_ERROR)
2091- throw_exception (ex);
2092- }
2093- END_CATCH
2077+ i386_frame_cache_1 (this_frame, cache);
20942078
20952079 return cache;
20962080 }
@@ -2101,9 +2085,7 @@ i386_frame_this_id (struct frame_info *this_frame, void **this_cache,
21012085 {
21022086 struct i386_frame_cache *cache = i386_frame_cache (this_frame, this_cache);
21032087
2104- if (!cache->base_p)
2105- (*this_id) = frame_id_build_unavailable_stack (cache->pc);
2106- else if (cache->base == 0)
2088+ if (cache->base == 0)
21072089 {
21082090 /* This marks the outermost frame. */
21092091 }
@@ -2120,9 +2102,6 @@ i386_frame_unwind_stop_reason (struct frame_info *this_frame,
21202102 {
21212103 struct i386_frame_cache *cache = i386_frame_cache (this_frame, this_cache);
21222104
2123- if (!cache->base_p)
2124- return UNWIND_UNAVAILABLE;
2125-
21262105 /* This marks the outermost frame. */
21272106 if (cache->base == 0)
21282107 return UNWIND_OUTERMOST;
@@ -2251,26 +2230,15 @@ i386_epilogue_frame_cache (struct frame_info *this_frame, void **this_cache)
22512230 cache = i386_alloc_frame_cache ();
22522231 *this_cache = cache;
22532232
2254- TRY
2255- {
2256- cache->pc = get_frame_func (this_frame);
2233+ cache->pc = get_frame_func (this_frame);
22572234
2258- /* At this point the stack looks as if we just entered the
2259- function, with the return address at the top of the
2260- stack. */
2261- sp = get_frame_register_unsigned (this_frame, I386_ESP_REGNUM);
2262- cache->base = sp + cache->sp_offset;
2263- cache->saved_sp = cache->base + 8;
2264- cache->saved_regs[I386_EIP_REGNUM] = cache->base + 4;
2265-
2266- cache->base_p = 1;
2267- }
2268- CATCH (ex, RETURN_MASK_ERROR)
2269- {
2270- if (ex.error != NOT_AVAILABLE_ERROR)
2271- throw_exception (ex);
2272- }
2273- END_CATCH
2235+ /* At this point the stack looks as if we just entered the
2236+ function, with the return address at the top of the
2237+ stack. */
2238+ sp = get_frame_register_unsigned (this_frame, I386_ESP_REGNUM);
2239+ cache->base = sp + cache->sp_offset;
2240+ cache->saved_sp = cache->base + 8;
2241+ cache->saved_regs[I386_EIP_REGNUM] = cache->base + 4;
22742242
22752243 return cache;
22762244 }
@@ -2282,9 +2250,6 @@ i386_epilogue_frame_unwind_stop_reason (struct frame_info *this_frame,
22822250 struct i386_frame_cache *cache =
22832251 i386_epilogue_frame_cache (this_frame, this_cache);
22842252
2285- if (!cache->base_p)
2286- return UNWIND_UNAVAILABLE;
2287-
22882253 return UNWIND_NO_REASON;
22892254 }
22902255
@@ -2296,10 +2261,7 @@ i386_epilogue_frame_this_id (struct frame_info *this_frame,
22962261 struct i386_frame_cache *cache =
22972262 i386_epilogue_frame_cache (this_frame, this_cache);
22982263
2299- if (!cache->base_p)
2300- (*this_id) = frame_id_build_unavailable_stack (cache->pc);
2301- else
2302- (*this_id) = frame_id_build (cache->base + 8, cache->pc);
2264+ (*this_id) = frame_id_build (cache->base + 8, cache->pc);
23032265 }
23042266
23052267 static struct value *
@@ -2437,36 +2399,25 @@ i386_sigtramp_frame_cache (struct frame_info *this_frame, void **this_cache)
24372399
24382400 cache = i386_alloc_frame_cache ();
24392401
2440- TRY
2441- {
2442- get_frame_register (this_frame, I386_ESP_REGNUM, buf);
2443- cache->base = extract_unsigned_integer (buf, 4, byte_order) - 4;
2402+ get_frame_register (this_frame, I386_ESP_REGNUM, buf);
2403+ cache->base = extract_unsigned_integer (buf, 4, byte_order) - 4;
24442404
2445- addr = tdep->sigcontext_addr (this_frame);
2446- if (tdep->sc_reg_offset)
2447- {
2448- int i;
2405+ addr = tdep->sigcontext_addr (this_frame);
2406+ if (tdep->sc_reg_offset)
2407+ {
2408+ int i;
24492409
2450- gdb_assert (tdep->sc_num_regs <= I386_NUM_SAVED_REGS);
2410+ gdb_assert (tdep->sc_num_regs <= I386_NUM_SAVED_REGS);
24512411
2452- for (i = 0; i < tdep->sc_num_regs; i++)
2453- if (tdep->sc_reg_offset[i] != -1)
2454- cache->saved_regs[i] = addr + tdep->sc_reg_offset[i];
2455- }
2456- else
2457- {
2458- cache->saved_regs[I386_EIP_REGNUM] = addr + tdep->sc_pc_offset;
2459- cache->saved_regs[I386_ESP_REGNUM] = addr + tdep->sc_sp_offset;
2460- }
2461-
2462- cache->base_p = 1;
2412+ for (i = 0; i < tdep->sc_num_regs; i++)
2413+ if (tdep->sc_reg_offset[i] != -1)
2414+ cache->saved_regs[i] = addr + tdep->sc_reg_offset[i];
24632415 }
2464- CATCH (ex, RETURN_MASK_ERROR)
2416+ else
24652417 {
2466- if (ex.error != NOT_AVAILABLE_ERROR)
2467- throw_exception (ex);
2418+ cache->saved_regs[I386_EIP_REGNUM] = addr + tdep->sc_pc_offset;
2419+ cache->saved_regs[I386_ESP_REGNUM] = addr + tdep->sc_sp_offset;
24682420 }
2469- END_CATCH
24702421
24712422 *this_cache = cache;
24722423 return cache;
@@ -2479,9 +2430,6 @@ i386_sigtramp_frame_unwind_stop_reason (struct frame_info *this_frame,
24792430 struct i386_frame_cache *cache =
24802431 i386_sigtramp_frame_cache (this_frame, this_cache);
24812432
2482- if (!cache->base_p)
2483- return UNWIND_UNAVAILABLE;
2484-
24852433 return UNWIND_NO_REASON;
24862434 }
24872435
@@ -2492,13 +2440,8 @@ i386_sigtramp_frame_this_id (struct frame_info *this_frame, void **this_cache,
24922440 struct i386_frame_cache *cache =
24932441 i386_sigtramp_frame_cache (this_frame, this_cache);
24942442
2495- if (!cache->base_p)
2496- (*this_id) = frame_id_build_unavailable_stack (get_frame_pc (this_frame));
2497- else
2498- {
2499- /* See the end of i386_push_dummy_call. */
2500- (*this_id) = frame_id_build (cache->base + 8, get_frame_pc (this_frame));
2501- }
2443+ /* See the end of i386_push_dummy_call. */
2444+ (*this_id) = frame_id_build (cache->base + 8, get_frame_pc (this_frame));
25022445 }
25032446
25042447 static struct value *