platform/upstream/binutils.git
11 years ago * elf32-ppc.c (ppc_elf_check_relocs): Set PLT_IFUNC in local got
Alan Modra [Wed, 27 Mar 2013 13:25:48 +0000 (13:25 +0000)]
* elf32-ppc.c (ppc_elf_check_relocs): Set PLT_IFUNC in local got
masks for all local ifunc syms.
(allocate_dynrelocs): Don't use htab->relgot for ifunc.
(ppc_elf_size_dynamic_sections): Likewise.
(ppc_elf_relocate_section): Likewise.

11 years ago PR ld/13812
Nick Clifton [Wed, 27 Mar 2013 13:21:38 +0000 (13:21 +0000)]
PR ld/13812
* scripttempl/avr.sc: Place trampolines before .progmem section.

11 years agoForbid "set history size (INT_MAX..UINT_MAX)"
Pedro Alves [Wed, 27 Mar 2013 12:14:09 +0000 (12:14 +0000)]
Forbid "set history size (INT_MAX..UINT_MAX)"

The whole readline interface is signed, and works with the 0..INT_MAX
range.

We don't allow setting the size to UINT_MAX directly.  The documented
user visible interface is "use 0 for unlimited".  The UINT_MAX
representation is an implementation detail we could change, e.g., by
keeping a separate flag for "unlimited", which is actually what the
readline interface does (stifled vs non stifled).  Generically
speaking, exposing this detail to clients of the interface may make
our lives complicated when we find the need to extend the range of
some command in the future, and it's better if users
(frontends/scripts) aren't relying on anything but what we tell them
to use for "unlimited".  Making values other than 0 error out is the
way to prevent users from using those ranges inappropriately.  Quite
related, note:

    (gdb) set history size 0xffffffff
    integer 4294967295 out of range

  But,

    (gdb) set history size 0xfffffffe
    (gdb) show history size
    The size of the command history is unlimited.

    (gdb) set history size 0x100000000
    integer 4294967296 out of range

If values over INT_MAX are accepted as unlimited, then there's no good
argument for only accepting [INT_MAX..UINT_MAX) as valid "unlimited"
magic numbers, while not accepting [UINT_MAX..inf).

Making the setting's control variable of different type (unsigned int)
of the rest of the related code (int) adds the need to recall that one
variable among all these is unsigned, and that one need to think about
whether these comparisons are signed or unsigned, along with the
promotion/conversion rules.  Since this is an easy to forget detail,
this patch renames the variable to at least make it more obvious that
this variable is not one of GNU history's public int variables, which
are all signed.  We don't actually need the only code that presently
is affected by this, though, the code that is computing the current
history's length.  We can just use GNU history's history_length
instead:

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Variable: int history_length
    The number of entries currently stored in the history list.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

/* Return the history entry which is logically at OFFSET in the history array.
   OFFSET is relative to history_base. */
HIST_ENTRY *
history_get (offset)
     int offset;
{
  int local_index;

  local_index = offset - history_base;
  return (local_index >= history_length || local_index < 0 || the_history == 0)
? (HIST_ENTRY *)NULL
: the_history[local_index];
}
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

At the time this code was added (gdb 4.13 ~1994), 'history_length' was
extern, but not documented in readline's GNU history documents, so I
guess it wasn't considered public then and the loop was the
workaround.

One of the warts of GDB choosing 0 to mean unlimited is that "set
history size 0" behaves differently from 'HISTSIZE=0 gdb'.  The latter
leaves GDB with no history, while the former means "unlimited"...

 $ HISTSIZE=0 ./gdb
 ...
 (gdb) show history size
 The size of the command history is 0.

We shouldn't really change what HISTSIZE=0 means, as bash, etc. also
handle 0 as real zero, and zero it's what really makes sense.

gdb/
2013-03-27  Pedro Alves  <palves@redhat.com>

* top.c (history_size): Rename to ...
(history_size_setshow_var): ... this.  Add comment.
(show_commands): Use readline's 'history_length' instead of
computing the history length by calling history_get in a loop.
(set_history_size_command): Error out for sizes over INT_MAX.
Restore previous history size on invalid size.
(init_history): If HISTSIZE is negative, leave the history size as
zero.  Add comments.
(init_main): Adjust.

11 years ago PR binutils/13409
Nick Clifton [Wed, 27 Mar 2013 11:53:46 +0000 (11:53 +0000)]
PR binutils/13409
* winduni.c (codepages[]): Use UTF-16LE.
(wind_MultiByteToWideChar): Likewise.
(wind_WideCharToMultiByte): Likewise.

11 years ago PR binutils/15068
Nick Clifton [Wed, 27 Mar 2013 11:43:37 +0000 (11:43 +0000)]
PR binutils/15068
* tic6x-dis.c: Add support for displaying 16-bit insns.
* tic6xc-insn-formats.h (FLD): Add use of bitfield array.
Add 16-bit opcodes.
* tic6xc-opcode-table.h: Add 16-bit insns.
* tic6x.h: Add support for 16-bit insns.
* config/tc-tic6x.c (tic6x_try_encode): Add use of bitfields array.
* gas/tic6x/insns16-d-unit.s: New test.
* gas/tic6x/insns16-d-unit.d: Expected disassembly.
* gas/tic6x/insns16-ddec.s: New test.
* gas/tic6x/insns16-ddec.d: Expected disassembly.
* gas/tic6x/insns16-dinc.s: New test.
* gas/tic6x/insns16-dinc.d: Expected disassembly.
* gas/tic6x/insns16-dind.s: New test.
* gas/tic6x/insns16-dind.d: Expected disassembly.
* gas/tic6x/insns16-doff4.s: New test.
* gas/tic6x/insns16-doff4.d: Expected disassembly.
* gas/tic6x/insns16-l-unit.s: New test.
* gas/tic6x/insns16-l-unit.d: Expected disassembly.
* gas/tic6x/insns16-lsd-unit.s: New test.
* gas/tic6x/insns16-lsd-unit.d: Expected disassembly.
* gas/tic6x/insns16-m-unit.s: New test.
* gas/tic6x/insns16-m-unit.d: Expected disassembly.
* gas/tic6x/insns16-s-unit-pcrel.s: New test.
* gas/tic6x/insns16-s-unit-pcrel.d: Expected disassembly.
* gas/tic6x/insns16-s-unit: New test.
* gas/tic6x/insns16-s-unit.d: Expected disassembly.

11 years agobfd/ChangeLog:
Will Newton [Wed, 27 Mar 2013 09:51:46 +0000 (09:51 +0000)]
bfd/ChangeLog:

2013-03-20  Will Newton  <will.newton@linaro.org>

* elf32-arm.c (elf32_arm_final_link_relocate): Avoid emitting a
dynamic reloc for symbols with dynindx == -1.
(allocate_dynrelocs_for_symbol): Avoid allocating space for a
dynamic reloc for symbols with dynindx == -1.

11 years agobfd/ChangeLog:
Will Newton [Wed, 27 Mar 2013 09:48:46 +0000 (09:48 +0000)]
bfd/ChangeLog:

2013-03-20  Will Newton  <will.newton@linaro.org>

* elf32-arm.c (elf32_arm_final_link_relocate): Avoid emitting a
dynamic reloc for symbols with dynindx == -1.
(allocate_dynrelocs_for_symbol): Avoid allocating space for a
dynamic reloc for symbols with dynindx == -1.

11 years agoRename "set debug coff_pe_read" command to "set debug coff-pe-read".
Pedro Alves [Wed, 27 Mar 2013 09:47:41 +0000 (09:47 +0000)]
Rename "set debug coff_pe_read" command to "set debug coff-pe-read".

Hyphens are much more common than underscores in command names.

gdb/
2013-03-27  Pedro Alves  <palves@redhat.com>

* coff-pe-read.c (_initialize_coff_pe_read): Rename "set debug
coff_pe_read" command to "set debug coff-pe-read".

11 years agorecord: fix instruction-history-size regression
Markus Metzger [Wed, 27 Mar 2013 09:42:47 +0000 (09:42 +0000)]
record: fix instruction-history-size regression

