aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2014-04-22Add a note to the GDB/NEWS file mentioning that the ARM simulator nowNick Clifton2-0/+7
supports instruction tracing with or without disassembly alongside. * NEWS: Mention that ARM sim now supports tracing.
2014-04-22Fix build problem on 32-bit hosts with the recent patch for PR 16821.Yuanhui Zhang2-1/+14
PR ld/16821 * peXXigen.c (abs_finder): Fix for 32-bit host builds.
2014-04-22bfd/elfnn-aarch64.c: Remove elfNN_aarch64_section_flagsWill Newton2-14/+5
This function seems to be a left over from some previous functionality that no longer exists - the comment above seems to make no sense with the current code. Remove the function as it breaks handling of SystemTap static probe note sections. bfd/ChangeLog: 2014-04-22 Will Newton <will.newton@linaro.org> * elfnn-aarch64.c (elfNN_aarch64_section_flags): Remove function. (elf_backend_section_flags): Remove define.
2014-04-22Check tracefile is generated by binary executionYao Qi4-14/+51
In gdb.trace/tfile.exp, we execute binary to generate tracefile, remote_exec target "$binfile" however, this fails on bare metal target. This patch is to handle binary execution failure by running binary in GDB. The binary will do some io operation to generate tracefile, so we need a check 'target_info exists gdb,nofileio'. This patch is to check whether tracefile is generated. tfile.exp can be skipped if generation is failed, while test_tfind_tfile in mi-traceframe-changed.exp is skipped if generated failed. The rest of the mi-traceframe-changed.exp can still be executed, because on some bare metal targets, the remote stub supports tracepoint but doesn't support fileio. gdb/testsuite: 2014-04-22 Yao Qi <yao@codesourcery.com> * lib/trace-support.exp (generate_tracefile): New procedure. * gdb.trace/tfile.exp: Skip the test if generate_tracefile return 0. * gdb.trace/mi-traceframe-changed.exp: Invoke test_tfind_tfile if generate_tracefile returns 1.
2014-04-22Unify ctf_fetch_registers and tfile_fetch_registersYao Qi5-97/+82
Functions ctf_fetch_registers and tfile_fetch_registers have some duplicated code about guessing the PC in regcache. Sometimes, we may change one function and forget to update the other one, like this https://www.sourceware.org/ml/gdb-patches/2014-01/msg00292.html This patch is to move the duplicated code into a new function tracefile_fetch_registers, and let both ctf_fetch_registers and tfile_fetch_registers call it. gdb: 2014-04-22 Yao Qi <yao@codesourcery.com> * tracefile-tfile.c (tfile_fetch_registers): Move the bottom to ... * tracefile.c (tracefile_fetch_registers): ... it. New function. * tracefile.h (tracefile_fetch_registers): Declare. * ctf.c (ctf_fetch_registers): Remove the bottom. Call tracefile_fetch_registers.
2014-04-22daily updateAlan Modra1-1/+1
2014-04-21Fix alpha-elf relaxationRichard Henderson4-96/+159
ld/ * emultempl/alphaelf.em (alpha_after_parse): Enable 2 relax passes. bfd/ * elf64-alpha.c (elf64_alpha_size_got_sections): New may_merge parameter; honor it and disable got merging when false. (elf64_alpha_relax_got_load): Do not relax to GPREL relocs during the first pass of relaxation. (elf64_alpha_relax_with_lituse): Likewise. Move relaxed relocs to the end of the LITERAL+LITUSE chain. (elf64_alpha_relax_section): Only process LITERAL relocs during the second pass of relaxation.
2014-04-21Enable secureplt by default for alpha-linuxRichard Henderson3-2/+7
* configure.ac (use_secureplt): Enable by default. * configure: Rebuild.
2014-04-21daily updateAlan Modra1-1/+1
2014-04-20daily updateAlan Modra1-1/+1
2014-04-19PR gdb/14018 -- avoid "PC register not available" errors.Eli Zaretskii2-16/+52
gdb/windows-nat.c (thread_rec): Don't display a warning when SuspendThread fails with ERROR_ACCESS_DENIED. If SuspendThread fails for any reason, set th->suspended to -1, so that we don't try to resume such a thread. Also, don't return NULL in these cases, to avoid completely ruin the session due to "PC register is not available" error. (do_windows_fetch_inferior_registers): Check errors in GetThreadContext call. (windows_continue): Accept an additional argument KILLED; if not zero, ignore errors in the SetThreadContext call, since the inferior was killed and is shutting down. (windows_resume, get_windows_debug_event) (windows_create_inferior, windows_mourn_inferior) (windows_kill_inferior): All callers of windows_continue changed to adjust to its new calling sequence.
2014-04-19Call post_create_inferior in ctf_open.Yao Qi2-0/+6
We don't call post_create_inferior at the end of ctf_open. It is an oversight in patch [PATCH 2/2] Create inferior for ctf target. https://sourceware.org/ml/gdb-patches/2014-01/msg01056.html This patch is to call post_create_inferior at the end of ctf_open, like the end of tfile_open. gdb: 2014-04-19 Yao Qi <yao@codesourcery.com> * ctf.c (ctf_open): Call post_create_inferior.
2014-04-19Get trace_regblock_size from metadata instead of eventYao Qi2-34/+29
In ctf trace, for each 'R' block, we save it as a "register" event, as defined below in metadata. event { name = "register"; id = 0; fields := struct { ascii contents[440]; }; } Nowadays, we initialize trace_regblock_size by getting the length of "contents" from a "register" event. However, 'R' block may not exist in traceframe, as a result, "register" event doesn't exist in trace file and trace_regblock_size isn't set. This patch changes to get trace_regblock_size from metadata (or declaration) which always exists. gdb: 2014-04-19 Yao Qi <yao@codesourcery.com> * ctf.c (handle_id): New static variable. (ctf_open_dir): Get handle_id from bt_context_add_trace return value. Get the declaration of event "register" and get length of field "contents".
2014-04-19Add null pointer check in ctf_xfer_partialYao Qi2-1/+5
I find a gdb crash when gdb reads ctf trace. The crash is caused by passing NULL to strcmp. This patch is to add null pointer check, as what we did somewhere else in ctf.c. gdb: 2014-04-19 Yao Qi <yao@codesourcery.com> * ctf.c (ctf_xfer_partial): Check 'name' is NULL before strcmp.
2014-04-18Remove unnecessary argument METHOD to valops.c:oload_method_static.Siva Chandra2-8/+12
* valops.c (oload_method_static): Remove unnecessary argument METHOD. Update all callers.
2014-04-19daily updateAlan Modra1-1/+1
2014-04-18mach-o: layout executablesTristan Gingold5-450/+1153
bfd/ * mach-o.h (bfd_mach_o_dyld_info_command): Add rebase_content, bind_content, weak_bind_content, lazy_bind_content, export_content. (bfd_mach_o_load_command): Add comments, add next field. (mach_o_data_struct): Replace commands field by first_command and last_command. * mach-o.c (bfd_mach_o_append_command): New function. (bfd_mach_o_bfd_copy_private_symbol_data): Add blank lines. (bfd_mach_o_bfd_copy_private_section_data): Check flavour, copy fields. (bfd_mach_o_bfd_copy_private_header_data): Copy load commands. (bfd_mach_o_pad4, bfd_mach_o_pad_command): New functions. (bfd_mach_o_write_thread): Use macro instead of literal. (bfd_mach_o_write_dylinker, bfd_mach_o_write_dylib) (bfd_mach_o_write_main, bfd_mach_o_write_dyld_info): New functions. (bfd_mach_o_write_symtab_content): New function (extracted from bfd_mach_o_write_symtab). (bfd_mach_o_write_symtab): Split. (bfd_mach_o_count_indirect_symbols): Move (bfd_mach_o_build_dysymtab): Remove layout code. (bfd_mach_o_write_contents): Rewritten to build commands in order. (bfd_mach_o_count_sections_for_seg): Remove. (bfd_mach_o_build_obj_seg_command): New function (extracted from bfd_mach_o_build_seg_command). (bfd_mach_o_build_exec_seg_command): New function. (bfd_mach_o_build_dysymtab_command): Remove. (bfd_mach_o_layout_commands): New function. (bfd_mach_o_init_segment): New function. (bfd_mach_o_build_commands): Major rework to handle non-object files. (bfd_mach_o_alloc_and_read, bfd_mach_o_read_dyld_content): New function. (bfd_mach_o_read_dyld_info): Clear content fields. (bfd_mach_o_read_segment): Adjust call. (bfd_mach_o_flatten_sections): Adjust as now load commands are chained. (bfd_mach_o_scan_start_address, bfd_mach_o_scan) (bfd_mach_o_mkobject_init, bfd_mach_o_get_base_address) (bfd_mach_o_lookup_command, bfd_mach_o_core_fetch_environment): Likewise. binutils/ * od-macho.c (dump_section_map): Adjust as load commands are now chained. (dump_load_command, dump_section_content): Likewise.
2014-04-18mach-o: Define copy_private_header instead of copy_private_bfd.Tristan Gingold4-3/+10
bfd/ * mach-o-target.c (bfd_mach_o_bfd_copy_private_header_data): Define instead of bfd_mach_o_bfd_copy_private_bfd_data. * mach-o.c (bfd_mach_o_bfd_copy_private_bfd_data): Rename. * mach-o.h (bfd_mach_o_bfd_copy_private_bfd_data): Likewise.
2014-04-18mach-o: remove name_len field.Tristan Gingold3-16/+25
bfd/ * mach-o.h (bfd_mach_o_dylinker_command) (bfd_mach_o_dylib_command, bfd_mach_o_fvmlib_command): Remove name_len field. * mach-o.c (bfd_mach_o_read_dylinker, bfd_mach_o_read_dylib) (bfd_mach_o_read_fvmlib): Adjust after name_len removal.
2014-04-18Fix PR backtrace/15558Pedro Alves8-19/+87
This PR is about an assertion failure in GDB that can be triggered by setting "backtrace limit" to a value that causes GDB to stop unwinding after an inline frame. In this case, an assertion in inline_frame_this_id will trigger: /* We need a valid frame ID, so we need to be based on a valid frame. (...). */ gdb_assert (frame_id_p (*this_id)); Looking at the function: static void inline_frame_this_id (struct frame_info *this_frame, void **this_cache, struct frame_id *this_id) { struct symbol *func; /* In order to have a stable frame ID for a given inline function, we must get the stack / special addresses from the underlying real frame's this_id method. So we must call get_prev_frame. Because we are inlined into some function, there must be previous frames, so this is safe - as long as we're careful not to create any cycles. */ *this_id = get_frame_id (get_prev_frame (this_frame)); we see we're computing the frame id for the inline frame. If this is an inline frame, which is a virtual frame constructed based on debug info, on top of a real stack frame, we should _always_ be able to find where the frame was inlined into, as that ultimately just means peeling off the virtual frames on top of the real stack frame. If there ultimately was no prev (real) stack frame, then we wouldn't have been able to construct the inline frame either, by design. That's what the assertion catches. So we have an inline frame, we should _always_ be able to compute its ID, even if that means bypassing the user backtrace limits to get at the real stack frame's info. The problem is that inline_frame_id calls get_prev_frame, and that takes user backtrace limits into account. Code that wants to bypass the limits calls get_prev_frame_1 instead. Note how get_prev_frame_1 already skips all checks for inline frames: /* If we are unwinding from an inline frame, all of the below tests were already performed when we unwound from the next non-inline frame. We must skip them, since we can not get THIS_FRAME's ID until we have unwound all the way down to the previous non-inline frame. */ if (get_frame_type (this_frame) == INLINE_FRAME) return get_prev_frame_if_no_cycle (this_frame); And note how the related frame_unwind_caller_id function also uses get_prev_frame_1: struct frame_id frame_unwind_caller_id (struct frame_info *next_frame) { struct frame_info *this_frame; /* Use get_prev_frame_1, and not get_prev_frame. The latter will truncate the frame chain, leading to this function unintentionally returning a null_frame_id (e.g., when a caller requests the frame ID of "main()"s caller. */ next_frame = skip_artificial_frames (next_frame); this_frame = get_prev_frame_1 (next_frame); if (this_frame) return get_frame_id (skip_artificial_frames (this_frame)); else return null_frame_id; } get_prev_frame_1 is currently static in frame.c. As a _1 suffix is not a good name for an extern function, I've renamed it. Tested on x86-64 Fedora 17. gdb/ 2014-04-18 Pedro alves <palves@redhat.com> Tom Tromey <tromey@redhat.com> PR backtrace/15558 * frame.c (get_prev_frame_1): Rename to ... (get_prev_frame_always): ... this, and make extern. Adjust. (skip_artificial_frames): Use get_prev_frame_always. (frame_unwind_caller_id, frame_pop, get_prev_frame) (get_frame_unwind_stop_reason): Adjust to rename. * frame.h (get_prev_frame_always): Declare. * inline-frame.c: Include frame.h. (inline_frame_this_id): Use get_prev_frame_always. gdb/testsuite/ 2014-04-18 Tom Tromey <palves@redhat.com> Pedro alves <tromey@redhat.com> PR backtrace/15558 * gdb.opt/inline-bt.exp: Test backtracing from an inline function with a backtrace limit. * gdb.python/py-frame-inline.exp: Test running to an inline function with a backtrace limit, and printing the newest frame. * gdb.python/py-frame-inline.c (main): Call f.
2014-04-18solib-darwin: simplify code.Tristan Gingold2-18/+7
Use bfd_mach_o_get_base_address to extract load address. gdb/ * solib-darwin.c (darwin_solib_create_inferior_hook): Simplify code by using bfd_mach_o_get_base_address.
2014-04-18mach-o: add page_size to backend data.Tristan Gingold6-0/+24
This is preliminary work to layout executables. bfd/ * mach-o.h (bfd_mach_o_backend_data): Add page_size field. * mach-o-target.c: Check TARGET_PAGESIZE is defined. (TARGET_NAME_BACKEND): Add TARGET_PAGESIZE. * mach-o.c (TARGET_PAGESIZE): Define and undefined for each targets declared. * mach-o-x86-64.c (TARGET_PAGESIZE): Define. * mach-o-i386.c (TARGET_PAGESIZE): Define.
2014-04-18mach-o.c: use boolean instead of int to return status.Tristan Gingold2-141/+159
bfd/ * mach-o.c (bfd_mach_o_write_thread) (bfd_mach_o_write_section_32, bfd_mach_o_write_section_64) (bfd_mach_o_write_segment_32, bfd_mach_o_write_segment_64) (bfd_mach_o_read_dylinker, bfd_mach_o_read_dylib) (bfd_mach_o_read_prebound_dylib, bfd_mach_o_read_prebind_cksum) (bfd_mach_o_read_twolevel_hints, bfd_mach_o_read_fvmlib) (bfd_mach_o_read_thread, bfd_mach_o_read_dysymtab) (bfd_mach_o_read_symtab, bfd_mach_o_read_uuid) (bfd_mach_o_read_linkedit, bfd_mach_o_read_str) (bfd_mach_o_read_dyld_info, bfd_mach_o_read_segment) (bfd_mach_o_read_segment_32, bfd_mach_o_read_segment_64) (bfd_mach_o_read_command): Now return a boolean status. Adjust return statements. (bfd_mach_o_write_contents, bfd_mach_o_scan): Adjust tests. (bfd_mach_o_core_file_failing_command): Remove useless initialization.
2014-04-18daily updateAlan Modra1-1/+1
2014-04-17Drop srcdir from untested source path.Marcus Shawcroft2-1/+5
2014-04-17This patch causes local GOT entries addressed via a 16-bit index toKwok Cheung Yeung8-526/+565
be placed towards the front of local GOT space, while entries addressed via a 32-bit index are placed towards the rear. Provided that there are fewer than ~16K local GOT entries addressed via a 16-bit index in total, this should eliminate any relocation overflows caused by such GOT entries being allocated beyond the addressable range. bfd/ * elfxx-mips.c (struct mips_got_info): Delete assigned_gotno field. Add assigned_low_gotno and assigned_high_gotno fields. (mips_elf_create_local_got_entry): Update out-of-space condition. Set index of new GOT entry to assigned_low_gotno if required by the current relocation, else set it to assigned_high_gotno. (mips_elf_set_global_gotidx): Replace uses of assigned_gotno with assigned_low_gotno. (mips_elf_multi_got): Initialize assigned_low_gotno and assigned_high_gotno in secondary GOTs. Use assigned_low_gotno in place of assigned_gotno when handling global GOT entries. (mips_elf_lay_out_got): Initialize assigned_low_gotno and assigned_high_gotno. (_bfd_mips_elf_finish_dynamic_sections): Account for a possible gap in the middle of local GOT space. ld/testsuite/ * ld-mips-elf/elf-rel-xgot-n32.d: Update for new GOT layout. * ld-mips-elf/elf-rel-xgot-n32-embed.d: Likewise. * ld-mips-elf/elf-rel-xgot-n64.d: Likewise. * ld-mips-elf/elf-rel-xgot-n64-embed.d: Likewise. * ld-mips-elf/elf-rel-xgot-n64-linux.d: Likewise.
2014-04-17Enable DWARF unwinders for SPUUlrich Weigand2-0/+70
This patch enables use of DWARF unwinders for the SPU target. In addition to appending the DWARF unwinders, we also need to install a spu_dwarf_reg_to_regnum that maps the raw stack pointer register to the cooked version (to avoid mismatches with gdbarch_sp_regnum). This also causes confusion with the AX collect handling, so we also install ax_pseudo_register routines to handle the cooked SP. gdb/ 2014-04-17 Ulrich Weigand  <uweigand@de.ibm.com> * spu-tdep.c: Include "dwarf2-frame.h" and "ax.h". (spu_ax_pseudo_register_collect): New function. (spu_ax_pseudo_register_push_stack): Likewise. (spu_dwarf_reg_to_regnum): Likewise. (spu_gdbarch_init): Install them. Append DWARF unwinders.
2014-04-17Use address_from_register in dwarf2-frame.c:read_addr_from_regUlrich Weigand10-42/+67
This patch fixes a problem that prevented use of the Dwarf unwinders on SPU, because dwarf2-frame.c common code did not support the situation where the stack and/or frame pointer is maintained in a *vector* register. This is because read_addr_from_reg is hard-coded to assume that such pointers can be read from registers via a simple get_frame_register / unpack_pointer operation. Now, there *is* a routine address_from_register that calls into the appropriate tdep routines to handle pointer values in "weird" registers like on SPU, but it turns out I cannot simply change dwarf2-frame.c to use address_from_register. This is because address_from_register uses value_from_register to create a (temporary) value, and that routine at some point calls get_frame_id in order to set up that value's VALUE_FRAME_ID entry. However, the dwarf2-frame.c read_addr_from_reg routine will be called during early unwinding (to unwind the frame's CFA), at which point the frame's ID is not actually known yet! This would cause an assert. On the other hand, we may notice that VALUE_FRAME_ID is only needed in the value returned by value_from_register if that value is later used as an lvalue. But this is obviously never done to the temporary value used in address_from_register. So, if we could change address_from_register to not call value_from_register but instead accept constructing a value that doesn't have VALUE_FRAME_ID set, things should be fine. To do that, we can change the value_from_register callback to accept a FRAME_ID instead of a FRAME; the only existing uses of the FRAME argument were either to extract its frame ID, or its gdbarch. (To keep a way of getting at the latter, we also change the callback's type from "f" to "m".) Together with the required follow-on changes in the existing value_from_register implementations (including the default one), this seems to fix the problem. As another minor interface cleanup, I've removed the explicit TYPE argument from address_from_register. This routine really always uses a default pointer type, and in the new implementation it -to some extent- relies on that fact, in that it will now no longer handle types that require gdbarch_convert_register_p handling. gdb: 2014-04-17 Ulrich Weigand  <uweigand@de.ibm.com> * gdbarch.sh (value_from_register): Make class "m" instead of "f". Replace FRAME argument with FRAME_ID. * gdbarch.c, gdbarch.h: Regenerate. * findvar.c (default_value_from_register): Add GDBARCH argument; replace FRAME by FRAME_ID. No longer call get_frame_id. (value_from_register): Update call to gdbarch_value_from_register. * value.h (default_value_from_register): Update prototype. * s390-linux-tdep.c (s390_value_from_register): Update interface and call to default_value_from_register. * spu-tdep.c (spu_value_from_register): Likewise. * findvar.c (address_from_register): Remove TYPE argument. Do not call value_from_register; use gdbarch_value_from_register with null_frame_id instead. * value.h (address_from_register): Update prototype. * dwarf2-frame.c (read_addr_from_reg): Use address_from_register. * dwarf2loc.c (dwarf_expr_read_addr_from_reg): Update for address_from_register interface change.
2014-04-17Drop prefix from unsupported source path.Marcus Shawcroft2-2/+7
2014-04-17Fix LTO mismatched TLS referenceAlan Modra2-9/+15
PR 16846 * elflink.c (_bfd_elf_merge_symbol): Ignore TLS mismatch when current bfd is a plugin. Don't always set type_change_ok when old bfd is a plugin.
2014-04-17[testsuite] Set target-charset to asciiYao Qi4-356/+423
Hi, We find gdb.base/printcmds.exp fails a lot on windows host, like this, p ctable1[163] $204 = 163 '£' (gdb) FAIL: gdb.base/printcmds.exp: p ctable1[163] however, on linux host, p ctable1[163] $205 = 163 '\243' (gdb) PASS: gdb.base/printcmds.exp: p ctable1[163] The printing related code is in valprint.c:print_wchar, if (gdb_iswprint (w) && (!need_escape || (!gdb_iswdigit (w) && w != LCST ('8') && w != LCST ('9')))) { gdb_wchar_t wchar = w; if (w == gdb_btowc (quoter) || w == LCST ('\\')) obstack_grow_wstr (output, LCST ("\\")); obstack_grow (output, &wchar, sizeof (gdb_wchar_t)); } else { // print W in hex or octal digits } When I debug gdb on different hosts, I find on windows host, gdb_iswprint (iswprint) returns true if 'w' is 163. However, on linux host, iswprint returns false if 'w' is 163. Looks this difference is caused by the charset. On Linux host, the target-charset is ANSI_X3.4-1968, while on windows host, the target-charset is CP1252. We can see how target-charset affects the output. On linux host, (gdb) set target-charset ASCII (gdb) p ctable1[163] $1 = 163 '\243' (gdb) set target-charset CP1252 (gdb) p ctable1[163] $2 = 163 '£' we can print the pound sign too, and it shows target-charset does affect the output. This patch is to set target-charset temporarily to ASCII for some charset-sensitive tests. Tested on arm-none-eabi and powerpc-linux-gnu on mingw32 host. More than one hundred fails are fixed. gdb/testsuite: 2014-04-17 Yao Qi <yao@codesourcery.com> * lib/gdb.exp (with_target_charset): New proc. * gdb.base/printcmds.exp (test_print_all_chars): Wrap tests with with_target_charset. (test_print_strings): Likewise. (test_repeat_bytes): Likewise. * gdb.base/setvar.exp: Set target-charset to ASCII temporarily for some tests.
2014-04-17Automatic link generation by doxygenYao Qi2-7/+13
Nowadays, we have one page on "GDB Types" generated by doxygen, but types and macros referenced in doc are not linked to their definitions. This patch tweaks the comments a little to use doxygen syntax so that these types and macros are linked their definitions. Is it OK? gdb: 2014-04-17 Yao Qi <yao@codesourcery.com> * gdbtypes.h: Update comments to link to types and macros' definitions.
2014-04-17daily updateAlan Modra1-1/+1
2014-04-16Add the ChangeLog entry missed in 8000c58e455259951daa4370631aa616b367d1a7.Siva Chandra1-0/+4
2014-04-16Remove unused and incorrect macro TYPE_FN_FIELDS.Siva Chandra1-1/+0
* gdbtypes.h: Remove definition of the macro TYPE_FN_FIELDS.
2014-04-16PR gdb/15827Keith Seitz5-0/+118
Install some sanity checks that sibling DIE offsets are not beyond the defined limits of the DWARF input buffer in read_partial_die and skip_one_die. 2014-03-20 Keith Seitz <keiths@redhat.com> PR gdb/15827 * dwarf2read.c (skip_one_die): Check that all relative-offset sibling DIEs fall within range of the current reader's buffer. (read_partial_die): Likewise. 2014-03-20 Keith Seitz <keiths@redhat.com> PR gdb/15827 * gdb.dwarf2/corrupt.c: New file. * gdb.dwarf2/corrupt.exp: New file.
2014-04-16PR c++/16597Keith Seitz3-0/+18
[forgot to commit/push these with previous push] If lookup_symbol_file tries to locate a member variable with NULL name: /* A simple lookup failed. Check if the symbol was defined in a base class. */ cleanup = make_cleanup (null_cleanup, NULL); /* Find the name of the class and the name of the method, variable, etc. */ prefix_len = cp_entire_prefix_len (name); /* If no prefix was found, search "this". */ if (prefix_len == 0) { struct type *type; struct symbol *this; this = lookup_language_this (language_def (language_cplus), block); if (this == NULL) { do_cleanups (cleanup); return NULL; } type = check_typedef (TYPE_TARGET_TYPE (SYMBOL_TYPE (this))); klass = xstrdup (TYPE_NAME (type)); nested = xstrdup (name); } TYPE_NAME (type) is NULL, so xstrdup (NULL) and boom! This can happen, e.g., with clang++. See testsuite/gdb.cp/namelessclass.exp or the bugzilla report. This patch simply adds a fencepost against this case, allowing the caller of lookup_symbol_file to search other blocks for the right symbol.
2014-04-16PR c++/16597Keith Seitz3-0/+988
If lookup_symbol_file tries to locate a member variable with NULL name: /* A simple lookup failed. Check if the symbol was defined in a base class. */ cleanup = make_cleanup (null_cleanup, NULL); /* Find the name of the class and the name of the method, variable, etc. */ prefix_len = cp_entire_prefix_len (name); /* If no prefix was found, search "this". */ if (prefix_len == 0) { struct type *type; struct symbol *this; this = lookup_language_this (language_def (language_cplus), block); if (this == NULL) { do_cleanups (cleanup); return NULL; } type = check_typedef (TYPE_TARGET_TYPE (SYMBOL_TYPE (this))); klass = xstrdup (TYPE_NAME (type)); nested = xstrdup (name); } TYPE_NAME (type) is NULL, so xstrdup (NULL) and boom! This can happen, e.g., with clang++. See testsuite/gdb.cp/namelessclass.exp or the bugzilla report. This patch simply adds a fencepost against this case, allowing the caller of lookup_symbol_file to search other blocks for the right symbol.
2014-04-162014-04-16 Steve Ellcey <sellcey@mips.com>Steve Ellcey2-0/+5
* emultempl/elf32.em: Include safe-ctype.h.
2014-04-162014-04-16 Steve Ellcey <sellcey@mips.com>Steve Ellcey2-1/+5
* ldbuildid.c (generate_build_id): Add ATTRIBUTE_UNUSED to size arg.
2014-04-16Fix wrapper.exp testcase with stdio gdbserver.Doug Evans4-77/+50
* lib/gdbserver-support.exp (gdbserver_default_get_remote_address): Add comment. (gdbserver_default_get_comm_port): New function. (gdbserver_start): Check if board file provided "gdbserver,get_comm_port" and use it if so. * boards/native-stdio-gdbserver.exp (sockethost): Set to "". (gdb,socketport): Set to "stdio". (gdbserver,get_comm_port): Set to ${board}_get_comm_port. (stdio_gdbserver_template): Delete. (${board}_get_remote_address): Update. (${board}_build_remote_cmd): Delete. (${board}_get_comm_port): New function. (${board}_spawn): Update. * boards/remote-stdio-gdbserver.exp (${board}_build_remote_cmd): Delete. (${board}_get_remote_address): Update. (${board}_get_comm_port): New function.
2014-04-16gdb.base/memattr.exp regexp improvements.Andrew Burgess2-40/+80
https://sourceware.org/ml/gdb-patches/2014-04/msg00210.html Improve the regexp used in the memattr.exp test so allow for different memory regions (.data / .bss) being laid out in different orders. gdb/testsuite/ChangeLog: * gdb.base/memattr.exp: Improve regexps to handle memory regions appearing in any order.
2014-04-16Fix more fallout from TC_CONS_FIX_NEW changeAlan Modra3-2/+7
* config/tc-tilegx.h (TC_CONS_FIX_NEW): Add RELOC arg. * config/tc-tilepro.h (TC_CONS_FIX_NEW): Likewise.
2014-04-16Mach-O: Add objdump -P dyld_info to dump dyld data.Tristan Gingold4-8/+426
include/mach-o/ * loader.h: Add macros for rebase, bind and export constants. binutils/ * od-macho.c (OPT_DYLD_INFO): New macro. (options): Add entry for dyld_info. (mach_o_help): Likewise. (load_and_dump, dump_dyld_info_rebase, dump_dyld_info_bind) (dump_dyld_info_export_1, dump_dyld_info_export): New functions. (bfd_mach_o_dyld_rebase_type_name): New array. (export_info_data): New struct. (dump_dyld_info): Add verbose argument. Dump rebase, bind and exports data. (dump_load_command): Adjust dump_dyld_info call. (mach_o_dump): Handle dyld_info.
2014-04-16Mach-O: improve objdump -P load output.Tristan Gingold2-53/+57
binutils/ * od-macho.c (dump_header): Display sizeofcmds in decimal too. (dump_segment): Reformat output. (dump_dyld_info): Also display end offsets. (dump_load_command): Add IDX argument, display commands size and offset, reformat display. (dump_load_commands): Adjust for added argument.
2014-04-16Mach-O: add cpu and cpusubtype caps.Tristan Gingold4-2/+20
include/mach-o/ 2014-04-16 Tristan Gingold <gingold@adacore.com> * loader.h (BFD_MACH_O_CPU_ARCH_MASK, BFD_MACH_O_CPU_ARCH_ABI64) (BFD_MACH_O_CPU_SUBTYPE_MASK, BFD_MACH_O_CPU_SUBTYPE_LIB64): Define. bfd/ 2014-04-16 Tristan Gingold <gingold@adacore.com> * mach-o-x86-64.c (bfd_mach_o_x86_64_mkobject): Adjust cpusubtype flag.
2014-04-16fill ppc476 fixup areaAlan Modra2-2/+19
Stops false positive warnings from scanner. * elf32-ppc.c (ppc_elf_relocate_section): Fill 476 fixup area with "ba 0" rather than zeros.
2014-04-16daily updateAlan Modra1-1/+1
2014-04-15 * gdb.gdb/selftest.exp (do_steps_and_nexts): Don't referenceDoug Evans2-1/+12
uninitialized value of "description".
2014-04-152014-04-15 Sasa Stankovic <Sasa.Stankovic@imgtec.com>Cary Coutant3-19/+159
elfcpp/ * mips.h (R _MIPS16_TLS_GD, R_MIPS16_TLS_LDM, R_MIPS16_TLS_DTPREL_HI16, R_MIPS16_TLS_DTPREL_LO16, R_MIPS16_TLS_GOTTPREL, R_MIPS16_TLS_TPREL_HI16, R_MIPS16_TLS_TPREL_LO16, R_MICROMIPS_26_S1, R_MICROMIPS_HI16, R_MICROMIPS_LO16, R_MICROMIPS_GPREL16, R_MICROMIPS_LITERAL, R_MICROMIPS_GOT16, R_MICROMIPS_PC7_S1, R_MICROMIPS_PC10_S1, R_MICROMIPS_PC16_S1, R_MICROMIPS_CALL16, R_MICROMIPS_GOT_DISP, R_MICROMIPS_GOT_PAGE, R_MICROMIPS_GOT_OFST, R_MICROMIPS_GOT_HI16, R_MICROMIPS_GOT_LO16, R_MICROMIPS_SUB, R_MICROMIPS_HIGHER, R_MICROMIPS_HIGHEST, R_MICROMIPS_CALL_HI16, R_MICROMIPS_CALL_LO16, R_MICROMIPS_SCN_DISP, R_MICROMIPS_JALR, R_MICROMIPS_HI0_LO16, R_MICROMIPS_TLS_GD, R_MICROMIPS_TLS_LDM, R_MICROMIPS_TLS_DTPREL_HI16, R_MICROMIPS_TLS_DTPREL_LO16, R_MICROMIPS_TLS_GOTTPREL, R_MICROMIPS_TLS_TPREL_HI16, R_MICROMIPS_TLS_TPREL_LO16, R_MICROMIPS_GPREL7_S2, R_MICROMIPS_PC23_S20, R_MIPS_EH): New enums for relocations (mips16 and micromips). (STO_MIPS_FLAGS): New enum constant. (elf_st_is_mips16): New function. (elf_st_is_micromips): New function. (is_micromips): New function. (abi_n32): New function. (abi_n64): New function. (ODK_NULL, ODK_REGINFO, ODK_EXCEPTIONS, ODK_PAD, ODK_HWPATCH, ODK_FILL, ODK_TAGS, ODK_HWAND, ODK_HWOR, ODK_GP_GROUP, ODK_IDENT): New enum constants. * elfcpp.h (SHT_MIPS_OPTIONS): New enum constant.