aboutsummaryrefslogtreecommitdiff
path: root/gdb
AgeCommit message (Collapse)AuthorFilesLines
2013-06-24 * objfiles.h (pc_in_section): New prototype.Maciej W. Rozycki24-70/+120
(in_plt_section): Remove name argument, replace prototype with static inline function. * mips-tdep.h: Include "objfiles.h". (in_mips_stubs_section): New function. * hppa-tdep.h (gdbarch_tdep): Remove name argument of in_solib_call_trampoline member. (hppa_in_solib_call_trampoline): Remove name argument. * objfiles.c (pc_in_section): New function. (in_plt_section): Remove function. * mips-linux-tdep.c: Include "objfiles.h". (mips_linux_in_dynsym_stub): Call in_mips_stubs_section. Remove name argument. Return 1 rather than the low 16-bit halfword of any instruction examined. (mips_linux_in_dynsym_resolve_code): Update mips_linux_in_dynsym_stub call accordingly. * mips-tdep.c (mips_stub_frame_sniffer): Use in_mips_stubs_section rather than an equivalent hand-coded sequence. * hppa-hpux-tdep.c (in_opd_section): Remove function. (hppa32_hpux_in_solib_call_trampoline): Remove name argument. (hppa64_hpux_in_solib_call_trampoline): Likewise. (hppa64_hpux_find_global_pointer): Use pc_in_section rather than in_opd_section. * hppa-tdep.c (hppa_stub_unwind_sniffer): Remove name argument on call to tdep->in_solib_call_trampoline. (hppa_in_solib_call_trampoline): Remove name argument, update according to in_plt_section change. (hppa_skip_trampoline_code): Update according to in_plt_section change. * aarch64-tdep.c (aarch64_stub_unwind_sniffer): Likewise. * arm-symbian-tdep.c (arm_symbian_skip_trampoline_code): Likewise. * arm-tdep.c (arm_stub_unwind_sniffer): Likewise. * hppa-linux-tdep.c (hppa_linux_find_global_pointer): Likewise. * hppabsd-tdep.c (hppabsd_find_global_pointer): Likewise. * nios2-tdep.c (nios2_stub_frame_sniffer): Likewise. * nto-tdep.c (nto_relocate_section_addresses): Likewise. * s390-tdep.c (s390_stub_frame_sniffer): Likewise. * sh-tdep.c (sh_stub_unwind_sniffer): Likewise. * solib-dsbt.c (dsbt_in_dynsym_resolve_code): Likewise. * solib-frv.c (frv_in_dynsym_resolve_code): Likewise. * solib-svr4.c (svr4_in_dynsym_resolve_code): Likewise. * solib-target.c (solib_target_in_dynsym_resolve_code): Likewise. * sparc-tdep.c (sparc_analyze_prologue): Likewise. * tic6x-tdep.c (tic6x_stub_unwind_sniffer): Likewise.
2013-06-24Fix host_name and target_name generation by common/create-version.sh.Joel Brobecker2-2/+8
This new script has one small snafoo, which prevented the $host_alias and $target_alias from being expanded during the generation of the version.c file. As a result, the version info yields: This GDB was configured as "--host=$host_alias --target=$target_alias". ^^^^^^^^^^^ ^^^^^^^^^^^^^ This patch fixes this issue. gdb/ChangeLog: * common/create-version.sh: Fix expansion of $host_alias and $target_alias in generation of HOST_NAME and TARGET_NAME (resp.).
2013-06-24don't keep a gdb-specific dateTom Tromey12-29/+86
Right now there are two nightly commits to update a file in the tree with the current date. One commit is for BFD, one is for gdb. It seems unnecessary to me to do this twice. We can make do with a single such commit. This patch changes gdb in a minimal way to reuse the BFD date -- it extracts it from bfd/version.h and changes version.in to use the placeholder string "DATE" for those times when a date is wanted. I propose removing the cron job that updates the version on trunk, and then check in this patch. For release branches, we can keep the cron job, but just tell it to rewrite bfd/version.h. I believe this is a simple change in the crontab -- the script will work just fine on this file. This also moves version.in and version.h into common/, to reflect their shared status; and updates gdbserver to use version.h besides. * common/create-version.sh: New file. * Makefile.in (version.c): Use bfd/version.h, common/version.in, create-version.sh. (HFILES_NO_SRCDIR): Use common/version.h. * version.in: Move to ... * common/version.in: ... here. Replace date with "DATE". * version.h: Move to ... * common/version.h: ... here. gdbserver: * Makefile.in (version.c): Use bfd/version.h, common/version.in, create-version.sh. (version.o): Remove. * gdbreplay.c: Include version.h. (version, host_name): Don't declare. * server.h: Include version.h. (version, host_name): Don't declare. doc: * Makefile.in (POD2MAN1, POD2MAN5): Use version.subst. (GDBvn.texi): Use version.subst. (version.subst): New target. (mostlyclean): Remove version.subst.
2013-06-24*** empty log message ***gdbadmin1-1/+1
2013-06-23*** empty log message ***gdbadmin1-1/+1
2013-06-22*** empty log message ***gdbadmin1-1/+1
2013-06-21Update dates in relevant gdb/gnulib/ copyright headersJoel Brobecker4-3/+9
This patch is the result of re-running the copyright.py script in GDB, after we modified it to stop ignoring some files in gdb/gnulib that should have been updated earlier this year. gdb/ChangeLog: * gdb/gnulib/Makefile.in: Update date in copyright header. * gdb/gnulib/configure.ac: Ditto. * gdb/gnulib/update-gnulib.sh: Ditto.
2013-06-21copyright.py: Handle files in gdb/gnulib owned by GDB.Joel Brobecker2-1/+6
The script was excluding all of gdb/gnulib but this is no longer correct, ever since we moved the imported files to gdb/gnulib/import. As a result, a number of files (Makefile, etc, including this script itself) did not have their copyright header updated. This fixes the problem. gdb/ChangeLog: * copyright.py (EXCLUDE_LIST): Replace "gdb/gnulib" by "gdb/gnulib/import".
2013-06-21 * gdb.trace/actions.exp (check_tracepoint): Don't use a full fileTom Tromey2-1/+7
name in a test name.
2013-06-21gdb/doublest.c: Use frexpl rather than ldfrexp.Will Newton2-48/+7
Most modern systems have frexpl and gnulib provides an implementation for those that don't, so use it instead of the generic but inaccurate ldfrexp. gdb/ChangeLog: 2013-06-21 Will Newton <will.newton@linaro.org> * doublest.c (ldfrexp): Remove function. (convert_doublest_to_floatformat): Call frexpl instead of ldfrexp.
2013-06-21gdb/gnulib: Import frexpl.Will Newton32-140/+8701
gdb/ChangeLog: 2013-06-21 Will Newton <will.newton@linaro.org> * gnulib/update-gnulib.sh(IMPORTED_GNULIB_MODULES): Add frexpl. * gnulib/aclocal.m4: Regenerate. * gnulib/config.in: Regenerate. * gnulib/configure: Regenerate. * gnulib/import/Makefile.am: Update. * gnulib/import/Makefile.in: Update. * gnulib/import/m4/gnulib-cache.m4: Update. * gnulib/import/m4/gnulib-comp.m4: Update. * gnulib/import/float+.h: Import. * gnulib/import/float.c: Import. * gnulib/import/float.in.h: Import. * gnulib/import/fpucw.h: Import. * gnulib/import/frexp.c: Import. * gnulib/import/frexpl.c: Import. * gnulib/import/isnan.c: Import. * gnulib/import/isnand-nolibm.h: Import. * gnulib/import/isnand.c: Import. * gnulib/import/isnanl-nolibm.h: Import. * gnulib/import/isnanl.c: Import. * gnulib/import/itold.c: Import. * gnulib/import/m4/exponentd.m4: Import. * gnulib/import/m4/exponentl.m4: Import. * gnulib/import/m4/float_h.m4: Import. * gnulib/import/m4/fpieee.m4: Import. * gnulib/import/m4/frexp.m4: Import. * gnulib/import/m4/frexpl.m4: Import. * gnulib/import/m4/isnand.m4: Import. * gnulib/import/m4/isnanl.m4: Import. * gnulib/import/m4/math_h.m4: Import. * gnulib/import/math.c: Import. * gnulib/import/math.in.h: Import.
2013-06-21gdb/Jan Kratochvil2-7/+8
* common/linux-btrace.c (cpu_supports_btrace): Remove variable vendor, replace strcmp with signature_INTEL_ebx, signature_INTEL_ecx and signature_INTEL_edx comparisons.
2013-06-21*** empty log message ***gdbadmin1-1/+1
2013-06-20 symtab/15652Doug Evans2-10/+46
* dwarf2read.c (try_open_dwop_file): New arg search_cwd. All callers updated. (open_dwp_file): If we can't find the dwp file, search the basename in debug-file-directory.
2013-06-20 * dwarf2read.c (struct dwp_file): Fix comment.Doug Evans2-3/+5
(open_and_init_dwp_file): Set dwp_file->name to bfd's file name.
2013-06-20 * source.c (openp): Document OPF_TRY_CWD_FIRST+OPF_SEARCH_IN_PATHDoug Evans2-3/+9
better.
2013-06-20gdb/Yao Qi2-29/+33
* breakpoint.c (create_breakpoint): Fix code indentation.
2013-06-20gdb/Yao Qi2-4/+9
* breakpoint.c (create_breakpoints_sal_default): Remove parameter 'lsal'. Update declaration. (bkpt_create_breakpoints_sal): Caller update. (tracepoint_create_breakpoints_sal): Likewise.
2013-06-20Teach -data-list-register-values to not include unavailable registersYao Qi9-16/+123
This patch adds an option --skip-unavailable to MI command -data-list-register-values, so that unavailable registers are not displayed (on the context of traceframes). The old -data-list-register-values command behaves like -data-list-register-values x 0 8 ^done,register-values=[{number="0",value="<unavailable>"},{number="8",value="0x80483de"}] With this patch, an option --skip-unavailable is added, -data-list-register-values --skip-unavailable x 0 8 ^done,register-values=[{number="8",value="0x80483de"}] gdb: 2013-06-20 Pedro Alves <pedro@codesourcery.com> Yao Qi <yao@codesourcery.com> * NEWS: Mention the new option '--skip-unavailable' of command -data-list-register-values. * mi/mi-main.c (mi_cmd_data_list_register_values): Accept the --skip-unavailable option. Adjust to use output_register. (output_register): Add new 'skip_unavailable' parameter. Handle it. gdb/doc: 2013-06-20 Pedro Alves <pedro@codesourcery.com> * gdb.texinfo (GDB/MI Data Manipulation) <-data-list-register-values>: Document the --skip-unavailable option. gdb/testsuite: 2013-06-20 Yao Qi <yao@codesourcery.com> * gdb.trace/mi-trace-unavailable.exp: Set tracepoint on 'foo' and set an action. (test_trace_unavailable): Test command -data-list-register-values in the context of traceframe and with option --skip-unavailable. * gdb.trace/trace-unavailable.c (foo): New. (main): Call it. * gdb.mi/gdb2549.exp: Update matching pattern.
2013-06-20*** empty log message ***gdbadmin1-1/+1
2013-06-19gdb: clean up x86 cpuid implementationsMike Frysinger11-70/+231
We've currently got 3 files doing open coded implementations of cpuid. Each has its own set of workarounds and varying levels of how well they're written and are generally hardcoded to specific cpuid functions. If you try to build the latest gdb as a PIE on an i386 system, the build will fail because one of them lacks PIC workarounds (wrt ebx). Specifically, we have: common/linux-btrace.c: two copies of cpuid asm w/specific args, one has no workarounds while the other implicitly does to avoid memcpy go32-nat.c: two copies of cpuid asm w/specific args, one has workarounds to avoid memcpy gdb/testsuite/gdb.arch/i386-cpuid.h: one general cpuid asm w/many workarounds copied from older gcc Fortunately, that last header there is pretty damn good -- it handles lots of edge cases, the code is nice & tight (uses gcc asm operands rather than manual movs), and is already almost a general library type header. It's also the basis of what is now the public cpuid.h that is shipped with gcc-4.3+. So what I've done is pull that test header out and into gdb/common/ (not sure if there's a better place), synced to the version found in gcc-4.8.0, put a wrapper API around it, and then cut over all the existing call points to this new header. Since the func already has support for "is cpuid supported on this proc", it makes it trivial to push the i386/x86_64 ifdefs down into this wrapper API too. Now it can be safely used for all targets and gcc will elide the unused code for us. I've verified the gdb.arch testsuite still passes, and this code compiles for an armv7a host as well as x86_64. The go32-nat code has been left ifdef-ed out until someone can test & verify the new stuff works (and if it doesn't, figure out how to make the new code work). URL: https://bugs.gentoo.org/467806 Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2013-06-19 * symfile.c (symfile_bfd_open): Delete unnecessary declaration.Doug Evans2-4/+5
(get_section_index): Ditto.
2013-06-19 * gdb.base/subst.exp: Delete default rules before furtherLuis Machado2-0/+11
tests.
2013-06-19 * breakpoint.c (_initialize_breakpoint): Remove trailing \n fromTom Tromey2-2/+6
"dprintf" help.
2013-06-19gdb/testsuite/Yao Qi2-0/+9
* gdb.base/maint.exp: Make the test to command 'maint dump-me' unsupported if it is not registered.
2013-06-19 * dwarf2read.c (dw2_symtab_iter_next): Check value of cu_indexDoug Evans2-10/+41
before using it. (dw2_expand_symtabs_matching): Fix symbol kind validity check. Move test of cu_index closer to use. Print complaint if cu_index is bad.
2013-06-19Fix this entry:Doug Evans1-1/+1
- * dwarf2read.c (dwarf2_per_objfile): Replace uses of + * dwarf2read.c (dwarf2_per_objfile_free): Replace uses of
2013-06-19*** empty log message ***gdbadmin1-1/+1
2013-06-18[Darwin] Fix cleanup leak in machoread.c:macho_symfile_readJoel Brobecker2-26/+35
This patch fixes a cleanup leak in macho_symfile_read (symbol_table): symbol_table = (asymbol **) xmalloc (storage_needed); make_cleanup (xfree, symbol_table); Unfortunately, fixing the leak alone triggers a crash which occurs while loading the symbols from an executable: % gdb (gdb) file g_exe [SIGSEGV] The crash is caused by the fact that performing the cleanup right after the call to macho_symtab_read, as currently done, is too early. Indeed, references to this symbol_table get saved in the oso_vector global during the call to macho_symtab_read via calls to macho_register_oso, and those references then get accessed later on, when processing all the OSOs that got pushed (see call to macho_symfile_read_all_oso). This patch prevents this by using one single cleanup queue for the entire function, rather than having additional separate cleanup queues (Eg: for the handling of the minimal symbols), thus preventing the premature free'ing of the minimal_symbols array. Secondly, this patch takes this opportunity for avoiding the use of the oso_vector global, thus making it simpler to track its lifetime. gdb/ChangeLog: * machoread.c (oso_vector): Delete this global. (macho_register_oso): Add new parameter "oso_vector_ptr". Use it instead of the "oso_vector" global. (macho_symtab_read, macho_symfile_read_all_oso): Likewise. (macho_symfile_read): Use a local oso_vector, to be free'ed at the end of this function, in place of the old "oso_vector" global. Update various function calls accordingly. Use one single cleanup chain for the entire function.
2013-06-18do not use dwarf2_per_objfile in dwarf2_per_objfile_free.Joel Brobecker2-6/+10
This patch fixes a case of multiple calls freeing the same data while free-ing objfiles that have child objfiles (separate debug info, as is the case on Darwin targets). Following the code, free_objfile_separate_debug iterates over all child objfiles of the parent objfile, calling free_objfile: for (child = objfile->separate_debug_objfile; child;) { struct objfile *next_child = child->separate_debug_objfile_link; free_objfile (child); child = next_child; } This causes, among other things, the free'ing of the child objfile's private data: /* Discard any data modules have associated with the objfile. The function still may reference objfile->obfd. */ objfile_free_data (objfile); This indirectly calls(back) dwarf2_per_objfile_free, which tries to free the dwarf2read-specific data by using the dwarf2_per_objfile global, eg: for (ix = 0; ix < dwarf2_per_objfile->n_comp_units; ++ix) Even if we were lucky enough the first time around that this global actually corresponds to the objfile being destroyed, the global will still have the same value at the second iteration, and thus become dangling. Indeed, after dwarf2_per_objfile_free returns eventually back to free_objfile, free_objfile then deallocates its objfile_obstack, where the dwarf2_per_objfile is allocated. Ironically, there should be no need to access that global at all, here, since the data is passed as an argument of the callback. And it looks like the dwo/dwp/[...]-handling code is in fact already using that argument, rather than the global. This patch thus fixes the problem by doing the same, replacing all references to DWARF2_PER_OBJFILE by uses of DATA instead. gdb/ChangeLog: * dwarf2read.c (dwarf2_per_objfile): Replace uses of DWARF2_PER_OBJFILE by uses of DATA instead.
2013-06-18Fix PR cli/15603Tom Tromey8-14/+138
This fixes PR cli/15603. The bug here is that when a software watchpoint is being used, gdb will stop responding to C-c. This is a regression caused by the "catch signal" patch. The problem is that software watchpoints always end up on the bpstat list. However, this makes bpstat_explains_signal return BPSTAT_SIGNAL_HIDE, causing infrun to think that the signal is not a "random signal". The fix is to change bpstat_explains_signal to handle this better. I chose to do it in a "clean API" way, by passing the signal value to bpstat_explains_signal and then adding an explains_signal method for watchpoints, which handles the specifics. Built and regtested on x86-64 Fedora 18. New test case included. * break-catch-sig.c (signal_catchpoint_explains_signal): Add 'sig' argument. * breakpoint.c (bpstat_explains_signal): Add 'sig' argument. Special case signals other than GDB_SIGNAL_TRAP. (explains_signal_watchpoint): New function. (base_breakpoint_explains_signal): Add 'sig' argument. (initialize_breakpoint_ops): Set 'explains_signal' method for watchpoints. * breakpoint.h (struct breakpoint_ops) <explains_signal>: Add signal argument. (bpstat_explains_signal): Likewise. * infrun.c (handle_syscall_event, handle_inferior_event): Update. * gdb.base/random-signal.c: New file. * gdb.base/random-signal.exp: New file.
2013-06-18 * python/py-inferior.c (gdbpy_selected_inferior): Don't incref.Tom Tromey2-6/+5
2013-06-18 * python/python.c (finish_python_initialization): DecrefTom Tromey2-2/+6
'pythondir' on failure path as well.
2013-06-18testsuite/gdb.base: Make skip test use defined behaviour.Will Newton3-4/+12
The skip test currently relies on the order of evaluation of arguments which is not defined. Use the comma operator where order is defined instead. gdb/testsuite/ChangeLog: 2013-06-18 Will Newton <will.newton@linaro.org> * gdb.base/skip.c: Use comma to evaluate results of foo() and bar() before passing to baz(). * gdb.base/skip.c: baz() now takes one argument instead of two.
2013-06-18Fix PR symtab/15391Tom Tromey8-5/+194
PR symtab/15391 is a failure with the DW_OP_GNU_implicit_pointer feature. I tracked it down to a logic error in read_pieced_value. The code truncates this_size_bits according to the type size and offset too early -- it should do it after taking bits_to_skip into account. This patch fixes the bug. While testing this, I also tripped across a latent bug because indirect_pieced_value does not sign-extend where needed. This patch fixes this bug as well. Finally, Pedro pointed out that a previous version implemented sign extension incorrectly. This version introduces a new gdb_sign_extend function for this. A couple of notes on this function: * It has the gdb_ prefix to avoid clashes with various libraries that felt free to avoid proper namespacing. There is a "sign_extend" function in a Tile GX header, in an SOM-related BFD header (and in sh64-tdep.c and as a macro in arm-wince-tdep.c, but those are ours...) * I looked at all the sign extensions in gdb and didn't see ones that I felt comfortable converting to use this function; in large part because I don't have a good way to test the conversion. Built and regtested on x86-64 Fedora 18. New test cases included; this required a minor addition to the DWARF assembler. Note that the DWARF CU made by implptrpiece.exp uses a funny pointer size in order to show the sign-extension bug on all platforms. * dwarf2loc.c (read_pieced_value): Truncate this_size_bits after taking bits_to_skip into account. Sign extend byte_offset. * utils.h (gdb_sign_extend): Declare. * utils.c (gdb_sign_extend): New function. * gdb.dwarf2/implptrpiece.exp: New file. * gdb.dwarf2/implptrconst.exp (d): New variable. Print d. * lib/dwarf2.exp (Dwarf::_location): Handle DW_OP_piece.
2013-06-18gdb/Jan Kratochvil2-0/+10
* dwarf2read.c (write_psymtabs_to_index): Ignore NULL PSYMTAB.
2013-06-18fix python-selftest.exp failure with gdbserverTom Tromey5-15/+14
python-selftest.exp fails with an error when using the native-gdbserver.exp board. The bug is that the selftest code doesn't work in this situation. It never has. This patch fixes the problem by pushing the needed check into do_self_tests. This helps prevent the problem in the future. * lib/selftest-support.exp (do_self_tests): Reject remote or non-native targets. * gdb.gdb/complaints.exp: Remove check. * gdb.gdb/observer.exp: Remove check. * gdb.gdb/xfullpath.exp: Remove check. * gdb.gdb/complaints.exp: Remove check.
2013-06-18*** empty log message ***gdbadmin1-1/+1
2013-06-17 * corelow.c (core_open): Print GDB signal name instead of targetPierre Muller2-2/+7
signal number.
2013-06-17gdb: ignore generated gcoreMike Frysinger2-0/+5
2013-06-17*** empty log message ***gdbadmin1-1/+1
2013-06-16*** empty log message ***gdbadmin1-1/+1
2013-06-15*** empty log message ***gdbadmin1-1/+1
2013-06-14*** empty log message ***gdbadmin1-1/+1
2013-06-13 * dwarf2read.c (try_open_dwop_file): Work around behaviour ofDoug Evans2-7/+21
OPF_TRY_CWD_FIRST to not search path if the file contains a '/'.
2013-06-13*** empty log message ***gdbadmin1-1/+1
2013-06-12[GDBserver] Fix gdb.threads/siginfo-threads.exp, gdb.base/siginfo-obj.exp ↵Pedro Alves2-3/+11
regressions. This fixes the regressions reported at <http://sourceware.org/ml/gdb-patches/2013-06/msg00280.html>: $ runtest-gdbserver gdb.base/siginfo-obj.exp gdb.base/siginfo-thread.exp gdb.threads/siginfo-threads.exp Running ./gdb.base/siginfo-thread.exp ... FAIL: gdb.base/siginfo-thread.exp: p ssi_addr Running ./gdb.threads/siginfo-threads.exp ... FAIL: gdb.threads/siginfo-threads.exp: signal 0 si_pid FAIL: gdb.threads/siginfo-threads.exp: signal 1 si_pid FAIL: gdb.threads/siginfo-threads.exp: signal 2 si_pid FAIL: gdb.threads/siginfo-threads.exp: signal 3 si_pid Running ./gdb.base/siginfo-obj.exp ... FAIL: gdb.base/siginfo-obj.exp: p ssi_addr FAIL: gdb.base/siginfo-obj.exp: p ssi_addr The multi-arch patch made GDBserver do the the wrong siginfo layout conversion, because most uses of `linux_is_elf64' were removed, and it ended up never set. A global really is the wrong thing to use as elf64-ness is a per-process property; `linux_is_elf64' was just accidentally left behind. Tested on x86_64 Fedora 17. gdb/gdbserver/ 2013-06-12 Pedro Alves <palves@redhat.com> * linux-x86-low.c (linux_is_elf64): Delete global. (x86_siginfo_fixup): Replace reference to `linux_is_elf64' global with local linux_pid_exe_is_elf_64_file use.
2013-06-122013-06-12 Phil Muldoon <pmuldoon@redhat.com>Phil Muldoon2-11/+15
* stack.c (backtrace_command_1): Fix indentation.
2013-06-12*** empty log message ***gdbadmin1-1/+1
2013-06-11Lazily allocate 'struct regsets_info'::disabled_regsets.Pedro Alves3-14/+39
There's no need for every arch to pre-allocate disabled_regsets. Chances are the array won't be used. (I have a hunch that with some more work we could dispense with initialize_regsets_info.) Tested on x86_64 Fedora 17 w/ -lmcheck. gdb/gdbserver/ 2013-06-11 Pedro Alves <palves@redhat.com> * linux-low.c (regset_disabled, disable_regset): New functions. (regsets_fetch_inferior_registers) (regsets_store_inferior_registers): Use them. (initialize_regsets_info); Don't allocate the disabled_regsets array here. * linux-low.h (struct regsets_info) <disabled_regsets>: Extend comment.