aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2014-08-19Replace static variables in the MSP430 simulator with fields in the cpu ↵Nick Clifton3-66/+98
state structure. * msp430-sim.c: Move static hardware multiply support variables from here... * msp430-sim.h (msp430_cpu_state): ... into here ... * msp430-sim.c (get_op, put_op): ... and update references to use the msp430_cpu_state structure.
2014-08-19Introduce common-debug.hGary Benson12-27/+161
This introduces common-debug.h. This holds the functions debug_printf and debug_vprintf, two functions that the common code can use to print debugging messages. Clients of the common code are expected to implement debug_vprintf; a debug_vprintf function is written from scratch for GDB, and gdbserver's existing debug_printf is repurposed as debug_vprintf. common/agent.c is changed to use debug_vprintf rather than defining the macro DEBUG_AGENT depending on GDBSERVER. nat/i386-dregs.c is changed to use the externally-implemented debug_printf, rather than defining it itself. gdb/ChangeLog: * common/common-debug.h: New file. * common/common-debug.c: Likewise. * debug.c: Likewise. * Makefile.in (SFILES): Add common/common-debug.c. (HFILES_NO_SRCDIR): Add common/common-debug.h. (COMMON_OBS): Add common-debug.o and debug.o. (common-debug.o): New rule. * common/common-defs.h: Include common-debug.h. * common/agent.c (debug_agent_printf): New function. (DEBUG_AGENT): Redefine. * nat/i386-dregs.c (debug_printf): Undefine. gdb/gdbserver/ChangeLog: * Makefile.in (SFILES): Add common/common-debug.c. (OBS): Add common-debug.o. (common-debug.o): New rule. * debug.h (debug_printf): Don't declare. * debug.c (debug_printf): Renamed and rewritten as... (debug_vprintf): New function.
2014-08-19Move print-utils.h to common-defs.hGary Benson5-3/+10
This commit moves the inclusion of print-utils.h to common-defs.h and removes all other inclusions. gdb/ChangeLog: * common/common-defs.h: Include print-utils.h. * utils.h: Do not include print-utils.h. gdb/gdbserver/ChangeLog: * utils.h: Do not include print-utils.h.
2014-08-19Introduce common-types.hGary Benson7-41/+80
This introduces common-types.h. This file defines various standard types used by gdb and gdbserver. Currently these types are conditionally defined based on GDBSERVER. The long term goal is to remove all such tests; however, this is difficult as currently gdb uses definitions from BFD. In the meantime this is still a step in the right direction. gdb/ChangeLog: * common/common-types.h: New file. * Makefile.in (HFILES_NO_SRCDIR): Add common/common-types.h. * common/common-defs.h: Include common-types.h. * defs.h (gdb_byte, CORE_ADDR, CORE_ADDR_MAX, LONGEST) (ULONGEST): Remove. gdb/gdbserver/ChangeLog: * server.h: Add static assertion. (gdb_byte, CORE_ADDR, LONGEST, ULONGEST): Remove.
2014-08-19Introduce common/errors.hGary Benson12-80/+196
This introduces common/errors.h. This holds some error- and warning- related declarations that can be used by the code in common, nat and target. Some of the declared functions must be provided by the client as documented by the header file comments. gdb/ChangeLog: * common/errors.h: New file. * common/errors.c: Likewise. * Makefile.in (SFILES): Add common/errors.c. (HFILES_NO_SRCDIR): Add common/errors.h. (COMMON_OBS): Add errors.o. (errors.o): New rule. * common/common-defs.h: Include errors.h. * utils.h (perror_with_name, error, verror, warning, vwarning): Don't declare. * common/common-utils.h: (malloc_failure, internal_error): Likewise. gdb/gdbserver/ChangeLog: * Makefile.in (SFILES): Add common/errors.c. (OBS): Add errors.o. (IPA_OBS): Add errors-ipa.o. (errors.o): New rule. (errors-ipa.o): Likewise. * utils.h (perror_with_name, error, warning): Don't declare. * utils.c (warning): Renamed and rewritten as... (vwarning): New function. (error): Renamed and rewritten as... (verror): New function. (internal_error): Renamed and rewritten as... (internal_verror): New function.
2014-08-19Ensure internal_vproblem always prints the messageGary Benson2-6/+9
While working on internal_vproblem I noticed that the error/warning message is suppressed if problem->should_quit is internal_problem_yes or internal_problem_no. This behaviour seems wrong. This commit modifies internal_vproblem to emit the message regardless of the user's settings. gdb/ 2014-08-19 Gary Benson <gbenson@redhat.com> * utils.c (internal_vproblem): Always print the message.
2014-08-19daily updateAlan Modra1-1/+1
2014-08-18boards/fission.exp: Explicitly pass -ggnu-pubnames for clang.David Blaikie2-1/+7
* boards/fission.exp: Explicitly pass -ggnu-pubnames for clang.
2014-08-18gdb.dwarf2/data-loc.exp: Remove second DW_AT_upper bound in array range.Joel Brobecker2-1/+5
The testcase generates an assembly file where a second DW_AT_upper_bound attribute gets generated in the array range. This was definitely unintentional, and I only noticed this after pushing the testcase, when dumping one more time the DWARF data using readelf. This patch fixes it. gdb/testsuite/ChangeLog: * gdb.dwarf2/data-loc.exp: Remove second DW_AT_upper bound attribute in array range.
2014-08-18ada-typeprint.c (print_range): Initialize lo,hi for gcc -Wall.Doug Evans2-1/+5
* ada-typeprint.c (print_range): Initialize lo,hi for gcc -Wall.
2014-08-18This fixes the processing of BFD_RELOC_RL78_DIFF fixups when the size is lessNick Clifton2-1/+15
than 4. This affects DWARF debug info generation in particular. * config/tc-rl78.c (md_apply_fix): Correct handling of small sized RELOC_RL78_DIFF fixups.
2014-08-18DW_AT_data_location and DW_OP_push_object_address testcase.Joel Brobecker3-0/+241
This testcase allows us to test the proper processing of both DW_AT_data_location and DW_OP_push_object_address using a hand-crafted testcase duplicating how we expect the Ada compiler to represent unbounded arrays. gdb/testsuite/ChangeLog: * gdb.dwarf2/data-loc.c, gdb.dwarf2/data-loc.exp: New files.
2014-08-18[Ada] "ptype" of array where bound value uses DW_OP_push_object_addressJoel Brobecker2-5/+32
Consider an Ada array type where the DWARF debugging info for at least one of the bounds involves an expression containing a DW_OP_push_object_address operation. Trying to "ptype" that type currently yields: (gdb) ptype foo.array_type type = array (Location address is not set. This patch improves ada-typeprint by adding handling of the situation where an array range type has dynamic bounds. In that case, it prints the array bounds using Ada's typical syntax for unbounded ranges "<>": (gdb) ptype array_type type = array (<>) of integer gdb/ChangeLog: * ada-typeprint.c (type_is_full_subrange_of_target_type): Return 0 if TYPE is dynamic. (print_range): Add handling of dynamic ranges.
2014-08-18Add support for DW_AT_data_location.Joel Brobecker5-0/+83
gdb/ChangeLog: * gdbtypes.h (struct main_type): Add field "data_location". (TYPE_DATA_LOCATION, TYPE_DATA_LOCATION_BATON) (TYPE_DATA_LOCATION_ADDR, TYPE_DATA_LOCATION_KIND): New macros. * gdbtypes.c (is_dynamic_type): Return 1 if the type has a dynamic data location. (resolve_dynamic_type): Add DW_AT_data_location handling. (copy_recursive, copy_type): Copy the data_location information when present. * dwarf2read.c (set_die_type): Add DW_AT_data_location handling. * value.c (value_from_contents_and_address): Add DW_AT_data_location handling.
2014-08-18Add support for DW_OP_push_object_address.Joel Brobecker6-18/+79
gdb/ChangeLog: * dwarf2expr.h (struct dwarf_expr_context_funcs): Uncomment field "get_object_address". * dwarf2expr.c (execute_stack_op): Add handling for DW_OP_push_object_address. * dwarf2loc.h (dwarf2_evaluate_property): Add "address" field. * dwarf2loc.c (struct dwarf_expr_baton): Add field "obj_address". (dwarf_expr_push_dwarf_reg_entry_value): Set baton_local.obj_address. (dwarf_expr_get_obj_addr): New function. (dwarf_expr_ctx_funcs): Add get_object_address field. (dwarf2_evaluate_loc_desc_full): Set baton.obj_address. (dwarf2_locexpr_baton_eval): Add parameter "addr". Use it. (dwarf2_evaluate_property): Add parameter "address". Use it. (needs_get_obj_addr): New function. (needs_frame_ctx_funcs): Add get_object_address field. (dwarf2_compile_expr_to_ax): Add DW_OP_push_object_address handling. * gdbtypes.c (resolve_dynamic_range): Add "addr" field. Use it. (resolve_dynamic_array): Likewise.
2014-08-18ada_evaluate_subexp<OP_VAR_VALUE>: Avoid static fixing when possible.Joel Brobecker2-2/+23
Now that the OP_VAR_VALUE section of this function has been reorganized a bit, we can fall-back on standard evaluation when static fixing is not required. This patch does that, but being exclusive about when static fixing has to be used, rather than doing it all the time when noside is EVAL_AVOID_SIDE_EFFECTS. This will pave the way for later when we want to evaluate entities that have no GNAT encodings related to them but dynamic properties instead. In that case, we expect the standard evaluation to resolve those dynamic properties for us, even in no-side-effect mode. gdb/ChangeLog: * ada-lang.c (ada_evaluate_subexp) <OP_VAR_VALUE>: When noside is EVAL_AVOID_SIDE_EFFECTS, only return a statically fixed value for records and unions for which some GNAT encodings are present.
2014-08-18avoid "if ... else if ... else" logic in ada-lang.c::ada_evaluate_subexpJoel Brobecker2-7/+13
The OP_VAR_VALUE branch in ada_evaluate_subexp is written with multiple "if ... else if ... else if ... else ..." block. But in practice, these blocks all either goto out of that block of code, or return. This patch rewrites this code slightly by replacing the "else if"-s by simple "if"s. This should better reflect the ideal processing where we try to do a standard eval whenever possible, and only do something else when the standard eval does not work. On a pratical level, this patch makes it easier to fall through to the default processing when none of the special situations are detected, thus making it easier to add more handlers of those special situations; or to remove them as they no longer become necessary! gdb/ChangeLog: * ada-lang.c (ada_evaluate_subexp) <OP_VAR_VALUE>: Slight code rewrite to avoid "else if" and "else" constructs. Should be a no-op in practice.
2014-08-18Fix indentation level in ada-lang.c::ada_evaluate_subexp.Joel Brobecker2-44/+49
I just happen to notice that a lexical block was missing one indentation level. gdb/ChangeLog: * ada-lang.c (ada_evaluate_subexp) <OP_VAR_VALUE>: Fix identation of lexical block.
2014-08-18LTO plugin with older gccAlan Modra2-1/+5
* ld-plugin/lto.exp: Use gcc -print-file-name to find lto plugin.
2014-08-18PowerPC fix for ifunc broken by d1eca1e4Alan Modra3-1/+11
This probably could be fixed by making changes in relocate_section for ifunc, but it's simpler to disable the optimisation for ifunc. * elf64-ppc.c (ppc64_elf_adjust_dynamic_symbol): Don't attempt to use dynrelocs for ifunc. * elf32-ppc.c (ppc_elf_adjust_dynamic_symbol): Similarly.
2014-08-18PR 17287, DT_NEEDED of unneeded libraries affects --as-neededAlan Modra7-3/+40
PR 17287 bfd/ * elflink.c (on_needed_list): Only consider libraries that have been loaded. ld/ * ld.texinfo (--as-needed): Clarify that references from libraries must be from needed libraries. ld/testsuite/ * ld-plugin/needed3.c: New file. * ld-elf/shared.exp: Add needed3 test.
2014-08-18Return error status from bfd_elf_discard_info.Alan Modra15-45/+118
bfd/ * elflink.c (bfd_elf_discard_info): Return int error status. * stabs.c (_bfd_discard_section_stabs): Comment typo fix. * bfd-in.h (bfd_elf_discard_info): Updata prototype. * bfd-in2.h: Regenerate. ld/ * emultempl/aarch64elf.em (gld${EMULATION_NAME}_after_allocation): Handle error status from bfd_elf_discard_info. * emultempl/armelf.em: Likewise. * emultempl/elf32.em: Likewise. * emultempl/hppaelf.em: Likewise. * emultempl/metagelf.em: Likewise. * emultempl/nios2elf.em: Likewise. * emultempl/ppc64elf.em: Likewise. * emultempl/tic6xdsbt.em: Likewise. * emultempl/vms.em: Likewise.
2014-08-18Cast result of TC_PARSE_CONS_EXPRESSIONAlan Modra2-1/+5
* read.c (parse_mri_cons): Warning fix.
2014-08-18daily updateAlan Modra1-1/+1
2014-08-17daily updateAlan Modra1-1/+1
2014-08-15Add new argument NOSIDE to find_overload_match.Siva Chandra8-14/+146
This is a fix for PR c++/17132. If this new argument is set to EVAL_AVOID_SIDE_EFFECTS, then the object's memory will not be read while picking the best overload match. gdb/ * eval.c: Update all calls to find_overload_match. * valarith.c: Likewise. (value_user_defined_cpp_op, value_user_defined_op): New argument NOSIDE. Update all callers. * valops.c (find_overload_match): New argument NOSIDE. * value.h (find_overload_match): Update signature. gdb/testsuite * gdb.cp/pr17132.cc: New file. * gdb.cp/pr17132.exp: New file.
2014-08-15Fix xmethod Python so that it works with Python3.Siva Chandra4-11/+23
gdb/ * python/lib/gdb/command/xmethods.py (set_xm_status1): Use the 'items' methods instead of 'iteritems' method on dictionaries. gdb/testsuite/ * gdb.python/py-xmethods.py (A_getarrayind) (E_method_char_worker.__call__, E_method_int_worker.__call__): Use 'print' with function call syntax. (E_method_matcher.match): Fix tab vs space indentation mixup.
2014-08-16daily updateAlan Modra1-1/+1
2014-08-15(dwarf_decode_lines_1): Move definition of adj_opcode closer to use.Doug Evans2-1/+7
* dwarf2read.c (dwarf_decode_lines_1): Move definition of adj_opcode closer to use.
2014-08-15dwarf2read.c (dwarf_decode_lines_1): Add comment.Doug Evans2-0/+6
* dwarf2read.c (dwarf_decode_lines_1): Add comment.
2014-08-15Regenerate sim configury.Roland McGrath78-234/+1427
2014-08-15(dwarf_decode_lines_1): Delete local "column", unused.Doug Evans2-2/+5
* dwarf2read.c (dwarf_decode_lines_1): Delete local "column", unused.
2014-08-15(dwarf_decode_lines_1): Delete local basic_block, unused.Doug Evans2-4/+5
* dwarf2read.c (dwarf_decode_lines_1): Delete local basic_block, unused.
2014-08-15Avoid compiler warnings about incomplete parameter types.Eli Zaretskii2-0/+6
gdb/ChangeLog: * dcache.h: Include target.h, to avoid compile time warnings.
2014-08-15Add "frame.h" #include in gdbarch.h.Joel Brobecker3-2/+10
This include is needed because gdbarch_dummy_id needs the full definition of struct frame_id. gdb/ChangeLog: * gdbarch.sh: #include "frame.h" in gdbarch.h. Delete "struct frame_info" partial declaration. * gdbarch.h: Regenerate. Tested on x86_64-linux by rebuilding GDB.
2014-08-15Skip tfile.exp if unable to generate trace fileYao Qi2-0/+6
I added proc generate_tracefile in this patch https://sourceware.org/ml/gdb-patches/2014-03/msg00591.html but tfile.exp isn't skipped as changelog entry said: * gdb.trace/tfile.exp: Skip the test if generate_tracefile return 0. it is a mistake I made at the last minute. Patch below fixed it. gdb/testsuite: 2014-08-15 Yao Qi <yao@codesourcery.com> * gdb.trace/tfile.exp: Return -1 if generate_tracefile returns false.
2014-08-15daily updateAlan Modra1-1/+1
2014-08-15Set print symbol off in some testsYao Qi5-1/+17
GDB in default prints the symbol associated on an address, and tests assume that there is no symbol on address zero. However, on bare metal target, address may be mapped to zero and there may be a symbol. Then, some tests fail as below: print const_cast<void *> (0)^M $8 = (void *) 0x0 <_ftext>^M (gdb) FAIL: gdb.cp/casts.exp: const_cast of 0 p acp->c1^M $9 = (A *) 0x0 <_ftext>^M (gdb) FAIL: gdb.cp/class2.exp: p acp->c1 This patch is to set print symbol off in these tests, like what I did previously https://sourceware.org/ml/gdb-patches/2014-07/msg00257.html gdb/testsuite: 2014-08-15 Yao Qi <yao@codesourcery.com> * gdb.cp/casts.exp: Set print symbol off. * gdb.cp/class2.exp: Likewise. * gdb.cp/overload.exp: Likewise. * gdb.cp/templates.exp: Likewise.
2014-08-15Remove pst from dwarf_decode_lines_1Yao Qi2-3/+7
Hi, Parameter 'pst' of function dwarf_decode_lines_1 isn't used except to compute decode_for_pst_p, which has been got in the caller dwarf_decode_lines. I wonder it would be good if we just pass 'decode_for_pst_p'. gdb: 2014-08-15 Yao Qi <yao@codesourcery.com> * dwarf2read.c (dwarf_decode_lines_1): Remove parameter 'pst'. Add parameter 'decode_for_pst_p'. Callers update.
2014-08-14opcodes: blackfin: convert ad-hoc ints to bfd_booleanMike Frysinger2-21/+31
These various int fields are being used as booleans, so change to the existing bfd_boolean style. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2014-08-14opcodes: blackfin: simplify decode_CC2stat_0 logicMike Frysinger2-41/+11
These multiple if statements can be condensed down into a single if statement and an array of strings. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2014-08-14opcodes: blackfin: avoid duplicate memory readsMike Frysinger2-6/+10
Rather than reading the same memory twice, pass the value back up. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2014-08-14Fix for objdump segfault on broken PE executableAlan Modra2-17/+25
* peXXigen.c (pe_print_reloc): Protect against access past end of .reloc section.
2014-08-14Linker part of PR16563 fixAlan Modra7-54/+121
Presents .eh_frame input sections to the optimisation machinery in elf-eh-frame.c in the order they are given by the linker script. PR 16563 bfd/ * elflink.c (bfd_elf_discard_info): Process .eh_frame and .stab in the order they are mapped to output sections. ld/ * ldlang.c (map_head_is_link_order): Rename from stripped_excluded_sections. (lang_clear_os_map): New function, extracted from.. (strip_excluded_output_sections): ..here. * ldlang.h (lang_clear_os_map): Declare. * ldwrite.c (ldwrite): Call lang_clear_os_map. * emultempl/sh64elf.em (sh64_elf_${EMULATION_NAME}_after_allocation): Likewise.
2014-08-14configury changes to make ld plugin support controlled by --enable-pluginsAlan Modra21-1647/+1768
This also makes --enable-plugins default to on for hosts that can support plugins, so we have consistent lto toolchain support. The ACX_LARGEFILE moves aren't strictly necessary, but are harmless and will be necessary if plugin support is extended to more hosts via libtool's dlopen support. I started down that path then decided it was more work than I was interested in doing. (ACX_LARGEFILE invokes AC_PLUGINS.) config/ * plugins.m4: Test for dlfcn.h or windows.h here to set default for --enable-plugins. Report error if someone tries to enable plugins on a host we don't support. bfd/ * configure.ac: Delete redundant plugin related checks. * configure: Regenerate. binutils/ * configure.ac: Move ACX_LARGEFILE after LT_INIT. * config.in: Regenerate. * configure: Regenerate. gas/ * configure.ac: Move ACX_LARGEFILE after LT_INIT. * config.in: Regenerate. * configure: Regenerate. gprof/ * configure.ac: Move ACX_LARGEFILE after LT_INIT. * configure: Regenerate. * gconfig.in: Regenerate. ld/ * configure.ac: Move AC_PROG_CC and other macros earlier. Delete plugin checks now done in config/plugins.m4. * config.in: Regenerate. * configure: Regenerate.
2014-08-14Simplify is_ir_dummy_bfd testAlan Modra2-8/+8
is_ir_dummy_bfd started life before BFD_PLUGIN was invented. * plugin.c (is_ir_dummy_bfd): Test BFD_PLUGIN flag rather than flags.claimed.
2014-08-13Add option -no-pie.Sriraman Tallam2-1/+6
2014-08-14daily updateAlan Modra1-1/+1
2014-08-13bfd: or1k: avoid emitting R_OR1K_INSN_REL_26 in shared libsStefan Kristiansson2-18/+12
This fixes a bug where R_OR1K_INSN_REL_26 relocations would be emitted into shared libraries even when the referenced symbol was hidden or the symbol was contained in the same .so which had been linked with -Bsymbolic. bfd/ * elf32-or1k.c (or1k_elf_relocate_section, or1k_elf_check_relocs, allocate_dynrelocs): Use SYMBOL_REFERENCES_LOCAL, SYMBOL_CALLS_LOCAL and SYMBOLIC_BIND.
2014-08-13opcodes: blackfin: push down global stateMike Frysinger4-48/+92
The variables used to track insn state should be pushed down into the private_data structure to avoid pollution across calls. This also happens to fix the output when hitting comments/invalid insns which needs to tweak a gas test. Signed-off-by: Mike Frysinger <vapier@gentoo.org>