Skip to content
Snippets Groups Projects
  1. Jul 20, 2014
    • Michael Eager's avatar
      Fix for remote G Packet message too long error for baremetal. · 164224e9
      Michael Eager authored
      
      Prior to version MicroBlaze v8.10.a,EDK 13.1, XMD's gdbserver stub returned 57
      registers in response to GDB's G request. Starting with version MicroBlaze
      v8.10.a, EDK 13.1, XMD added the slr and shr register, for a count of 59
      registers. This patch adds these registers to the expected G response. This patch
      fixes the above problem for baremetal and also supports the backward compatibility.
      
      ChangeLog:
      2014-07-02  Ajit Agarwal  <ajitkum@xilinx.com>
      
      	* microblaze-tdep.c (microblaze_register_names): Add
      	the rshr and rslr register names.
      	(microblaze_gdbarch_init): Use of tdesc_has_registers.
      	Use of tdesc_find_feature. Use of tdesc_data_alloc.
      	Use of tdesc_numbered_register. Use of
      	microblaze_register_g_packet_guesses. Use of
      	tdesc_use_registers. Use of set_gdbarch_register_type.
      	(microblaze_register_g_packet_guesses): New.
      	* microblaze-tdep.h (microblaze_reg_num): Add
      	field MICROBLAZE_SLR_REGNUM MICROBLAZE_SHR_REGNUM
      	MICROBLAZE_NUM_REGS and MICROBLAZE_NUM_CORE_REGS.
      	(microblaze_frame_cache): Use of MICROBLAZE_NUM_REGS.
      	* features/microblaze-core.xml: New file.
      	* features/microblaze-stack-protect.xml: New file.
      	* features/microblaze-with-stack-protect.c: New file.
      	* features/microblaze-with-stack-protect.xml: New file.
      	* features/microblaze.xml: New file.
      	* features/microblaze.c: New file.
      	* features/Makefile (microblaze-with-stack-protect): Add
      	microblaze-with-stack-protect microblaze and
      	microblaze-expedite.
      	* regformats/microblaze-with-stack-protect.dat: New file.
      	* regformats/microblaze.dat: New file.
      	* doc/gdb.texinfo (MicroBlaze Features): New.
      
      Signed-off-by: default avatarAjit Agarwal <ajitkum@xilinx.com>
      164224e9
    • Alan Modra's avatar
      daily update · 57319490
      Alan Modra authored
      57319490
  2. Jul 19, 2014
  3. Jul 18, 2014
    • Tom Tromey's avatar
      make exec_ops static · e8b2341c
      Tom Tromey authored
      While working on some target stack changes, I noticed that exec_ops is
      only used from exec.c.  This patch makes it "static".  This is cleaner
      and makes it simpler to reason about the use of the target.
      
      Tested by rebuilding.
      I'm checking this in as obvious.
      
      2014-07-18  Tom Tromey  <tromey@redhat.com>
      
      	* exec.c (exec_ops): Now static.
      	* exec.h (exec_ops): Don't declare.
      e8b2341c
    • Tom Tromey's avatar
      fix calls to find_target_beneath · 44e89118
      Tom Tromey authored
      A long time ago Pedro pointed out that there are some calls to
      find_target_beneath that pass in an explicit target_ops; but which
      should instead use the ops provided to the method in question.  See:
      
          https://sourceware.org/ml/gdb-patches/2014-01/msg00429.html
      
      This patch is just a minor cleanup to fix all such calls.  There were
      only three.
      
      2014-07-18  Tom Tromey  <tromey@redhat.com>
      
      	* spu-multiarch.c (spu_region_ok_for_hw_watchpoint): Pass "self"
      	to find_target_beneath.
      	* ravenscar-thread.c (ravenscar_prepare_to_store): Pass "ops" to
      	find_target_beneath.
      	(ravenscar_mourn_inferior): Pass "self" to find_target_beneath.
      44e89118
    • Tom Tromey's avatar
      fix PR gdb/17130 · b0ed115f
      Tom Tromey authored
      This fixes PR gdb/17130.
      
      The bug is that some code in utils.c was not updated during the target
      delegation change:
      
        if (job_control
            /* If there is no terminal switching for this target, then we can't
               possibly get screwed by the lack of job control.  */
            || current_target.to_terminal_ours == NULL)
          fatal ("Quit");
        else
          fatal ("Quit (expect signal SIGINT when the program is resumed)");
      
      After the delegation change, to_terminal_ours will never be NULL.
      
      I think this bug can be seen before the target delegation change by
      enabling target debugging -- this would also cause to_terminal_ours to
      be non-NULL.
      
      The fix is to introduce a new target_supports_terminal_ours function,
      that properly checks the target stack.  This is not perhaps ideal, but
      I think is a reasonable-enough approach, and in keeping with some
      other existing code of the same form.
      
      This patch also fixes a similar bug in target_supports_delete_record.
      
      2014-07-18  Tom Tromey  <tromey@redhat.com>
      
      	PR gdb/17130:
      	* utils.c (quit): Use target_supports_terminal_ours.
      	* target.h (target_supports_terminal_ours): Declare.
      	* target.c (target_supports_delete_record): Don't check
      	to_delete_record against NULL.
      	(target_supports_terminal_ours): New function.
      b0ed115f
    • Tom Tromey's avatar
      clean up some target delegation cases · e75fdfca
      Tom Tromey authored
      This patch cleans up some minor inconsistencies in target delegation.
      It's primary purpose is to avoid confusion in the code.  A few spots
      were checking the "beneath" target; however this can only be NULL for
      the dummy target, so such tests are not needed.  Some other spots were
      iterating over the beneath targets, looking for a method
      implementation.  This is not needed for methods handled by
      make-target-delegates, as there is always an implementation.
      
      2014-07-18  Tom Tromey  <tromey@redhat.com>
      
      	PR gdb/17130:
      	* spu-multiarch.c (spu_region_ok_for_hw_watchpoint)
      	(spu_fetch_registers, spu_store_registers, spu_xfer_partial)
      	(spu_search_memory, spu_mourn_inferior): Simplify delegation.
      	* linux-thread-db.c (thread_db_pid_to_str): Always delegate.
      	* windows-nat.c (windows_xfer_partial): Always delegate.
      	* record-btrace.c (record_btrace_xfer_partial): Simplify
      	delegation.
      	(record_btrace_fetch_registers, record_btrace_store_registers)
      	(record_btrace_prepare_to_store, record_btrace_resume)
      	(record_btrace_wait, record_btrace_find_new_threads)
      	(record_btrace_thread_alive): Likewise.
      	* procfs.c (procfs_xfer_partial): Always delegate.
      	* corelow.c (core_xfer_partial): Always delegate.
      	* sol-thread.c (sol_find_new_threads): Simplify delegation.
      e75fdfca
    • Tom Tromey's avatar
      move exec_make_note_section earlier · 83814951
      Tom Tromey authored
      This patch moves exec_make_note_section a bit earlier in exec.c.  This
      lets us remove an otherwise unnecessary forward declaration and it
      also makes the file a bit more in line with other code, as now
      _initialize_exec is the final function in the file.
      
      Tested by rebuilding.
      I'm committing this as obvious.
      
      2014-07-18  Tom Tromey  <tromey@redhat.com>
      
      	* exec.c (exec_make_note_section): Move earlier.
      83814951
    • Alan Modra's avatar
      daily update · fe1873d0
      Alan Modra authored
      fe1873d0
  4. Jul 17, 2014
  5. Jul 16, 2014
    • Stefan Kristiansson's avatar
      or1k: increase linux TEXT_START_ADDR to 0x2000 · 8d14e191
      Stefan Kristiansson authored
      Override the default value of 0x0000 defined in
      TEXT_START_ADDR to avoid linux executables to be mapped
      at zero page.
      
      ld/
      	* emulparams/elf32or1k_linux.sh (TEXT_START_ADDR): Increase from
      	0x0 to first page boundary at 0x2000.
      8d14e191
    • Pedro Alves's avatar
      Linux: Use kill_lwp/tkill instead of kill when killing a process · 69ff6be5
      Pedro Alves authored
      Since we use tkill everywhere, using kill to try to kill each lwp
      individually looks suspiciously odd.  We should really be using tgkill
      everywhere, but at least while we don't get there this makes us
      consistent.
      
      gdb/gdbserver/
      2014-07-16  Pedro Alves  <palves@redhat.com>
      
      	* linux-low.c (linux_kill_one_lwp): Use kill_lwp, not kill.
      
      gdb/
      2014-07-16  Pedro Alves  <palves@redhat.com>
      
      	* linux-nat.c (kill_callback): Use kill_lwp, not kill.
      69ff6be5
    • Pedro Alves's avatar
      gdb.trace/tfile.c: Remove Thumb bit in one more more, general cleanup · 1b5d0ab3
      Pedro Alves authored
      I noticed that the existing code casts a function's address to 'long',
      but that doesn't work correctly on some ABIs, like Win64, where long
      is 32-bit and while pointers are 64-bit:
      
        func_addr = (long) &write_basic_trace_file;
      
      Fixing that showed there's actually another place in the file that
      writes a function address to file, and therefore should clear the
      Thumb bit.  This commit adds a macro+function pair to centralize the
      Thumb bit handling, and uses it in both places.
      
      The rest is just enough changes to make the file build without
      warnings with "-Wall -Wextra" with x86_64-w64-mingw32-gcc and
      i686-w64-mingw32-gcc cross compilers, and with -m32/-m64 on x86_64
      GNU/Linux.  Currently with x86_64-w64-mingw32-gcc we get:
      
        $ x86_64-w64-mingw32-gcc tfile.c  -Wall -DTFILE_DIR=\"\"
        tfile.c: In function 'start_trace_file':
        tfile.c:51:23: error: 'S_IRGRP' undeclared (first use in this function)
      	 S_IRUSR|S_IWUSR|S_IRGRP|S_IROTH);
      			 ^
        tfile.c:51:23: note: each undeclared identifier is reported only once for each function it appears in
        tfile.c:51:31: error: 'S_IROTH' undeclared (first use in this function)
      	 S_IRUSR|S_IWUSR|S_IRGRP|S_IROTH);
      				 ^
        tfile.c: In function 'add_memory_block':
        tfile.c:79:10: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
           ll_x = (unsigned long) addr;
      	    ^
        tfile.c: In function 'write_basic_trace_file':
        tfile.c:113:15: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
           func_addr = (long) &write_basic_trace_file;
      		 ^
        tfile.c:137:3: warning: passing argument 1 of 'add_memory_block' from incompatible pointer type [enabled by default]
           add_memory_block (&testglob, sizeof (testglob));
           ^
        tfile.c:72:1: note: expected 'char *' but argument is of type 'int *'
         add_memory_block (char *addr, int size)
         ^
        tfile.c:139:3: warning: passing argument 1 of 'add_memory_block' from incompatible pointer type [enabled by default]
           add_memory_block (&testglob2, 1);
           ^
        tfile.c:72:1: note: expected 'char *' but argument is of type 'int *'
         add_memory_block (char *addr, int size)
         ^
        tfile.c: In function 'write_error_trace_file':
        tfile.c:185:3: warning: implicit declaration of function 'alloca' [-Wimplicit-function-declaration]
           char *hex = alloca (len * 2 + 1);
           ^
        tfile.c:185:15: warning: incompatible implicit declaration of built-in function 'alloca' [enabled by default]
           char *hex = alloca (len * 2 + 1);
      		 ^
        tfile.c:211:6: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
      	(long) &write_basic_trace_file);
            ^
      
      Tested on x86_64 Fedora 20, -m64 and -m32.
      Tested by Yao on arm targets.
      
      gdb/testsuite/
      2014-07-16  Pedro Alves  <palves@redhat.com>
      
      	* gdb.trace/tfile.c: Include unistd.h and stdint.h.
      	(start_trace_file): Guard S_IRGRP and S_IROTH uses behind #ifdef.
      	(tfile_write_64, tfile_write_16, tfile_write_8, tfile_write_addr)
      	(tfile_write_buf): New functions.
      	(add_memory_block): Rewrite using the above.
      	(adjust_function_address): New function.
      	(FUNCTION_ADDRESS): New macro.
      	(write_basic_trace_file): Remove short_x local, and use
      	tfile_write_16. Change type of func_addr local to unsigned long
      	long.  Use FUNCTION_ADDRESS instead of handling the Thumb bit
      	here.  Cast argument of add_memory_block to char pointer.
      	(write_error_trace_file): Avoid alloca.  Use FUNCTION_ADDRESS.
      	(main): Remove parameters.
      	* gdb.trace/tfile.exp: Remove nowarnings.
      1b5d0ab3
    • H.J. Lu's avatar
      Match PLT entry only for ELFOSABI_GNU input · cca5b8b6
      H.J. Lu authored
      	* elf32-i386.c (elf_i386_plt_sym_val): Match PLT entry only for
      	ELFOSABI_GNU input.
      	* elf64-x86-64.c (elf_x86_64_plt_sym_val): Likewise.
      	(elf_x86_64_plt_sym_val_offset_plt_bnd): Likewise.
      cca5b8b6
    • H.J. Lu's avatar
      Properly match PLT entry against .got.plt relocation · 144bed8d
      H.J. Lu authored
      Relocations against .got.plt section may not be in the same order as
      entries in PLT section.  It is incorrect to assume that the Ith reloction
      index against .got.plt section always maps to the (I + 1)th entry in PLT
      section.  This patch matches the .got.plt relocation offset/index in PLT
      entry against the index in .got.plt relocation table.  It only checks
      R_*_JUMP_SLOT and R_*_IRELATIVE relocations.  It ignores R_*_TLS_DESC
      and R_*_TLSDESC relocations since they have different PLT entries.
      
      bfd/
      
      	PR binutils/17154
      	* elf32-i386.c (elf_i386_plt_sym_val): Only match R_*_JUMP_SLOT
      	and R_*_IRELATIVE relocation offset with PLT entry.
      	* elf64-x86-64.c (elf_x86_64_plt_sym_val): Likewise.
      	(elf_x86_64_plt_sym_val_offset_plt_bnd): New.
      	(elf_x86_64_get_synthetic_symtab): Use it.
      
      ld/testsuite/
      
      	PR binutils/17154
      	* ld-ifunc/pr17154-i386.d: New file.
      	* ld-ifunc/pr17154-x86-64.d: Likewise.
      	* ld-ifunc/pr17154-x86.s: Likewise.
      	* ld-x86-64/bnd-ifunc-2.d: Likewise.
      	* ld-x86-64/bnd-ifunc-2.s: Likewise.
      	* ld-x86-64/mpx.exp: Run bnd-ifunc-2.
      	* ld-x86-64/tlsdesc-nacl.pd: Updated.
      	* ld-x86-64/tlsdesc.pd: Likewise.
      144bed8d
    • Simon Marchi's avatar
      Add test for string evaluation with "debug expression" on · 4d974e88
      Simon Marchi authored
      As Joel pointed out in...
      https://sourceware.org/ml/gdb-patches/2014-07/msg00391.html
      ...it would be nice to add a test for that.
      
      Tested on Linux x86_64 (Ubuntu 14.10).
      
      gdb/testsuite/ChangeLog
      
      2014-07-15  Simon Marchi  <simon.marchi@ericsson.com>
      
      	* gdb.base/debug-expr.exp: Test string evaluation with
      	"debug expression" on.
      4d974e88
    • Tom Tromey's avatar
      reformat comment in target.h · 252db1b5
      Tom Tromey authored
      A comment in target.h went past the column limit.  This patch
      reformats it.  I'm pushing this as obvious.
      
      2014-07-16  Tom Tromey  <tromey@redhat.com>
      
      	* target.h (struct target_ops) <to_delete_record>: Reformat
      	comment.
      252db1b5
    • Tom Tromey's avatar
      rebuild target-delegates.c · a432721e
      Tom Tromey authored
      target-delegates.c was out of date.  This patch rebuilds it.
      Built and regtested on x86-64 Fedora 20.
      Committed as obvious.
      
      2014-07-16  Tom Tromey  <tromey@redhat.com>
      
      	* target-delegates.c: Rebuild.
      a432721e
    • Alan Modra's avatar
      daily update · 0a45ee16
      Alan Modra authored
      0a45ee16
  6. Jul 15, 2014
    • H.J. Lu's avatar
      Update elf_i386_compute_jump_table_size · 998d811a
      H.J. Lu authored
      Commit e1f98742 changed how
      next_tls_desc_index was set up.  This patch updates
      elf_i386_compute_jump_table_size to use elf.srelplt->reloc_count
      instead of next_tls_desc_index.
      
      bfd/
      
      	PR ld/17057
      	* elf32-i386.c (elf_i386_compute_jump_table_size): Replace
      	next_tls_desc_index with elf.srelplt->reloc_count.
      
      ld/testsuite/
      
      	PR ld/17057
      	* ld-i386/i386.exp: Run pr17057.
      	* ld-i386/pr17057.d: New file.
      	* ld-i386/pr17057.s: Likewise.
      998d811a
    • Pedro Alves's avatar
      gdb.base/reread.exp: Really restart GDB · 41e99568
      Pedro Alves authored
      The other day I noticed that default_gdb_start reuses the GDB process
      if it has been spawned already:
      
      proc default_gdb_start { } {
      ...
          if [info exists gdb_spawn_id] {
      	return 0
          }
      
      I was a bit surprised, and so I hacked in an error to check whether
      anything is relying on it:
      
       + if [info exists gdb_spawn_id] {
       +    error "GDB already spawned"
       + }
      
      And lo, that tripped on a funny buglet (see below).  The comment in
      reread.exp says "Restart GDB entirely", but in reality, due to the
      above, that's not what is happening, as a gdb_exit call is missing.
      The test is proceeding with the previous GDB process...
      
      I don't really want to go hunt for whether there's an odd setup out
      there that assumes this in its board file or something, so for now,
      I'm taking the simple route of just making the test do what it says it
      does.  I think this much makes it an obvious fix.
      
       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
       (gdb) PASS: gdb.base/reread.exp: run to foo() second time
       ERROR: tcl error sourcing ../src/gdb/testsuite/gdb.base/reread.exp.
       ERROR: GDB already spawned
           while executing
       "error "GDB already spawned""
           invoked from within
       "if [info exists gdb_spawn_id] {
      	 error "GDB already spawned"
           }"
           (procedure "default_gdb_start" line 22)
           invoked from within
       "default_gdb_start"
           (procedure "gdb_start" line 2)
           invoked from within
       "gdb_start"
           invoked from within
       "if [is_remote target] {
           unsupported "second pass: GDB should check for changes before running"
       } else {
      
           # Put the older executable back in pl..."
           (file "../src/gdb/testsuite/gdb.base/reread.exp" line 114)
           invoked from within
       "source ../src/gdb/testsuite/gdb.base/reread.exp"
           ("uplevel" body line 1)
           invoked from within
       "uplevel #0 source ../src/gdb/testsuite/gdb.base/reread.exp"
           invoked from within
       "catch "uplevel #0 source $test_file_name""
       testcase ../src/gdb/testsuite/gdb.base/reread.exp completed in 1 seconds
       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      
      gdb/testsuite/
      2014-07-15  Pedro Alves  <palves@redhat.com>
      
      	* gdb.base/reread.exp: Use clean_restart.
      41e99568
    • Pierre Langlois's avatar
      Add support for the __flash qualifier on AVR · 487d9753
      Pierre Langlois authored
      The __flash qualifier is part of the named address spaces for AVR [1]. It
      allows putting read-only data in the flash memory, normally reserved for
      code.
      
      When used together with a pointer, the DW_AT_address_class attribute is set
      to 1 and allows GDB to detect that when it will be dereferenced, the data
      will be loaded from the flash memory (with the LPM instruction).
      
      We can now properly debug the following code:
      
      ~~~
      const __flash char data_in_flash = 0xab;
      
      int
      main (void)
      {
        const __flash char *pointer_to_flash = &data_in_flash;
      }
      ~~~
      
      ~~~
      (gdb) print pointer_to_flash
      $1 = 0x1e8 <data_in_flash> "\253"
      (gdb) print/x *pointer_to_flash
      $2 = 0xab
      (gdb) x/x pointer_to_flash
      0x1e8 <data_in_flash>: 0xXXXXXXab
      ~~~
      
      Whereas previously, GDB would revert to the default address space which is
      RAM and mapped in higher memory:
      
      ~~~
      (gdb) print pointer_to_flash
      $1 = 0x8001e8 ""
      ~~~
      
      [1] https://gcc.gnu.org/onlinedocs/gcc/Named-Address-Spaces.html
      
      2014-07-15  Pierre Langlois  <pierre.langlois@embecosm.com>
      
      gdb/
      	* avr-tdep.c (AVR_TYPE_ADDRESS_CLASS_FLASH): New macro.
      	(AVR_TYPE_INSTANCE_FLAG_ADDRESS_CLASS_FLASH): Likewise.
      	(avr_address_to_pointer): Check for AVR_TYPE_ADDRESS_CLASS_FLASH.
      	(avr_pointer_to_address): Likewise.
      	(avr_address_class_type_flags): New function.
      	(avr_address_class_type_flags_to_name): Likewise.
      	(avr_address_class_name_to_type_flags): Likewise.
      	(avr_gdbarch_init): Set address_class_type_flags,
      	address_class_type_flags_to_name and
      	address_class_name_to_type_flags.
      
      gdb/testsuite/
      	* gdb.arch/avr-flash-qualifer.c: New.
      	* gdb.arch/avr-flash-qualifer.exp: New.
      487d9753
    • Pedro Alves's avatar
      [GDB/Linux] Avoid stale errno · 57745c90
      Pedro Alves authored
      The fix that went into GDBserver is also needed on the GDB side.
      
      Although most compilers follow right-to-left evaluation order, the
      order of evaluation of a function call's arguments is really
      unspecified.  target_pid_to_str may well clobber errno when we get to
      evaluate the third argument to fprintf_unfiltered.
      
      gdb/
      2014-07-15  Pedro Alves  <palves@redhat.com>
      
      	* linux-nat.c (kill_callback): Save errno and work with saved
      	copy.
      57745c90
    • Simon Marchi's avatar
      Handle OP_STRING in dump_subexp_body_standard · 2d40be18
      Simon Marchi authored
      For some reason, OP_STRING is not handled in dump_subexp_body_standard.
      This makes the output of "set debug expression 1" very bad when a string
      is involved. Example:
      
      (gdb) set debug expression 1
      (gdb) print "hello"
      ... (random garbage, possibly segfault)
      
      This commit handles OP_STRING and skips the appropriate number of exp
      elements. The line corresponding to the string now looks like:
      
      	    0  OP_STRING             Language-specific string type: 0
      
      gdb/ChangeLog:
      
      2014-07-15  Simon Marchi  <simon.marchi@ericsson.com>
      
      	* expprint.c (dump_subexp_body_standard): Handle OP_STRING.
      2d40be18
    • Pedro Alves's avatar
      [GDBserver] Avoid stale errno · ce9e3fe7
      Pedro Alves authored
      Although most compilers follow right-to-left evaluation order, the
      order of evaluation of a function call's arguments is really
      unspecified.  target_pid_to_str or ptid_of may well clobber errno when
      we get to evaluate the third argument to debug_printf.
      
      gdb/gdbserver/
      2014-07-15  Pedro Alves  <palves@redhat.com>
      
      	* linux-low.c (linux_kill_one_lwp): Save errno and work with saved
      	copy.
      ce9e3fe7
    • Jiong Wang's avatar
      [ARM] Fix 32-bit host build failure. · 19f2f6a9
      Jiong Wang authored
        gas/
          * config/tc-arm.c (add_to_lit_pool): Use "inst.operands[1].imm" for * sign
          extension.  Casting the type of imm1 and imm2 to offsetT.  Fix one logic
          error when checking X_op.
      19f2f6a9
    • Jiong Wang's avatar
      [AArch64] Fix ld testcase linker script glitch. · d6f18fe6
      Jiong Wang authored
        Specify -T relocs.ld for emit-relocs-local-addend.d to be consistent
        will all other emit-relocs* testcases
      
        ld/testsuite/
          * ld-aarch64/emit-relocs-local-addend.d: Use target linker script.
      d6f18fe6
    • Andreas Schwab's avatar
      Don't complain about dbCC to long branch conversion · ea7cc5bf
      Andreas Schwab authored
      * config/tc-m68k.c (md_convert_frag_1): Don't complain with
      --pcrel about TAB (DBCCLBR, LONG) conversion.
      ea7cc5bf
    • Alan Modra's avatar
      Account for trailing bytes read from bfd_bread · 87f14779
      Alan Modra authored
      	* cache.c (cache_bread_1): Don't return -1 when fread returns
      	a positive value.
      87f14779
    • Alan Modra's avatar
      tidy elf_merge_st_other · cd3416da
      Alan Modra authored
      So that we munge isym->st_other once per symbol.
      
      	* elflink.c (elf_merge_st_other): Update comments.  Simplify
      	visibility handling.  Make isym const.  Move code modifying
      	isym->st_other for --exclude-libs to..
      	(elf_link_add_object_symbols): ..here.
      cd3416da
    • Alan Modra's avatar
      daily update · 98d45516
      Alan Modra authored
      98d45516
    • Edjunior Barbosa Machado's avatar
      2014-07-14 Edjunior Barbosa Machado <emachado@linux.vnet.ibm.com> · 572f6555
      Edjunior Barbosa Machado authored
      	* ppc-linux-nat.c (ppc_linux_can_use_hw_breakpoint): Report no hardware
      	breakpoint support correctly.
      572f6555
  7. Jul 14, 2014
    • Pedro Alves's avatar
      Add missing ChangeLog entry for 15cd413a · cc1c52ad
      Pedro Alves authored
      Put GDB's terminal settings into effect when paginating
      gdb/
      2014-07-14  Pedro Alves  <palves@redhat.com>
      
      	* utils.c (prompt_for_continue): Call target_terminal_ours.
      
      gdb/testsuite/
      2014-07-14  Pedro Alves  <palves@redhat.com>
      
      	* gdb.base/paginate-after-ctrl-c-running.c: New file.
      	* gdb.base/paginate-after-ctrl-c-running.exp: New file.
      cc1c52ad
    • Pedro Alves's avatar
      Put GDB's terminal settings into effect when paginating · 82584158
      Pedro Alves authored
      When the target is resumed in the foreground, we put the inferior's
      terminal settings into effect, and remove stdin from the event loop.
      When the target stops, we put GDB's terminal settings into effect
      again, and re-register stdin in the event loop, ready for user input.
      The former is done by target_terminal_inferior, and the latter by
      target_terminal_ours.
      
      There's an intermediate -- target_terminal_ours_for_output -- that is
      called when printing output related to target events, and we don't
      know yet whether we'll stop the program.  That puts our terminal
      settings into effect, enough to get proper results from our output,
      but leaves input wired into the inferior.
      
      If such output paginates, then we need the full target_terminal_ours
      in order for the user to be able to provide input to answer the
      pagination query.
      
      The test in this commit hangs in async-capable targets without the fix
      (as the user/test can't answer the pagination query).  It doesn't hang
      on sync targets because on those we don't unregister stdin from the
      event loop while the target is running (because we block in
      target_wait instead of in the event loop in that case).
      
      gdb/
      2014-07-14  Pedro Alves  <palves@redhat.com>
      
      	* utils.c (prompt_for_continue): Call target_terminal_ours.
      
      gdb/testsuite/
      2014-07-14  Pedro Alves  <palves@redhat.com>
      
      	* gdb.base/paginate-after-ctrl-c-running.c: New file.
       	* gdb.base/paginate-after-ctrl-c-running.exp: New file.
      82584158
    • Pedro Alves's avatar
      Fix double prompt · 1e973570
      Pedro Alves authored
      If an error is thrown while handling a target event (within
      fetch_inferior_event), and, the interpreter is not async (but the
      target is), then GDB prints the prompt twice.
      
      One way to see that in action is throw a QUIT while in a pagination
      prompt issued from within fetch_inferior_event (or one of its
      callees).  E.g. from the test:
      
       ---Type <return> to continue, or q <return> to quit---
       ^CQuit
       (gdb) (gdb) p 1
       ^^^^^^^^^^^
       $1 = 1
       (gdb)
      
      The issue is that inferior_event_handler swallows errors and notifies
      the observers (the interpreters) about the command error, even if the
      interpreter is forced sync while we're handling a nested event loop
      (for execute_command).  The observers print a prompt, and then when we
      get back to the top event loop, we print another (in
      start_event_loop).
      
      I see no reason the error should be swallowed here.  Just cancel the
      execution related bits and let the error propagate to the top level
      (start_event_loop), which re-enables stdin and notifies observers.
      
      gdb/
      2014-07-14  Pedro Alves  <palves@redhat.com>
      
      	* inf-loop.c (inferior_event_handler): Use TRY_CATCH instead of
      	catch_errors.  Don't re-enable stdin or notify observers where,
      	and rethrow error.
      	(fetch_inferior_event_wrapper): Delete.
      
      gdb/testsuite/
      2014-07-14  Pedro Alves  <palves@redhat.com>
      
      	* gdb.base/double-prompt-target-event-error.c: New file.
      	* gdb.base/double-prompt-target-event-error.exp: New file.
      1e973570
Loading