summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* dwarf2read.c: C++fy lnp_state_machineusers/palves/cxx-dwarf2readPedro Alves2017-03-291-198/+244
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | While I was looking at the file, I noticed that this struct could be nicely converted to a class. As I was progressing, I ended up moving all state machine actual internal state manipulation to methods of lnp_state_machine, essentially decoupling DWARF parsing from state tracking. I also noticed that the lnp_reader_state doesn't really serve any good use, so that's eliminated in the process. gdb/ChangeLog: yyyy-mm-dd Pedro Alves <palves@redhat.com> * dwarf2read.c (lnp_state_machine): Now a class. Initialize all data fields, make them private and add "m_" prefixes. (lnp_state_machine::lnp_state_machine): New ctor. (record_line, check_line_address, handle_set_discriminator) (handle_set_address, handle_advance_pc, handle_special_opcode) (handle_advance_line, handle_set_file, handle_negate_stmt) (handle_const_add_pc, handle_fixed_advance_pc, handle_copy) (end_sequence, advance_line): New methods. (m_gdbarch, m_record_lines_p): New fields. (lnp_reader_state): Delete. (dwarf_record_line): Rename to ... (lnp_state_machine::record_line): ... adjust. (init_lnp_state_machine): Delete. (lnp_state_machine::lnp_state_machine): New. (check_line_address): Rename to ... (lnp_state_machine::check_line_address): This. (dwarf_decode_lines_1): Remove reference to "reader_state". Adjust lnp_state_machine having a non-default ctor. Use bool. State machine internal state manipulation moved to lnp_state_machine methods.
* Make sect_offset and cu_offset strong typedefs instead of structsPedro Alves2017-03-2911-384/+875
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A while ago, back when GDB was a C program, the sect_offset and cu_offset types were made structs in order to prevent incorrect mixing of those offsets. Now that we require C++11, we can make them integers again, while keeping the safety, by exploiting "enum class". We can add a bit more safety, even, by defining operators that the types _should_ support, helping making the suspicious uses stand out more. Getting at the underlying type is done with the new to_underlying function added by the previous patch, which also helps better spot where do we need to step out of the safety net. Mostly, that's around parsing the DWARF, and when we print the offset for complaint/debug purposes. But there are other occasional uses. Since we have to define the sect_offset/cu_offset types in a header anyway, I went ahead and generalized/library-fied the idea of "offset" types, making it trivial to add more such types if we find a use. See common/offset-type.h and the DEFINE_OFFSET_TYPE macro. I needed a couple generaly-useful preprocessor bits (e.g., yet another CONCAT implementation), so I started a new common/preprocessor.h file. I included units tests covering the "offset" types API. These are mostly compile-time tests, using SFINAE to check that expressions that shouldn't compile (e.g., comparing unrelated offset types) really are invalid and would fail to compile. This same idea appeared in my pending enum-flags revamp from a few months ago (though this version is a bit further modernized compared to what I had posted), and I plan on reusing the "check valid expression" bits added here in that series, so I went ahead and defined the CHECK_VALID_EXPR macro in its own header -- common/valid-expr.h. I think that's nicer regardless. I was borderline between calling the new types "offset" types, or "index" types, BTW. I stuck with "offset" simply because that's what we're already calling them, mostly. gdb/ChangeLog: 2017-03-29 Pedro Alves <palves@redhat.com> * Makefile.in (SUBDIR_UNITTESTS_SRCS): Add unittests/offset-type-selftests.c. (SUBDIR_UNITTESTS_OBS): Add offset-type-selftests.o. * common/offset-type.h: New file. * common/preprocessor.h: New file. * common/traits.h: New file. * common/valid-expr.h: New file. * dwarf2expr.c: Include "common/underlying.h". Adjust to use sect_offset and cu_offset strong typedefs throughout. * dwarf2expr.h: Adjust to use sect_offset and cu_offset strong typedefs throughout. * dwarf2loc.c: Include "common/underlying.h". Adjust to use sect_offset and cu_offset strong typedefs throughout. * dwarf2read.c: Adjust to use sect_offset and cu_offset strong typedefs throughout. * gdbtypes.h: Include "common/offset-type.h". (cu_offset): Now an offset type (strong typedef) instead of a struct. (sect_offset): Likewise. (union call_site_parameter_u): Rename "param_offset" field to "param_cu_off". * unittests/offset-type-selftests.c: New file.
* dwarf2read.c: Make dir_index and file_name_index strong typedefsPedro Alves2017-03-292-61/+112
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This should help catch mistakes related to mixing the 1-based DWARF indexes with 0-based std::vector indexes, since the new types do not implicitly convert to anything. The change in read_formatted_entries relates to the fact that doing the seemingly simpler: - uintp = &fe.dir_index; + uintp = (unsigned int *) &fe.dir_index; would be undefined C/C++. So to address that, I made the function extract the form before assigning to the file_entry. It felt natural to use gdb::optional for "do I have this value", and this is what motivated the previous patch that added the missing observer methods to gdb::optional. gdb/ChangeLog: yyyy-mm-dd Pedro Alves <palves@redhat.com> * common/underlying.h: New file. * dwarf2read.c: Include "common/gdb_optional.h" and "common/underlying.h". (dir_index, file_name_index): New types. (file_entry): Use them. (file_entry::include): Use to_underlying. (line_header::add_file_name): Use dir_index. (read_formatted_entries): Use gdb::optional. Read form before writting to file_entry. (dwarf_decode_line_header): Use dir_index. (lnp_state_machine::current_file): Use to_underlying. (lnp_state_machine::file): Change type to file_name_index. (dwarf_record_line): Use to_underlying. (init_lnp_state_machine): Use file_name_index. (dwarf_decode_lines_1): Use dir_index and file_name_index.
* gdb::optional: Add observersPedro Alves2017-03-291-0/+29
| | | | | | | | | | | | | | | Currently, gdb::optional is really minimal and can only be used for lazy initialization. There's no way to get at the value contained inside the optinal. This commit corrects that, by adding observer methods, mostly copied from libstdc++'s implementation of C++17 std::optional. This will be used in the following patch. gdb/ChangeLog: 2017-03-29 Pedro Alves <palves@redhat.com> * common/gdb_optional.h (gdb::optiona): Add operator->, operator*, operator bool, has_value and get methods.
* dwarf2read.c: Some C++fycation, use std::vector, std::unique_ptrPedro Alves2017-03-271-179/+127
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This starts off as replacing a couple custom open coded vector implementations in the file with std::vector, and then the rest falls off of that. I.e., use new/delete instead of XCNEW/xfree, add ctors/dtors/initializers where appropriate. And then use std::unique_ptr instead of cleanups. Some functions became methods, and in a couple spots, some single-use callback functions that would have to be tweaked anyway are converted to lambdas instead. yyyy-mm-dd Pedro Alves <palves@redhat.com> * dwarf2read.c (struct file_entry): Add ctors, and initialize all fields. (line_header): Initialize all data fields. Change type of standard_opcode_lengths to std::unique_ptr<unsigned char[]>. Change type of include_dirs to std::vector<const char *>. Remove num_include_dirs, include_dirs_size. Change type of file_names to std::vector<file_entry>. Remove num_file_names, file_names_size. (line_header::line_header): New. (line_header::add_include_dir, line_header::add_file_name): New methods. (line_header::include_dir_at): Remove NULL check. (line_header::file_name_at): Add const overload. (line_header_up): New unique_ptr typedef. (dw2_get_file_names_reader): Use line_header_up. Adjust to use std::vector. Remove free_line_header call. (dwarf2_build_include_psymtabs): Use line_header_up. Remove free_line_header call. (free_cu_line_header): Delete. (handle_DW_AT_stmt_list, handle_DW_AT_stmt_list) (setup_type_unit_groups): Use line_header_up instead of cleanups. Adjust to use std::vector. (free_line_header): Delete. (free_line_header_voidp): Use delete. (add_include_dir): Replace with ... (line_header::add_include_dir): ... this method. Use std::vector. (add_file_name): Replace with ... (line_header::add_file_name): ... this method. Use std::vector. (add_include_dir_stub): Delete. (read_formatted_entries): Remove memset. (dwarf_decode_line_header): Return a line_header_up instead of a raw pointer. Remove cleanup handling. Pass lambdas to read_formatted_entries. Adjust to use line_header methods. (dwarf_decode_lines_1): Adjust to use line_header methods. (dwarf_decode_lines, file_file_name, file_full_name): Adjust to use std::vector.
* dwarf2read.c: Clean up out of bounds handlingPedro Alves2017-03-272-70/+106
| | | | | | | | | | | | | | | | | | | | | | | Multiple places in dwarf2read.c open code 1-based to 0-based index conversion and check for out of bounds accesses to lh->include_dirs and lh->file_names. This commit factors those out to a couple methods and uses them throughout. gdb/ChangeLog: 2017-03-27 Pedro Alves <palves@redhat.com> * dwarf2read.c (file_entry) <dir_index>: Add comment. (file_entry::include_dir): New method. (line_header::include_dir_at, line_header::file_name_at): New methods. (setup_type_unit_groups, setup_type_unit_groups) (psymtab_include_file_name): Simplify using the new methods. (lnp_state_machine) <the_line_header>: New field. <file>: Add comment. (lnp_state_machine::current_file): New method. (dwarf_record_line): Simplify using the new methods. (init_lnp_state_machine): Initialize the "the_line_header" field. (dwarf_decode_lines_1, dwarf_decode_lines, file_file_name): Simplify using the new methods.
* gdb/cp-name-parser.y: Eliminate make_empty, use cplus_demangle_fill_componentPedro Alves2017-03-272-46/+21
| | | | | | | | | | | | | | | | | | | | | The demangler exports the cplus_demangle_fill_component function that clients should use to initialize demangle_component components that use the "s_binary" union member. cp-name-parser.y uses it in some places, via the fill_comp wrapper, but not all. Several places instead use a GDB-specific "make_empty" function. Because this function does not call any of the demangler "fill" functions, we had to patch it recently to clear the allocated demangle_component's "d_printing" field, which is supposedly a "private" demangler field. To avoid such problems in the future, this commit switches those places to use "fill_comp" instead, and eliminates the "make_empty" function. gdb/ChangeLog: 2017-03-27 Pedro Alves <palves@redhat.com> * cp-name-parser.y (make_empty): Delete. (demangler_special, nested_name, ptr_operator, array_indicator) (direct_declarator, declarator_1): Use fill_comp instead of make_empty.
* cplus_demangle_fill_component: Handle DEMANGLE_COMPONENT_RVALUE_REFERENCEPedro Alves2017-03-272-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | This patch almost a decade ago: ... 2007-08-31 Douglas Gregor <doug.gregor@gmail.com> * cp-demangle.c (d_dump): Handle DEMANGLE_COMPONENT_RVALUE_REFERENCE. (d_make_comp): Ditto. ... ... missed doing the same change to cplus_demangle_fill_component that was done to d_make_comp. I.e., teach it to only validate that we're not passing in a "right" subtree. GDB has recently (finally) learned about rvalue references, and a change to make it use cplus_demangle_fill_component more ran into an assertion because of this. (GDB is the only user of cplus_demangle_fill_component in both the gcc and binutils-gdb trees.) libiberty/ChangeLog: 2017-03-27 Pedro Alves <palves@redhat.com> * cp-demint.c (cplus_demangle_fill_component): Handle DEMANGLE_COMPONENT_RVALUE_REFERENCE.
* Add support for the WebAssembly backend to the BFD library.Pip Cet2017-03-2712-665/+1630
| | | | | | | | | | | | | * wasm-module.c: New file to support WebAssembly modules. * wasm-module.h: New file to support WebAssembly modules. * doc/webassembly.texi: Start documenting wasm-module.c. * config.bfd: Add wasm_vec. * targets.c: Likewise. * configure.ac: Likewise. * Makefile.am: Add entries for wasm-module.c. * Makefile.in: Regenerate. * configure: Regenerate. * po/SRC-POTFILES.in: Regenerate.
* Fix gdb_xml_debug/gdb_xml_error ATTRIBUTE_PRINTF usePedro Alves2017-03-274-5/+14
| | | | | | | | | | | | | | | | | | | The declarations of gdb_xml_debug and gdb_xml_error are passing "0" as "first-to-check" argument to ATTRIBUTE_PRINTF, as if they were va_args functions. Consequently, the arguments to gdb_xml_debug / gdb_xml_error aren't being checked against the format strings. With that fixed, a couple obvious bugs are exposed, both fixed by this commit. gdb/ChangeLog: 2017-03-27 Pedro Alves <palves@redhat.com> * xml-support.h (gdb_xml_debug): Pass a "first-to-check" argument to ATTRIBUTE_PRINTF. * solib-target.c (library_list_start_list): Print "string" not "version". * xml-tdesc.c (tdesc_start_field): Pass "field_name" to gdb_xml_error call.
* PR21303, objdump doesn't show e200z4 insnsAlan Modra2017-03-276-2/+44
| | | | | | | | | | | PR 21303 opcodes/ * ppc-dis.c (struct ppc_mopt): Comment. (ppc_opts <e200z4>): Move PPC_OPCODE_VLE from .sticky to .cpu. gas/ * testsuite/gas/ppc/pr21303.d, * testsuite/gas/ppc/pr21303.s: New test * testsuite/gas/ppc/ppc.exp: Run it.
* gdb: Make ldirname return a std::stringPedro Alves2017-03-277-78/+90
| | | | | | | | | | | | | | | | | | | | | | | | | Eliminates several uses of cleanups. Tested on x86_64 Fedora 23 with Python 2 and 3. gdb/ChangeLog 2017-03-27 Pedro Alves <palves@redhat.com> * dwarf2read.c (struct file_and_directory): New. (dwarf2_get_dwz_file): Adjust to use std::string. (dw2_get_file_names_reader): Adjust to use file_and_directory. (find_file_and_directory): Adjust to return a file_and_directory object. (read_file_scope): Adjust to use file_and_directory. Remove make_cleanup/do_cleanups calls. (open_and_init_dwp_file): Adjust to use std::string. Remove make_cleanup/do_cleanups calls. * python/python.c (do_start_initialization): Adjust to ldirname returning a std::string. * utils.c (ldirname): Now returns a std::string. * utils.h (ldirname): Change return type to std::string. * xml-syscall.c (xml_init_syscalls_info): Adjust to ldirname returning a std::string. * xml-tdesc.c (file_read_description_xml): Likewise.
* oops - forgot to add the bfd/ChangeLog entry...Pip Cet2017-03-271-0/+14
|
* Add minimal support for WebAssembly backend to the BFD library.Pip Cet2017-03-2713-0/+148
| | | | | | | | | | | | include * elf/wasm32.h: New file to support wasm32 architecture. bfd * cpu-wasm32.c: New file to support wasm32 architecture. * elf32-wasm32.c: New file to support wasm32 architecture. * Makefile.am: Add wasm32 architecture. * archures.c: Likewise. * config.bfd: Likewise. * configure.ac: Likewise. * targets.c: Likewise.
* Implement ARC NPS-400 Ultra Ip and Miscellaneous instructions.Rinat Zelig2017-03-278-356/+759
| | | | | | | | | | | | | | opcodes * arc-nps400-tbl.h: Add Ultra Ip and Miscellaneous instructions format. * arc-opc.c: Add defines. e.g. F_NJ, F_NM , F_NO_T, F_NPS_SR, F_NPS_M, F_NPS_CORE, F_NPS_ALL. (insert_nps_misc_imm_offset): New function. (extract_nps_misc imm_offset): New function. (arc_num_flag_operands): Add F_NJ, F_NM, F_NO_T. (arc_flag_special_cases): Add F_NJ, F_NM, F_NO_T. include * opcode/arc.h (insn_class_t): Add ULTRAIP and MISC class. gas * testsuite/gas/arc/nps400-12.s: New file. * testsuite/gas/arc/nps400-12.d: New file.
* Automatic date update in version.inGDB Administrator2017-03-271-1/+1
|
* Fix bug with cmn/adds where C flag was incorrectly set.Jim Wilson2017-03-254-1/+27
| | | | | | | | | sim/aarch64/ * simulator.c (set_flags_for_add32): Cast result to uint32_t in carry flag check. sim/testsuite/sim/aarch64/ * adds.s: Add checks for values -2 and 1, where C is not set.
* Automatic date update in version.inGDB Administrator2017-03-261-1/+1
|
* Automatic date update in version.inGDB Administrator2017-03-251-1/+1
|
* Remove MAX_REGISTER_SIZE from target.cAlan Hayward2017-03-244-39/+52
| | | | | | | | | gdb/ * regcache.c (regcache_debug_print_register): New function. * regcache.h (regcache_debug_print_register): New declaration. * target.c (debug_print_register): Remove. (target_fetch_registers): Call regcache_debug_print_register. (target_store_registers): Likewise.
* Avoid segfault on invalid directory tablePádraig Brady2017-03-242-6/+22
| | | | | | | | | | | | | | | | | | | gdb was segfaulting during backtrace on a binary here, where fe->dir_index parsed from the DWARF info was seen to access beyond the provided include_dirs array. This commit bounds the access to entries actually written to the array, and was verified to output the backtrace correctly. gdb/ChangeLog: * dwarf2read.c (setup_type_unit_groups): Ensure dir_index doesn't reference beyond the 'lh->include_dirs' array before accessing to it. (psymtab_include_file_name): Likewise. (dwarf_decode_lines_1): Likewise. (dwarf_decode_lines): Likewise. (file_file_name): Likewise.
* [GAS/ARM] Fix selected_cpu with default CPU and -mcpuThomas Preud'homme2017-03-242-2/+7
| | | | | | | | | | | | | When GAS is compiled with DEFAULT_CPU set and then run with a -mcpu or -march option, selected_cpu will be set to the default CPU. This means the -mcpu is ignored which is surprising behavior. This commit instead sets selected_cpu from the value passed to -mcpu/-march. 2017-03-24 Thomas preud'homme <thomas.preudhomme@arm.com> gas/ * config/tc-arm.: (md_begin): Set selected_cpu from *mcpu_cpu_opt when CPU_DEFAULT is defined.
* readelf: Fix incorrect "Version definition past end of section" message ↵Maciej W. Rozycki2017-03-241-1/+2
| | | | | | | (ChangeLog) Correct ChangeLog entry for commit c9f02c3e2949 ("readelf: Fix incorrect "Version definition past end of section" message").
* Automatic date update in version.inGDB Administrator2017-03-241-1/+1
|
* Remove some unnecessary inferior_ptid setting/restoring when ↵Simon Marchi2017-03-236-82/+39
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | fetching/storing registers Now that the to_fetch_registers, to_store_registers and to_prepare_to_store target methods don't rely on the value of inferior_ptid anymore, we can remove a bunch of now unnecessary setting and restoring of inferior_ptid. The asserts added recently in target_fetch_registers and target_store_registers, which validate that inferior_ptid matches the regcache's ptid, must go away. It's the whole point of this effort, to not require inferior_ptid to have a particular value when calling these functions. One thing that I noticed is how sol-thread.c's ps_lgetregs and friends use the current value of inferior_ptid instead of what's passed as argument (ph->ptid), unlike proc-service.c's versions of the same functions. Is it expected? I left it like this in the current patch, but unless there's a good reason for it to be that way, I guess we should make it use the parameter. gdb/ChangeLog: * fbsd-tdep.c (fbsd_corefile_thread): Don't set/restore inferior_ptid. * proc-service.c (ps_lgetregs, ps_lsetregs, ps_lgetfpregs, ps_lsetfpregs): Likewise. * regcache.c (regcache_raw_update, regcache_raw_write): Likewise. * sol-thread.c (ps_lgetregs, ps_lsetregs, ps_lgetfpregs, ps_lsetfpregs): Likewise. * target.c (target_fetch_registers, target_store_registers): Remove asserts.
* Remove MAX_REGISTER_SIZE from sol-thread.cAlan Hayward2017-03-232-9/+4
| | | | | gdb/ * sol-thread.c (sol_thread_store_registers): Remove regcache calls.
* Handle PRFM in AArch64 process recordYao Qi2017-03-232-3/+64
| | | | | | | | | | | | | | | This patch fixes the bug of handling PRFM instruction. PRFM is documented in a table with other load and store instructions, but it doesn't do any load or store. This patch also adds a unit test to PRFM instruction. gdb: 2017-03-23 Yao Qi <yao.qi@linaro.org> * aarch64-tdep.c (aarch64_process_record_test): Declare. (_initialize_aarch64_tdep): Register it. (aarch64_record_load_store): Handle PRFM instruction. (aarch64_process_record_test): New function.
* Fix code indentationYao Qi2017-03-232-8/+17
| | | | | | | | | gdb: 2017-03-23 Yao Qi <yao.qi@linaro.org> * aarch64-tdep.c (aarch64_record_load_store): Fix code indentation.
* Remove AARCH64_RECORD_FAILUREYao Qi2017-03-232-1/+4
| | | | | | | | | | It is not used at all. gdb: 2017-03-23 Yao Qi <yao.qi@linaro.org> * aarch64-tdep.c: Remove AARCH64_RECORD_FAILURE.
* Remove constness of libdir in do_start_initializationAndreas Arnez2017-03-231-1/+1
| | | | | | | | | | | | | | | | | | The patch "Fix memory leak in python.c:do_start_initialization" (https://sourceware.org/ml/gdb-patches/2017-03/msg00407.html) introduced a compilation error on some platforms: ../../binutils-gdb/gdb/python/python.c: In function bool do_start_initialization(): ../../binutils-gdb/gdb/python/python.c:1556:16: error: invalid conversion from const void* to void* [-fpermissive] xfree (libdir); ^ This is fixed by removing the constness of libdir's data type. gdb/ChangeLog: * python/python.c (do_start_initialization): Remove 'const' from data type of libdir.
* Fix memory leak in python.c:do_start_initializationPhilipp Rudo2017-03-232-1/+7
| | | | | | | | | | | | | | | | When intializing Python the path to the python binary is build the following way progname = concat (ldirname (python_libdir), SLASH_STRING, "bin", SLASH_STRING, "python", (char *) NULL); This is problematic as both concat and ldirname allocate memory for the string they return. Thus the memory allocated by ldirname cannot be accessed afterwards causing a memory leak. Fix it by temporarily storing libdir in a variable and xfree it after concat. gdb/ChangeLog: python/python.c (do_start_initialization): Fix memory leak.
* Automatic date update in version.inGDB Administrator2017-03-231-1/+1
|
* Sanitize RISC-V GAS help text, documentationPalmer Dabbelt2017-03-223-7/+17
| | | | | | | It looks like I missed the GAS help text when going through all the documentation last time, so it printed some of the old-format (never upstream) arguments. I fixed this, and when I went to check doc/ I noticed it was missing the '-fpic'/'-fno-pic' options.
* gas: xtensa: make trampolines relaxation work with jumps in slots other than 0Max Filippov2017-03-222-4/+25
| | | | | | | | | | | | | | | | | | | | | | | | add_jump_to_trampoline assumes that jump instruction is in slot 0, when it's in other slot that results in fixup that references NULL symbol, which results in segfault later in xtensa_make_cached_fixup. Search for the non-NULL symbol in the tc_frag_data.slot_symbols and check that there's exactly one such slot. xtensa_relax_frag for RELAX_TRAMPOLINE reassigns fixup from the original instruction with jump to generated jump in the trampoline frag, but does not fix its fx_r_type or fx_size. That results in "undecodable fix" or "fixup not contained within frag" error messages during relaxation. Fix both these fields. gas/ 2017-03-22 Max Filippov <jcmvbkbc@gmail.com> * config/tc-xtensa.c (xtensa_relax_frag): Change fx_size of the reassigned fixup to size of jump instruction (3) and fx_r_type to BFD_RELOC_XTENSA_SLOT0_OP, as there's only one slot. (add_jump_to_trampoline): Search origfrag->tc_frag_data.slot_symbols for the slot with non-NULL symbol and use that slot instead of slot 0.
* Remove lwp -> pid conversion in linux_nat_xfer_partialSimon Marchi2017-03-223-11/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The linux_nat_xfer_partial does a conversion of inferior_ptid: if it's an LWP (ptid::lwp != 0), it builds a new ptid with the lwp as the pid and assigns that temporarily to inferior_ptid. For example, if inferior_ptid is: { .pid = 1234, .lwp = 1235 } it will assign this to inferior_ptid for the duration of the call: { .pid = 1235, .lwp = 0 } Instead of doing this, this patch teaches the inf-ptrace implementation of xfer_partial to deal with ptids representing lwps by using get_ptrace_pid. Also, in linux_proc_xfer_spu and linux_proc_xfer_partial, we use ptid_get_lwp instead of ptid_get_pid. While not strictly necessary, since the content of /proc/<pid> and /proc/<lwp> should be the same, it's a bit safer, because: - some files under /proc/<pid>/ may not work if the <pid> thread is running, just like ptrace requires a stopped thread. The current thread's lwp id is more likely to be in the necessary state (stopped). - if the leader (<pid>) had exited and is thus now zombie, then several files under "/proc/<pid>" won't work, while they will if you use "/proc/<lwp>". The testsuite found no regression on native amd64 linux. gdb/ChangeLog: * inf-ptrace.c (inf_ptrace_xfer_partial): Get pid from ptid using get_ptrace_pid. * linux-nat.c (linux_nat_xfer_partial): Don't set/restore inferior_ptid. (linux_proc_xfer_partial, linux_proc_xfer_spu): Use lwp of inferior_ptid instead of pid.
* Sync top level config files with master versions in the FSF config project.Nick Clifton2017-03-223-9/+26
| | | | | * config.sub: Sync with master version in config project. * config.guess: Likewise.
* Remove @code for pythonYao Qi2017-03-222-1/+5
| | | | | | | | | | | There's no reason to use @code for Python the name of a programming language. gdb/doc: 2017-03-22 Yao Qi <yao.qi@linaro.org> * python.texi (Inferiors In Python): Remove @code from Python.
* Wrap locally used classes in anonymous namespaceYao Qi2017-03-225-0/+27
| | | | | | | | | | | | | | | | | | | | | | Both aarch64-tdep.c and arm-tdep.c defines a class instruction_reader, which violates ODR, but linker doesn't an emit error. I fix this issue by wrapping them by anonymous namespace, but I think it is better to apply this for all locally used classes. If it is a good idea to put locally used class into anonymous namespace, we should document this rule into GDB coding convention, or even GCC coding convention. Note that anonymous namespace has been used in GCC but GCC coding convention doesn't mention the it. gdb: 2017-03-22 Yao Qi <yao.qi@linaro.org> * aarch64-tdep.c: Wrap locally used classes in anonymous namespace. * arm-tdep.c: Likewise. * linespec.c: Likewise. * ui-out.c: Likewise.
* Import sys in gdb/python/lib/gdb/printer/bound_registers.pyJonah Graham2017-03-222-0/+7
| | | | | | | | | Pick up missing bits from the patch merged in. 2017-03-22 Jonah Graham <jonah@kichwacoders.com> PR gdb/19637 * python/lib/gdb/printer/bound_registers.py: Import sys.
* Automatic date update in version.inGDB Administrator2017-03-221-1/+1
|
* Disable shared library tests for nios2-*-elf.Sandra Loosemore2017-03-212-0/+6
| | | | | | | | | | | | The Nios II processor documentation defines relocations for PIC and shared libraries as part of the GNU/Linux ABI only; GCC rejects -fpic on bare-metal. 2017-03-21 Sandra Loosemore <sandra@codesourcery.com> ld/ * testsuite/lib/ld-lib.exp (check_shared_lib_support): Return false for nios2-*-elf.
* windows: Use ptid from regcache in register fetch/storeSimon Marchi2017-03-212-26/+40
| | | | | | | | | | | | | | | | | | | | | | | | | | Use the ptid from the regcache so we don't depend on the current value of the inferior_ptid global. Also, change how the current thread is passed to sub-functions. The windows_fetch_inferior_registers function sets current_thread then calls do_windows_fetch_inferior_registers, which reads current_thread. This very much looks like passing a parameter through a global variable. I think it would be more straightforward to pass the thread as a parameter. gdb/ChangeLog: * windows-nat.c (do_windows_fetch_inferior_registers): Add windows_thread_info parameter and use it instead of current_thread. (windows_fetch_inferior_registers): Don't set current_thread, pass the thread to do_windows_fetch_inferior_registers. Use ptid from regcache instead of inferior_ptid. (do_windows_store_inferior_registers): Add windows_thread_info parameter and use it instead of current_thread. (windows_store_inferior_registers): Don't set current_thread, pass the thread to do_windows_store_inferior_registers. Use ptid from regcache instead of inferior_ptid.
* Remove remaining reference to struct serial::current_timeoutSimon Marchi2017-03-212-2/+5
| | | | | | | | | | | | | | | | | | | I get this when trying to build for --host=x68_64-w64-mingw32: /home/emaisin/src/binutils-gdb/gdb/ser-mingw.c: In function 'void ser_windows_raw(serial*)': /home/emaisin/src/binutils-gdb/gdb/ser-mingw.c:166:8: error: 'struct serial' has no member named 'current_timeout' scb->current_timeout = 0; ^~~~~~~~~~~~~~~ It is just a leftover from 9bcbdca808b5f9fec6217d20bd4b48a56008c460 PR remote/21188: Fix remote serial timeout gdb/ChangeLog: * ser-mingw.c (ser_windows_raw): Remove reference to struct serial::current_timeout.
* S/390: Remove vx2 facility flagAndreas Krebbel2017-03-217-152/+160
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch removes the vx2 facility flag. It will not be used by GCC and was a misnomer anyway. Committed to mainline and 2.28 branch. include/ChangeLog: 2017-03-21 Andreas Krebbel <krebbel@linux.vnet.ibm.com> * opcode/s390.h (S390_INSTR_FLAG_VX2): Remove. (S390_INSTR_FLAG_FACILITY_MASK): Adjust value. gas/ChangeLog: 2017-03-21 Andreas Krebbel <krebbel@linux.vnet.ibm.com> * config/tc-s390.c (s390_parse_cpu): Remove S390_INSTR_FLAG_VX2 from cpu_table. Remove vx2, and novx2 from cpu_flags. opcodes/ChangeLog: 2017-03-21 Andreas Krebbel <krebbel@linux.vnet.ibm.com> * s390-mkopc.c (main): Remove vx2 check. * s390-opc.txt: Remove vx2 instruction flags.
* Add --inlines option to objdump to include scope backtrace of inlined ↵Andi Kleen2017-03-214-2/+44
| | | | | | | | | | | | functions when generating source line number information. * objdump.c (unwind_inlines): Add. (option_values): Add OPTION_INLINES. (show_line): Unwind inlines if requested. (main): Parse OPTION_INLINES. (usage): Document --inlines. * doc/binutils.texi: Document --inlines. * NEWS: Likewise.
* arc/nps400: Add cp16/cp32 instructions to opcodes libraryRinat Zelig2017-03-218-3/+900
| | | | | | | | | | | | | | | | | | | | | | | Instructions for loading or storing 16/32B data from one address type to another. gas/ChangeLog * testsuite/gas/arc/nps400-11.s: New file. * testsuite/gas/arc/nps400-11.d: New file. include/ChangeLog * opcode/arc.h (insn_class_t): Add DMA class. opcodes/ChangeLog * arc-nps400-tbl.h: Add cp32/cp16 instructions format. * arc-opc.c: Add F_NPS_NA, NPS_DMA_IMM_ENTRY, NPS_DMA_IMM_OFFSET. (insert_nps_imm_offset): New function. (extract_nps_imm_offset): New function. (insert_nps_imm_entry): New function. (extract_nps_imm_entry): New function.
* Update support for GNU BUILD notes so that version notes can contain extra ↵Nick Clifton2017-03-213-25/+46
| | | | | | | | | | | information, and stack protection notes can contain numeric values. * readelf.c (print_gnu_build_attribute_name): Allow stack protection notes to contain numeric values. Use a colon rather than a space to separate a string name from its values. Decode the numeric value of a stack protection note. * objcopy.c (merge_gnu_build_notes): Allow version notes to contain extra text after the protocol version number.
* Decode properly flags of %ccr register on sparc64.Ivo Raisr2017-03-216-11/+304
| | | | | | | | | | | | | | | | | | | | While at it, decode also properly one-bit flags for %fsr (accrued and current exception flags were mixed up). ChangeLog entry: 2017-03-21 Ivo Raisr <ivo.raisr@oracle.com> PR tdep/20928 * gdb/sparc-tdep.h (gdbarch_tdep) <sparc64_ccr_type>: New field. * gdb/sparc64-tdep.c (sparc64_ccr_type): New function. (sparc64_fsr_type): Fix %fsr decoding. ChangeLog entry for testsuite: 2017-03-21 Ivo Raisr <ivo.raisr@oracle.com> PR tdep/20928 * gdb.arch/sparc64-regs.exp: New file. * gdb.arch/sparc64-regs.S: Likewise.
* ld: check overflow only for allocated sections.Tristan Gingold2017-03-212-14/+20
| | | | | * ldlang.c (lang_check_section_addresses): Check only for allocated sections.
* Fix break on Python 2Tim Wiederhake2017-03-216-2/+27
| | | | | | This changes the return type of "gdb.BtraceInstruction.data ()" from "memoryview" to "buffer" on Python 2.7 and below, similar to what "gdb.Inferior.read_memory ()" does.