aboutsummaryrefslogtreecommitdiff
path: root/gdb
AgeCommit message (Collapse)AuthorFilesLines
2015-01-21Add myself as write-after-approval GDB maintainer.Wei-cheng Wang2-0/+5
gdb/ChangeLog: * MAINTAINERS (Write After Approval): Add "Wei-cheng Wang".
2015-01-21Add missing comments in rs6000-tdep.c, ppc64-tdep.c and ppc-linux-tdep.c.Wei-cheng Wang4-13/+70
gdb/ChangeLog: * ppc-linux-tdep.c (ppc_skip_trampoline_code, ppc_canonicalize_syscall, ppc_linux_syscall_record, ppc_linux_record_signal, ppc_init_linux_record_tdep): Add comments. * ppc64-tdep.c (ppc64_skip_trampoline_code): Likewise. * rs6000-tdep.c (rs6000_epilogue_frame_cache, rs6000_epilogue_frame_this_id, rs6000_epilogue_frame_prev_register, rs6000_epilogue_frame_sniffer, ppc_record_vsr, ppc_process_record_op4, ppc_process_record_op19, ppc_process_record_op31, ppc_process_record_op59, ppc_process_record_op60, ppc_process_record_op63): Likewise.
2015-01-20gdb/ARI: Call safe_strerror instead of strerror in linux-ptrace.cJoel Brobecker2-8/+14
gdb/ChangeLog: * nat/linux-ptrace.c (linux_ptrace_attach_fail_reason_string) (linux_ptrace_test_ret_to_nx): Use safe_strerror instead of strerror.
2015-01-20Fix date in gdb/ChangeLog.Joel Brobecker1-1/+1
2015-01-20Fix format warning in rs6000t-dep.cWei-cheng Wang2-17/+25
2015-01-20Add myself as write-after-approval GDB maintainer.Chen Gang2-0/+5
gdb/ChangeLog: * MAINTAINERS (Write After Approval): Add "Chen Gang".
2015-01-19Don't use windows-termcap.c when linking against a curses libraryEli Zaretskii4-6/+25
gdb/ 2015-01-17 Eli Zaretskii <eliz@gnu.org> * configure.ac [*mingw32*]: Only add windows-termcap.o to CONFIG_OBS if not building with a curses library. * configure: Regenerate. * windows-termcap.c: Include defs.h. Make the whole body empty if either one of HAVE_CURSES_H or HAVE_NCURSES_H or HAVE_NCURSES_NCURSES_H is defined.
2015-01-19Fix ARI warning in rs6000-tdep.c::rs6000_gdbarch_init.Joel Brobecker2-2/+7
gdb/ChangeLog: * rs6000-tdep.c (rs6000_gdbarch_init): Move divide operator from end of line to start of next line.
2015-01-17Skip-trampoline for PowerPC reverse-stepping.Wei-cheng Wang3-47/+105
2015-01-17Reverse debugging for PowerPC.Wei-cheng Wang7-3/+2111
2015-01-17Epilogue unwinder for PowerPC.Wei-cheng Wang2-4/+107
2015-01-16Really add a prototype for tui_rehighlight_all.Eli Zaretskii1-0/+1
2015-01-16Fix nat/linux-personality.c regression on RHEL-5Sergio Durigan Junior2-1/+8
This commit fixes the regression on RHEL-5 systems introduced by nat/linux-personality.c's check of HAVE_DECL_ADDR_NO_RANDOMIZE. RHEL-5 systems define HAVE_DECL_ADDR_NO_RANDOMIZE as zero, so we cannot use #ifndef; instead this patch uses the "#if !" construction. The regression was reported by Ulrich Weigand here: <https://sourceware.org/ml/gdb-patches/2015-01/msg00458.html> gdb/ChangeLog 2015-01-16 Sergio Durigan Junior <sergiodj@redhat.com> * nat/linux-personality.c: Replace "#ifndef HAVE_DECL_ADDR_NO_RANDOMIZE" by "#if !HAVE_DECL_ADDR_NO_RANDOMIZE", fixing a regression in RHEL-5 systems.
2015-01-16Fix an erroneous commentary.Eli Zaretskii2-1/+3
gdb/ 2015-01-16 Eli Zaretskii <eliz@gnu.org> * tui/tui-win.c (tui_set_tab_width_command): Fix the commentary.
2015-01-16Make setting TUI border attributes take effect immediatelyEli Zaretskii3-3/+29
gdb/ 2015-01-16 Eli Zaretskii <eliz@gnu.org> * tui/tui-win.c (tui_rehighlight_all, tui_set_var_cmd): New functions. (_initialize_tui_win) <border-kind, border-mode>: <active-border-mode>: Use tui_set_var_cmd as the "set" function. * tui/tui-win.h: Add prototype for tui_rehighlight_all.
2015-01-16Make the change of tab size in TUI mode effective immediatelyEli Zaretskii2-1/+24
gdb/ChangeLog: 2015-01-16 Eli Zaretskii <eliz@gnu.org> * tui/tui-win.c (tui_set_tab_width_command): Delete and recreate the source and the disassembly windows, to show the effect of the changed tab size immediately.
2015-01-16Fix TUI-related documentation.Eli Zaretskii4-4/+17
tui/tui-win.c (tui_scroll_left_command, tui_scroll_right_command): Doc fix. doc/gdb.texinfo (TUI Commands): Document the possible values of NAME argument to 'winheight' command. Explain the effect of 'tabset' setting better.
2015-01-16Leave more space in TUI mode for thread ID.Eli Zaretskii2-2/+8
gdb/tui/tui-data.h (LINE_PREFIX): Make shorter (MAX_PID_WIDTH): Enlarge from 14 to 19, to leave enough space for "Thread NNNNN.XXXX" thread ID notation on Windows.
2015-01-16Fix gcc-5 compilationJan Kratochvil2-1/+6
With gcc-5.0 pre-release one gets: hppa-tdep.c: In function ‘inst_saves_gr’: hppa-tdep.c:1406:30: error: comparison of constant ‘9’ with boolean expression is always false [-Werror=bool-compare] I find the misplaced parentheses obvious. gdb/ChangeLog 2015-01-16 Jan Kratochvil <jan.kratochvil@redhat.com> Fix gcc-5 compilation. * hppa-tdep.c (inst_saves_gr): Fix parentheses typo.
2015-01-15Move code to disable ASR to nat/Sergio Durigan Junior29-84/+213
This patch moves the shared code present on gdb/linux-nat.c:linux_nat_create_inferior and gdb/gdbserver/linux-low.c:linux_create_inferior to nat/linux-personality.c. This code is responsible for disabling address space randomization based on user setting, and using <sys/personality.h> to do that. I decided to put the prototype of the maybe_disable_address_space_randomization on nat/linux-osdata.h because it seemed the best place to put it. I regression-tested this patch on Fedora 20 x86_64, and found no regressions. gdb/ChangeLog 2015-01-15 Sergio Durigan Junior <sergiodj@redhat.com> * Makefile.in (HFILES_NO_SRCDIR): Add nat/linux-personality.h. (linux-personality.o): New rule. * common/common-defs.h: Include <stdint.h>. * config/aarch64/linux.mh (NATDEPFILES): Include linux-personality.o. * config/alpha/alpha-linux.mh (NATDEPFILES): Likewise. * config/arm/linux.mh (NATDEPFILES): Likewise. * config/i386/linux64.mh (NATDEPFILES): Likewise. * config/i386/linux.mh (NATDEPFILES): Likewise. * config/ia64/linux.mh (NATDEPFILES): Likewise. * config/m32r/linux.mh (NATDEPFILES): Likewise. * config/m68k/linux.mh (NATDEPFILES): Likewise. * config/mips/linux.mh (NATDEPFILES): Likewise. * config/pa/linux.mh (NATDEPFILES): Likewise. * config/powerpc/linux.mh (NATDEPFILES): Likewise. * config/powerpc/ppc64-linux.mh (NATDEPFILES): Likewise. * config/powerpc/spu-linux.mh (NATDEPFILES): Likewise. * config/s390/linux.mh (NATDEPFILES): Likewise. * config/sparc/linux64.mh (NATDEPFILES): Likewise. * config/sparc/linux.mh (NATDEPFILES): Likewise. * config/tilegx/linux.mh (NATDEPFILES): Likewise. * config/xtensa/linux.mh (NATDEPFILES): Likewise. * defs.h: Remove #include <stdint.h> (moved to common/common-defs.h). * linux-nat.c: Include nat/linux-personality.h. Remove #include <sys/personality.h>; do not define ADDR_NO_RANDOMIZE (moved to nat/linux-personality.c). (linux_nat_create_inferior): Remove code to disable address space randomization (moved to nat/linux-personality.c). Create cleanup to disable address space randomization. * nat/linux-personality.c: New file. * nat/linux-personality.h: Likewise. gdb/gdbserver/ChangeLog 2015-01-15 Sergio Durigan Junior <sergiodj@redhat.com> * Makefile.in (SFILES): Add linux-personality.c. (linux-personality.o): New rule. * configure.srv (srv_linux_obj): Add linux-personality.o to the list of objects to be built. * linux-low.c: Include nat/linux-personality.h. (linux_create_inferior): Remove code to disable address space randomization (moved to ../nat/linux-personality.c). Create cleanup to disable address space randomization.
2015-01-15Move safe_strerror to common/Sergio Durigan Junior16-73/+212
This patch moves safe_strerror from the gdb/{posix,mingw}-hdep.c files to the respective common/{posix,mingw}-strerror.c files. This is a preparation for the next patch, which shares a common code (to disable address space randomization when creating a new inferior). The patch has been regtested on Fedora 20 x86_64, and no regressions were found. gdb/ChangeLog 2015-01-15 Sergio Durigan Junior <sergiodj@redhat.com> * Makefile.in (ALLDEPFILES): Including common/mingw-strerror.c and common/posix-strerror.c. (posix-strerror.o): New rule. (mingw-strerror.o): Likewise. * common/common-utils.h (safe_strerror): Move prototype to here, from utils.h. * common/common.host: New file. * common/mingw-strerror.c: Likewise. * common/posix-strerror.c: Likewise. * configure: Regenerated. * configure.ac: Source common/common.host. Add variable common_host_obs to gdb_host_obs. * contrib/ari/gdb_ari.sh: Mention gdb/common/mingw-strerror.c and gdb/common/posix-strerror.c when warning about the use of strerror. * mingw-hdep.c (safe_strerror): Remove definition; move it to common/mingw-strerror.c. * posix-hdep.c (safe_strerror): Remove definition; move it to common/posix-hdep.c. * utils.h (safe_strerror): Remove prototype; move to common/common-utils.h. gdb/gdbserver/ChangeLog 2015-01-15 Sergio Durigan Junior <sergiodj@redhat.com> * Makefile.in (posix-strerror.o): New rule. (mingw-strerror.o): Likewise. * configure: Regenerated. * configure.ac: Source file ../common/common.host. Initialize new variable srv_host_obs. Add srv_host_obs to GDBSERVER_DEPFILES.
2015-01-15Skip two more attach tests when testing against stub-like targetsDon Breazeal3-8/+17
This patch updates two attach tests to use utility procs for checking if the attach test should run and for launching the program to be attached, as follows: 1) Use can_spawn_for_attach instead of is_remote target 2) Use spawn_wait_for_attach instead of exec/sleep Tested (1) with i686-mingw32 host and i686-pc-linux-gnu build/target and both with x86_64 Ubuntu. gdb/testsuite/ChangeLog: * gdb.base/attach-pie-noexec.exp: Use can_spawn_for_attach instead of checking whether the target board is remote and use spawn_wait_for_attach instead of exec/sleep. * gdb.base/attach-twice.exp: Likewise.
2015-01-15Document the GDB 7.8.2 release in gdb/ChangeLogJoel Brobecker1-0/+4
gdb/ChangeLog: GDB 7.8.2 released.
2015-01-15[Ada] 'first/'last/'length of array whose bound is a discriminantJoel Brobecker7-2/+143
Consider the following code: type Table is array (Positive range <>) of Integer; type Object (N : Integer) is record Data : Table (1 .. N); end record; My_Object : Object := (N => 3, Data => (3, 5, 8)); Trying to print the range and length of the My_Object.Data array yields: (gdb) print my_object.data'first $1 = 1 (gdb) print my_object.data'last $2 = 0 (gdb) print my_object.data'length $3 = 0 The first one is correct, and that is thanks to the fact that the lower bound is statically known. However, for the upper bound, and consequently the array's length, the values are incorrect. It should be: (gdb) print my_object.data'last $2 = 3 (gdb) print my_object.data'length $3 = 3 What happens here is that ada_array_bound_from_type sees that our array has a parallel "___XA" type, and therefore tries to use it. In particular, it described our array's index type as: [...]___XDLU_1__n, which means lower bound = 1, and upper bound is value of "n". Unfortunately, ada_array_bound_from_type does not have access to the discriminant, and is therefore unable to compute the bound correctly. Fortunately, at this stage, the bound has already been computed a while ago, and therefore doesn't need to be re-computed here. This patch fixes the issue by ignoring that ___XA type if the array is marked as already fixed. This also fixes the same issue with packed arrays. gdb/ChangeLog: * ada-lang.c (ada_array_bound_from_type): Ignore array's parallel ___XA type if the array has already been fixed. gdb/testsuite/ChangeLog: * gdb.ada/var_arr_attrs: New testcase.
2015-01-14Detect 64-bit-ness in PowerPC Book III-EYao Qi16-11/+127
This patch is to teach both GDB and GDBServer to detect 64-bit inferior correctly. We find a problem that GDBServer is unable to detect on a e5500 core processor. Current GDBServer assumes that MSR is a 64-bit register, but MSR is a 32-bit register in Book III-E. This patch is to fix this problem by checking the right bit in MSR, in order to handle both Book III-S and Book III-E. In order to detect Book III-S and Book III-E, we check the PPC_FEATURE_BOOKE from the host's HWCAP (by getauxval on glibc >= 2.16. If getauxval doesn't exist, we implement the fallback by parsing /proc/self/auxv), because it should an invariant on the same machine cross different processes. In order to share code, I add nat/ppc-linux.c for both GDB and GDBserver side. gdb: 2015-01-14 Yao Qi <yao@codesourcery.com> * Makefile.in (ppc-linux.o): New rule. * config/powerpc/ppc64-linux.mh (NATDEPFILES): Add ppc-linux.o. * configure.ac: AC_CHECK_FUNCS(getauxval). * config.in: Re-generated. * configure: Re-generated. * nat/ppc-linux.h [__powerpc64__] (ppc64_64bit_inferior_p): Declare. * nat/ppc-linux.c: New file. * ppc-linux-nat.c (ppc_linux_target_wordsize) [__powerpc64__]: Call ppc64_64bit_inferior_p. gdb/gdbserver: 2015-01-14 Yao Qi <yao@codesourcery.com> * Makefile.in (SFILES): Add nat/ppc-linux.c. (ppc-linux.o): New rule. * configure.srv (powerpc*-*-linux*): Add ppc-linux.o. * configure.ac: AC_CHECK_FUNCS(getauxval). * config.in: Re-generated. * configure: Re-generated. * linux-ppc-low.c (ppc_arch_setup) [__powerpc64__]: Call ppc64_64bit_inferior_p
2015-01-14Move some ppc macros to nat/ppc-linux.hYao Qi6-81/+111
When I use PPC_FEATURE_BOOKE in GDBserver, I find it is defined in GDB but not in GDBserver. After taking a further look, I find some macros are duplicated between ppc-linux-nat.c and linux-ppc-low.c, so this patch is to move them into nat/ppc-linux.h. gdb/gdbserver: 2015-01-14 Yao Qi <yao@codesourcery.com> * linux-ppc-low.c: Include "nat/ppc-linux.h". (PPC_FEATURE_HAS_VSX): Move to nat/ppc-linux.h. (PPC_FEATURE_HAS_ALTIVEC, PPC_FEATURE_HAS_SPE): Likewise. (PT_ORIG_R3, PT_TRAP): Likewise. (PTRACE_GETVSXREGS, PTRACE_SETVSXREGS): Likewise. (PTRACE_GETVRREGS, PTRACE_SETVRREGS): Likewise. (PTRACE_GETEVRREGS, PTRACE_SETEVRREGS): Likewise. gdb: 2015-01-14 Yao Qi <yao@codesourcery.com> * ppc-linux-nat.c (PT_ORIG_R3, PT_TRAP): Move to nat/ppc-linux.h. (PPC_FEATURE_CELL, PPC_FEATURE_BOOKE): Likewise. (PPC_FEATURE_HAS_DFP): Likewise. (PTRACE_GETVRREGS, PTRACE_SETVRREGS): Likewise. (PTRACE_GETVSXREGS, PTRACE_SETVSXREGS): Likewise. (PTRACE_GETEVRREGS, PTRACE_SETEVRREGS): Likewise. Include "nat/ppc-linux.h". * nat/ppc-linux.h: New file. * Makefile.in (HFILES_NO_SRCDIR): Add nat/ppc-linux.h.
2015-01-14PR17525 - breakpoint commands not executed when program run from -x scriptPedro Alves6-2/+147
Executing a gdb script that runs the inferior (from the command line with -x), and has it hit breakpoints with breakpoint commands that themselves run the target, is currently broken on async targets (Linux, remote). While we're executing a command list or a script, we force the interpreter to be sync, which results in some functions nesting an event loop and waiting for the target to stop, instead of returning immediately and having the top level event loop handle the stop. The issue with this bug is simply that bpstat_do_actions misses checking whether the interpreter is sync. When we get here, in the case of executing a script (or, when the interpreter is sync), the program has already advanced to the next breakpoint, through maybe_wait_sync_command_done. We need to process its breakpoints immediately, just like with a sync target. Tested on x86_64 Fedora 20. gdb/ 2015-01-14 Pedro Alves <palves@redhat.com> PR gdb/17525 * breakpoint.c: Include "interps.h". (bpstat_do_actions_1): Also check whether the interpreter is async. gdb/testsuite/ 2015-01-14 Pedro Alves <palves@redhat.com> Joel Brobecker <brobecker@adacore.com> PR gdb/17525 * gdb.base/bp-cmds-execution-x-script.c: New file. * gdb.base/bp-cmds-execution-x-script.exp: New file. * gdb.base/bp-cmds-execution-x-script.gdb: New file.
2015-01-14PR cli/17828: -batch -ex r breaks terminalPedro Alves5-0/+230
Commit d3d4baed (PR python/17372 - Python hangs when displaying help()) had the side effect of causing 'gdb -batch' to leave the terminal in the wrong state if the program was run. E.g,. $ echo 'main(){*(int*)0=0;}' | gcc -x c -; ./gdb/gdb -batch -ex r ./a.out Program received signal SIGSEGV, Segmentation fault. 0x00000000004004ff in main () $ If you start typing the next command, seemingly nothing happens - GDB left the terminal with echo disabled. The issue is that that "r" ends up in fetch_inferior_event, which calls reinstall_readline_callback_handler_cleanup, which causes readline to prep the terminal (raw, echo disabled). But "-batch" causes GDB to exit before the top level event loop is first started, and then nothing de-preps the terminal. The reinstall_readline_callback_handler_cleanup function's intro comment mentions: "Need to do this as we go back to the event loop, ready to process further input." but the implementation forgets the case of when the interpreter is sync, which indicates we won't return to the event loop yet, or as in the case of -batch, we have not started it yet. The fix is to not install the readline callback in that case. For the test, in this case, checking that command echo still works is sufficient. Comparing stty output before/after running GDB is even better. Because stty may not be available, the test tries both ways. In any case, since expect's spawn (what we use to start gdb) creates a new pseudo tty, another expect spawn or tcl exec after GDB exits would not see the wrong terminal settings. So instead, the test spawns a shell and runs stty and GDB in it. Tested on x86_64 Fedora 20. gdb/ 2015-01-14 Pedro Alves <palves@redhat.com> PR cli/17828 * infrun.c (reinstall_readline_callback_handler_cleanup): Don't reinstall if the interpreter is sync. gdb/testsuite/ 2015-01-14 Pedro Alves <palves@redhat.com> PR cli/17828 * gdb.base/batch-preserve-term-settings.c: New file. * gdb.base/batch-preserve-term-settings.exp: New file.
2015-01-13Enhance gdb.lookup_objfile so that it works with a symlinked binary.Doug Evans6-2/+52
gdb/Changelog: * objfiles.c (objfile_filename): New function. * objfiles.h (objfile_filename): Declare it. (objfile_name): Add function comment. * python/py-objfile.c (objfpy_lookup_objfile_by_name): Try both the bfd file name (which may be realpath'd), and the original name. gdb/testsuite/ChangeLog: * gdb.python/py-objfile.exp: Test gdb.lookup_objfile on symlinked binary.
2015-01-13gdb/testsuite: Make clean mostlyclean should not delete *.py.Joel Brobecker2-1/+5
A sanity-check in my release scripts caught something: After having created the tarballs, I verify that no checked-in file disappeared in the process, and lo and behod, it found that the following file got wiped: - gdb/testsuite/dg-extract-results.py: And it's not part of the tarball either. I don't understand while we delete all *.py files in gdb/testsuite, since I don't see a rule that expected to create one. A run of the testsuite also doesn't seem to be creating .py files there. I traced this to the following commit, which unfortunately provided no explanation. Perhaps we used to run some tests in the gdb/testsuite directory and caused files to be left behind there. Perhaps we still do today? In the meantime, Executive Decision: In order to allow me to create tarballs without losing files, I removed it. It's easy to put something back if we find out why it might still be needed. gdb/testsuite/ChangeLog: * Makefile.in (clean mostlyclean): Do not delete *.py. Tested on x86_64-linux by running the src-release.sh script again, and this time, dg-extract-results.py no longer gets wiped.
2015-01-13Update NEWS post GDB 7.9 branch creation.Joel Brobecker2-1/+9
gdb/ChangeLog: * NEWS: Create a new section for the next release branch. Rename the section of the current branch, now that it has been cut.
2015-01-13Bump version to 7.9.50.DATE-cvs.Joel Brobecker2-1/+6
Now that the GDB 7.9 branch has been created, we can bump the version number. gdb/ChangeLog: GDB 7.9 branch created (92fc2e6978d9a7c8324c7e851dbee59e22ec7a37): * version.in: Bump version to 7.9.50.DATE-cvs.
2015-01-13[ARI] Remove trailing new-line in argument of call to warning.gdb-7.9-branchpointJoel Brobecker2-1/+6
gdb/ChangeLog: * nat/linux-procfs.c (linux_proc_attach_tgid_threads): Remove trailing new-line in argument of call to warning.
2015-01-13[ARI] Remove trailing new-line in argument of call to warning.Joel Brobecker2-1/+6
gdb/ChangeLog: * linux-nat.c (attach_proc_task_lwp_callback): Remove trailing new-line in argument of call to "warning".
2015-01-13[python/Ada] gdb.lookup_type fails to looking primitive typeJoel Brobecker4-1/+100
The following change... commit 1994afbf19892c9e614a034fbf1a5233e9addce3 Date: Tue Dec 23 07:55:39 2014 -0800 Subject: Look up primitive types as symbols. ... caused the following regression: % gdb (gdb) set lang ada (gdb) python print gdb.lookup_type('character') Traceback (most recent call last): File "<string>", line 1, in <module> gdb.error: No type named character. Error while executing Python code. This is because the language_lookup_primitive_type_as_symbol call was moved to the la_lookup_symbol_nonlocal hook. A couple of implementations have been upated accordingly, but the Ada version has not. This patch fixes this omission. gdb/ChangeLog: * ada-lang.c (ada_lookup_symbol_nonlocal): If name not found in static block, then try searching for primitive types. gdb/testsuite/ChangeLog: * gdb.python/py-lookup-type.exp: New file.
2015-01-12Append to input history file instead of overwriting itPatrick Palka4-4/+84
This patch makes readline append new history lines to the GDB history file on exit instead of overwriting the entire history file on exit. This change allows us to run multiple simultaneous GDB sessions without having each session overwrite the added history of each other session on exit. Care must be taken to ensure that the history file doesn't get corrupted when multiple GDB processes are trying to simultaneously append to and then truncate it. Safety is achieved in such a situation by using an intermediate local history file to mutually exclude multiple processes from simultaneously performing write operations on the global history file. gdb/ChangeLog: * top.h (gdb_add_history): Declare. * top.c (command_count): New variable. (gdb_add_history): New function. (gdb_safe_append_history): New static function. (quit_force): Call it. (command_line_input): Use gdb_add_history instead of add_history. * event-top.c (command_line_handler): Likewise.
2015-01-12[darwin/gdb] Use <setjmp.h> instead of <machine/setjmp.h>James Clarke2-1/+7
The `machine/setjmp.h' header is no longer present on OS X 10.10, and is non-standard. Instead, `darwin-nat.c' should be using the standard `setjmp.h' header. gdb/ChangeLog: 2015-01-12 James Clarke <jrtc27@jrtc27.com> (tiny patch) PR gdb/17046 * darwin-nat.c: Replace <machine/setjmp.h> #include by <setjmp.h> #include.
2015-01-12gdb.python/py-prompt.exp: restore GDBFLAGSPedro Alves2-0/+6
The previous change to py-prompt.exp made it return without restoring GDBFLAGS, resulting in breaking the following tests: $ make check RUNTESTFLAGS="--target_board=native-gdbserver --directory=gdb.python" ... Running src/gdb/testsuite/gdb.python/py-prompt.exp ... Running src/gdb/testsuite/gdb.python/py-section-script.exp ... ERROR: (timeout) GDB never initialized after 10 seconds. ERROR: no fileid for gdbuild ERROR: Couldn't send python print ('test') to GDB. ERROR: no fileid for gdbuild ERROR: Couldn't send python print (sys.version_info[0]) to GDB. ERROR: no fileid for gdbuild ERROR: Couldn't send python print (sys.version_info[1]) to GDB. ERROR: no fileid for gdbuild ERROR: no fileid for gdbuild ... gdb/testsuite/ 2015-01-12 Pedro Alves <palves@redhat.com> * gdb.python/py-prompt.exp: When the board can't spawn for attach, restore GDBFLAGS before returning.
2015-01-12[testsuite patch] Fix new FAIL: py-frame.exp: test Frame.read_register(rip)Jan Kratochvil2-4/+15
for x86_64 -m32 run one gets: +FAIL: gdb.python/py-frame.exp: test Frame.read_register(rip) I do not have x32 OS here but the %rip test should PASS there I think. On Sun, 11 Jan 2015 14:58:06 +0100, Yao Qi wrote: With your patch applied, this test is skipped on 'x86_64 -m32'. I prefer to increasing the test coverage, so how about extending the test for 'x86_64 -m32'? I mean test Frame.read_register(eip)... gdb/testsuite/ChangeLog 2015-01-12 Jan Kratochvil <jan.kratochvil@redhat.com> * gdb.python/py-frame.exp (test Frame.read_register(rip)): Use is_amd64_regs_target and is_x86_like_target.
2015-01-11dwarf2read.c (compute_delayed_physnames): Use TYPE_FN_FIELD_PHYSNAME.Doug Evans2-1/+6
gdb/ChangeLog: * dwarf2read.c (compute_delayed_physnames): Use TYPE_FN_FIELD_PHYSNAME.
2015-01-11Require numeric attributes to specify the form.Doug Evans7-18/+35
gdb/testsuite/ChangeLog: * lib/dwarf.exp (Dwarf): Flag an error if a numeric attribute value is given without an explicit form. * gdb.dwarf2/arr-subrange.exp: Specify forms for all numeric attributes. * gdb.dwarf/corrupt.exp: Ditto. * gdb.dwarf2/enum-type.exp: Ditto. * gdb.trace/entry-values.exp: Ditto. * gdb.trace/unavailable-dwarf-piece.exp: Ditto.
2015-01-11Temporarily revert symbol lookup cache.Doug Evans5-828/+14
clear_symtab_users calls breakpoint_re_set before observer_notify_new_objfile(NULL), and thus symbol lookup done during breakpoint_re_set will see a stale cache. Presumably we just need to move the call to observer_notify_new_objfile(NULL) to before breakpoint_re_set, but need to check for other such issues, and 7.9 is scheduled to branch tomorrow. Reverts commits: b2fb95e006c29e2cbe4b30523879fe3640f906ad 400678a494713abf8f7ea2367f213109a2c4b886 d98b9ccbccf36563dad92f6093a93655b38bc51b 77087adf50cedf78cc216ac6eb3b2863839d713c gdb/ChangeLog: * symtab.c (eq_symbol_entry): Use SYMBOL_SEARCH_NAME and symbol_matches_domain for symbol comparisons. * symtab.c (symbol_cache_mark_found): Improve function comment. Rename parameter objfile to objfile_context. (symbol_cache_mark_not_found): Improve function comment. Add symbol lookup cache. * NEWS: Document new options and commands. * symtab.c (symbol_cache_key): New static global. (DEFAULT_SYMBOL_CACHE_SIZE, MAX_SYMBOL_CACHE_SIZE): New macros. (SYMBOL_LOOKUP_FAILED): New macro. (symbol_cache_slot_state): New enum. (block_symbol_cache): New struct. (symbol_cache): New struct. (new_symbol_cache_size, symbol_cache_size): New static globals. (hash_symbol_entry, eq_symbol_entry): New functions. (symbol_cache_byte_size, resize_symbol_cache): New functions. (make_symbol_cache, free_symbol_cache): New functions. (get_symbol_cache, symbol_cache_cleanup): New function. (set_symbol_cache_size, set_symbol_cache_size_handler): New functions. (symbol_cache_lookup, symbol_cache_clear_slot): New function. (symbol_cache_mark_found, symbol_cache_mark_not_found): New functions. (symbol_cache_flush, symbol_cache_dump): New functions. (maintenance_print_symbol_cache): New function. (maintenance_flush_symbol_cache): New function. (symbol_cache_stats): New function. (maintenance_print_symbol_cache_statistics): New function. (symtab_new_objfile_observer): New function. (symtab_free_objfile_observer): New function. (lookup_static_symbol, lookup_global_symbol): Use symbol cache. (_initialize_symtab): Init symbol_cache_key. New parameter maint symbol-cache-size. New maint commands print symbol-cache, print symbol-cache-statistics, flush-symbol-cache. Install new_objfile, free_objfile observers. gdb/doc/ChangeLog: * gdb.texinfo (Symbols): Document new commands "maint print symbol-cache", "maint print symbol-cache-statistics", "maint flush-symbol-cache". Document new option "maint set symbol-cache-size".
2015-01-11PR gdb/15830Doug Evans10-53/+159
gdb/ChangeLog: PR gdb/15830 * NEWS: The "maint demangle" command is renamed as "demangle". * demangle.c: #include cli/cli-utils.h, language.h. (demangle_command): New function. (_initialize_demangle): Add new command "demangle". * maint.c (maintenance_demangle): Stub out. (_initialize_maint_cmds): Update help text for "maint demangle", and mark as deprecated. gdb/doc/ChangeLog: * gdb.texinfo (Debugging C Plus Plus): Mention "demangle". (Symbols): Ditto. (Maintenance Commands): Delete docs for "maint demangle". gdb/testsuite/ChangeLog: * gdb.base/maint.exp: Remove references to "maint demangle". * gdb.cp/demangle.exp: Update. "maint demangle" -> "demangle". Add tests for explicitly specifying language to demangle. * gdb.dlang/demangle.exp: Ditto.
2015-01-11Fix build on OpenBSD.Mark Kettenis2-1/+7
gdb/ChangeLog: * inf-ptrace.c (inf_ptrace_follow_fork): Adjust now that inferior_thread is a function.
2015-01-11symtab.c (eq_symbol_entry): Use SYMBOL_SEARCH_NAME and symbol_matches_domain.Doug Evans2-7/+38
gdb/ChangeLog: * symtab.c (eq_symbol_entry): Use SYMBOL_SEARCH_NAME and symbol_matches_domain for symbol comparisons.
2015-01-11tweak previous entryDoug Evans1-1/+1
2015-01-11Improve comments for symbol_cache_mark_{not_,}found.Doug Evans2-4/+16
gdb/ChangeLog: * symtab.c (symbol_cache_mark_found): Improve function comment. Rename parameter objfile to objfile_context. (symbol_cache_mark_not_found): Ditto.
2015-01-10Add symbol lookup cache.Doug Evans5-14/+785
gdb/ChangeLog: Add symbol lookup cache. * NEWS: Document new options and commands. * symtab.c (symbol_cache_key): New static global. (DEFAULT_SYMBOL_CACHE_SIZE, MAX_SYMBOL_CACHE_SIZE): New macros. (SYMBOL_LOOKUP_FAILED): New macro. (symbol_cache_slot_state): New enum. (block_symbol_cache): New struct. (symbol_cache): New struct. (new_symbol_cache_size, symbol_cache_size): New static globals. (hash_symbol_entry, eq_symbol_entry): New functions. (symbol_cache_byte_size, resize_symbol_cache): New functions. (make_symbol_cache, free_symbol_cache): New functions. (get_symbol_cache, symbol_cache_cleanup): New function. (set_symbol_cache_size, set_symbol_cache_size_handler): New functions. (symbol_cache_lookup, symbol_cache_clear_slot): New function. (symbol_cache_mark_found, symbol_cache_mark_not_found): New functions. (symbol_cache_flush, symbol_cache_dump): New functions. (maintenance_print_symbol_cache): New function. (maintenance_flush_symbol_cache): New function. (symbol_cache_stats): New function. (maintenance_print_symbol_cache_statistics): New function. (symtab_new_objfile_observer): New function. (symtab_free_objfile_observer): New function. (lookup_static_symbol, lookup_global_symbol): Use symbol cache. (_initialize_symtab): Init symbol_cache_key. New parameter maint symbol-cache-size. New maint commands print symbol-cache, print symbol-cache-statistics, flush-symbol-cache. Install new_objfile, free_objfile observers. doc/ChangeLog: * gdb.texinfo (Symbols): Document new commands "maint print symbol-cache", "maint print symbol-cache-statistics", "maint flush-symbol-cache". Document new option "maint set symbol-cache-size".
2015-01-10Fix use of wrong struct i387_xsave field in i387_cache_to_xsaveJoel Brobecker2-1/+7
gdb/gdbserver/ChangeLog: * i387-fp.c (i387_cache_to_xsave): In look over num_avx512_zmmh_high_registers, replace use of struct i387_xsave zmmh_low_space field by use of zmmh_high_space. Tested on x86_64-linux, using boards/native-gdbserver.exp.
2015-01-09Don't munge yacc's #line directivesPatrick Palka2-1/+5
The #line directives within GDB's autogenerated yacc files (e.g. c-exp.c) are being incorrectly munged, causing these directives to refer to nonexistent source files, e.g. #line 36 "/home/patrick/binutils-gdb/gdb//home/patrick/binutils-gdb/gdb/c-exp.y" as opposed to #line 36 "/home/patrick/binutils-gdb/gdb/c-exp.y" The munging happens due to a sed expression added by commit 954d8cae whose intended purpose[1] was to work around the fact that ylwrap emitted #line directives without any directory information, e.g. #line 36 "c-exp.y" So the sed expression was meant to munge such directives to refer to absolute paths instead. But the behavior of ylwrap was changed some years ago[2] to emit absolute paths within #line directives. And when our local copy of ylwrap was synced by commit e30465112, the sed expression in question became unnecessary, and indeed harmful. This patch removes the now-obsolete sed expression. The emitted #line directives are now correct without it. gdb/ChangeLog: * Makefile.in (.y.c): Don't munge yacc's #line directives. [1]: https://sourceware.org/ml/gdb-patches/2010-11/msg00265.html [2]: http://git.savannah.gnu.org/cgit/automake.git/commit/lib/ylwrap?id=b6359a5f3