aboutsummaryrefslogtreecommitdiff
path: root/gdb
AgeCommit message (Collapse)AuthorFilesLines
2016-10-06Fix PR11094: JIT breakpoint is not properly recreated on rerunsPedro Alves7-43/+226
Even though this was supposedly in the gdb 7.2 timeframe, the testcase in PR11094 crashes current GDB with a segfault: Program received signal SIGSEGV, Segmentation fault. 0x00000000005ee894 in event_location_to_string (location=0x0) at src/gdb/location.c:412 412 if (EL_STRING (location) == NULL) (top-gdb) bt #0 0x00000000005ee894 in event_location_to_string (location=0x0) at src/gdb/location.c:412 #1 0x000000000057411a in print_breakpoint_location (b=0x18288e0, loc=0x0) at src/gdb/breakpoint.c:6201 #2 0x000000000057483f in print_one_breakpoint_location (b=0x18288e0, loc=0x182cf10, loc_number=0, last_loc=0x7fffffffd258, allflag=1) at src/gdb/breakpoint.c:6473 #3 0x00000000005751e1 in print_one_breakpoint (b=0x18288e0, last_loc=0x7fffffffd258, allflag=1) at src/gdb/breakpoint.c:6707 #4 0x000000000057589c in breakpoint_1 (args=0x0, allflag=1, filter=0x0) at src/gdb/breakpoint.c:6947 #5 0x0000000000575aa8 in maintenance_info_breakpoints (args=0x0, from_tty=0) at src/gdb/breakpoint.c:7026 [...] This is GDB trying to print the location spec of the JIT event breakpoint, but that's an internal breakpoint without one. If I add a NULL check, then we see that the JIT breakpoint is now pending (because its location has shlib_disabled set): (gdb) maint info breakpoints Num Type Disp Enb Address What [...] -8 jit events keep y <PENDING> inf 1 [...] But that's incorrect. GDB should have managed to recreate the JIT breakpoint's location for the second run. So the problem is elsewhere. The problem is that if the JIT loads at the same address on the second run, we never recreate the JIT breakpoint, because we hit this early return: static int jit_breakpoint_re_set_internal (struct gdbarch *gdbarch, struct jit_program_space_data *ps_data) { [...] if (ps_data->cached_code_address == addr) return 0; [...] delete_breakpoint (ps_data->jit_breakpoint); [...] ps_data->jit_breakpoint = create_jit_event_breakpoint (gdbarch, addr); Fix this by deleting the breakpoint and discarding the cached code address when the objfile where the previous JIT breakpoint was found is deleted/unloaded in the first place. The test that was originally added for PR11094 doesn't trip on this because: #1 - It doesn't test the case of the JIT descriptor's address _not_ changing between reruns. #2 - And then it doesn't do "maint info breakpoints", or really anything with the JIT at all. #3 - and even then, to trigger the problem the JIT descriptor needs to be in a separate library, while the current test puts it in the main program. The patch extends the test to cover all combinations of these scenarios. gdb/ChangeLog: 2016-10-06 Pedro Alves <palves@redhat.com> * jit.c (free_objfile_data): Delete the JIT breakpoint and clear the cached code address. gdb/testsuite/ChangeLog: 2016-10-06 Pedro Alves <palves@redhat.com> * gdb.base/jit-simple-dl.c: New file. * gdb.base/jit-simple-jit.c: New file, factored out from ... * gdb.base/jit-simple.c: ... this. * gdb.base/jit-simple.exp (jit_run): Delete. (build_jit): New proc. (jit_test_reread): Recompile either the main program or the shared library, depending on what is being tested. Skip changing address if caller wants to. Compare before/after addresses. If testing standalone, explicitly load the binary. Test "maint info breakpoints". (top level): Add "standalone vs shared lib" and "change address" vs "same address" axes.
2016-10-06Fix a few gdb.base/jit-simple.exp problemsPedro Alves2-30/+33
I noticed that we sometimes get this: (gdb) print &__jit_debug_descriptor $1 = (struct jit_descriptor *) 0x601040 <__jit_debug_descriptor> (gdb) PASS: gdb.base/jit-simple.exp: blah 1 [...] (gdb) run [...] Starting program: build/gdb/testsuite/outputs/gdb.base/jit-simple/jit-simple Unsupported JIT protocol version 4 in descriptor (expected 1) Breakpoint 2, main () at src/gdb/testsuite/gdb.base/jit-simple.c:36 36 return 0; (gdb) print &__jit_debug_descriptor $2 = (struct jit_descriptor *) 0x601040 <__jit_debug_descriptor> (gdb) PASS: gdb.base/jit-simple.exp: blah 1 All tests PASSed, but note the "Unsupported JIT protocol version 4" message. Also notice that "__jit_debug_descriptor" has the same address before and after the rerun, while the test is built in a way that should make that address change between runs. The test doesn't catch any of this because it doesn't compare before/after addresses. And then notice the "blah 1" test messages. "blah" is clearly a WIP message, but it should be at least "blah 2" the second time. :-) The reason this sometimes happens is that the test recompiles the program and expects gdb to reload it automaticallyt on "run". However, if the original program and the new recompilation happen to be in the same second, then gdb does not realize that the binary needs to be reloaded. (This is an old problem out of scope of this series.) If that happens, then GDB ends up using the wrong symbols for the program that it spawns, reads the JIT descriptor out of the wrong address, finds garbage, and prints that "unsupported version" notice. Fix that in the same way gdb.base/reread.exp handles it -- by sleeping one second before recompiling. gdb/testsuite/ChangeLog: 2016-10-06 Pedro Alves <palves@redhat.com> * gdb.base/jit-simple.exp (top level) Delete get_compiler_info call. (jit_run): Delete. (jit_test_reread): Use with_test_prefix. Reload the main binary explicitly. Compare the before/after addresses of the JIT descriptor.
2016-10-06Make "end" field in feature specs required again.Doug Evans24-173/+206
Newer gdbservers may be talking to older gdbs, and older gdbs will flag a missing "end" as an error. So just make "end" required again, and for compatibility change the default field type to "bool". gdb/ChangeLog: 2016-10-06 Doug Evans <dje@google.com> * features/aarch64-core.xml (cpsr_flags): Elide "type" and specify "end" in all fields. * features/aarch64.c: Regenerate. * features/i386/32bit-mpx.xml (_bndcfgu): Specify type of "preserved" and "enabled" fields. Correct size of "enabled" field. * features/i386/64bit-mpx.xml (_bndcfgu): Specify type of "preserved" and "enabled" fields. * features/i386/i386-avx-mpx-linux.c: Regenerate. * features/i386/i386-avx-mpx.c: Regenerate. * features/i386/i386-avx512-linux.c: Regenerate. * features/i386/i386-avx512.c: Regenerate. * features/i386/i386-mpx-linux.c: Regenerate. * features/i386/i386-mpx.c: Regenerate. * features/arc-arcompact.c: Regenerate. * features/arc-v2.c: Regenerate. * xml-tdesc.c (tdesc_start_field): Require "end" spec. Single bit fields default to "bool" type. Revert 2016-03-15 Doug Evans <dje@google.com> * features/i386/32bit-core.xml (i386_eflags): Remove "end" spec. * features/i386/32bit-sse.xml (i386_eflags): Ditto. * features/i386/64bit-core.xml (i386_eflags): Ditto. * features/i386/64bit-sse.xml (i386_eflags): Ditto. * features/i386/x32-core.xml (i386_eflags): Ditto. gdb/doc/ChangeLog: 2016-10-06 Doug Evans <dje@google.com> * gdb.texinfo (Target Description Format): Update docs on "end" field spec and field default type. gdb/testsuite/ChangeLog: 2016-10-06 Doug Evans <dje@google.com> * gdb.xml/extra-regs.xml: Update, end field now required, default type for single bitfields is bool. * gdb.xml/tdesc-regs.exp: Ditto.
2016-10-05testsuite: Fix recent GCC FAIL: gdb.arch/i386-signal.expJan Kratochvil2-1/+5
gcc-6.2.1-2.fc24.x86_64 (gdb) backtrace 10^M (gdb) FAIL: gdb.arch/i386-signal.exp: backtrace 10 (gdb) disas/s Dump of assembler code for function main: .../gdb/testsuite/gdb.arch/i386-signal.c: 30 { 0x000000000040057f <+0>: push %rbp 0x0000000000400580 <+1>: mov %rsp,%rbp 31 setup (); 0x0000000000400583 <+4>: callq 0x400590 <setup> => 0x0000000000400588 <+9>: mov $0x0,%eax 32 } 0x000000000040058d <+14>: pop %rbp 0x000000000040058e <+15>: retq End of assembler dump. The .exp patch is an obvious typo fix I think. The regex was written to accept "ADDR in main" and I find it OK as checking .debug_line validity is not the purpose of this testfile. gcc-4.8.5-11.el7.x86_64 did not put the 'mov $0x0,%eax' instruction there at all so there was no problem with .debug_line. gdb/testsuite/ChangeLog 2016-10-05 Jan Kratochvil <jan.kratochvil@redhat.com> * gdb.arch/i386-signal.exp (backtrace 10): Fix #2 typo.
2016-10-05PR remote/20655 - small fix in handle_tracepoint_bkptsTom Tromey2-1/+7
handle_tracepoint_bkpts has two parallel "if"s. This changes the second one to check ipa_error_tracepoint, which seems to be what was intended. 2016-10-05 Tom Tromey <tom@tromey.com> PR remote/20655: * tracepoint.c (handle_tracepoint_bkpts): Check ipa_error_tracepoint, not ipa_stopping_tracepoint.
2016-10-05PR gdb/20653 - small cleanup in string_to_explicit_locationTom Tromey2-1/+6
This bug points out that string_to_explicit_location compares a char* against '\0'; whereas comparing against NULL is more normal. 2016-10-05 Tom Tromey <tom@tromey.com> PR breakpoints/20653: * location.c (string_to_explicit_location): Use NULL, not '\0'.
2016-10-05PR symtab/20652 - fix psymbol_compareTom Tromey2-1/+7
This fixes an oversight in psymbol_compare. 2016-10-05 Tom Tromey <tom@tromey.com> PR symtab/20652: * psymtab.c (psymbol_compare): Correctly compare "ginfo.value" fields.
2016-10-05Skip complex types tests if gdb_skip_float_testYao Qi2-0/+12
If the target doesn't support float, we don't run float complex types tests. gdb/testsuite: 2016-10-05 Yao Qi <yao.qi@linaro.org> * lib/gdb.exp (support_complex_tests): Return zero if gdb_skip_float_test return true.
2016-10-05Fix incorrect formatting of a ChangeLog entryAnton Kolesov1-1/+1
My previous commit had an invalid formatting of a ChangeLog entry. This commit fixes that.
2016-10-05Allow DW_OP_GNU_uninit in dwarf_expr_require_compositionAndreas Arnez2-12/+12
In DWARF expression handling, some operators are required to be either at the end of an expression or followed by a composition operator. So far only the operators DW_OP_reg0-31 were allowed to be followed by DW_OP_GNU_uninit instead, and particularly DW_OP_regx was not, which is obviously inconsistent. This patch allows DW_OP_GNU_uninit after all operators requiring a composition, to simplify the code and make it more consistent. This policy may be more permissive than necessary, but in the worst case just leads to a DWARF location description resulting in an uninitialized value instead of an error message. gdb/ChangeLog: * dwarf2expr.c (dwarf_expr_require_composition): Allow DW_OP_GNU_uninit. (execute_stack_op): Use dwarf_expr_require_composition instead of copying its logic.
2016-10-05arc: Remove annoying debug messageAnton Kolesov2-3/+4
The logging message is called too often - once for each register when it's value has to be evaluated. This floods the screen for commands like "info register all", but doesn't give really any help at debugging GDB issues. Between increasing the debug level of this message and removing it altogether I think that removing it is preferable. gdb/ChangeLog: arc-tdep.c (arc_frame_prev_register): Remove annoying log message.
2016-10-05Update the path arm-*.xml files for aarch64Yao Qi2-2/+6
0a69eedb (Clean up the XML files for ARM) breaks the GDBserver build on aarch64 because some arm-*.xml files can't be found. This patch is to fix the build failure. gdb/gdbserver: 2016-10-05 Yao Qi <yao.qi@linaro.org> * configure.srv: Update the path of arm-*.xml files.
2016-10-05Regenerate some regformats/rs6000/*.dat filesYao Qi8-6/+28
If I remove all regformats/*.dat files and run make GDB=/scratch/yao/gdb/build-git/all-targets/gdb/gdb all, some powerpc .dat files are not generated. This patch fixes it by adding them to WHICH, so these .dat files can be generated. gdb: 2016-10-05 Yao Qi <yao.qi@linaro.org> * features/Makefile (WHICH): Add rs6000/powerpc-isa205-32l, rs6000/powerpc-isa205-64l, rs6000/powerpc-isa205-altivec32l, rs6000/powerpc-isa205-altivec64l, rs6000/powerpc-isa205-vsx32l and rs6000/powerpc-isa205-vsx64l. * regformats/rs6000/powerpc-isa205-32l.dat: Regenerated. * regformats/rs6000/powerpc-isa205-64l.dat: Likewise. * regformats/rs6000/powerpc-isa205-altivec32l.dat: Likewise. * regformats/rs6000/powerpc-isa205-altivec64l.dat: Likewise. * regformats/rs6000/powerpc-isa205-vsx32l.dat: Likewise. * regformats/rs6000/powerpc-isa205-vsx64l.dat: Likewise.
2016-10-05Generate s390 target description c filesYao Qi2-0/+10
If I delete all target description c files under features/ directory, and run make GDB=/scratch/yao/gdb/build-git/all-targets/gdb/gdb cfiles, some s390 target description c files are not generated. This patch adds these s390 xml files to XMLTOC, so these c files can be generated. gdb: 2016-10-05 Yao Qi <yao.qi@linaro.org> * features/Makefile (XMLTOC): Add s390-tevx-linux64.xml, s390-vx-linux64.xml, s390x-tevx-linux64.xml and s390x-vx-linux64.xml.
2016-10-05Simplify i386, amd64 and x32 expedite registersYao Qi2-28/+8
Nowadays, there are a lot of duplication about i386/{i386, amd64, x32}*-expedite in features/Makefile. However, in features/Makefile, we have echo "expedite:$(if $($*-expedite),$($*-expedite),$($(firstword $(subst -, ,$(notdir $*)))-expedite))" \ >> $(outdir)/$*.tmp which means for a given bar/foo-baz.xml, we'll look for either bar/foo-baz-expedite or foo-expedite. In x86 expedite registers, we use the former now, but it will be much simpler if we use the latter. This is what this patch does. This patch removes them, and defines three generic expedite. Re-run 'make GDB=/path/build/gdb all' to regenerate regformats/*.dat files, and they are not changed. gdb: 2016-10-05 Yao Qi <yao.qi@linaro.org> * features/Makefile: Remove i386/*-expedite. Add i386-expedite, amd64-expedite, and x32-expedite.
2016-10-05Clean up the XML files for ARMYao Qi30-36/+97
This patch is move features/arm-*.xml to features/arm/, and it is based on Terry's patch posted here https://sourceware.org/ml/gdb-patches/2014-06/msg00794.html One comment to Terry's patch is about losing "arm" prefix, and the new patch fixes this problem. gdb: 2016-10-05 Terry Guo <terry.guo@arm.com> Yao Qi <yao.qi@linaro.org> * arm-tdep.c: Adjust includes. * features/Makefile (WHICH): Add "arm/" directory to arm target descriptions. (XMLTOC): Likewise. (arm/arm-with-iwmmxt.dat): Adjust the path for dependencies. * features/arm-core.xml: Moved to ... * features/arm/arm-core.xml: ... it. * features/arm-fpa.xml: Moved to ... * features/arm/arm-fpa.xml: ... it. * features/arm-m-profile.xml: Moved to ... * features/arm/arm-m-profile.xm: ... it. * features/arm-vfpv2.xml: Moved to ... * features/arm/arm-vfpv2.xm: ... it. * features/arm-vfpv3.xml: Moved to ... * features/arm/arm-vfpv3.xml: ... it. * features/arm-with-iwmmxt.c: Moved to ... * features/arm/arm-with-iwmmxt.c: ... it. * features/arm-with-iwmmxt.xml: Moved to ... * features/arm/arm-with-iwmmxt.xml: ... it. * features/arm-with-m-fpa-layout.c: Moved to ... * features/arm/arm-with-m-fpa-layout.c: ... it. * features/arm-with-m-fpa-layout.xml: Moved to ... * features/arm/arm-with-m-fpa-layout.xml: ... it. * features/arm-with-m-vfp-d16.c: Moved to ... * features/arm/arm-with-m-vfp-d16.c: ... it. * features/arm-with-m-vfp-d16.xml: Moved to ... * features/arm/arm-with-m-vfp-d16.xml: ... it. * features/arm-with-m.c: Moved to ... * features/arm/arm-with-m.c: ... it. * features/arm-with-m.xml: Moved to ... * features/arm/arm-with-m.xm: ... it. * features/arm-with-neon.c: Moved to ... * features/arm/arm-with-neon.c: ... it. * features/arm-with-neon.xml: Moved to ... * features/arm/arm-with-neon.xml: ... it. * features/arm-with-vfpv2.c: Moved to ... * features/arm/arm-with-vfpv2.c: ... it. * features/arm-with-vfpv2.xml: Moved to ... * features/arm/arm-with-vfpv2.xml: ... it. * features/arm-with-vfpv3.c: Moved to ... * features/arm/arm-with-vfpv3.c: ... it. * features/arm-with-vfpv3.xml: Moved to ... * features/arm/arm-with-vfpv3.xml: ... it. * features/xscale-iwmmxt.xml: Moved to ... * features/arm/xscale-iwmmxt.xml: ... it. gdb/gdbserver: 2016-10-05 Terry Guo <terry.guo@arm.com> Yao Qi <yao.qi@linaro.org> * Makefile.in: Adjust the path of rules. * configure.srv: Update the path of xml files. * regformats/arm-with-iwmmxt.dat: Regenerated. * regformats/arm-with-neon.dat: Likewise. * regformats/arm-with-vfpv2.dat: Likewise. * regformats/arm-with-vfpv3.dat Likewise.
2016-10-03Add test for user context selection syncAntoine Tremblay3-0/+1355
This patch adds a test to verify that events are sent properly to all UIs when the user selection context (inferior, thread, frame) changes. The goal of the C test file is to provide two threads that are stopped with the same predictable backtrace (so that we can test frame switching). The barrier helps us know when the child threads are started. Then, scheduler-locking is used to bring each thread one by one to the position we expect them to be during the test. gdb/testsuite/ChangeLog: YYYY-MM-DD Antoine Tremblay <antoine.tremblay@ericsson.com> YYYY-MM-DD Simon Marchi <simon.marchi@ericsson.com> PR gdb/20487 * gdb.mi/user-selected-context-sync.exp: New file. * gdb.mi/user-selected-context-sync.c: New file.
2016-10-03Emit inferior, thread and frame selection events to all UIsAntoine Tremblay23-88/+503
With this patch, when an inferior, thread or frame is explicitly selected by the user, notifications will appear on all CLI and MI UIs. When a GDB console is integrated in a front-end, this allows the front-end to follow a selection made by the user ont he CLI, and it informs the user about selection changes made behind the scenes by the front-end. This patch addresses PR gdb/20487. In order to communicate frame changes to the front-end, this patch adds a new field to the =thread-selected event for the selected frame. The idea is that since inferior/thread/frame can be seen as a composition, it makes sense to send them together in the same event. The vision would be to eventually send the inferior information as well, if we find that it's needed, although the "=thread-selected" event would be ill-named for that job. Front-ends need to handle this new field if they want to follow the frame selection changes that originate from the console. The format of the frame attribute is the same as what is found in the *stopped events. Here's a detailed example for each command and the events they generate: thread ------ 1. CLI command: thread 1.3 MI event: =thread-selected,id="3",frame={...} 2. MI command: -thread-select 3 CLI event: [Switching to thread 1.3 ...] 3. MI command (CLI-in-MI): thread 1.3 MI event/reply: &"thread 1.3\n" ~"#0 child_sub_function () ... =thread-selected,id="3",frame={level="0",...} ^done frame ----- 1. CLI command: frame 1 MI event: =thread-selected,id="3",frame={level="1",...} 2. MI command: -stack-select-frame 1 CLI event: #1 0x00000000004007f0 in child_function... 3. MI command (CLI-in-MI): frame 1 MI event/reply: &"frame 1\n" ~"#1 0x00000000004007f9 in ..." =thread-selected,id="3",frame={level="1"...} ^done inferior -------- Inferior selection events only go from the console to MI, since there's no way to select the inferior in pure MI. 1. CLI command: inferior 2 MI event: =thread-selected,id="3" Note that if the user selects an inferior that is not started or exited, the MI doesn't receive a notification. Since there is no threads to select, the =thread-selected event does not apply... 2. MI command (CLI-in-MI): inferior 2 MI event/reply: &"inferior 2\n" ~"[Switching to inferior 2 ...]" =thread-selected,id="4",frame={level="0"...} ^done Internal implementation detail: this patch makes it possible to suppress notifications caused by a CLI command, like what is done in mi-interp.c. This means that it's now possible to use the add_com_suppress_notification function to register a command with some event suppressed. It is used to implement the select-frame command in this patch. The function command_notifies_uscc_observer was added to extract the rather complicated logical expression from the if statement. It is also now clearer what that logic does: if the command used by the user already notifies the user_selected_context_changed observer, there is not need to notify it again. It therefore protects again emitting the event twice. No regressions, tested on ubuntu 14.04 x86 with target boards unix and native-extended-gdbserver. gdb/ChangeLog: YYYY-MM-DD Antoine Tremblay <antoine.tremblay@ericsson.com> YYYY-MM-DD Simon Marchi <simon.marchi@ericsson.com> PR gdb/20487 * NEWS: Mention new frame field of =thread-selected event. * cli/cli-decode.c (add_cmd): Initialize c->suppress_notification. (add_com_suppress_notification): New function definition. (cmd_func): Set and restore the suppress_notification flag. * cli/cli-deicode.h (struct cmd_list_element) <suppress_notification>: New field. * cli/cli-interp.c (cli_suppress_notification): New global variable. (cli_on_user_selected_context_changed): New function. (_initialize_cli_interp): Attach to user_selected_context_changed observer. * command.h (struct cli_suppress_notification): New structure. (cli_suppress_notification): New global variable declaration. (add_com_suppress_notification): New function declaration. * defs.h (enum user_selected_what_flag): New enum. (user_selected_what): New enum flag type. * frame.h (print_stack_frame_to_uiout): New function declaration. * gdbthread.h (print_selected_thread_frame): New function declaration. * inferior.c (print_selected_inferior): New function definition. (inferior_command): Remove printing of inferior/thread/frame switch notifications, notify user_selected_context_changed observer. * inferior.h (print_selected_inferior): New function declaration. * mi/mi-cmds.c (struct mi_cmd): Add user_selected_context suppression to stack-select-frame and thread-select commands. * mi/mi-interp.c (struct mi_suppress_notification) <user_selected_context>: Initialize. (mi_user_selected_context_changed): New function definition. (_initialize_mi_interp): Attach to user_selected_context_changed. * mi/mi-main.c (mi_cmd_thread_select): Print thread selection reply. (mi_execute_command): Handle notification suppression. Notify user_selected_context_changed observer on thread change instead of printing event directly. Don't send it if command already sends the notification. (command_notifies_uscc_observer): New function. (mi_cmd_execute): Don't handle notification suppression. * mi/mi-main.h (struct mi_suppress_notification) <user_selected_context>: New field. * stack.c (print_stack_frame_to_uiout): New function definition. (select_frame_command): Notify user_selected_context_changed observer. (frame_command): Call print_selected_thread_frame if there's no frame change or notify user_selected_context_changed observer if there is. (up_command): Notify user_selected_context_changed observer. (down_command): Likewise. (_initialize_stack): Suppress user_selected_context notification for command select-frame. * thread.c (thread_command): Notify user_selected_context_changed if the thread has changed, print thread info directly if it hasn't. (do_captured_thread_select): Do not print thread switch event. (print_selected_thread_frame): New function definition. * tui/tui-interp.c (tui_on_user_selected_context_changed): New function definition. (_initialize_tui_interp): Attach to user_selected_context_changed observer. gdb/doc/ChangeLog: PR gdb/20487 * gdb.texinfo (Context management): Update mention of frame change notifications. (gdb/mi Async Records): Document frame field in =thread-select event. * observer.texi (GDB Observers): New user_selected_context_changed observer. gdb/testsuite/ChangeLog: PR gdb/20487 * gdb.mi/mi-pthreads.exp (check_mi_thread_command_set): Adapt =thread-select-event check.
2016-09-30PR 20627: Use resume_stop to stop lwpYao Qi2-1/+11
Commit 049a8570 (Use target_continue{,_no_signal} instead of target_resume) replaces the code stopping lwp with target_continue_no_signal in target_stop_and_wait, like this, - resume_info.thread = ptid; - resume_info.kind = resume_stop; - resume_info.sig = GDB_SIGNAL_0; - (*the_target->resume) (&resume_info, 1); + target_continue_no_signal (ptid); the replacement is not equivalent, and it causes PR 20627. This patch is just to revert that change. Regression testing it on x86_64-linux. gdb/gdbserver: 2016-09-30 Yao Qi <yao.qi@linaro.org> PR gdbserver/20627 * target.c (target_stop_and_wait): Don't call target_continue_no_signal, use resume_stop instead.
2016-09-29Update tests to account for the L operand being compulsory.Peter Bergner3-4/+10
* gdb.arch/powerpc-power.exp <cmprb>: Update tests to account for the compulsory L operand changes. * gdb.arch/powerpc-power.s: Likewise.
2016-09-29PR gdb/20609 - attach of JIT-debug-enabled inf 7.11.1 regressionJan Kratochvil8-5/+133
Regression: gdb --pid $(pidof qemu-system-x86_64) stopped working with gdb 7.11.1 https://sourceware.org/bugzilla/show_bug.cgi?id=20609 It was reported for qemu-system-x86_64 but it happens for any multithreaded inferior with a JIT debugging hook. 136613ef0c6850427317e57be1b644080ff6decb is the first bad commit Author: Pedro Alves <palves@redhat.com> Fix PR gdb/19828: gdb -p <process from a container>: internal error Message-ID: <cbdf2e04-4fa8-872a-2a23-08c9c1b26e00@redhat.com> https://sourceware.org/ml/gdb-patches/2016-05/msg00450.html jit_breakpoint_re_set() is specific by trying to insert a breakpoint into the main executable, not into a shared library. During attachment GDB thinks it needs to use 'breakpoint always-inserted' from breakpoints_should_be_inserted_now() as a newly attached thread is 'thread_info->executing' due to 'lwp_info->must_set_ptrace_flags' enabled and the task not yet stopped. This did not happen before the 'bad commit' above which adds tracking of such thread. GDB then fails to insert the breakpoints to invalid address as PIE executable gets properly relocated during later phase of attachment. One can see in the backtraces below: -> jit_breakpoint_re_set_internal() later: -> svr4_exec_displacement() One can suppress the initial breakpoint_re_set() call as there will be another breakpoint_re_set() done from the final post_create_inferior() call in setup_inferior(). BTW additionally 'threads_executing' cache bool is somehow stale (somewhere is missing update_threads_executing()). I was trying to deal with that in my first/second attempt below but in my final third attempt (attached) I have left it as it is. First attempt trying not to falsely require 'breakpoint always-inserted': https://people.redhat.com/jkratoch/rhbz1375553-fix1.patch Reduced first attempt: https://people.redhat.com/jkratoch/rhbz1375553-fix2.patch The third attempt suppresses breakpoint insertion until PIE executable gets relocated by svr4_exec_displacement(). Applied. gdb/ChangeLog 2016-09-29 Jan Kratochvil <jan.kratochvil@redhat.com> PR gdb/20609 - attach of JIT-debug-enabled inf 7.11.1 regression * exec.c (exec_file_locate_attach): Add parameter defer_bp_reset. Use it. * gdbcore.h (exec_file_locate_attach): Add parameter defer_bp_reset. * infcmd.c (setup_inferior): Update caller. * remote.c (remote_add_inferior): Likewise. gdb/testsuite/ChangeLog 2016-09-29 Jan Kratochvil <jan.kratochvil@redhat.com> PR gdb/20609 - attach of JIT-debug-enabled inf 7.11.1 regression * gdb.base/jit-attach-pie.c: New file. * gdb.base/jit-attach-pie.exp: New file.
2016-09-28Fix PR 20345 - call_function_by_hand_dummy: Assertion `tp->thread_fsm == ↵Pedro Alves5-0/+105
&sm->thread_fsm' failed If you run an infcall from the command line, and immediately after run some other command, GDB incorrectly processes the other command before the infcall finishes. The problem is that the fix for PR gdb/20418 (Problems with synchronous commands and new-ui, git 3eb7562a983b) moved the add_file_handler/delete_file_handler calls out of target_terminal_$foo, and missed adjusting the infcall code. gdb/ChangeLog: 2016-09-28 Pedro Alves <palves@redhat.com> * infcall.c (run_inferior_call): Remove input from the event loop while running the infcall. gdb/testsuite/ChangeLog: 2016-09-28 Pedro Alves <palves@redhat.com> * gdb.base/infcall-input.c: New file. * gdb.base/infcall-input.exp: New file.
2016-09-28Small improvements to the remote protocol manualTom Tromey2-27/+51
I was reading the gdb RSP manual recently and I found a number of small problems in the documentation. This patch attempts to improve these areas. Specfically: * The term "memory breakpoint" is used only in this section of the manual, and there inconsistently. I found this term confusing -- initially I thought it might be a watchpoint. This patch changes it to use the term "software breakpoint", which is used in the rest of the manual. * The z0 packet didn't document how "kind" was written. And, it had a stray link to the architecture-specific protocol details node. This patch moves this link to a better spot. * The z1 patch didn't document that it accepts cmd_list. * I couldn't find any text saying what response is given to a command like vCont in non-stop mode. The answer is that OK is sent, and then a stop reply is sent as a notification. This patch adds a note about this. * The "create" stop reply did not document that the "R" argument is ignored. * The "W", "X", and "w" packets did not document how the "AA" part is formatted. * The %Stop notification example said "%%Stop", but I think this is incorrect. 2016-09-28 Tom Tromey <tom@tromey.com> * gdb.texinfo (Packets) <z0>: Use "software breakpoint" rather than "memory breakpoint". Further document "kind". Move protocol-details link earlier. <z1>: Document the cmd_list argument. Fix typo. <g>: Remove incorrect sentence. (Stop Reply Packets): Document "OK" response to requests when in non-stop mode. <swbreak>: Use "software breakpoint" rather than "memory breakpoint". <create>: Document that "R" is ignored. <W, X, w>: Document formatting of "AA". (Notification Packets): Use "%Stop", not "%%Stop".
2016-09-27Detect the magic address of EXC_RETURN in ARM coretx-m profileFredrik Hederstierna2-9/+65
On ARMv6-M and ARMv7-M, the exception return address is sort of magic address defined by the manual. This patch is to let GDB well handle these magic addresses. 2016-09-27 Fredrik Hederstierna <fredrik.hederstierna@verisure.com> * arm-tdep.c (arm_m_addr_is_magic): New function. (arm_addr_bits_remove): Call arm_m_addr_is_magic. (arm_m_exception_unwind_sniffer): Likewise.
2016-09-26Call debug_exit in linux_wait_1Yao Qi2-0/+17
When I read the GDBserver debug message, I find the "entering" of linux_wait_1 doesn't match the "existing" of linux_wait_1. Looks we don't call debug_exit somewhere in linux_wait_1 on return. gdb/gdbserver: 2016-09-26 Yao Qi <yao.qi@linaro.org> * linux-low.c (linux_wait_1): Call debug_exit.
2016-09-24Fix a use of target_mourn_inferior in windows-nat.cJon Turney2-1/+6
One use of target_mourn_interior seems to have been missed in bc1e6c81 gdb/ChangeLog: 2016-09-23 Jon Turney <jon.turney@dronecode.org.uk> * windows-nat.c (windows_delete_thread): Adjusting call to target_mourn_inferior to include ptid_t argument.
2016-09-23Use std::string rather than dyn-stringTom Tromey4-39/+27
This patch changes some code in cli-cmds.c to use std::string rather than dyn-string, removing some cleanups. Since this was the last use of dyn-string in gdb, this patch also removes make_cleanup_dyn_string_delete. 2016-09-23 Tom Tromey <tom@tromey.com> * utils.h (make_cleanup_dyn_string_delete): Remove declaration. * utils.c: Don't include dyn-string.h. (do_dyn_string_delete, make_cleanup_dyn_string_delete): Remove. * cli/cli-cmds.c: Include <string>. Don't include dyn-string.h. (argv_to_string): Rename. Change return type to std::string. (alias_command): Use std::string.
2016-09-23Use std::vector in objfiles.cTom Tromey2-7/+11
This patch changes a spot in objfiles.c to use a std::vector, removing a cleanup. 2016-09-23 Tom Tromey <tom@tromey.com> * objfiles.c: Include <vector>. (objfile_relocate): Use std::vector.
2016-09-23Use std::string, std::vector in rust-lang.cTom Tromey2-22/+20
This patch changes some spots in rust-lang.c to use std::string or std::vector, removing some cleanups. 2016-09-23 Tom Tromey <tom@tromey.com> * rust-lang.c: Include <string> and <vector>. (rust_evaluate_funcall): Use std::vector, std::string. (rust_evaluate_subexp): Use std::string. (rust_lookup_symbol_nonlocal): Use std::string.
2016-09-23Use std::string in cp-namespace.cTom Tromey2-34/+22
This changes a few spots in cp-namespace.c to use std::string, removing some cleanups. 2016-09-23 Tom Tromey <tom@tromey.com> * cp-namespace.c: Include <string>. (cp_search_static_and_baseclasses) (cp_lookup_symbol_imports_or_template, find_symbol_in_baseclass): Use std::string.
2016-09-23Use std::string in break-catch-sig.cTom Tromey2-11/+11
This changes one spot in break-catch-sig.c to use std::string, removing some cleanups. 2016-09-23 Tom Tromey <tom@tromey.com> * break-catch-sig.c: Include <string>. (signal_catchpoint_print_one): Use std::string.
2016-09-23Remove some unnecessary codeTom Tromey3-8/+5
This patch removes some unnecessary code. In particular, terminate_minimal_symbol_table is declared in minsyms.h, so it doesn't need to be declared in objfiles.h as well. And, restore_ui_out_closure was rendered unnecessary by an earlier patch, so the structure definition can be removed now. I'm checking this in as obvious. Tested by rebuilding on x86-64 Fedora 24 with --enable-targets=all; which would notice any missing includes of minsyms.h. 2016-09-23 Tom Tromey <tom@tromey.com> * utils.c (struct restore_ui_out_closure): Remove. * objfiles.h (terminate_minimal_symbol_table): Don't declare.
2016-09-23Replace sprintf with xsnprintf in nat/linux-osdata.cYao Qi2-2/+10
I see the following build warning when I build GDB with GCC trunk. ../../binutils-gdb/gdb/nat/linux-osdata.c: In function ‘LONGEST linux_xfer_osdata_fds(gdb_byte*, ULONGEST, ULONGEST)’: ../../binutils-gdb/gdb/nat/linux-osdata.c:767:1: error: ‘%s’ directive writing between 0 and 255 bytes into a region of size 11 [-Werror=format-length=] linux_xfer_osdata_fds (gdb_byte *readbuf, ^~~~~~~~~~~~~~~~~~~~~ ../../binutils-gdb/gdb/nat/linux-osdata.c:800:51: note: format output between 7 and 262 bytes into a destination of size 17 sprintf (procentry, "/proc/%s", dp->d_name); ^ ../../binutils-gdb/gdb/nat/linux-osdata.c: In function ‘LONGEST linux_xfer_osdata_threads(gdb_byte*, ULONGEST, ULONGEST)’: ../../binutils-gdb/gdb/nat/linux-osdata.c:555:1: error: ‘%s’ directive writing between 0 and 255 bytes into a region of size 11 [-Werror=format-length=] linux_xfer_osdata_threads (gdb_byte *readbuf, ^~~~~~~~~~~~~~~~~~~~~~~~~ ../../binutils-gdb/gdb/nat/linux-osdata.c:588:51: note: format output between 7 and 262 bytes into a destination of size 17 sprintf (procentry, "/proc/%s", dp->d_name); ^ cc1plus: all warnings being treated as errors The warning is a false positive, but we can workaround it by replacing sprintf with xsnprintf. On the other hand, it is always preferred to use xsnprintf. gdb: 2016-09-23 Yao Qi <yao.qi@linaro.org> * nat/linux-osdata.c (linux_xfer_osdata_threads): Replace sprintf with xsnprintf. (linux_xfer_osdata_fds): Likewise.
2016-09-23gdb: Replace operator new / operator new[]Pedro Alves6-4/+132
If xmalloc fails allocating memory, usually because something tried a huge allocation, like xmalloc(-1) or some such, GDB asks the user what to do: .../src/gdb/utils.c:1079: internal-error: virtual memory exhausted. A problem internal to GDB has been detected, further debugging may prove unreliable. Quit this debugging session? (y or n) If the user says "n", that throws a QUIT exception, which is caught by one of the multiple CATCH(RETURN_MASK_ALL) blocks somewhere up the stack. The default implementations of operator new / operator new[] call malloc directly, and on memory allocation failure throw std::bad_alloc. Currently, if that happens, since nothing catches it, the exception escapes out of main, and GDB aborts from unhandled exception. This patch replaces the default operator new variants with versions that, just like xmalloc: #1 - Raise an internal-error on memory allocation failure. #2 - Throw a QUIT gdb_exception, so that the exact same CATCH blocks continue handling memory allocation problems. A minor complication of #2 is that operator new can _only_ throw std::bad_alloc, or something that extends it: void* operator new (std::size_t size) throw (std::bad_alloc); That means that if we let a gdb QUIT exception escape from within operator new, the C++ runtime aborts due to unexpected exception thrown. So to bridge the gap, this patch adds a new gdb_quit_bad_alloc exception type that inherits both std::bad_alloc and gdb_exception, and throws _that_. If we decide that we should be catching memory allocation errors in fewer places than all the places we currently catch them (everywhere we use RETURN_MASK_ALL currently), then we could change operator new to throw plain std::bad_alloc then. But I'm considering such a change as separate matter from this one -- it'd make sense to do the same to xmalloc at the same time, for instance. Meanwhile, this allows using new/new[] instead of xmalloc/XNEW/etc. without losing the "virtual memory exhausted" internal-error safeguard. Tested on x86_64 Fedora 23. gdb/ChangeLog: 2016-09-23 Pedro Alves <palves@redhat.com> * Makefile.in (SFILES): Add common/new-op.c. (COMMON_OBS): Add common/new-op.o. (new-op.o): New rule. * common/common-exceptions.h: Include <new>. (struct gdb_quit_bad_alloc): New type. * common/new-op.c: New file. gdb/gdbserver/ChangeLog: 2016-09-23 Pedro Alves <palves@redhat.com> * Makefile.in (SFILES): Add common/new-op.c. (OBS): Add common/new-op.o. (new-op.o): New rule.
2016-09-22Close gdbserver in mi_gdb_exitYao Qi2-5/+38
In commit 6423214f (testsuite: Don't use expect_background to reap gdbserver), we override gdb_exit in lib/gdbserver-support.exp, so that we can close gdbserver first. However, we don't close gdbserver in mi_gdb_exit. This makes a problem in my aarch64 mulit-arch testing, in which I run some mi tests, mi-watch.exp for example, in different variations (aarch64 and arm), Schedule of variations: junor0-2 junor0-2-arm/-marm junor0-2-arm/-mthumb When the test is done in the first variation (aarch64), test case is recompiled for arm, but GDBserver with aarch64 program is still running. When the second variation is started, GDB loads arm program, but GDBserver still loads aarch64 program because the old GDBserver process is using it. We'll get, 47-target-select remote junor0-2:2350^M &"warning: Selected architecture arm is not compatible with reported target architecture aarch64\n"^M &"warning: Architecture rejected target-supplied description\n" This patch fixes this problem by closing GDBserver in mi_gdb_exit. gdb/testsuite: 2016-09-22 Yao Qi <yao.qi@linaro.org> * lib/gdbserver-support.exp: Rename mi_gdb_exit. (gdb_exit): Rename it to ... (gdbserver_gdb_exit): ... Close GDBserver. (gdb_exit): New proc, call gdbserver_gdb_exit. (mi_gdb_exit): Likewise.
2016-09-22Fix build breakage from commit 6ec2b2Edjunior Barbosa Machado2-2/+11
I was notified by buildbot that my patch (commit 6ec2b2) has broken the build on x86_64: ../../binutils-gdb/gdb/rs6000-tdep.c: In function int ppc_process_record_op31(gdbarch*, regcache*, CORE_ADDR, uint32_t): ../../binutils-gdb/gdb/rs6000-tdep.c:4705:50: error: cannot convert CORE_ADDR* {aka long unsigned int*} to ULONGEST* {aka long long unsigned int*} for argument 3 to register_status regcache_raw_read_unsigned(regcache*, int, ULONGEST*) tdep->ppc_gp0_regnum + PPC_RA (insn), &ea); ^ ../../binutils-gdb/gdb/rs6000-tdep.c:4718:50: error: cannot convert CORE_ADDR* {aka long unsigned int*} to ULONGEST* {aka long long unsigned int*} for argument 3 to register_status regcache_raw_read_unsigned(regcache*, int, ULONGEST*) tdep->ppc_gp0_regnum + PPC_RA (insn), &ea); ^ The patch below should fix it. gdb/ChangeLog: 2016-09-22 Edjunior Barbosa Machado <emachado@linux.vnet.ibm.com> * rs6000-tdep.c (ppc_process_record_op31): Fix regcache_raw_read_unsigned call using the correct parameter type.
2016-09-22Use gdbserver-base in remote-gdbserver-on-localhost.expYao Qi3-37/+9
This patch is to make remote-gdbserver-on-localhost.exp use gdbserver-base and remove duplicated code. gdb/testsuite: 2016-09-22 Yao Qi <yao.qi@linaro.org> * boards/gdbserver-base.exp (gdb_server_prog): Set the absolute path. * boards/remote-gdbserver-on-localhost.exp: Use gdbserver-base. Remove duplication.
2016-09-22arc: Fix ARI warning for printf(%p)Anton Kolesov2-2/+7
Replace printf ("%p") with printf ("%s", host_address_to_string ()). Printing host addrss might make sense here because pointers can be null and this would affect how function behaves. This particular warning is printed only when option -Wari is passed to contrib/ari/gdb_ari.sh gdb/ChangeLog: * arc-tdep.c: Fix ARI warning for printf(%p).
2016-09-22Check the right proc nameYao Qi2-1/+6
In lib/gdbserver-support.exp, we rename gdb_exit to gdbserver_orig_gdb_exit, but we check the existence gdbserver_gdb_exit. We should check gdbserver_orig_gdb_exit instead. Looks it is a typo or an oversight. gdb/testsuite: 2016-09-22 Yao Qi <yao.qi@linaro.org> * lib/gdbserver-support.exp: Check the existence of gdbserver_orig_gdb_exit rather than gdbserver_gdb_exit.
2016-09-21Add myself as a write-after-approval GDB maintainerAnton Kolesov2-0/+5
gdb/ChangeLog: * MAINTAINERS (Write After Approval): Add Anton Kolesov.
2016-09-21arc: New Synopsys ARC portAnton Kolesov15-1/+1822
ARC is a family of licensable processors developed by Synopsys. This is an initial patch that doesn't yet support some of the features, that are already available in Synopsys' fork of GDB, namely: * longjmp support * signal frame handling * prologue analysis * Linux targets support * native Linux support ARC cores are configurable and extensible, which means from debugger perspective that some registers and debug capabilities are optional, therefore it is up to the GDB stub to determine exact list of register available on target and supply it to GDB via XML target descriptions. List of registers that is known to GDB and is required is intentionally kept small to simplify requirements to GDB stub and implementation of a GDB client. gdb/ChangeLog: * Makefile.in (ALL_TARGET_OBS): Add arc-tdep.o. (HFILES_NO_SRCDIR): Add arc-tdep.h. (ALLDEPFILES): Add arc-tdep.c. * NEWS: Mention new ARC port. * configure.tgt: Add ARC. * arc-tdep.c: New file. * arc-tdep.h: New file. * features/Makefile (XMLTOC): Add arc-v2.xml and arc-arcompact.xml. * features/arc-v2.xml: New file. * features/arc-v2.c: New file (generated). * features/arc-arcompact.xml: New file. * features/arc-arcompact.c: New file (generated). gdb/doc/ChangeLog: * gdb.texinfo (Embedded Processors): Document ARC. (Synopsys ARC): New section. (Standard Target Features): Document ARC features. (ARC Features): New section. gdb/testsuite/ChangeLog: * gdb.xml/tdesc-regs.exp: set core-regs for arc*-*-elf32.
2016-09-21ppc: Fix return of instruction handlers in ppc_process_record_op63Edjunior Barbosa Machado2-2/+8
some instruction handlers in ppc_process_record_op63() seem to be missing return or incorrectly using break. This patch aims to fix that. gdb/ChangeLog: 2016-09-21 Edjunior Barbosa Machado <emachado@linux.vnet.ibm.com> * rs6000-tdep.c (ppc_process_record_op63): Fix return of instruction handlers.
2016-09-21PR gdb/20604 - fix "quit" when an invalid expression is usedTom Tromey6-10/+65
This fixes PR gdb/20604. The bug here is that passing an invalid expression to "quit" -- e.g., "quit()" -- causes gdb to enter a non-functioning state. The immediate problem is that quit_force resets the terminal before evaluating the expression. However, it seemed to me that it doesn't really make sense to pass the quit_force argument to kill_or_detach (which passes it to to_detach), first because conflating the exit status for "quit" and the signal to pass when detaching doesn't make sense, and second because to_detach implementations generally only accept a constant here, while "quit" accepts an expression. So, I removed that. As an aside, I think the "detach SIGNO" functionality is not documented. Built and regtested on x86-64 Fedora 24. 2016-09-21 Tom Tromey <tom@tromey.com> PR gdb/20604: * top.h (quit_force): Update. * top.c (quit_force): Changed type of first argument. Don't evaluate expression. Pass NULL to kill_or_detach. * cli/cli-cmds.c (quit_command): Evaluate "args". 2016-09-21 Tom Tromey <tom@tromey.com> PR gdb/20604: * gdb.base/quit.exp: New file.
2016-09-21Update and add .gitignore'sSimon Marchi9-0/+53
This patch adds a bunch of generated files to gdb's gitignore files. There are still a bunch of "stamp" files that are not ignored, but I think the rule for them should be put in the top-level gitignore. Users and developers are encouraged to build out-of-tree, but some people prefer the simplicity to build in-tree, so it should be useful for them. gdb/ChangeLog: * .gitignore: Ignore more files. * data-directory/.gitignore: Likewise. gdb/doc/ChangeLog: * .gitignore: New file. gdb/gdbserver/ChangeLog: * .gitinore: Ignore more files. gdb/testsuite/ChangeLog: * .gitignore: New file.
2016-09-21ppc: Add Power ISA 3.0/POWER9 instructions record supportEdjunior Barbosa Machado2-11/+460
gdb/ChangeLog: 2016-09-21 Edjunior Barbosa Machado <emachado@linux.vnet.ibm.com> * rs6000-tdep.c (PPC_DQ): New macro. (ppc_process_record_op4): Add Power ISA 3.0 instructions. (ppc_process_record_op19): Likewise. (ppc_process_record_op31): Likewise. (ppc_process_record_op59): Likewise. (ppc_process_record_op60): Likewise. (ppc_process_record_op63): Likewise. (ppc_process_record): Likewise. (ppc_process_record_op61): New function.
2016-09-21MIPS/testsuite: mips16-thunks: Use `standard_output_file'Maciej W. Rozycki2-5/+9
Correct a commit 2151ccc56c74 ("Always organize test artifacts in a directory hierarchy") regression causing: Running .../gdb/testsuite/gdb.arch/mips16-thunks.exp ... gdb compile failed, Assembler messages: Fatal error: can't create .../gdb/testsuite/gdb.arch/mips16-thunks-inmain.o: No such file or directory gdb compile failed, Assembler messages: Fatal error: can't create .../gdb/testsuite/gdb.arch/mips16-thunks-main.o: No such file or directory gdb compile failed, mips-mti-linux-gnu-gcc: error: .../gdb/testsuite/gdb.arch/mips16-thunks-inmain.o: No such file or directory mips-mti-linux-gnu-gcc: error: .../gdb/testsuite/gdb.arch/mips16-thunks-main.o: No such file or directory UNSUPPORTED: gdb.arch/mips16-thunks.exp: No MIPS16 support in the toolchain. by using `standard_output_file' to construct output file names throughout. gdb/testsuite/ * gdb.arch/mips16-thunks.exp: Use `standard_output_file' throughout.
2016-09-21Keep reserved bits in CPSR on writeYao Qi4-2/+23
In patch https://sourceware.org/ml/gdb-patches/2016-04/msg00529.html I cleared reserved bits when reading CPSR. It makes a problem that these bits (zero) are written back to kernel through ptrace, and it changes the state of the processor on some recent kernel, which is unexpected. In this patch, I keep these reserved bits when write CPSR back to hardware. gdb: 2016-09-21 Yao Qi <yao.qi@linaro.org> * aarch32-linux-nat.c (aarch32_gp_regcache_collect): Keep bits 20 to 23. gdb/gdbserver: 2016-09-21 Yao Qi <yao.qi@linaro.org> * linux-aarch32-low.c (arm_fill_gregset): Keep bits 20 to 23.
2016-09-20Avoid -Wduplicated-cond warnings in gdb/pythonTom Tromey3-0/+11
I tried building gdb with -Wduplicated-cond. This patch fixes the simpler issue that was found. In Python 3, "int" and "long" are synonyms, so code like: else if (PyLong_Check (obj)) ... else if (PyInt_Check (obj)) .... will trigger this warning. The fix is to conditionalize the PyInt_Check branches on Python 2. Tested by rebuilding, with both version of Python, on x86-64 Fedora 24. 2016-09-20 Tom Tromey <tom@tromey.com> * python/py-value.c (convert_value_from_python): Make PyInt_Check conditional on Python 2. * python/py-arch.c (archpy_disassemble): Make PyInt_Check conditional on Python 2.
2016-09-20ppc: Fix record support of Store String Word instructionsEdjunior Barbosa Machado2-3/+12
gdb/ChangeLog 2016-09-20 Edjunior Barbosa Machado <emachado@linux.vnet.ibm.com> * rs6000-tdep.c (ppc_process_record_op31): Fix record of Store String Word instructions.
2016-09-20Use 'event_ptid' instead of 'resume_ptid' on startup_inferior (fix for ↵Sergio Durigan Junior2-2/+8
regression on my last commit) Pedro pointed out a regression happening on gdb.mi/mi-exec-run.exp, and as it turned out, this was a thinko when dealing with some events on startup_inferior. Basically, one needs to pass 'event_ptid' to target_mourn_inferior, but I mistakenly passed 'resume_ptid'. This commit fixes it. Built and regtested on BuildBot, now with fixed e-mail notifications! gdb/ChangeLog: 2016-09-20 Sergio Durigan Junior <sergiodj@redhat.com> * fork-inferior.c (startup_inferior): Pass 'event_ptid' instead of 'resume_ptid' to 'target_mourn_inferior'. Fix regression introduced by my last commit.