From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1747 invoked by alias); 16 Mar 2012 23:48:17 -0000 Mailing-List: contact archer-commits-help@sourceware.org; run by ezmlm Sender: Precedence: bulk List-Post: List-Help: List-Subscribe: Received: (qmail 1690 invoked by uid 9079); 16 Mar 2012 23:48:15 -0000 Date: Fri, 16 Mar 2012 23:48:00 -0000 Message-ID: <20120316234815.1674.qmail@sourceware.org> From: kseitz@sourceware.org To: archer-commits@sourceware.org Subject: [SCM] archer-keiths-linespec-rewrite: Merge remote-tracking branch 'gdb/master' into archer-keiths-linespec-rewrite X-Git-Refname: refs/heads/archer-keiths-linespec-rewrite X-Git-Reftype: branch X-Git-Oldrev: 53031c1df4ddea9b5f0d44341e062362fcf878e3 X-Git-Newrev: 0f71eb02bb04e340cad29d5f0ffde88bce7e5242 X-SW-Source: 2012-q1/txt/msg00064.txt.bz2 List-Id: The branch, archer-keiths-linespec-rewrite has been updated via 0f71eb02bb04e340cad29d5f0ffde88bce7e5242 (commit) via 7d88a86396ca36f64a7e5d435ebc8439532d07d9 (commit) via d5bc117868b2062712a1b3de41de8d0a79b669c2 (commit) via b3a19e4dbf598ae0b33e80f77583b25b94196459 (commit) via fb064b7e2ed57d24a5deb87245ccba336a161d3e (commit) via facda9cb2701bda45dc901ecf9be8115b70f04d5 (commit) via c55ff693014c302c8b91b99cee0484751f105e15 (commit) via e6fdde6964c1d797f9e9337adb0afe24e46ae9db (commit) via 759c5fffb2d76fa8844c2ee5ec91746dcea434a8 (commit) via 7f8076204b091192cb2050f5aa80cdf4c45a7926 (commit) via cc89c790f5fe692768ba246325c71b7e58f496f6 (commit) via cf56649757d05c7bbe2f76d9fcadfdee65b99c7d (commit) via d77939f6c2c8efa0e583abbf61a0920eabb579a2 (commit) via e4e4948e3da703ffc745386e7462851c02a31c4e (commit) via 5cddcb364a808283eed8f4a427796a789b83ebde (commit) via e384caece0b8fadc1c904bab294f749b3e0472a3 (commit) via 75dcd60a60fa0e3f47d558b8312d00fe2b08efa4 (commit) via 171e9f303ff92d99018142fc40bca86989ca396b (commit) via 601078dae9e3e738ab39bfe5eee21f653304f485 (commit) from 53031c1df4ddea9b5f0d44341e062362fcf878e3 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email. - Log ----------------------------------------------------------------- commit 0f71eb02bb04e340cad29d5f0ffde88bce7e5242 Merge: 7d88a86 d5bc117 Author: Keith Seitz Date: Fri Mar 16 16:44:28 2012 -0700 Merge remote-tracking branch 'gdb/master' into archer-keiths-linespec-rewrite Conflicts: gdb/linespec.c commit 7d88a86396ca36f64a7e5d435ebc8439532d07d9 Author: Keith Seitz Date: Fri Mar 16 16:16:52 2012 -0700 "end-of-input" -> "end of input" commit d5bc117868b2062712a1b3de41de8d0a79b669c2 Author: Jan Kratochvil Date: Fri Mar 16 18:26:00 2012 +0000 gdb/ PR symtab/13777 * dwarf2read.c (process_full_comp_unit): Set LOCATIONS_VALID only for GCC >=4.5. gdb/testsuite/ PR symtab/13777 * gdb.dwarf2/dw2-skip-prologue.S (DW_AT_producer): Set it to 4.5.0. commit b3a19e4dbf598ae0b33e80f77583b25b94196459 Author: Tom Tromey Date: Fri Mar 16 18:22:23 2012 +0000 2012-03-16 Chris January * tui-tui.win.c (tui_resize_all): Use erase and clearok instead of clear. commit fb064b7e2ed57d24a5deb87245ccba336a161d3e Author: Tom Tromey Date: Fri Mar 16 18:20:28 2012 +0000 2012-03-16 Chris January * source.c (add_path): Use memmove instead of strcpy because the strings overlap. commit facda9cb2701bda45dc901ecf9be8115b70f04d5 Author: Joel Brobecker Date: Fri Mar 16 17:55:39 2012 +0000 [Ada] Crash when trying to set value of packed array element Consider the following declaration: type Small is new Integer range 0 .. 2 ** 4 - 1; type Simple_Array is array (1 .. 4) of Small; pragma Pack (Simple_Array); SA : Simple_Array := (1, 2, 3, 4); Trying to change the value of one of the elements in the packed array causes the debugger to crash: (gdb) set sa(3) := 9 [1] 4880 segmentation fault gdb -q foo The circumstances leading to the crash are as follow: . ada_evaluate_subexp creates a value corresponding to "sa(3)". . ada_evaluate_subexp then tries to assign 9 to this value, and for this calls value_assign (via ada_value_assign). . Because the array is packed, the destination value is 3 bits long, and as a result, value_assign uses the parent to determine that element byte address and offset: | if (value_bitsize (toval)) | { | struct value *parent = value_parent (toval); | | changed_addr = value_address (parent) + value_offset (toval); The destination value (corresponding to "sa(3)") was incorrectly created by ada-lang.c:ada_value_primitive_packed_val, because the "parent" was left as NULL. So, when we try to dereference it to get the parent address, GDB crashed. The first part of the fix therefore consists in setting that field. This required the addition of a new "setter" in value.[hc]. It fixes the crash, but is still not sufficient for the assignment to actually work. The second part of the problem came from the fact that value_assign seems to expect the "child"'s address to be equal to the parent's address, with the difference being the offset. Unfortunately, this requirement was not followed by ada_value_primitive_packed_val, so the second part of the fix consisted in fixing that. Still, this was not sufficient, because it caused a regression when trying to perform an aggregate assignment of a packed array of packed record. The key element here is the nesting of packed entities. Looking at the way ada_value_primitive_packed_val creates the value of each sub-component, one can see that the value's offset is set to the offset compared to the start of the parent. This was meant to match what value_primitive_field does as well. So, with our array of records, if the record offset was 2, and if the field we're interested in that record is at offset 1, the record value's offset would be set to 2, and the field value's offset would be set to 1. But the address for both values would be left to the array's address. This is where things start breaking down, because the value_address function for our field value would return the address of the array + 1, instead of + 3. This is what causes the final issue, here, because ada-lang.c's value_assign_to_component needs to compute the offset of the subcomponent compared to the top-level aggregate's start address (the array in our case). And it does so by subtracting the array's address from the sub-component's address. When you have two levels of packed components, and the mid-level component is at an offset of the top-level component, things didn't work, because the component's address was miscomputed (the parent's offset is missing). The fix consists is fixing value_address to match the work done by value_primitive_field (where we ignore the parent's offset). gdb/ChangeLog: * value.h (set_value_parent): Add declaration. * value.c (set_value_parent): New function. (value_address): If VALUE->PARENT is not NULL, then use it as the base address instead of VALUE->LOCATION.address. * ada-lang.c (ada_value_primitive_packed_val): Keep V's address the same as OBJ's address. Adjust V's offset accordingly. Set V's parent. gdb/testsuite/ChangeLog: * gdb.ada/set_pckd_arr_elt: New testcase. commit c55ff693014c302c8b91b99cee0484751f105e15 Author: gary Date: Fri Mar 16 16:47:29 2012 +0000 gdb: PR breakpoints/10738 * dwarf2read.c (use_deprecated_index_sections): New global. (struct partial_die_info): New member may_be_inlined. (read_partial_die): Set may_be_inlined where appropriate. (add_partial_subprogram): Add partial symbols for partial DIEs that may be inlined. (new_symbol_full): Add inlined subroutines to the current scope. (write_psymtabs_to_index): Bump version number. (dwarf2_read_index): Read only version 6 indices unless use_deprecated_index_sections is set. * linespec.c (symbol_and_data_callback): New structure. (iterate_inline_only): New function. (iterate_over_all_matching_symtabs): New argument "include_inline". If nonzero, also call the callback for symbols representing inlined subroutines. (lookup_prefix_sym): Pass extra argument to the above. (find_function_symbols): Likewise. (add_matching_symbols_to_info): Likewise. * NEWS: Mention that GDB can now set breakpoints on inlined functions. gdb/doc: PR breakpoints/10738 * gdb.texinfo (Inline Functions): Remove the now-unnecessary @item stating that GDB cannot set breakpoints on inlined functions. (Mode Options): Document --use-deprecated-index-sections. (Index Section Format): Document new index section version format. gdb/testsuite: PR breakpoints/10738 * gdb.opt/inline-break.exp: New file. * gdb.opt/inline-break.c: Likewise. * gdb.dwarf2/inline-break.exp: Likewise. * gdb.dwarf2/inline-break.S: Likewise. * gdb.base/annota1.exp: Cope with old .gdb_index warnings. * gdb.base/async-shell.exp: Likewise. * lib/mi-support.exp (library_loaded_re): Likewise. commit e6fdde6964c1d797f9e9337adb0afe24e46ae9db Author: mgretton Date: Fri Mar 16 15:15:13 2012 +0000 * bfd/elf32-arm.c (elf32_arm_attributes_accept_div): New function. (elf32_arm_attributes_forbid_div): Likewise. (elf32_arm_merge_eabi_attributes): Correct handling of Tag_DIV_use. commit 759c5fffb2d76fa8844c2ee5ec91746dcea434a8 Author: Alan Modra Date: Fri Mar 16 12:14:31 2012 +0000 * ppc-dis.c (PPC_OPC_SEGS, PPC_OP_TO_SEG): Delete. (powerpc_opcd_indices): Bump array size. (disassemble_init_powerpc): Set powerpc_opcd_indices entries corresponding to unused opcodes to following entry. (lookup_powerpc): New function, extracted and optimised from.. (print_insn_powerpc): ..here. commit 7f8076204b091192cb2050f5aa80cdf4c45a7926 Author: Pierre Muller Date: Fri Mar 16 11:10:04 2012 +0000 * p-typeprint.c (pascal_type_print_method_args): Fix display of parameter of methods. commit cc89c790f5fe692768ba246325c71b7e58f496f6 Author: Pierre Muller Date: Fri Mar 16 10:54:38 2012 +0000 * amd64-windows-nat.c (_initialize_amd64_windows_nat): Add missing prototype. commit cf56649757d05c7bbe2f76d9fcadfdee65b99c7d Author: Jan Kratochvil Date: Fri Mar 16 08:18:07 2012 +0000 gdb/ Fix false compilation warning. * gnu-v3-abi.c (print_one_vtable): Initialize ADDR. commit d77939f6c2c8efa0e583abbf61a0920eabb579a2 Author: gdbadmin Date: Fri Mar 16 00:00:33 2012 +0000 *** empty log message *** commit e4e4948e3da703ffc745386e7462851c02a31c4e Merge: e384cae 75dcd60 Author: Keith Seitz Date: Thu Mar 15 16:01:03 2012 -0700 Merge remote-tracking branch 'gdb/master' into archer-keiths-linespec-rewrite commit 5cddcb364a808283eed8f4a427796a789b83ebde Author: Alan Modra Date: Thu Mar 15 23:00:05 2012 +0000 daily update commit e384caece0b8fadc1c904bab294f749b3e0472a3 Author: Keith Seitz Date: Thu Mar 15 12:38:56 2012 -0700 More consistent wording of error messages. commit 75dcd60a60fa0e3f47d558b8312d00fe2b08efa4 Author: Jonathan Larmour Date: Thu Mar 15 18:53:42 2012 +0000 * arm-tdep.c: Include "remote.h" and "features/arm-with-m-fpa-layout.c". (arm_register_g_packet_guesses): New function. (arm_gdbarch_init): Don't force a target description with registers when the executable is detected as M-profile. Instead set gdbarch->tdep->is_m. Register `g' packet guesses. (_initialize_arm_tdep): Initialize the new target description. * features/arm-with-m-fpa-layout.xml: New description. * features/arm-with-m-fpa-layout.c: New, generated. commit 171e9f303ff92d99018142fc40bca86989ca396b Author: Joel Brobecker Date: Thu Mar 15 18:33:43 2012 +0000 Problem after hitting breakpoint on Windows (with GDBserver) When debugging on Windows with GDBserver, the debugger starts failing after hitting a breakpoint. For instance: (gdb) b foo Breakpoint 1 at 0x40177e: file foo.adb, line 5. (gdb) cont Continuing. Breakpoint 1, foo () at foo.adb:5 5 Put_Line ("Hello World."); -- STOP (gdb) n Program received signal SIGSEGV, Segmentation fault. 0x00401782 in foo () at foo.adb:5 5 Put_Line ("Hello World."); -- STOP There are two issues: 1. While trying to re-insert a breakpoint that is still inserted in memory, insert_bp_location wipes out the breakpoint location's shadow_contents. As a consequence, we cannot restore the proper instruction when removing the breakpoint anymore. That's why the inferior's behavior changes when trying to resume after the breakpoint was hit. 2. mem-break.c:default_memory_insert_breakpoint passes a breakpoint location's shadow_contents as the buffer for a memory read. This reveals a limitation of the various memory-read target functions. This patch documents this limitation and adjust the two calls that seem to hit that limitation. gdb/ChangeLog: * breakpoint.c (breakpoint_xfer_memory): Add assertion. Update function description. (insert_bp_location): Do not wipe bl->target_info out. * mem-break.c: #include "gdb_string.h". (default_memory_insert_breakpoint): Do not call target_read_memory with a pointer to the breakpoint's shadow_contents buffer. Use a local buffer instead. * m32r-tdep.c (m32r_memory_insert_breakpoint): Ditto. commit 601078dae9e3e738ab39bfe5eee21f653304f485 Author: Roland McGrath Date: Thu Mar 15 18:20:21 2012 +0000 * elf64-x86-64.c (elf_x86_64_create_dynamic_sections): Use elf_x86_64_backend_data parameters for plt_eh_frame. Change-Id: I4e1a7c2787ed1276765e269f50fc8ba89bab41d5 ----------------------------------------------------------------------- Summary of changes: bfd/ChangeLog | 10 + bfd/elf32-arm.c | 79 +- bfd/elf64-x86-64.c | 10 +- bfd/version.h | 2 +- gdb/ChangeLog | 89 ++ gdb/NEWS | 11 + gdb/ada-lang.c | 17 +- gdb/amd64-windows-nat.c | 3 + gdb/arm-tdep.c | 42 +- gdb/breakpoint.c | 21 +- gdb/doc/ChangeLog | 8 + gdb/doc/gdb.texinfo | 24 +- gdb/dwarf2read.c | 62 +- gdb/features/arm-with-m-fpa-layout.c | 44 + gdb/features/arm-with-m-fpa-layout.xml | 45 + gdb/gnu-v3-abi.c | 3 +- gdb/linespec.c | 59 +- gdb/m32r-tdep.c | 3 +- gdb/main.c | 6 + gdb/mem-break.c | 17 +- gdb/p-typeprint.c | 3 +- gdb/source.c | 2 +- gdb/symfile.h | 3 + gdb/testsuite/ChangeLog | 20 + gdb/testsuite/gdb.ada/set_pckd_arr_elt.exp | 47 + gdb/testsuite/gdb.ada/set_pckd_arr_elt/foo.adb | 22 + gdb/testsuite/gdb.ada/set_pckd_arr_elt/pck.adb | 21 + gdb/testsuite/gdb.ada/set_pckd_arr_elt/pck.ads | 22 + gdb/testsuite/gdb.base/annota1.exp | 2 +- gdb/testsuite/gdb.base/async-shell.exp | 4 +- gdb/testsuite/gdb.dwarf2/dw2-inline-break.S | 1663 ++++++++++++++++++++++++ gdb/testsuite/gdb.dwarf2/dw2-inline-break.exp | 124 ++ gdb/testsuite/gdb.dwarf2/dw2-skip-prologue.S | 2 +- gdb/testsuite/gdb.linespec/ls-errs.exp | 8 +- gdb/testsuite/gdb.opt/inline-break.c | 159 +++ gdb/testsuite/gdb.opt/inline-break.exp | 114 ++ gdb/testsuite/lib/mi-support.exp | 3 +- gdb/tui/tui-win.c | 11 +- gdb/value.c | 13 +- gdb/value.h | 1 + gdb/version.in | 2 +- opcodes/ChangeLog | 9 + opcodes/ppc-dis.c | 115 +- 43 files changed, 2779 insertions(+), 146 deletions(-) create mode 100644 gdb/features/arm-with-m-fpa-layout.c create mode 100644 gdb/features/arm-with-m-fpa-layout.xml create mode 100644 gdb/testsuite/gdb.ada/set_pckd_arr_elt.exp create mode 100644 gdb/testsuite/gdb.ada/set_pckd_arr_elt/foo.adb create mode 100644 gdb/testsuite/gdb.ada/set_pckd_arr_elt/pck.adb create mode 100644 gdb/testsuite/gdb.ada/set_pckd_arr_elt/pck.ads create mode 100644 gdb/testsuite/gdb.dwarf2/dw2-inline-break.S create mode 100644 gdb/testsuite/gdb.dwarf2/dw2-inline-break.exp create mode 100644 gdb/testsuite/gdb.opt/inline-break.c create mode 100644 gdb/testsuite/gdb.opt/inline-break.exp First 500 lines of diff: diff --git a/bfd/ChangeLog b/bfd/ChangeLog index 0a674b8..15819e6 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,5 +1,15 @@ +2012-03-16 Matthew Gretton-Dann + + * elf32-arm.c (elf32_arm_attributes_accept_div): New function. + (elf32_arm_attributes_forbid_div): Likewise. + (elf32_arm_merge_eabi_attributes): Correct handling of + Tag_DIV_use. + 2012-03-15 Roland McGrath + * elf64-x86-64.c (elf_x86_64_create_dynamic_sections): Use + elf_x86_64_backend_data parameters for plt_eh_frame. + * elf64-x86-64.c (struct elf_x86_64_backend_data): New type. (get_elf_x86_64_backend_data, GET_PLT_ENTRY_SIZE): New macros. (elf_x86_64_arch_bed): New variable. diff --git a/bfd/elf32-arm.c b/bfd/elf32-arm.c index 9231552..8721f94 100644 --- a/bfd/elf32-arm.c +++ b/bfd/elf32-arm.c @@ -11268,6 +11268,46 @@ tag_cpu_arch_combine (bfd *ibfd, int oldtag, int *secondary_compat_out, #undef T } +/* Query attributes object to see if integer divide instructions may be + present in an object. */ +static bfd_boolean +elf32_arm_attributes_accept_div (const obj_attribute *attr) +{ + int arch = attr[Tag_CPU_arch].i; + int profile = attr[Tag_CPU_arch_profile].i; + + switch (attr[Tag_DIV_use].i) + { + case 0: + /* Integer divide allowed if instruction contained in archetecture. */ + if (arch == TAG_CPU_ARCH_V7 && (profile == 'R' || profile == 'M')) + return TRUE; + else if (arch >= TAG_CPU_ARCH_V7E_M) + return TRUE; + else + return FALSE; + + case 1: + /* Integer divide explicitly prohibited. */ + return FALSE; + + default: + /* Unrecognised case - treat as allowing divide everywhere. */ + case 2: + /* Integer divide allowed in ARM state. */ + return TRUE; + } +} + +/* Query attributes object to see if integer divide instructions are + forbidden to be in the object. This is not the inverse of + elf32_arm_attributes_accept_div. */ +static bfd_boolean +elf32_arm_attributes_forbid_div (const obj_attribute *attr) +{ + return attr[Tag_DIV_use].i == 1; +} + /* Merge EABI object attributes from IBFD into OBFD. Raise an error if there are conflicting attributes. */ @@ -11709,29 +11749,22 @@ elf32_arm_merge_eabi_attributes (bfd *ibfd, bfd *obfd) break; case Tag_DIV_use: - /* This tag is set to zero if we can use UDIV and SDIV in Thumb - mode on a v7-M or v7-R CPU; to one if we can not use UDIV or - SDIV at all; and to two if we can use UDIV or SDIV on a v7-A - CPU. We will merge as follows: If the input attribute's value - is one then the output attribute's value remains unchanged. If - the input attribute's value is zero or two then if the output - attribute's value is one the output value is set to the input - value, otherwise the output value must be the same as the - inputs. */ - if (in_attr[i].i != 1 && out_attr[i].i != 1) - { - if (in_attr[i].i != out_attr[i].i) - { - _bfd_error_handler - (_("DIV usage mismatch between %B and %B"), - ibfd, obfd); - result = FALSE; - } - } - - if (in_attr[i].i != 1) - out_attr[i].i = in_attr[i].i; - + /* A value of zero on input means that the divide instruction may + be used if available in the base architecture as specified via + Tag_CPU_arch and Tag_CPU_arch_profile. A value of 1 means that + the user did not want divide instructions. A value of 2 + explicitly means that divide instructions were allowed in ARM + and Thumb state. */ + if (in_attr[i].i == out_attr[i].i) + /* Do nothing. */ ; + else if (elf32_arm_attributes_forbid_div (in_attr) + && !elf32_arm_attributes_accept_div (out_attr)) + out_attr[i].i = 1; + else if (elf32_arm_attributes_forbid_div (out_attr) + && elf32_arm_attributes_accept_div (in_attr)) + out_attr[i].i = in_attr[i].i; + else if (in_attr[i].i == 2) + out_attr[i].i = in_attr[i].i; break; case Tag_MPextension_use_legacy: diff --git a/bfd/elf64-x86-64.c b/bfd/elf64-x86-64.c index c0a4493..51204a5 100644 --- a/bfd/elf64-x86-64.c +++ b/bfd/elf64-x86-64.c @@ -981,6 +981,8 @@ elf_x86_64_create_dynamic_sections (bfd *dynobj, && bfd_get_section_by_name (dynobj, ".eh_frame") == NULL && htab->elf.splt != NULL) { + const struct elf_x86_64_backend_data *const abed + = get_elf_x86_64_backend_data (dynobj); flagword flags = get_elf_backend_data (dynobj)->dynamic_sec_flags; htab->plt_eh_frame = bfd_make_section_with_flags (dynobj, ".eh_frame", @@ -989,11 +991,11 @@ elf_x86_64_create_dynamic_sections (bfd *dynobj, || !bfd_set_section_alignment (dynobj, htab->plt_eh_frame, 3)) return FALSE; - htab->plt_eh_frame->size = sizeof (elf_x86_64_eh_frame_plt); + htab->plt_eh_frame->size = abed->eh_frame_plt_size; htab->plt_eh_frame->contents - = bfd_alloc (dynobj, htab->plt_eh_frame->size); - memcpy (htab->plt_eh_frame->contents, elf_x86_64_eh_frame_plt, - sizeof (elf_x86_64_eh_frame_plt)); + = bfd_alloc (dynobj, htab->plt_eh_frame->size); + memcpy (htab->plt_eh_frame->contents, + abed->eh_frame_plt, abed->eh_frame_plt_size); } return TRUE; } diff --git a/bfd/version.h b/bfd/version.h index c00a05b..f1ed722 100644 --- a/bfd/version.h +++ b/bfd/version.h @@ -1,4 +1,4 @@ -#define BFD_VERSION_DATE 20120315 +#define BFD_VERSION_DATE 20120316 #define BFD_VERSION @bfd_version@ #define BFD_VERSION_STRING @bfd_version_package@ @bfd_version_string@ #define REPORT_BUGS_TO @report_bugs_to@ diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 1a75508..7325047 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,92 @@ +2012-03-16 Jan Kratochvil + + PR symtab/13777 + * dwarf2read.c (process_full_comp_unit): Set LOCATIONS_VALID only for + GCC >=4.5. + +2012-03-16 Chris January + + * tui-tui.win.c (tui_resize_all): Use erase and clearok instead + of clear. + +2012-03-16 Chris January + + * source.c (add_path): Use memmove instead of strcpy because the + strings overlap. + +2012-03-16 Joel Brobecker + + * value.h (set_value_parent): Add declaration. + * value.c (set_value_parent): New function. + (value_address): If VALUE->PARENT is not NULL, then use it as + the base address instead of VALUE->LOCATION.address. + * ada-lang.c (ada_value_primitive_packed_val): Keep V's address + the same as OBJ's address. Adjust V's offset accordingly. + Set V's parent. + +2012-03-16 Gary Benson + + PR breakpoints/10738 + * dwarf2read.c (use_deprecated_index_sections): New global. + (struct partial_die_info): New member may_be_inlined. + (read_partial_die): Set may_be_inlined where appropriate. + (add_partial_subprogram): Add partial symbols for partial + DIEs that may be inlined. + (new_symbol_full): Add inlined subroutines to the current + scope. + (write_psymtabs_to_index): Bump version number. + (dwarf2_read_index): Read only version 6 indices unless + use_deprecated_index_sections is set. + * linespec.c (symbol_and_data_callback): New structure. + (iterate_inline_only): New function. + (iterate_over_all_matching_symtabs): New argument + "include_inline". If nonzero, also call the callback for + symbols representing inlined subroutines. + (lookup_prefix_sym): Pass extra argument to the above. + (find_function_symbols): Likewise. + (add_matching_symbols_to_info): Likewise. + * NEWS: Mention that GDB can now set breakpoints on inlined + functions. + +2012-03-16 Pierre Muller + + * p-typeprint.c (pascal_type_print_method_args): + Fix display of parameter of methods. + +2012-03-16 Pierre Muller + + * amd64-windows-nat.c (_initialize_amd64_windows_nat): + Add missing prototype. + +2012-03-16 Yao Qi + Jan Kratochvil + + Fix false compilation warning. + * gnu-v3-abi.c (print_one_vtable): Initialize ADDR. + +2012-03-15 Jonathan Larmour + Pedro Alves + + * arm-tdep.c: Include "remote.h" and "features/arm-with-m-fpa-layout.c". + (arm_register_g_packet_guesses): New function. + (arm_gdbarch_init): Don't force a target description with + registers when the executable is detected as M-profile. Instead + set gdbarch->tdep->is_m. Register `g' packet guesses. + (_initialize_arm_tdep): Initialize the new target description. + * features/arm-with-m-fpa-layout.xml: New description. + * features/arm-with-m-fpa-layout.c: New, generated. + +2012-03-15 Joel Brobecker + + * breakpoint.c (breakpoint_xfer_memory): Add assertion. + Update function description. + (insert_bp_location): Do not wipe bl->target_info out. + * mem-break.c: #include "gdb_string.h". + (default_memory_insert_breakpoint): Do not call target_read_memory + with a pointer to the breakpoint's shadow_contents buffer. Use + a local buffer instead. + * m32r-tdep.c (m32r_memory_insert_breakpoint): Ditto. + 2012-03-15 Tom Tromey * NEWS: Mention "info vtbl", not "info vtable". diff --git a/gdb/NEWS b/gdb/NEWS index 6444984..e6bf59c 100644 --- a/gdb/NEWS +++ b/gdb/NEWS @@ -62,6 +62,17 @@ * The "info static-tracepoint-marker" command will now also work on native Linux targets with in-process agent. +* GDB can now set breakpoints on inlined functions. + +* The .gdb_index section has been updated to include symbols for + inlined functions. GDB will ignore older .gdb_index sections by + default, which could cause symbol files to be loaded more slowly + until their .gdb_index sections can be recreated. The new option + --use-deprecated-index-sections will cause GDB to use any older + .gdb_index sections it finds. This will restore performance, but + the ability to set breakpoints on inlined functions will be lost + in symbol files with older .gdb_index sections. + * New commands ** "catch load" and "catch unload" can be used to stop when a shared diff --git a/gdb/ada-lang.c b/gdb/ada-lang.c index 040d606..78a0261 100644 --- a/gdb/ada-lang.c +++ b/gdb/ada-lang.c @@ -2297,10 +2297,9 @@ ada_value_primitive_packed_val (struct value *obj, const gdb_byte *valaddr, } else if (VALUE_LVAL (obj) == lval_memory && value_lazy (obj)) { - v = value_at (type, - value_address (obj) + offset); + v = value_at (type, value_address (obj)); bytes = (unsigned char *) alloca (len); - read_memory (value_address (v), bytes, len); + read_memory (value_address (v) + offset, bytes, len); } else { @@ -2310,18 +2309,22 @@ ada_value_primitive_packed_val (struct value *obj, const gdb_byte *valaddr, if (obj != NULL) { - CORE_ADDR new_addr; + long new_offset = offset; set_value_component_location (v, obj); - new_addr = value_address (obj) + offset; set_value_bitpos (v, bit_offset + value_bitpos (obj)); set_value_bitsize (v, bit_size); if (value_bitpos (v) >= HOST_CHAR_BIT) { - ++new_addr; + ++new_offset; set_value_bitpos (v, value_bitpos (v) - HOST_CHAR_BIT); } - set_value_address (v, new_addr); + set_value_offset (v, new_offset); + + /* Also set the parent value. This is needed when trying to + assign a new value (in inferior memory). */ + set_value_parent (v, obj); + value_incref (obj); } else set_value_bitsize (v, bit_size); diff --git a/gdb/amd64-windows-nat.c b/gdb/amd64-windows-nat.c index 49119d1..bc2c047 100644 --- a/gdb/amd64-windows-nat.c +++ b/gdb/amd64-windows-nat.c @@ -85,6 +85,9 @@ static const int mappings[] = }; #undef context_offset +/* -Wmissing-prototypes */ +extern initialize_file_ftype _initialize_amd64_windows_nat; + void _initialize_amd64_windows_nat (void) { diff --git a/gdb/arm-tdep.c b/gdb/arm-tdep.c index b4da01d..a3cdc7c 100644 --- a/gdb/arm-tdep.c +++ b/gdb/arm-tdep.c @@ -40,6 +40,7 @@ #include "dwarf2-frame.h" #include "gdbtypes.h" #include "prologue-value.h" +#include "remote.h" #include "target-descriptions.h" #include "user-regs.h" #include "observer.h" @@ -55,6 +56,7 @@ #include "vec.h" #include "features/arm-with-m.c" +#include "features/arm-with-m-fpa-layout.c" #include "features/arm-with-iwmmxt.c" #include "features/arm-with-vfpv2.c" #include "features/arm-with-vfpv3.c" @@ -9665,6 +9667,41 @@ arm_register_reggroup_p (struct gdbarch *gdbarch, int regnum, } +/* For backward-compatibility we allow two 'g' packet lengths with + the remote protocol depending on whether FPA registers are + supplied. M-profile targets do not have FPA registers, but some + stubs already exist in the wild which use a 'g' packet which + supplies them albeit with dummy values. The packet format which + includes FPA registers should be considered deprecated for + M-profile targets. */ + +static void +arm_register_g_packet_guesses (struct gdbarch *gdbarch) +{ + if (gdbarch_tdep (gdbarch)->is_m) + { + /* If we know from the executable this is an M-profile target, + cater for remote targets whose register set layout is the + same as the FPA layout. */ + register_remote_g_packet_guess (gdbarch, + /* r0-r12,sp,lr,pc; f0-f7; fps,cpsr */ + (16 * INT_REGISTER_SIZE) + + (8 * FP_REGISTER_SIZE) + + (2 * INT_REGISTER_SIZE), + tdesc_arm_with_m_fpa_layout); + + /* The regular M-profile layout. */ + register_remote_g_packet_guess (gdbarch, + /* r0-r12,sp,lr,pc; xpsr */ + (16 * INT_REGISTER_SIZE) + + INT_REGISTER_SIZE, + tdesc_arm_with_m); + } + + /* Otherwise we don't have a useful guess. */ +} + + /* Initialize the current architecture based on INFO. If possible, re-use an architecture from ARCHES, which is a list of architectures already created during this debugging session. @@ -9798,7 +9835,7 @@ arm_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) && (attr_arch == TAG_CPU_ARCH_V6_M || attr_arch == TAG_CPU_ARCH_V6S_M || attr_profile == 'M')) - tdesc = tdesc_arm_with_m; + is_m = 1; #endif } @@ -10055,6 +10092,8 @@ arm_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) tdep->have_neon_pseudos = have_neon_pseudos; tdep->have_neon = have_neon; + arm_register_g_packet_guesses (gdbarch); + /* Breakpoints. */ switch (info.byte_order_for_code) { @@ -10291,6 +10330,7 @@ _initialize_arm_tdep (void) /* Initialize the standard target descriptions. */ initialize_tdesc_arm_with_m (); + initialize_tdesc_arm_with_m_fpa_layout (); initialize_tdesc_arm_with_iwmmxt (); initialize_tdesc_arm_with_vfpv2 (); initialize_tdesc_arm_with_vfpv3 (); diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c index d35704d..debf2b2 100644 --- a/gdb/breakpoint.c +++ b/gdb/breakpoint.c @@ -1318,6 +1318,10 @@ bp_location_has_shadow (struct bp_location *bl) /* Update BUF, which is LEN bytes read from the target address MEMADDR, by replacing any memory breakpoints with their shadowed contents. + If READBUF is not NULL, this buffer must not overlap with any of + the breakpoint location's shadow_contents buffers. Otherwise, + a failed assertion internal error will be raised. + The range of shadowed area by each bp_location is: bl->address - bp_location_placed_address_before_address_max up to bl->address + bp_location_shadow_len_after_address_max @@ -1446,6 +1450,12 @@ breakpoint_xfer_memory (gdb_byte *readbuf, gdb_byte *writebuf, if (readbuf != NULL) { + /* Verify that the readbuf buffer does not overlap with + the shadow_contents buffer. */ + gdb_assert (bl->target_info.shadow_contents >= readbuf + len + || readbuf >= (bl->target_info.shadow_contents + + bl->target_info.shadow_len)); + /* Update the read buffer with this inserted breakpoint's shadow. */ memcpy (readbuf + bp_addr - memaddr, @@ -2082,8 +2092,15 @@ insert_bp_location (struct bp_location *bl, if (!should_be_inserted (bl) || (bl->inserted && !bl->needs_update)) return 0; - /* Initialize the target-specific information. */ - memset (&bl->target_info, 0, sizeof (bl->target_info)); + /* Note we don't initialize bl->target_info, as that wipes out + the breakpoint location's shadow_contents if the breakpoint + is still inserted at that location. This in turn breaks + target_read_memory which depends on these buffers when + a memory read is requested at the breakpoint location: + Once the target_info has been wiped, we fail to see that + we have a breakpoint inserted at that address and thus + read the breakpoint instead of returning the data saved in + the breakpoint location's shadow contents. */ bl->target_info.placed_address = bl->address; bl->target_info.placed_address_space = bl->pspace->aspace; bl->target_info.length = bl->length; diff --git a/gdb/doc/ChangeLog b/gdb/doc/ChangeLog index 8ea02d0..cb6d0e9 100644 --- a/gdb/doc/ChangeLog +++ b/gdb/doc/ChangeLog @@ -1,3 +1,11 @@ +2012-03-16 Gary Benson + + PR breakpoints/10738 + * gdb.texinfo (Inline Functions): Remove the now-unnecessary @item + stating that GDB cannot set breakpoints on inlined functions. + (Mode Options): Document --use-deprecated-index-sections. + (Index Section Format): Document new index section version format. + 2012-03-15 Tom Tromey * gdb.texinfo (Debugging C Plus Plus): Document "info vtbl". diff --git a/gdb/doc/gdb.texinfo b/gdb/doc/gdb.texinfo index d4c5656..56bf5d5 100644 --- a/gdb/doc/gdb.texinfo +++ b/gdb/doc/gdb.texinfo @@ -1221,6 +1221,13 @@ memory usage after it completes each command and returns to the prompt. This option causes @value{GDBN} to print its version number and no-warranty blurb, and exit. +@item -use-deprecated-index-sections +@cindex @code{--use-deprecated-index-sections} +This option causes @value{GDBN} to read and use deprecated +@samp{.gdb_index} sections from symbol files. This can speed up +startup, but may result in some functionality being lost. +@xref{Index Section Format}. + @end table hooks/post-receive -- Repository for Project Archer.