aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2013-11-27Make "set debug frame 1" use the standard print routine for optimized out ↵Andrew Burgess3-2/+15
values. ... - { frame_unwind_register_value (frame=0,regnum=7(rsp),...) -> optimized out } + { frame_unwind_register_value (frame=0,regnum=7(rsp),...) -> <optimized out> } ... Tested on x86_64 Fedora 17. 2013-11-27 Andrew Burgess <aburgess@broadcom.com> * frame.c: Include "valprint.h". (frame_unwind_register_value): Use value_optimized_out. * value.c (value_fetch_lazy): Likewise.
2013-11-27[ld/testsuite/]Kyrylo Tkachov3-5/+10
2013-11-27 Kyrylo Tkachov <kyrylo.tkachov@arm.com> * ld-plugin/lto.exp: Add -ffat-lto-objects. * lib/ld-lib.exp (check_lto_available): Likewise.
2013-11-27 * gdb.base/callfuncs.c (main): Assign malloc's return valueLuis Machado6-5/+21
and free it afterwards. * gdb.base/charset-malloc.c (malloc_stub): Likewise. * gdb.base/printcmds.c (main): Likewise. * gdb.base/randomize.c (main): Free "p" and change breakpoint marker position. * gdb.base/setvar.c (dummy): Assign malloc's return value and free it afterwards.
2013-11-27Improve dump of xdata/pdata on x86_64.Tristan Gingold2-264/+303
bfd/ 2013-11-27 Tristan Gingold <gingold@adacore.com> * pei-x86_64.c (pex_regs): Make it const. Add comments. (pex64_get_runtime_function): Do not split UnwindData. (pex64_get_unwind_info): Extract the chain and the handler. (pex64_xdata_print_uwd_codes): Rewritten: do not reverse print the opcode, handle version 2, add consistency check, make the code host neutral. (pex64_dump_xdata): Change arguments to pass the section and its content. Handle version 2, change output. (pex64_bfd_print_pdata): Add comments, load section for xdata. Avoid duplicate outputs. include/coff 2013-11-27 Tristan Gingold <gingold@adacore.com> * pe.h (struct pex64_runtime_function): Remove isChained. (UWOP_SAVE_XMM): Add comment. (struct pex64_unwind_info): Remove extra fields.
2013-11-27binutils/testsuite/Richard Sandiford7-4/+25
2013-11-27 Matthew Fortune <matthew.fortune@imgtec.com> * binutils-all/objcopy.exp: Consider mips-mti-elf the same as mips-sde-elf * binutils-all/readelf.exp: Likewise gas/testsuite/ 2013-11-27 Matthew Fortune <matthew.fortune@imgtec.com> * gas/mips/mips.exp: Consider mips-mti-elf the same as mips-sde-elf ld/testsuite/ 2013-11-27 Matthew Fortune <matthew.fortune@imgtec.com> * ld-mips-elf/mips-elf.exp: Consider mips-mti-elf the same as mips-sde-elf
2013-11-27daily updateAlan Modra1-1/+1
2013-11-26Fix a typoH.J. Lu1-1/+1
2013-11-26Add HOSTING_SLIBS and use it for -pieH.J. Lu9-5/+34
ld/ PR ld/16259 * Makefile.am (HOSTING_SLIBS): New. * configure.host (HOSTING_SLIBS): New. Used for PIE. * configure.in (HOSTING_SLIBS): New AC_SUBST. * Makefile.in: Regenerated. * configure: Likewise. ld/testsuite/ PR ld/16259 * config/default.exp (get_target_emul): Also set HOSTING_SLIBS. * lib/ld-lib.exp (default_ld_link): Use HOSTING_SLIBS for -pie.
2013-11-26Tighten regexp in gdb.base/setshow.expAndrew Burgess2-2/+7
https://sourceware.org/ml/gdb-patches/2013-11/msg00817.html gdb/testsuite/ChangeLog * gdb.base/setshow.exp: Add $gdb_prompt to the patterns in gdb_test_multiple.
2013-11-26Fix demangler to handle conversion operators correctly.ccoutant4-36/+202
libiberty/ PR other/59195 * cp-demangle.c (struct d_info_checkpoint): New struct. (struct d_print_info): Add current_template field. (d_operator_name): Set flag when processing a conversion operator. (cplus_demangle_type): When processing <template-args> for a conversion operator, backtrack if necessary. (d_expression_1): Renamed from d_expression. (d_expression): New wrapper around d_expression_1. (d_checkpoint): New function. (d_backtrack): New function. (d_print_init): Initialize current_template. (d_print_comp): Set current_template. (d_print_cast): Put current_template in scope for printing conversion operator name. (cplus_demangle_init_info): Initialize is_expression and is_conversion. * cp-demangle.h (struct d_info): Add is_expression and is_conversion fields. * testsuite/demangle-expected: New test cases. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@205292 138bc75d-0d04-0410-961f-82ee72b054a4
2013-11-26Mark entirely optimized out value as non-lazy.Andrew Burgess2-1/+5
If a value is entirely optimized out, then there's nothing for value_fetch_lazy to fetch. Sequences like: if (value_lazy (retval)) value_fetch_lazy (retval); End up allocating the value contents buffer, wasting memory, for no use. gdb/ChangeLog 2013-11-26 Andrew Burgess <aburgess@broadcom.com> * value.c (allocate_optimized_out_value): Mark value as non-lazy.
2013-11-26bfd/elfnn-aarch64.c: Handle static links with ifunc correctly.Will Newton6-1/+66
The code for handling GOT references to ifunc symbols in static links was missing. bfd/ChangeLog: 2013-11-26 Will Newton <will.newton@linaro.org> * elfnn-aarch64.c (elfNN_aarch64_finish_dynamic_symbol): Handle STT_GNU_IFUNC symbols correctly in static links. ld/testsuite/ChangeLog: 2013-11-26 Will Newton <will.newton@linaro.org> * ld-aarch64/aarch64-elf.exp: Add ifunc-22. * ld-aarch64/ifunc-22.d: New file. * ld-aarch64/ifunc-22.s: Likewise.
2013-11-26bfd/elfnn-aarch64.c: Fix miscalculation of GOTPLT offset for ifunc syms.Will Newton6-1/+58
The .got.plt header size was not being correctly taken into account when calculating the offset for relocations against ifunc symbols. bfd/ChangeLog: 2013-11-26 Will Newton <will.newton@linaro.org> * elfnn-aarch64.c (elfNN_aarch64_final_link_relocate): Ensure PLT_INDEX is calculated using correct header size. ld/testsuite/ChangeLog: 2013-11-26 Will Newton <will.newton@linaro.org> * ld-aarch64/aarch64-elf.exp: Add ifunc-21 test. * ld-aarch64/ifunc-21.d: New file. * ld-aarch64/ifunc-21.s: Likewise.
2013-11-26revert patch from 2013-11-22Tom Tromey6-291/+11
This reverts da2b2fdf57a96f7a5b6b153e94afb747e212b17f and some follow-up patches. They were incorrect. 2013-11-26 Tom Tromey <tromey@redhat.com> * dwarf2-frame.c (dwarf2_frame_cache): Revert patch from 2013-11-22. 2013-11-26 Tom Tromey <tromey@redhat.com> * gdb.dwarf2/dw2-unspecified-ret-addr.S: Remove. * gdb.dwarf2/dw2-unspecified-ret-addr.c: Remove. * gdb.dwarf2/dw2-unspecified-ret-addr.exp: Remove.
2013-11-26Fix PR16193 - gdbserver aborts.Walfred Tedeschi2-7/+16
The MPX patch has broken the I386_XSTATE_SIZE macro. For AVX machines, it ends up returning I386_XSTATE_SSE_SIZE. Where it first reads I386_XSTATE_AVX_SIZE, it should have read I386_XSTATE_AVX: #define I386_XSTATE_SIZE(XCR0) \ (((XCR0) & I386_XSTATE_BNDCFG) != 0 ? I386_XSTATE_BNDCFG_SIZE \ : (((XCR0) & I386_XSTATE_BNDREGS) != 0 ? I386_XSTATE_BNDCFG_SIZE \ - : (((XCR0) & I386_XSTATE_AVX_SIZE) != 0 ? I386_XSTATE_AVX_SIZE \ + : (((XCR0) & I386_XSTATE_AVX) != 0 ? I386_XSTATE_AVX_SIZE \ : I386_XSTATE_SSE_SIZE))) The patch goes a step further and improves readability of the macro, by adding a couple other auxiliary macros. 2013-11-26 Walfred Tedeschi <walfred.tedeschi@intel.com> * i386-xstate.h (I386_XSTATE_MPX): New Macro. (I386_XSTATE_MPX_MASK): Makes use of I386_XSTATE_MPX. (HAS_MPX): New macro. (HAS_AVX): New macro. (I386_XSTATE_SIZE): Uses HAS_MPX and HAS_AVX.
2013-11-26daily updateAlan Modra1-1/+1
2013-11-25PR c++/14819: Explicit class:: inside class scope does not workKeith Seitz8-3/+370
https://sourceware.org/ml/gdb-patches/2013-11/msg00102.html
2013-11-252013-11-25 Steve Ellcey <sellcey@mips.com>Steve Ellcey2-1/+5
* igen/Makefile.in (igen): Use BUILD_CFLAGS in link.
2013-11-25GDB perf test on backtraceYao Qi4-0/+176
gdb/testsuite/ 2013-11-25 Yao Qi <yao@codesourcery.com> * gdb.perf/backtrace.c: New. * gdb.perf/backtrace.exp: New. * gdb.perf/backtrace.py: New.
2013-11-25daily updateAlan Modra1-1/+1
2013-11-24Use target_read_code in disassemble.Yao Qi2-1/+6
This patch teaches "disassembly" use code cache mechanism to read target code. gdb: 2013-11-24 Yao Qi <yao@codesourcery.com> * disasm.c (dis_asm_read_memory): Call target_read_code instead of target_read_memory.
2013-11-24set/show code-cacheYao Qi8-5/+118
Similar to stack cache, in this patch, we add TARGET_OBJECT_CODE_MEMORY to read code from target and add a new option "set code-cache on|off" to optimize code accesses by using the target memory cache. In V4: - Remove "without affecting correctness" from NEWS and doc. - Replace "ON" with "on" in doc. - "access" -> "accesses". In V3: - Rename functions and variables. - Update command help, doc and NEWS entry. - Invalidate cache on option transitions, to align with the behaviour of "stack-cache". Since cache invalidation is transparent to users, users don't know option "stack-cache" transitions cause code cache invalidation. V2 was reviewed by Doug. There are some changes in V3, so I post it here. gdb: 2013-11-24 Yao Qi <yao@codesourcery.com> * NEWS: Add note on new "set code-cache" option. * target-dcache.c (code_cache_enabled_1): New variable. (code_cache_enabled): New variable. (show_code_cache, set_code_cache): New function. (code_cache_enabled_p): New function. (_initialize_target_dcache): Register command. * target-dcache.h (code_cache_enabled_p): Declare. * target.c (memory_xfer_partial_1):Handle TARGET_OBJECT_CODE_MEMORY and code_cache_enabled. (target_read_code): New function. * target.h (enum target_object) <TARGET_OBJECT_CODE_MEMORY>: New. (target_read_code): Declare. gdb/doc: 2013-11-24 Yao Qi <yao@codesourcery.com> * gdb.texinfo (Caching Remote Data): Document new "set/show stack-cache" option.
2013-11-24Renaming in target-dcache.cYao Qi4-18/+34
Hi, This patch does some renamings on "stack-cache" related functions and variables. In the review to "code cache" series v2, we have some discussions on the name of predicate function 'stack_cache_enabled', and have some options, 1 keep it unchanged, as it is already a predicate clearly, 2 rename it to stack_cache_enabled_p, 3 rename it to enable_stack_cache_p, I choose #2, because 'stack_cache_enabled' is a predicate, but it's better to add "_p" suffix to stress this. There are some other similar patterns used in GDB source, such as unop_user_defined_p and agent_loaded_p. Then, I have to rename variable stack_cache_enabled_p to something else. The option is "stack-cache", so I'd like to name the variable associated with this command as "stack_cache". Similarly, the commands associated with this command should be renamed to "set_stack_cache" and "show_stack_cache" respectively. gdb: 2013-11-24 Yao Qi <yao@codesourcery.com> * target-dcache.c (stack_cache_enabled_p_1): Rename to ... (stack_cache_enabled_1): ... this. New variable. (stack_cache_enabled_p): Rename to ... (stack_cache_enabled): ... this. New variable. (set_stack_cache_enabled_p): Rename to ... (set_stack_cache): ... this. Update caller. (show_stack_cache_enabled_p): Rename to ... (show_stack_cache): ... this. Update caller. (stack_cache_enabled): Rename to ... (stack_cache_enabled_p): ... this. Update caller. (_initialize_target_dcache): Replace "data cache" with "target memory cache". * target-dcache.h (stack_cache_enabled): Remove declaration. (stack_cache_enabled_p): Add declaration.
2013-11-24GDB perf test on single stepYao Qi4-0/+131
gdb/testsuite: 2013-11-24 Yao Qi <yao@codesourcery.com> * gdb.perf/single-step.c: New. * gdb.perf/single-step.exp: New. * gdb.perf/single-step.py: New.
2013-11-24Write "ON" and "OFF" in lower case in GDB doc.Yao Qi2-3/+9
gdb/doc: 2013-11-24 Yao Qi <yao@codesourcery.com> * gdb.texinfo (Caching Target Data): Replace "ON" with "on". (Maintenance Commands): Replace "ON" and "OFF" with "on" and "off" respectively.
2013-11-23 * gdb.base/ena-dis-br.exp: Add missing quote to "step after continueDoug Evans2-1/+6
with ignore count".
2013-11-23Test name tweaks for py-value.exp.Doug Evans2-5/+13
* gdb.python/py-value.exp (test_lazy_strings): Tweak test names. (test_subscript_regression): Ditto. (top level): Run test_subscript_regression for c++ with "c++" prefix.
2013-11-23 * gdb.python/py-type.exp (test_enums): Fix typo.Doug Evans2-1/+6
2013-11-23* gdb.python/py-symbol.exp: Add some comments. Make all test names unique.Doug Evans2-16/+34
2013-11-23* gdb.python/py-symbol.exp: Fix whitespace.Doug Evans2-4/+8
2013-11-23Fix long line in earlier entry.Doug Evans1-2/+2
2013-11-23 * gdb.python/python.exp: Don't call skip_python_tests, we still wantDoug Evans2-3/+7
to test some things in the case where python is not configured in.
2013-11-24daily updateAlan Modra1-1/+1
2013-11-23 * python/py-frame.c (gdbpy_initialize_frames): Remove FIRST_ERROR,Doug Evans2-4/+5
superfluous.
2013-11-23 * python/py-frame.c (frapy_block): Fix error message text.Doug Evans2-1/+5
2013-11-23cli/cli-script.c (multi_line_command_p): New function.Doug Evans2-15/+31
* cli/cli-script.c (multi_line_command_p): New function. (recurse_read_control_structure, read_command_lines_1): Call it. (execute_control_command): Consistently have a blank line between each case.
2013-11-23Update doc on displayhint in command -var-list-childrenYao Qi2-0/+10
Hi, When using command -var-list-children, "displayhint" appears in the result of each child, shown as the following output. -var-list-children ss1 ^M ^done,numchild="2",displayhint="pp_ss",children=[child={name="ss1.a",exp="a",numchild="0",type="struct s",thread-id="1",displayhint="pp_s",dynamic="1"},child={name="ss1.b",exp="b",numchild="0",type="struct s",thread-id="1",displayhint="pp_s",dynamic="1"}],has_more="0" Current doc on command -var-list-children doesn't reflect this. This patch is to fix it. gdb/doc: 2013-11-23 Yao Qi <yao@codesourcery.com> * gdb.texinfo (GDB/MI Variable Objects): Add the description of "displayhint" to the table about child results.
2013-11-22Add check for which library is needed for dlopen.Cary Coutant3-5/+74
gold/ PR gold/16203 * configure.ac: Add check for which library is needed for dlopen. * configure: Regenerate.
2013-11-22Use in-tree assembler for exception_x86_64_bnd_test.Cary Coutant3-4/+10
gold/ * testsuite/Makefile.am (exception_x86_64_bnd_test): Use in-tree assembler. * testsuite/Makefile.in: Regenerate.
2013-11-23daily updateAlan Modra1-1/+1
2013-11-23Import config.sub and config.guess from upstream.Alan Modra3-72/+95
2013-11-222013-11-22 Sterling Augustine <saugustine@google.com>Sterling Augustine1-1/+1
PR gdb/16196: * valprint.c (read_string): Set new variable fetchlen based on fetchlimit and size. Use it in call to partial_memory_read. Update comment.
2013-11-222013-11-22 Sterling Augustine <saugustine@google.com>Sterling Augustine2-7/+18
PR gdb/16196: * valprint.c (read_string): Set new variable fetchlen based on fetchlimit and size. Use it in call to partial_memory_read. Update comment.
2013-11-22Rename gdb.dwarf2/dw2-bad-cfi.* to gdb.dwarf2/dw2-unspecified-ret-addr.*.Pedro Alves4-13/+22
gdb/testsuite/ 2013-11-22 Pedro Alves <palves@redhat.com> * gdb.dwarf2/dw2-bad-cfi.S: Rename to ... * gdb.dwarf2/dw2-unspecified-ret-addr.S: ... this. Adjust. * gdb.dwarf2/dw2-bad-cfi.c: Rename to ... * gdb.dwarf2/dw2-unspecified-ret-addr.c: ... this. * gdb.dwarf2/dw2-bad-cfi.exp: Rename to ... * gdb.dwarf2/dw2-unspecified-ret-addr.exp: ... this.
2013-11-22update comment in dw2-bad-cfi.S.Tom Tromey2-1/+6
Pedro asked me to add a comment to dw2-bad-cfi.S explaining the nature of the badness. I'm checking this in. 2013-11-22 Tom Tromey <tromey@redhat.com> * gdb.dwarf2/dw2-bad-cfi.S: Update comment.
2013-11-22handle an unspecified return address columnTom Tromey6-0/+302
Debugging PR 16155 further, I found that the DWARF unwinder found the function in question, but thought it had no registers saved (fs->regs.num_regs == 0). It seems to me that if a frame does not specify the return address column, or if the return address column is explicitly marked as DWARF2_FRAME_REG_UNSPECIFIED, then we should set the "undefined_retaddr" flag and let the DWARF unwinder gracefully stop. This patch implements that idea. With this patch the backtrace works properly: (gdb) bt #0 0x0000007fb7ed485c in nanosleep () from /lib64/libc.so.6 #1 0x0000007fb7ed4508 in sleep () from /lib64/libc.so.6 #2 0x00000000004008bc in thread_function (arg=0x4) at threadapply.c:73 #3 0x0000007fb7fad950 in start_thread () from /lib64/libpthread.so.0 #4 0x0000007fb7f0956c in clone () from /lib64/libc.so.6 2013-11-22 Tom Tromey <tromey@redhat.com> PR backtrace/16155: * dwarf2-frame.c (dwarf2_frame_cache): Set undefined_retaddr if the return address column is unspecified. 2013-11-22 Tom Tromey <tromey@redhat.com> * gdb.dwarf2/dw2-bad-cfi.c: New file. * gdb.dwarf2/dw2-bad-cfi.exp: New file. * gdb.dwarf2/dw2-bad-cfi.S: New file.
2013-11-22Detect infinite loop in value_fetch_lazy's lval_register handling.Tom Tromey2-1/+26
If value_fetch_lazy loops infinitely while unwrapping lval_register values, it means we either somehow ended up with two frames with the same ID in the frame chain, or some code is trying to unwind behind get_prev_frame's back (e.g., a frame unwind sniffer trying to unwind). In any case, it should always be an internal error to end up in this situation. This patch adds a check and throws an internal error if the same frame is returned. 2013-11-22 Tom Tromey <tromey@redhat.com> Pedro Alves <palves@redhat.com> PR backtrace/16155 * value.c (value_fetch_lazy): Internal error if get_frame_register_value returns the same register.
2013-11-22 * windres.c (define_resource): Use zero for timestamp, makingCory Fields12-44/+72
output deterministic. time.h include is no longer needed. * resres.c (res_append_resource): Likewise. * pe-dll.c (fill_edata): Only use a real timestamp if --insert-timestamp was used. * emultempl/pe.em: Add the --insert-timestamp option. * emultempl/pep.em: Likewise for 64bit. * ld.texinfo: Document the --insert-timestamp option. * libcoff-in.h: Add insert_timestamp flag to the pe_data struct. * libcoff.h: Regenerate. * peXXigen.c (_bfd_XXi_only_swap_filehdr_out): Only use a real timestamp if --insert-timestamp was used.
2013-11-22Make use of the frame stash to detect wider stack cycles.Pedro Alves2-63/+100
Given we already have the frame id stash, which holds the ids of all frames in the chain, detecting corrupted stacks with wide stack cycles with non-consecutive dup frame ids is just as cheap as just detecting cycles in consecutive frames: #0 frame_id1 #1 frame_id2 #2 frame_id3 #3 frame_id1 #4 frame_id2 #5 frame_id3 #6 frame_id1 ... forever ... We just need to check whether the stash already knows about a given frame id instead of comparing the ids of the previous/this frames. Tested on x86_64 Fedora 17. gdb/ 2013-11-22 Pedro Alves <palves@redhat.com> Tom Tromey <tromey@redhat.com> * frame.c (frame_stash_add): Now returns whether a frame with the same ID was already known. (compute_frame_id): New function, factored out from get_frame_id. (get_frame_id): No longer lazilly compute the frame id here. (get_prev_frame_if_no_cycle): New function. Detects wider stack cycles. (get_prev_frame_1): Use it instead of get_prev_frame_raw directly, and checking for stack cycles here.
2013-11-22Don't let two frames with the same id end up in the frame chain.Pedro Alves6-17/+660
The UNWIND_SAME_ID check is done between THIS_FRAME and the next frame when we go try to unwind the previous frame. But at this point, it's already too late -- we ended up with two frames with the same ID in the frame chain. Each frame having its own ID is an invariant assumed throughout GDB. This patch applies the UNWIND_SAME_ID detection earlier, right after the previous frame is unwound, discarding the dup frame if a cycle is detected. The patch includes a new test that fails before the change. Before the patch, the test causes an infinite loop in GDB, after the patch, the UNWIND_SAME_ID logic kicks in and makes the backtrace stop with: Backtrace stopped: previous frame identical to this frame (corrupt stack?) The test uses dwarf CFI to emulate a corrupted stack with a cycle. It has a function with registers marked DW_CFA_same_value (most importantly RSP/RIP), so that GDB computes the same ID for that frame and its caller. IOW, something like this: #0 - frame_id_1 #1 - frame_id_2 #2 - frame_id_3 #3 - frame_id_4 #4 - frame_id_4 <<<< outermost (UNWIND_SAME_ID). (The test's code is just a copy of dw2-reg-undefined.S / dw2-reg-undefined.c, adjusted to use DW_CFA_same_value instead of DW_CFA_undefined, and to mark a different set of registers.) The infinite loop is here, in value_fetch_lazy: while (VALUE_LVAL (new_val) == lval_register && value_lazy (new_val)) { frame = frame_find_by_id (VALUE_FRAME_ID (new_val)); ... new_val = get_frame_register_value (frame, regnum); } get_frame_register_value can return a lazy register value pointing to the next frame. This means that the register wasn't clobbered by FRAME; the debugger should therefore retrieve its value from the next frame. To be clear, get_frame_register_value unwinds the value in question from the next frame: struct value * get_frame_register_value (struct frame_info *frame, int regnum) { return frame_unwind_register_value (frame->next, regnum); ^^^^^^^^^^^ } In other words, if we get a lazy lval_register, it should have the frame ID of the _next_ frame, never of FRAME. At this point in value_fetch_lazy, the whole relevant chunk of the stack up to frame #4 has already been unwound. The loop always "unlazies" lval_registers in the "next/innermost" direction, not in the "prev/unwind further/outermost" direction. So say we're looking at frame #4. get_frame_register_value in frame #4 can return a lazy register value of frame #3. So the next iteration, frame_find_by_id tries to read the register from frame #3. But, since frame #4 happens to have same id as frame #3, frame_find_by_id returns frame #4 instead. Rinse, repeat, and we have an infinite loop. This is an old latent problem, exposed by the recent addition of the frame stash. Before we had a stash, frame_find_by_id(frame_id_4) would walk over all frames starting at the current frame, and would always find #3 first. The stash happens to return #4 instead: struct frame_info * frame_find_by_id (struct frame_id id) { struct frame_info *frame, *prev_frame; ... /* Try using the frame stash first. Finding it there removes the need to perform the search by looping over all frames, which can be very CPU-intensive if the number of frames is very high (the loop is O(n) and get_prev_frame performs a series of checks that are relatively expensive). This optimization is particularly useful when this function is called from another function (such as value_fetch_lazy, case VALUE_LVAL (val) == lval_register) which already loops over all frames, making the overall behavior O(n^2). */ frame = frame_stash_find (id); if (frame) return frame; for (frame = get_current_frame (); ; frame = prev_frame) { gdb/ 2013-11-22 Pedro Alves <palves@redhat.com> PR 16155 * frame.c (get_prev_frame_1): Do the UNWIND_SAME_ID check between this frame and the new previous frame, not between this frame and the next frame. gdb/testsuite/ 2013-11-22 Pedro Alves <palves@redhat.com> PR 16155 * gdb.dwarf2/dw2-dup-frame.S: New file. * gdb.dwarf2/dw2-dup-frame.c: New file. * gdb.dwarf2/dw2-dup-frame.exp: New file.