* record.c (command_size_to_target_size): Fix size comparison.
Change parameter type from pointer to integer to integer.
Update all users.

11 years ago * windows-nat.c (handle_output_debug_string): Avoid typecast
Pierre Muller [Wed, 27 Mar 2013 08:57:09 +0000 (08:57 +0000)]
* windows-nat.c (handle_output_debug_string): Avoid typecast
from integer of different size warning.

11 years ago * gdb.base/dprintf.exp: Fix typo preventing "dprintf info 2"
Keith Seitz [Wed, 27 Mar 2013 05:28:57 +0000 (05:28 +0000)]
* gdb.base/dprintf.exp: Fix typo preventing "dprintf info 2"
from passing.

11 years ago*** empty log message ***
gdbadmin [Wed, 27 Mar 2013 00:00:32 +0000 (00:00 +0000)]
*** empty log message ***

11 years ago PR binutils/15206
Alan Modra [Tue, 26 Mar 2013 23:55:54 +0000 (23:55 +0000)]
PR binutils/15206
* dwarf.c (read_and_display_attr_value): Cast format '*' arg to int.

11 years agowindows-nat.c: Add empty line after local block variable definitions.
Joel Brobecker [Tue, 26 Mar 2013 23:40:08 +0000 (23:40 +0000)]
windows-nat.c: Add empty line after local block variable definitions.

gdb/ChangeLog:

        * windows-nat.c (handle_output_debug_string): Add empty line
        after local block variable definition.

11 years agodaily update
Alan Modra [Tue, 26 Mar 2013 23:00:04 +0000 (23:00 +0000)]
daily update

11 years agooops - fix PR attributation
Nick Clifton [Tue, 26 Mar 2013 22:52:05 +0000 (22:52 +0000)]
oops - fix PR attributation

11 years ago PR binutils/15205
Nick Clifton [Tue, 26 Mar 2013 22:51:12 +0000 (22:51 +0000)]
PR binutils/15205
* dwarf.c (SAFE_BYTE_GET): New macro - checks remaining buffer
space before calling byte_get.
(SAFE_BYTE_GET_AND_INC): New macro.
(SAFE_SIGNED_BYTE_GET): New macro.
(SAFE_SIGNED_BYTE_GET_AND_INC): New macro.
(SAFE_BYTE_GET64): New macro.
(process_extened_line_op): Use new macros.  Use strnlen when
appropriate.
(fetch_indirect_string): Likewise.
(get_FORM_name): Likewise.
(decode_location_expression): Likewise.
(read_and_display_attr_value): Likewise.
(process_debug_info): Likewise.
(display_debug_lines_raw): Likewise.
(display_debug_lines_decoded): Likewise.
(display_debug_pubnames): Likewise.
(display_debug_macinfo): Likewise.
(get_line_filename_and_dirname): Likewise.
(display_debug_macro): Likewise.
(display_loc_list): Likewise.
(display_loc_list_dwo): Likewise.
(display_debug_aranges): Likewise.
(display_debug_ranges): Likewise.
(frame_display_row): Likewise.
(display_debug_frames): Likewise.

11 years agoser-tcp.c: Small signed->unsigned cleanup.
Pedro Alves [Tue, 26 Mar 2013 20:29:47 +0000 (20:29 +0000)]
ser-tcp.c: Small signed->unsigned cleanup.

The "set tcp connect-timeout" variable is unsigned:

  /* Timeout period for connections, in seconds.  */

  static unsigned int tcp_retry_limit = 15;

And used like:

  /* Check for timeout.  */
  if (*polls > tcp_retry_limit * POLL_INTERVAL)
    {
      errno = ETIMEDOUT;
      return -1;
    }

Which made me stop and look over why is it that 'polls' is signed.
What I found is there's really no reason.

gdb/
2013-03-26  Pedro Alves  <palves@redhat.com>

* ser-tcp.c (wait_for_connect): Make 'polls' parameter unsigned.
(net_open): Make 'polls' local unsigned.

11 years agoMake "set/show remoteaddresssize" a zuinteger command instead of uinteger.
Pedro Alves [Tue, 26 Mar 2013 20:19:31 +0000 (20:19 +0000)]
Make "set/show remoteaddresssize" a zuinteger command instead of uinteger.

It makes no sense to talk about an "unlimited" address size in this
context.

 (gdb) show remoteaddresssize
 The maximum size of the address (in bits) in a memory packet is 0.
 (gdb) set remoteaddresssize 0
 (gdb) show remoteaddresssize
 The maximum size of the address (in bits) in a memory packet is unlimited.

"set remoteaddresssize 0" mapping to UINT_MAX means you can't
force gdb through this path twice in the same GDB run:

  static CORE_ADDR
  remote_address_masked (CORE_ADDR addr)
  {
    unsigned int address_size = remote_address_size;

    /* If "remoteaddresssize" was not set, default to target address size.  */
    if (!address_size)
      address_size = gdbarch_addr_bit (target_gdbarch ());

gdb/
2013-03-26  Pedro Alves  <palves@redhat.com>

* remote.c (_initialize_remote): Make "set remoteaddresssize"
a zuinteger command instead of uinteger.

11 years agorecord-full.c: Remove always true checks.
Pedro Alves [Tue, 26 Mar 2013 20:01:03 +0000 (20:01 +0000)]
record-full.c: Remove always true checks.

The "set record full insn-number-max" command is an uinteger command.
If the variable that holds the maximum count of logged instructions is
unsigned, it's better if the variable that holds the current number of
logged instructions is also unsigned.  Looking over the code, there's
no case the variable could end up negative.

Then, tests like "if (record_full_insn_max_num)" are always true,
because being a uinteger command means that "set record full
insn-number-max 0" is actually mapped to UINT_MAX internally.  IOW,
the command's variable is never 0.  The checks might make some sense
if 0 wasn't mapped to UINT_MAX, and 0 meant unlimited, but, that's not
how things work.

Tested on x86_64 Fedora 17.

gdb/
2013-03-26  Pedro Alves  <palves@redhat.com>

* record-full.c (record_full_insn_num): Make it unsigned.
(record_full_check_insn_num, record_full_message)
(record_full_registers_change, record_full_xfer_partial): Remove
record_full_insn_max_num check (it's always != 0).
(record_full_info, record_full_restore): Use %u as format string.
(): Use %u as format string.
(set_record_full_insn_max_num): Remove record_full_insn_max_num
check (it's always != 0).

11 years agoMake "set/show dcache line-size" and "set/show dcache size" zinteger commands instead...
Pedro Alves [Tue, 26 Mar 2013 19:16:05 +0000 (19:16 +0000)]
Make "set/show dcache line-size" and "set/show dcache size" zinteger commands instead of uinteger.

It doesn't make sense to request an "unlimited" dcache.  You want to
configure the cache with specific lines and length of lines.

It doesn't actually work anyway:

  (gdb) set dcache line-size 0
  Invalid dcache line size: 4294967295 (must be power of 2).

  (gdb) set dcache size 0
  (gdb) show dcache size
  Number of dcache lines is unlimited.

  (gdb) info dcache
  Dcache 4294967295 lines of 64 bytes each.
  No data cache available.

The code already has guards in place to forbid 0s:

static void
set_dcache_size (char *args, int from_tty,
 struct cmd_list_element *c)
{
  if (dcache_size == 0)
    {
      dcache_size = DCACHE_DEFAULT_SIZE;
      error (_("Dcache size must be greater than 0."));
    }
  if (last_cache)
    dcache_invalidate (last_cache);
}

static void
set_dcache_line_size (char *args, int from_tty,
      struct cmd_list_element *c)
{
  if (dcache_line_size < 2
      || (dcache_line_size & (dcache_line_size - 1)) != 0)
    {
      unsigned d = dcache_line_size;
      dcache_line_size = DCACHE_DEFAULT_LINE_SIZE;
      error (_("Invalid dcache line size: %u (must be power of 2)."), d);
    }
  if (last_cache)
    dcache_invalidate (last_cache);
}

So we now get:

  (gdb) set dcache line-size 0
  Invalid dcache line size: 0 (must be power of 2).
  (gdb) set dcache size 0
  Dcache size must be greater than 0.

gdb/
2013-03-26  Pedro Alves  <palves@redhat.com>

* dcache.c (_initialize_dcache): Make the "set dcache line-size"
and "set dcache size" commands zuinteger instead of uinteger.

11 years agoMake "set/show cris-version" a zuinteger instead of uinteger.
Pedro Alves [Tue, 26 Mar 2013 18:55:51 +0000 (18:55 +0000)]
Make "set/show cris-version" a zuinteger instead of uinteger.

Being a uinteger means you revert back to having GDB decide the
version.  It makes no sense to have an "unlimited" version.

  (gdb) show cris-version
  The current CRIS version is 0.
  (gdb) set cris-version 0
  (gdb) show cris-version
  The current CRIS version is unlimited.
  (gdb)

gdb/
2013-03-26  Pedro Alves  <palves@redhat.com>

* cris-tdep.c (_initialize_cris_tdep): Make the "set cris-version"
command zuinteger instead of uinteger.

11 years agoMake "set/show debug coff_pe_read" a zuinteger instead of uinteger.
Pedro Alves [Tue, 26 Mar 2013 18:40:46 +0000 (18:40 +0000)]
Make "set/show debug coff_pe_read" a zuinteger instead of uinteger.

Being a uinteger means you can't disable debug output after enabling it...

  (gdb) show debug coff_pe_read
  Coff PE read debugging is 0.
  (gdb) set debug coff_pe_read 0
  (gdb) show debug coff_pe_read
  Coff PE read debugging is unlimited.
  (gdb)

gdb/
2013-03-26  Pedro Alves  <palves@redhat.com>

* coff-pe-read.c (_initialize_coff_pe_read): Make the command
zuinteger instead of uinteger.

11 years agoGet rid of "No such file or directory" in the testsuite's btrace support detection.
Pedro Alves [Tue, 26 Mar 2013 18:26:05 +0000 (18:26 +0000)]
Get rid of "No such file or directory" in the testsuite's btrace support detection.

When I tried running the btrace tests, I noticed something odd in the gdb.log file:

 (gdb) run
 Starting program: /home/pedro/gdb/mygit/build/gdb/testsuite/gdb.btrace/btrace22343.x
 Breakpoint 1, main () at /home/pedro/gdb/mygit/build/gdb/testsuite/gdb.btrace/btrace22343.c:1
 1       /home/pedro/gdb/mygit/build/gdb/testsuite/gdb.btrace/btrace22343.c: No such file or directory.
                                                                             ^^^^^^^^^^^^^^^^^^^^^^^^^
 (gdb) record btrace
 Target does not support branch tracing.
 (gdb) testcase ../../../src/gdb/testsuite/gdb.btrace/enable.exp completed in 0 seconds

I knew that the btrace tests on my machine weren't supposed to work,
but still, that error made me wonder if the test had something broken,
and waste a few minutes looking up where that is coming from.

The issue is that the btrace detection deletes the source file right
after compiling it, and before GDB has a chance to open it.  It's
really harmless, but I'd rather spare others from going through the
same exercise.

We now get the regular:

 (gdb) run
 Starting program: /home/pedro/gdb/mygit/build/gdb/testsuite/gdb.btrace/btrace24210.x
 ...
 Breakpoint 1, main () at /home/pedro/gdb/mygit/build/gdb/testsuite/gdb.btrace/btrace24210.c:1
 1       int main(void) { return 0; }
 ...

gdb/testsuite/
2013-03-26  Pedro Alves  <palves@redhat.com>

* lib/gdb.exp (skip_btrace_tests): Delay deleting the source file
until after GDB has run.

11 years ago"set record instruction-history-size"/"set record function-call-history-size" range...
Pedro Alves [Tue, 26 Mar 2013 18:03:03 +0000 (18:03 +0000)]
"set record instruction-history-size"/"set record function-call-history-size" range validation.

While the commands are uinteger, the target interfaces are limited to
INT_MAX.  Don't let the user request more than we can handle.

gdb/
2013-03-26  Pedro Alves  <palves@redhat.com>

* record.c (record_insn_history_size_setshow_var)
(record_call_history_size_setshow_var): New globals.
(command_size_to_target_size): New function.
(cmd_record_insn_history, cmd_record_call_history): Use
command_size_to_target_size instead of cast.
(validate_history_size, set_record_insn_history_size)
(set_record_call_history_size): New functions.
(_initialize_record): Install set_record_insn_history_size and
set_record_call_history_size as "set" hooks of "set record
instruction-history-size" and "set record
function-call-history-size".

11 years agosim: rewrite SIM_AC_OPTION_HARDWARE a bit to simplify things
Mike Frysinger [Tue, 26 Mar 2013 18:00:04 +0000 (18:00 +0000)]
sim: rewrite SIM_AC_OPTION_HARDWARE a bit to simplify things

There's no need to put the majority of the logic into the 3rd arg of the
AC_ARG_ENABLE.  Coupled with the lack of indentation, it makes it hard to
follow, error prone to update, and duplicates code (with the 4th arg).

So pull the logic out of the 3rd arg and outside of the AC_ARG_ENABLE
macro.  This allows us to gut the 4th arg entirely, merge with the code
that followed the macro, and fix bugs related to the new dv-sockser in
the process.

Hopefully building the various sims with the default sim-hardware
settings, as well as with explicit --{dis,en}able-sim-hardware flags,
should all just work now.

11 years agoUse readline's 'history_max_entries' instead of the old 'max_input_history'.
Pedro Alves [Tue, 26 Mar 2013 16:47:02 +0000 (16:47 +0000)]
Use readline's 'history_max_entries' instead of the old 'max_input_history'.

Ref: http://www.sourceware.org/ml/gdb-patches/2002-08/msg00486.html

We've long since imported a newer readline, no need to use the old
compatibility variable anymore.

Tested on x86_64 Fedora 17.

gdb/
2013-03-26  Pedro Alves  <palves@redhat.com>

* top.c (gdb_rl_operate_and_get_next): Replace max_input_history
use with history_max_entries use.  Remove FIXME note.

11 years ago PR gas/15295
Nick Clifton [Tue, 26 Mar 2013 14:16:59 +0000 (14:16 +0000)]
PR gas/15295
* listing.c (rebuffer_line): Rewrite to avoid seeking back to the
start of the file each time.

11 years ago PR gas/15178
Nick Clifton [Tue, 26 Mar 2013 13:49:12 +0000 (13:49 +0000)]
PR gas/15178
* config/tc-sparc.h (ELF_TARGET_FORMAT): Set to elf32-sparc for
FreeBSD targets.

11 years agogdb/testsuite/
Yao Qi [Tue, 26 Mar 2013 12:46:24 +0000 (12:46 +0000)]
gdb/testsuite/
* gdb.trace/actions.c, gdb.trace/circ.c: Add license header.
* gdb.trace/collection.c, gdb.trace/tfile.c: Likewise.

11 years agoFix typo in added CL entry.
Tristan Gingold [Tue, 26 Mar 2013 09:14:31 +0000 (09:14 +0000)]
Fix typo in added CL entry.

11 years agogas/
Tristan Gingold [Tue, 26 Mar 2013 09:13:17 +0000 (09:13 +0000)]
gas/
2013-03-26  Douglas B Rupp  <rupp@gnat.com>

* config/tc-ia64.c (emit_one_bundle): Move last_slot adjustment
after fixup.

gas/testsuite/
2013-03-26  Douglas B Rupp  <rupp@adacore.com

* gas/ia64/ia64.exp: Add new test reloc-mlx
* gas/ia64/reloc-mlx.[sd]: New test for X-unit reloc.
* gas/ia64/pcrel.d: Fix output for X-unit reloc.

11 years agorecord-btrace: fix assertion when enabling recording after re-run
Markus Metzger [Tue, 26 Mar 2013 07:15:09 +0000 (07:15 +0000)]
record-btrace: fix assertion when enabling recording after re-run

Reading symbols from /bin/true...(no debugging symbols found)...done.
(gdb) b _start
Function "_start" not defined.
Make breakpoint pending on future shared library load? (y or [n]) y
Breakpoint 1 (_start) pending.
(gdb) r
Starting program: /bin/true

Breakpoint 1, 0x00000039a0400af0 in _start () from /lib64/ld-linux-x86-64.so.2
(gdb) rec b
(gdb) r
The program being debugged has been started already.
Start it from the beginning? (y or n) y
Starting program: /bin/true

Breakpoint 1, 0x00000039a0400af0 in _start () from /lib64/ld-linux-x86-64.so.2
(gdb) rec b
gdb/record-btrace.c:154: internal-error: record_btrace_open:
 Assertion `record_btrace_thread_observer == NULL' failed.
A problem internal to GDB has been detected,
further debugging may prove unreliable.
Quit this debugging session? (y or n)

gdb/
* record-btrace.c (record_btrace_close): Call
record_btrace_auto_disable.

testsuite/
* gdb.btrace/enable.exp: Add regression test.

11 years ago * elflink.c (_bfd_elf_add_default_symbol): Preserve section
Alan Modra [Tue, 26 Mar 2013 07:02:52 +0000 (07:02 +0000)]
* elflink.c (_bfd_elf_add_default_symbol): Preserve section
over _bfd_elf_merge_symbol calls.

11 years ago * elflink.c (elf_link_add_object_symbols): Add assertion for
Alan Modra [Tue, 26 Mar 2013 06:08:14 +0000 (06:08 +0000)]
* elflink.c (elf_link_add_object_symbols): Add assertion for
common override alignment check code.  Formatting.

11 years agoDelete rs6000-nat.c:fixup_breakpoints extern declaration.
Joel Brobecker [Tue, 26 Mar 2013 00:13:08 +0000 (00:13 +0000)]
Delete rs6000-nat.c:fixup_breakpoints extern declaration.

This function does not exist...

gdb/ChangeLog:

        * rs6000-nat.c (fixup_breakpoints): Delete declaration.

11 years ago*** empty log message ***
gdbadmin [Tue, 26 Mar 2013 00:00:02 +0000 (00:00 +0000)]
*** empty log message ***

11 years agodaily update
Alan Modra [Mon, 25 Mar 2013 23:00:05 +0000 (23:00 +0000)]
daily update

11 years ago * contrib/cc-with-tweaks.sh: Check exit code of dwp.
Doug Evans [Mon, 25 Mar 2013 22:53:54 +0000 (22:53 +0000)]
* contrib/cc-with-tweaks.sh: Check exit code of dwp.

11 years ago * ld.texinfo (--disable-runtime-pseudo-reloc): Adjust default.
Kai Tietz [Mon, 25 Mar 2013 18:09:04 +0000 (18:09 +0000)]
    * ld.texinfo (--disable-runtime-pseudo-reloc): Adjust default.

11 years ago PR symtab/11462:
Tom Tromey [Mon, 25 Mar 2013 17:28:03 +0000 (17:28 +0000)]
PR symtab/11462:
* c-exp.y (exp): Add new productions for destructors after '.' and
'->'.
(write_destructor_name): New function.
gdb/testsuite
* gdb.cp/m-static.exp: Add destructor-printing tests.

11 years ago PR c++/9197:
Tom Tromey [Mon, 25 Mar 2013 17:26:18 +0000 (17:26 +0000)]
PR c++/9197:
* opencl-lang.c (evaluate_subexp_opencl) <STRUCTOP_STRUCT>: Use
value_struct_elt, not lookup_struct_elt_type.
* eval.c (evaluate_subexp_standard) <STRUCTOP_STRUCT,
STRUCTOP_PTR>: Use value_struct_elt, not lookup_struct_elt_type.
* expression.h (EVAL_AVOID_SIDE_EFFECTS): Update comment.
gdb/testsuite
* gdb.cp/m-static.exp: Add constructor ptype tests.
* gdb.cp/m-static.cc (single_constructor): New class.
(main): Make instance of single_constructor.

11 years ago PR binutils/15202
Nick Clifton [Mon, 25 Mar 2013 13:16:41 +0000 (13:16 +0000)]
PR binutils/15202
* dwarf.c (read_leb128): Add END parameter.  Do not read at or
beyond end.
(read_sleb128): Add END parameter.
(read_uleb128): New function.
(process_extended_line_op): Pass END to leb128 functions.
(process_abbrev_section): Likewise.
(decode_location_expression): Likewise.
(read_and_display_attr_value): Likewise.
(read_and_display_attr): Likewise.
(process_debug_info): Likewise.
(display_debug_lines_raw): Likewise.
(display_debug_lines_decoded): Likewise.
(display_debug_macinfo): Likewise.
(get_line_filename_and_dirname): Likewise.
(display_debug_macro): Likewise.
(display_loc_list_dwo): Likewise.
(display_debug_ranges): Likewise.
* dwarf.h (read_leb128): Update prototype.
* readelf.c (read_uleb128): Add END parameter.
(decode_arm_unwind_bytecode): Pass END to read_uleb128.
(decode_tic6x_unwind_bytecode): Likewise.
(display_tag_value): New function.
(display_arm_attribute): Add END parameter. Pass END to
read_uleb128.  Use display_tag_value.
(display_gnu_attribute): Likewise.
(display_power_gnu_attribute): Likewise.
(display_sparc_gnu_attribute): Likewise.
(display_mips_gnu_attribute): Likewise.
(display_tic6x_attribute): Likewise.
(process_attributes): Likewise.
(display_raw_attribute): New function.

11 years agogdb/
Yao Qi [Mon, 25 Mar 2013 10:55:28 +0000 (10:55 +0000)]
gdb/

* ctf.c [USE_WIN32API]: Undef 'mkdir' and use 'mkdir'
instead of '_mkdir'.

11 years ago * elflink.c (_bfd_elf_merge_symbol): Set old_alignment for
Alan Modra [Mon, 25 Mar 2013 06:12:06 +0000 (06:12 +0000)]
* elflink.c (_bfd_elf_merge_symbol): Set old_alignment for
usual common symbols as well as for dynamic.  Add poldbfd param.
Save old bfd.  Adjust callers.
(_bfd_elf_add_default_symbol): Add poldbfd param.  Pass "section"
and "value" by value, not pointer.  Adjust caller.
(elf_link_add_object_symbols): Combine undef_bfd and old_bfd vars.
Delete code to set same.  Use old_bfd and old_alignment from
_bfd_elf_merge_symbol instead.  Add default symbol before
alignment and size checks.  Wrap overlong lines.

11 years ago * elflink.c (_bfd_elf_add_default_symbol): Delete "override" param.
Alan Modra [Mon, 25 Mar 2013 06:06:35 +0000 (06:06 +0000)]
* elflink.c (_bfd_elf_add_default_symbol): Delete "override" param.
(elf_link_add_object_symbols): Don't call _bfd_elf_add_default_symbol
when override is true.

11 years ago * elflink.c (_bfd_elf_merge_symbol): Use local var holding value
Alan Modra [Mon, 25 Mar 2013 06:03:48 +0000 (06:03 +0000)]
* elflink.c (_bfd_elf_merge_symbol): Use local var holding value
of *sym_hash.

11 years ago * elflink.c (_bfd_elf_merge_symbol): Don't discard TLS symbols here.
Alan Modra [Mon, 25 Mar 2013 06:02:28 +0000 (06:02 +0000)]
* elflink.c (_bfd_elf_merge_symbol): Don't discard TLS symbols here.
Wrap long lines.
(elf_link_add_object_symbols): Discard TLS symbols for --just-syms
early in symbol loop.

11 years ago * elf-bfd.h (struct elf_backend_data <merge_symbol>): Update proto.
Alan Modra [Mon, 25 Mar 2013 06:00:06 +0000 (06:00 +0000)]
* elf-bfd.h (struct elf_backend_data <merge_symbol>): Update proto.
(_bfd_elf_init_reloc_shdr): Delete.
* elf.c (_bfd_elf_init_reloc_shdr): Make static.
* elf64-x86-64.c (elf_x86_64_merge_symbol): Trim parameters to
just what is needed.
* elflink.c (_bfd_elf_merge_symbol): Update bed->merge_symbol call.

11 years ago*** empty log message ***
gdbadmin [Mon, 25 Mar 2013 00:01:02 +0000 (00:01 +0000)]
*** empty log message ***

11 years agodaily update
Alan Modra [Sun, 24 Mar 2013 23:00:05 +0000 (23:00 +0000)]
daily update

11 years ago*** empty log message ***
gdbadmin [Sun, 24 Mar 2013 00:00:02 +0000 (00:00 +0000)]
*** empty log message ***

11 years agodaily update
Alan Modra [Sat, 23 Mar 2013 23:00:04 +0000 (23:00 +0000)]
daily update

11 years ago2013-03-23 Joel Sherrill <joel.sherrill@oarcorp.com>
Joel Sherrill [Sat, 23 Mar 2013 15:08:07 +0000 (15:08 +0000)]
2013-03-23  Joel Sherrill  <joel.sherrill@oarcorp.com>

* configure.ac: Use $SIM_DV_SOCKSER_O.
* configure: Regenerated.

11 years ago2013-03-23 Joel Sherrill <joel.sherrill@oarcorp.com>
Joel Sherrill [Sat, 23 Mar 2013 15:07:30 +0000 (15:07 +0000)]
2013-03-23  Joel Sherrill  <joel.sherrill@oarcorp.com>

* configure.ac: Fail if dv-sockser.o not available.
Error when --disable-sim-hardware is specified.
* configure: Regenerated.

11 years ago2013-03-23 Joel Sherrill <joel.sherrill@oarcorp.com>
Joel Sherrill [Sat, 23 Mar 2013 15:06:59 +0000 (15:06 +0000)]
2013-03-23  Joel Sherrill  <joel.sherrill@oarcorp.com>

* configure.ac: Fail if dv-sockser.o not available.
Error when --disable-sim-hardware is specified.
* tconfig.in: Conditionalize use of dv_sockser_install.
* configure: Regenerated.
* config.in: Regenerated.

11 years ago2013-03-23 Joel Sherrill <joel.sherrill@oarcorp.com>
Joel Sherrill [Sat, 23 Mar 2013 15:05:07 +0000 (15:05 +0000)]
2013-03-23  Joel Sherrill  <joel.sherrill@oarcorp.com>

* configure.ac: Address use of dv-sockser.o.
* tconfig.in: Conditionalize use of dv_sockser_install.
* configure: Regenerated.
* config.in: Regenerated.

11 years ago2013-03-23 Joel Sherrill <joel.sherrill@oarcorp.com>
Joel Sherrill [Sat, 23 Mar 2013 15:03:01 +0000 (15:03 +0000)]
2013-03-23  Joel Sherrill  <joel.sherrill@oarcorp.com>

* acinclude.m4: Add SIM_DV_SOCKSER_O which is empty  on hosts
which do not support dv-sockser.o.  Add always as option to
first argument to SIM_AC_OPTION_HARDWARE. Fail if hardware
is always required to be enabled by simulator.

11 years agoFix relocation of directories in the MinGW build.
Eli Zaretskii [Sat, 23 Mar 2013 10:48:23 +0000 (10:48 +0000)]
Fix relocation of directories in the MinGW build.

 windows-nat.c (windows_get_absolute_argv0): New function.
 windows-nat.h: Add its prototype.
 main.c (get_init_files): Use filename_ncmp instead of strncmp.
 Use IS_DIR_SEPARATOR instead of looking for a character inside
 SLASH_STRING.  Include filenames.h.
 (captured_main) [__MINGW32__]: Make argv[0] absolute, so that
 relocate_gdb_directory works when passed gdb_program_name.
 Include windows-nat.h.

11 years ago * elf-bfd.h (_bfd_elf_merge_symbol): Delete declaration.
Alan Modra [Sat, 23 Mar 2013 10:25:02 +0000 (10:25 +0000)]
* elf-bfd.h (_bfd_elf_merge_symbol): Delete declaration.
* elflink.c (_bfd_elf_merge_symbol): Make static.
* elf32-sh-symbian.c (sh_symbian_relocate_section): Don't call
_bfd_elf_merge_symbol, call _bfd_generic_link_add_one_symbol.

11 years ago*** empty log message ***
gdbadmin [Sat, 23 Mar 2013 00:00:32 +0000 (00:00 +0000)]
*** empty log message ***

11 years ago PR ld/15270
Alan Modra [Fri, 22 Mar 2013 23:35:55 +0000 (23:35 +0000)]
PR ld/15270
* elflink.c (elf_link_add_object_symbols): Don't set def_regular
or ref_regular for BFD_PLUGIN owned syms, or have them affect
def_dynamic/ref_dynamic.
(_bfd_elf_fix_symbol_flags): Don't set def_regular for BFD_PLUGIN
owned syms.

11 years agosrc-release: fix version look up for bfd based projects
Mike Frysinger [Fri, 22 Mar 2013 23:16:40 +0000 (23:16 +0000)]
src-release: fix version look up for bfd based projects

11 years agodaily update
Alan Modra [Fri, 22 Mar 2013 23:00:06 +0000 (23:00 +0000)]
daily update

11 years agogdb/
Jan Kratochvil [Fri, 22 Mar 2013 20:39:29 +0000 (20:39 +0000)]
gdb/
* exceptions.h (enum errors): New entry TARGET_CLOSE_ERROR.
* remote.c (trace_error): Remove the special handling of '2'.
(readchar) <SERIAL_EOF>
(readchar) <SERIAL_ERROR>
(getpkt_or_notif_sane_1): Use TARGET_CLOSE_ERROR for them.
(remote_get_trace_status): Call throw_exception if EX is
TARGET_CLOSE_ERROR.
* utils.c (perror_with_name): Rename to ...
(throw_perror_with_name): ... here.  New parameter errcode, describe it
in the function comment.
(perror_with_name): New function wrapper.
* utils.h (enum errors): New stub declaration.
(throw_perror_with_name): New declaration.

gdb/testsuite/
* gdb.server/server-kill.c: New file.
* gdb.server/server-kill.exp: New file.

11 years agoSubject: Fix range validation of integer commands with "unlimited".
Pedro Alves [Fri, 22 Mar 2013 20:25:40 +0000 (20:25 +0000)]
Subject: Fix range validation of integer commands with "unlimited".

The range validation added by

  http://sourceware.org/ml/gdb-patches/2013-03/msg00767.html

Changes things to allow setting the command to INT_MAX or UINT_MAX
directly, with signed and unsigned commands respectively.  However,
that went a little bit too far, as in the cases of var_integer and
var_uinteger, those values are actually implementation detail.  It's
better to not expose them in the interface, and have users assume
those values mean "unlimited" too, so to be safer to expand the range
of the commands in the future if we want to.  Yes, it's pedantic, and
it's not likely users actually will do this, but MI frontends and
Python scripts might.

gdb/
2013-03-22  Pedro Alves  <palves@redhat.com>
    Yao Qi  <yao@codesourcery.com>
    Mark Kettenis  <kettenis@gnu.org>

* cli/cli-setshow.c (do_set_command) <var_uinteger>:
Don't let the user set the value to UINT_MAX directly.
<var_integer>: Don't let the user set the value to INT_MAX
directly.

11 years agoWhoops, wrong patch. Reverting.
Pedro Alves [Fri, 22 Mar 2013 20:23:58 +0000 (20:23 +0000)]
Whoops, wrong patch.  Reverting.

11 years agoSubject: Fix range validation of integer commands with "unlimited".
Pedro Alves [Fri, 22 Mar 2013 20:21:48 +0000 (20:21 +0000)]
Subject: Fix range validation of integer commands with "unlimited".

The range validation added by

  http://sourceware.org/ml/gdb-patches/2013-03/msg00767.html

Changes things to allow setting the command to INT_MAX or UINT_MAX
directly, with signed and unsigned commands respectively.  However,
that went a little bit too far, as in the cases of var_integer and
var_uinteger, those values are actually implementation detail.  It's
better to not expose them in the interface, and have users assume
those values mean "unlimited" too, so to be safer to expand the range
of the commands in the future if we want to.  Yes, it's pedantic, and
it's not likely users actually will do this, but MI frontends and
Python scripts might.

gdb/
2013-03-22  Pedro Alves  <palves@redhat.com>
    Yao Qi  <yao@codesourcery.com>
    Mark Kettenis  <kettenis@gnu.org>

* cli/cli-setshow.c (do_set_command) <var_uinteger>:
Don't let the user set the value to UINT_MAX directly.
<var_integer>: Don't let the user set the value to INT_MAX
directly.

11 years agogdb/
Jan Kratochvil [Fri, 22 Mar 2013 19:07:03 +0000 (19:07 +0000)]
gdb/
* remote.c (remote_unpush_target): New function.
(remote_open_1): Remove two pop_target calls, update one comment, add
comment to target_preopen call.  Replace pop_target call by
remote_unpush_target call.
(interrupt_query, readchar, getpkt_or_notif_sane_1): Replace
pop_target calls by remote_unpush_target calls.

11 years ago PR binutils/15201
Nick Clifton [Fri, 22 Mar 2013 16:18:00 +0000 (16:18 +0000)]
PR binutils/15201
* dwarf.c (display_debug_ranges): Add checks for reading beyond
the end of the section.

11 years ago PR binutils/15157
Nick Clifton [Fri, 22 Mar 2013 16:04:55 +0000 (16:04 +0000)]
PR binutils/15157
* readelf.c (apply_relocations): Catch relocations with negative
offsets.

11 years agoFix attribute section output on sparc.
David S. Miller [Fri, 22 Mar 2013 15:54:21 +0000 (15:54 +0000)]
Fix attribute section output on sparc.

bfd/

* elfxx-sparc.c (_bfd_sparc_elf_merge_private_bfd_data): Set type of
hwcaps attribute.

11 years ago PR ld/14902
Nick Clifton [Fri, 22 Mar 2013 15:53:36 +0000 (15:53 +0000)]
PR ld/14902
* elf32-h8300.c (elf32_h8_relax_delete_bytes): Fix off by one
errors adjusting relocs and symbols.

11 years agoLinux: No need to set ptrace event options in fork/clone children.
Pedro Alves [Fri, 22 Mar 2013 14:52:26 +0000 (14:52 +0000)]
Linux: No need to set ptrace event options in fork/clone children.

Oleg Nesterov told me that the Linux kernel copies the parent's ptrace
options to fork/clone children, so there's no need for GDB to do that
manually.

I was actually a bit surprised, since I thought the ptracer had to
always set the ptrace options itself, and GDB is indeed calling
PTRACE_SETOPTIONS for each new fork child, if it'll stay attached.

Looking at the history of that code, I found that is was actually I
who added that set-ptrace-options-in-children bit, back in
http://sourceware.org/ml/gdb-patches/2009-05/msg00656.html.  But,
honestly, I don't recall why I needed that.  I think I may have just
blindly believed it was necessary.

I then looked back at the history of all the PTRACE_SETOPTIONS code we
have, and found that gdb never did copy the ptrace options before my
patch.  But, when gdbserver learnt to use PTRACE_EVENT_CLONE, at
http://sourceware.org/ml/gdb-patches/2007-10/msg00547.html, it was
made to do 'ptrace (PTRACE_SETOPTIONS, new_pid, 0,
PTRACE_O_TRACECLONE)' for all new clones.  Hmmm.  But, GDB itself
never did that, so it can't really ever have been necessary, I
believe, otherwise GDB should have been doing it too.

(GDBserver doesn't support following forks, and so naturally doesn't
do any PTRACE_SETOPTIONS on fork children.)

So this patch removes the -I believe- unnecessary ptrace syscalls.

Tested on x86_64 Fedora 17, native/gdbserver, and on x86_64 RHEL5
native/gdbserver (Linux 2.6.18, I think a ptrace-on-utrace kernel).
No regressions.

gdb/
2013-03-22  Pedro Alves  <palves@redhat.com>

* linux-nat.c (linux_child_follow_fork): Don't call
linux_enable_event_reporting.
(linux_handle_extended_wait): Don't call
linux_enable_event_reporting.

gdb/gdbserver/
2013-03-22  Pedro Alves  <palves@redhat.com>

* linux-low.c (handle_extended_wait): Don't call
linux_enable_event_reporting.

11 years agohppa-hpux-tdep.c: Fix host dependency.
Pedro Alves [Fri, 22 Mar 2013 14:43:28 +0000 (14:43 +0000)]
hppa-hpux-tdep.c: Fix host dependency.

$ make WERROR_CFLAGS="-Wpointer-sign -Werror" hppa-hpux-tdep.o -k 2>&1 1>/dev/null
../../src/gdb/hppa-hpux-tdep.c: In function ‘hppa_hpux_push_dummy_code’:
../../src/gdb/hppa-hpux-tdep.c:1225:7: error: pointer targets in passing argument 2 of ‘write_memory’ differ in signedness [-Werror=pointer-sign]
In file included from ../../src/gdb/hppa-hpux-tdep.c:22:0:
../../src/gdb/gdbcore.h:85:13: note: expected ‘const gdb_byte *’ but argument is of type ‘char *’
../../src/gdb/hppa-hpux-tdep.c:1251:7: error: pointer targets in passing argument 2 of ‘write_memory’ differ in signedness [-Werror=pointer-sign]
In file included from ../../src/gdb/hppa-hpux-tdep.c:22:0:
../../src/gdb/gdbcore.h:85:13: note: expected ‘const gdb_byte *’ but argument is of type ‘char *’
../../src/gdb/hppa-hpux-tdep.c: In function ‘hppa_hpux_supply_save_state’:
../../src/gdb/hppa-hpux-tdep.c:1354:9: error: pointer targets in passing argument 1 of ‘extract_unsigned_integer’ differ in signedness [-Werror=pointer-sign]
In file included from ../../src/gdb/hppa-hpux-tdep.c:20:0:
../../src/gdb/defs.h:675:22: note: expected ‘const gdb_byte *’ but argument is of type ‘const char *’

Casting to gdb_byte would fix it, however, writing an
unsigned int array like this

      static unsigned int hppa64_tramp[] = {
        0xeac0f000, /* bve,l (r22),%r2 */
        0x0fdf12d1, /* std r31,-8(,sp) */
        0x0fd110c2, /* ldd -8(,sp),rp */
        0xe840d002, /* bve,n (rp) */
        0x08000240  /* nop */
        ...

directly to target memory assumes the host endianness is the same as
the target's.  hppa is big endian, so I believe this patch should be
correct -- it defines the array as a gdb_byte array.  It uses a macro
to make the insn bytes a little more readable.  I thought of using
write_memory_unsigned_integer once for each element of the unsigned
int array, but this way keeps issuing a single target memory write /
roundtrip for the whole trampoline.

gdb/
2013-03-22  Pedro Alves  <palves@redhat.com>

* hppa-hpux-tdep.c (hppa_hpux_push_dummy_code): Define INSN macro,
use it to rewrite the trampoline buffers with type gdb_byte[], and
undefine the macro.  Remove char* cast.

11 years ago * ld-elf/init0.s: Add alloc attribute to .section directive.
Nick Clifton [Fri, 22 Mar 2013 09:40:06 +0000 (09:40 +0000)]
* ld-elf/init0.s: Add alloc attribute to .section directive.
* ld-elf/fini1.s: Likewise.
* ld-elf/fini2.s: Likewise.
* ld-elf/fini3.s: Likewise.
* ld-elf/finin.s: Likewise.
* ld-elf/init0.s: Likewise.
* ld-elf/init1.s: Likewise.
* ld-elf/init2.s: Likewise.
* ld-elf/init3.s: Likewise.
* ld-elf/initn.s: Likewise.

11 years agogdb/doc/
Yao Qi [Fri, 22 Mar 2013 00:58:53 +0000 (00:58 +0000)]
gdb/doc/
* gdb.texinfo (Embedded Processors): Remove menu item
"OpenRISC 1000".
(OpenRISC 1000): Remove.

11 years ago*** empty log message ***
gdbadmin [Fri, 22 Mar 2013 00:00:32 +0000 (00:00 +0000)]
*** empty log message ***

11 years agodaily update
Alan Modra [Thu, 21 Mar 2013 23:00:05 +0000 (23:00 +0000)]
daily update

11 years agoFix gdb.trace/trace-buffer-size.exp race.
Pedro Alves [Thu, 21 Mar 2013 19:18:25 +0000 (19:18 +0000)]
Fix gdb.trace/trace-buffer-size.exp race.

Just the usual missing $gdb_prompt match:

 (gdb) tstatus
 No trace has been run on the target.
 Collected 0 trace frames.
 Trace buffer has 5242880 bytes of 5242880 bytes free (0% full).
 Trace will stop if GDB disconnects.
 Not looking at any trace frame.
 PASS: gdb.trace/trace-buffer-size.exp: get default buffer size
 (gdb) set trace-buffer-size 4
 (gdb) FAIL: gdb.trace/trace-buffer-size.exp: set trace buffer size 1

This fixes it.

gdb/testsuite/
2013-03-21  Pedro Alves  <palves@redhat.com>

* gdb.trace/trace-buffer-size.exp (get default buffer size):
Expect $gdb_prompt in gdb_test_multiple.

11 years agogas/ChangeLog:
Will Newton [Thu, 21 Mar 2013 18:39:35 +0000 (18:39 +0000)]
gas/ChangeLog:

2013-03-21  Will Newton  <will.newton@linaro.org>

* config/tc-arm.c (encode_thumb32_addr_mode): Emit an error for all
pc-relative str instructions in Thumb mode.

gas/testsuite/ChangeLog:

2013-03-21  Will Newton  <will.newton@linaro.org>

* gas/arm/thumb2_relax.d: Strip out invalid pc-relative strs.
* gas/arm/thumb2_relax.s: Likewise.
* gas/arm/thumb32.d: Likewise.
* gas/arm/thumb32.l: Likewise.
* gas/arm/thumb32.s: Likewise.
* gas/arm/thumb2_str-bad.d: New file.
* gas/arm/thumb2_str-bad.l: Likewise.
* gas/arm/thumb2_str-bad.s: Likewise.

11 years ago New commands "mt set per-command {space,time,symtab} {on,off}".
Doug Evans [Thu, 21 Mar 2013 17:37:30 +0000 (17:37 +0000)]
New commands "mt set per-command {space,time,symtab} {on,off}".
* NEWS: Add entry.
* event-top.c: #include "maint.h".
* main.c: #include "maint.h".
* maint.c: #include <sys/time.h>, <time.h>, block.h, top.h,
timeval-utils.h, maint.h, cli/cli-setshow.h.
(per_command_time, per_command_space): New static globals.
(per_command_symtab): New static global.
(per_command_setlist, per_command_showlist): New static globals.
(struct cmd_stats): Move here from utils.c.
(set_per_command_time): Renamed from set_display_time in utils.c
and moved here.  All callers updated.
(set_per_command_space): Renamed from set_display_space in utils.c
and moved here.  All callers updated.
(count_symtabs_and_blocks): New function.
(report_command_stats): Moved here from utils.c.  Add support for
printing symtab stats.  Only print data if enabled before command
executed.
(make_command_stats_cleanup): Ditto.
(sert_per_command_cmd, show_per_command_cmd): New functions.
(_initialize_maint_cmds): Add new commands
mt set per-command {space,time,symtab} {on,off}.
* maint.h: New file.
* top.c: #include "maint.h".
* utils.c (reset_prompt_for_continue_wait_time): New function.
(get_prompt_for_continue_wait_time): New function.
* utils.h (reset_prompt_for_continue_wait_time): Declare
(get_prompt_for_continue_wait_time): Declare.
(make_command_stats_cleanup): Moved to maint.h.
(set_display_time, set_display_space): Moved to maint.h and renamed
to set_per_command_time, set_per_command_space.
* cli/cli-setshow.c (parse_cli_boolean_value): Renamed from
parse_binary_operation and made non-static.  Don't call error,
just return an error marker.  All callers updated.
* cli/cli-setshow.h (parse_cli_boolean_value): Declare.

doc/
* gdb.texinfo (Maintenance Commands): Add docs for
"mt set per-command {space,time,symtab} {on,off}".

testsuite/
* gdb.base/maint.exp: Update tests for per-command stats.

11 years ago * symfile.c (alloc_section_addr_info): Update header. Don't set
Tom Tromey [Thu, 21 Mar 2013 16:18:48 +0000 (16:18 +0000)]
* symfile.c (alloc_section_addr_info): Update header.  Don't set
'num_sections' field.
(build_section_addr_info_from_section_table): Set 'num_sections'.
(build_section_addr_info_from_bfd): Likewise.
(build_section_addr_info_from_objfile): Remove dead loop
condition.
(free_section_addr_info): Unconditionally call xfree.
(relative_addr_info_to_section_offsets, addrs_section_sort)
(addr_info_make_relative, syms_from_objfile_1): Remove dead loop
condition.
(syms_from_objfile_1): Remove dead 'if' condition.  Check
'num_sections'.
(add_symbol_file_command): Set 'num_sections'.
* symfile-mem.c (symbol_file_add_from_memory): Set
'num_sections'.
* somread.c (som_symfile_offsets): Remove dead loop condition.
* machoread.c (macho_symfile_offsets): Remove dead 'if'.
* jit.c (jit_bfd_try_read_symtab): Set 'num_sections'.

11 years agofix date in ChangeLog entry
Tom Tromey [Thu, 21 Mar 2013 16:16:33 +0000 (16:16 +0000)]
fix date in ChangeLog entry

11 years ago * tracepoint.h (decode_agent_options): Add 'trace_string'
Tom Tromey [Thu, 21 Mar 2013 16:09:27 +0000 (16:09 +0000)]
* tracepoint.h (decode_agent_options): Add 'trace_string'
argument.
* tracepoint.c (decode_agent_options): Add 'trace_string'
argument.
(validate_actionline): Update.
(collect_symbol): Add 'trace_string' argument.
(struct add_local_symbols_data) <trace_string>: New field.
(do_collect_symbol): Update.
(add_local_symbols): Add 'trace_string' argument.
(encode_actions_1): Update.
(trace_dump_actions): Update.
* dwarf2loc.c (access_memory): Update.
* ax.h (struct agent_expr) <tracing, trace_string>: New fields.
* ax-general.c (new_agent_expr): Update.
* ax-gdb.h (gen_trace_for_expr, gen_trace_for_var)
(gen_trace_for_return_address): Add argument.
(trace_kludge, trace_string_kludge): Remove.
* ax-gdb.c (trace_kludge, trace_string_kludge): Remove.
(gen_traced_pop, gen_fetch, gen_bitfield_ref, gen_expr): Update.
(gen_trace_for_var): Add 'trace_string' argument.
(gen_trace_for_expr, gen_trace_for_return_address): Likewise.
(gen_printf, agent_eval_command_one): Update.

11 years ago * elf32-h8300 (h8_relax_section): Add new relaxation of mov
Nick Clifton [Thu, 21 Mar 2013 16:08:07 +0000 (16:08 +0000)]
* elf32-h8300 (h8_relax_section): Add new relaxation of mov
@(disp:32,ERx) to mov @(disp:16,ERx).
(R_H8_DISP32A16): New reloc.
Comments added and corrected.
* reloc.c (BFD_RELOC_H8_DISP32A16): New reloc.
* bfd-in2.h: Regenerate.
* libbfd.h: Regenerate.

* ld.texinfo (H8/300): Add description of relaxation of
mov @(disp:32,ERx) to mov @(disp:16,ERx).

* ld-h8300/h8300.exp: Add new relax-7 test on ELF.
* ld-h8300/relax-2.s: Add other direction and .w/.l variants of
mov insns.
* ld-h8300/relax-2.d: Update expected disassembly.
* ld-h8300/relax-7a.s: New: tests for mov @(disp:32,ERx) -> mov
@(disp:16,ERx).
* ld-h8300/relax-7b.s: New: Likewise.
* ld-h8300/relax-7.d: New: expected disassembly.

* config/tc-h8300.c (do_a_fix_imm): Add relaxation of mov
@(disp:32,ERx) to mov @(disp:16,ERx) insns by new reloc
R_H8_DISP32A16.
* config/tc-h8300.h: Remove duplicated defines.

11 years ago PR exp/15109:
Tom Tromey [Thu, 21 Mar 2013 15:19:33 +0000 (15:19 +0000)]
PR exp/15109:
* c-exp.y (yylex): Rewrite to push all tokens onto the FIFO.
Handle FILENAME token.
gdb/testsuite
* gdb.cp/cpexprs.exp: Add test for FILENAME:: case.
* gdb.cp/misc.exp: Add test for FILENAME:: case.

11 years ago * c-exp.y (YYPRINT): Define.
Tom Tromey [Thu, 21 Mar 2013 15:01:55 +0000 (15:01 +0000)]
* c-exp.y (YYPRINT): Define.
(c_print_token): New function.

11 years ago PR gas/15282
Nick Clifton [Thu, 21 Mar 2013 14:47:34 +0000 (14:47 +0000)]
PR gas/15282
* tc-avr.c (mcu_has_3_byte_pc): New function.
(tc_cfi_frame_initial_instructions): Call it to find return
address size.

11 years ago * c-exp.y (%union) <sym, ivar, ivec>: Remove.
Tom Tromey [Thu, 21 Mar 2013 14:41:28 +0000 (14:41 +0000)]
* c-exp.y (%union) <sym, ivar, ivec>: Remove.

11 years ago * coffgen.c (coff_real_object_p): Make global.
Kai Tietz [Thu, 21 Mar 2013 14:07:08 +0000 (14:07 +0000)]
* coffgen.c (coff_real_object_p): Make global.
* peicode.h (coff_real_object_p): Add prototype.
(FILHDR): Defined for COFF_IMAGE_WITH_PE as
external_PEI_IMAGE_hdr structure.
(coff_swap_filehdr_in): Handle variable header-size.
* peXXigen.c (_bfd_XXi_swap_aouthdr_in): Just handle amount
of directory-entiries as specified in pe-header.

11 years ago * pe-dll.c (process_def_file_and_drectve): Don't handle VC
Kai Tietz [Thu, 21 Mar 2013 14:05:29 +0000 (14:05 +0000)]
* pe-dll.c (process_def_file_and_drectve): Don't handle VC
generated C++-symbols as stdcall/fastcall.

11 years ago PR sim/15286
Nick Clifton [Thu, 21 Mar 2013 10:34:11 +0000 (10:34 +0000)]
PR sim/15286
* elf32-arm.c (bfd_arm_get_mach_from_attributes): Identify XScale,
iWMMXt and iWMMXt2 processors from attributes.

11 years ago * layout.cc (Layout::set_segment_offsets): Accept writable .text
Alan Modra [Thu, 21 Mar 2013 04:52:55 +0000 (04:52 +0000)]
* layout.cc (Layout::set_segment_offsets): Accept writable .text
segment when omagic.

11 years ago * dwp.cc (Dwp_output_file::add_contribution): Avoid signed/unsigned
Alan Modra [Thu, 21 Mar 2013 02:00:16 +0000 (02:00 +0000)]
* dwp.cc (Dwp_output_file::add_contribution): Avoid signed/unsigned
comparison warning.
* layout.cc (Layout::create_dynamic_symtab): Avoid "may be used
uninitialized" warning.

11 years agogdb/
Yao Qi [Thu, 21 Mar 2013 01:08:46 +0000 (01:08 +0000)]
gdb/
* ctf.c: Include "gdb_stat.h".
[USE_WIN32API]: New macro 'mkdir'.
(ctf_start): Use permission bits macros if they are defined.

11 years ago*** empty log message ***
gdbadmin [Thu, 21 Mar 2013 00:00:02 +0000 (00:00 +0000)]
*** empty log message ***

11 years agodaily update
Alan Modra [Wed, 20 Mar 2013 23:00:04 +0000 (23:00 +0000)]
daily update

11 years ago * breakpoint.h (struct breakpoint): Add comment to
Keith Seitz [Wed, 20 Mar 2013 22:17:18 +0000 (22:17 +0000)]
* breakpoint.h (struct breakpoint): Add comment to
extra_string indicating that this member is mallod'd.
* breakpoint.c (base_breakpoint_dtor): Free extra_string.

11 years agoFix PR gdb/15289 - "set remote hardware-watchpoint-limit" broken (zinteger commands)
Pedro Alves [Wed, 20 Mar 2013 18:58:16 +0000 (18:58 +0000)]
Fix PR gdb/15289 - "set remote hardware-watchpoint-limit" broken (zinteger commands)

This is a regression from 7.5, introduced/exposed by:
  http://sourceware.org/ml/gdb-patches/2012-07/msg00259.html

There are a series of issues with this code.

It does:

unsigned int val = parse_and_eval_long (arg);
^^^^^^^^^^^^

(unsigned, usually 32-bit) while parse_and_eval_long returns a LONGEST
(usually 64-bit), so we lose precision without noticing:

  (gdb) set remote hardware-watchpoint-limit 0x100000000
  (gdb) show remote hardware-watchpoint-limit 0x100000000
  The maximum number of target hardware watchpoints is 0.

While at it, print the invalid number with plongest, so the user sees
what GDB thought the number was:

  (gdb) set remote hardware-watchpoint-limit 0x100000000
  integer 4294967296 out of range

So with "set remote hardware-watchpoint-limit -1", val ends converted
to 0xffffffff, which then fails the

else if (val >= INT_MAX)
  error (_("integer %u out of range"), val);

test.

Looking at that INT_MAX check, we forbid INT_MAX itself, but we
shouldn't, as that does fit in 'int' -- we want to forbid values
_greater_ than INT_MAX (and less than INT_MIN, while at it):

  (gdb) set remote hardware-watchpoint-limit 2147483647
  integer 2147483647 out of range

The same problem is in the new var_zuinteger_unlimited code, which
also uses "int" for variable.

Also, when printing a 'signed int', we should use %d, not %u.

This adds a couple regression tests.  Not completely thorough in checking
all kinds of invalid input; I'm saving more exaustive testing around
zXXinteger commands for something like new test-assisting commands
like "maint test cmd-zinteger -1", where testing would focus on the
command types, and thus be independent of particular user commands of
particular GDB features.

Tested on x86_64 Fedora 17.

gdb/
2013-03-20  Pedro Alves  <palves@redhat.com>

PR gdb/15289

* cli/cli-setshow.c (do_set_command)
<var_uinteger, var_zuinteger>: Use LONGEST for variable holding
the result of parsing the command argument.  Throw error if the
value is greater than UINT_MAX.  Print the invalid value with
plongest.
<var_integer, var_zinteger>: Use LONGEST for variable holding the
result of parsing the command argument.  Throw error if the value
is greater than INT_MAX, not greater or equal.  Also throw error
if the value is less than INT_MIN.  Print the invalid value with
plongest.
<var_zuinteger_unlimited>: Throw error if the value is greater
than INT_MAX, not greater or equal.
(do_show_command) <var_integer, var_zinteger,
var_zuinteger_unlimited>: Use %d for printing int, not %u.

gdb/testsuite/
2013-03-20  Pedro Alves  <palves@redhat.com>

PR gdb/15289

* gdb.base/remote.exp: Test
"set remote hardware-watchpoint-limit -1",
"set remote hardware-breakpoint-limit -1",
"set remote hardware-watchpoint-limit 2147483647" and
"set remote hardware-breakpoint-limit 2147483647".