* gdb.gdb/selftest.exp (do_steps_and_nexts): Handle bfd_init
	call.
	* dwarf2loc.c (dwarf2_compile_expr_to_ax) <DW_OP_fbreg>: Only
	require_rvalue for a register location.
There's code in annotate.c and breakpoint.c that is supposed to
suppress multiple breakpoints-invalid annotations when the ignore
count of a breakpoint changes, up until the target actually stops.

But, the code is bogus:

void
annotate_breakpoints_changed (void)
{
  if (annotation_level == 2)
    {
      target_terminal_ours ();
      printf_unfiltered (("\n\032\032breakpoints-invalid\n"));
      if (ignore_count_changed)
	ignore_count_changed = 0;   /* Avoid multiple break annotations.  */
    }
}

The "ignore_count_changed" flag isn't actually guarding the output of
the annotation at all.  It would have been better written something
like:

void
annotate_breakpoints_changed (void)
{
  if (annotation_level == 2 && !ignore_count_changed)
    {
      target_terminal_ours ();
      printf_unfiltered (("\n\032\032breakpoints-invalid\n"));
      ignore_count_changed = 0;   /* Avoid multiple break annotations.  */
    }
}

but, it wasn't.  AFAICS, that goes all the way back to the original
patch'es submission and check in, at
<http://sourceware.org/ml/gdb-patches/1999-q4/msg00106.html>.  I
looked a tar of HP's wdb from 1999, and even though that contains
local changes in the annotate code, this suppression seems borked
there too to me.

The original patch added a test to supposedly exercise this
suppression, but, it actually doesn't.  It merely tests that
"breakpoints-invalid" is output after "stopped", but doesn't check
whether the duplicates supression actually works (IOW, check that only
_one_ annotation is seen).  I was going to simply delete the tests
too, but a following patch will eliminate the duplicates in a
different way (which I needed for a different reason), so instead, I'm
making the tests actually fail if a duplicate annotation is seen.

Worry not, the test doesn't actually fail!  The reason is that
breakpoint.c does:

      else if (b->ignore_count > 0)
	{
	  b->ignore_count--;
	  annotate_ignore_count_change ();
	  bs->stop = 0;
	  /* Increase the hit count even though we don't stop.  */
	  ++(b->hit_count);
	  observer_notify_breakpoint_modified (b);
	}

where the annotate_ignore_count_change call is meant to inform the
"breakpoint_modified" annotation observer to ignore the notification.
All sounds good.  But, the trouble is that nowadays annotate.c only
installs the observers if GDB is started with annotations enabled with
a command line option (gdb --annotate=2):

void
_initialize_annotate (void)
{
  if (annotation_level == 2)
    {
      observer_attach_breakpoint_deleted (breakpoint_changed);
      observer_attach_breakpoint_modified (breakpoint_changed);
    }
}

and annota1.exp, to enable annotations, starts GDB normally, and
afterwards does "set annotate 2", so the observers aren't installed
when annota1.exp is run, and therefore changing the ignore count isn't
triggering any annotation at all...

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

	* annotate.c (ignore_count_changed): Delete.
	(annotate_breakpoints_changed): Don't clear ignore_count_changed.
	(annotate_ignore_count_change): Delete.
	(annotate_stopped): Don't emit a delayed breakpoints-changed
	annotation.
	* annotate.h (annotate_ignore_count_change): Delete.
	* breakpoint.c (bpstat_check_breakpoint_conditions): Don't call
	annotate_ignore_count_change.

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

	* gdb.base/annota1.exp (annotate ignore count change): Add
	expected output for failure case.
With some changes to how software single-step (SSS) breakpoints are
handled, one of those being to place SSS breakpoints on the breakpoint
chain as all other breakpoints, annota1.exp times out with lots and
lots of breakpoint-invalid and frame-changed annotations.  All those
extra annotations are actually unnecessary.  For one, SSS breakpoints
are internal breakpoints, so the frontend shouldn't care if they were
added, removed or changed.  Then, there's really no point in emitting
"breakpoints-invalid" or "frames-invalid" more than once between times
the frontend/user can actually issues GDB commands; the frontend will
have to wait for the GDB prompt to refresh its state, so emitting
those annotations at most once between prompts is enough.  Non-stop or
async would complicate this, but no frontend will be using annotations
in those modes (one of goes of emacs switching to MI was non-stop mode
support, AFAIK).  The previous patch reveals there has been an
intention in the past to suppress multiple breakpoints-invalid
annotations caused by ignore count changes.  As the previous patch
shows, that's always been broken, but in any case, this patch actually
makes it work.  The next patch will remove several annotation-specific
calls in breakpoint.c in favor of always using the breakpoint modified
& friends observers, and that causes yet more of these annotations,
because several calls to the corresponding annotate_* functions in
breakpoint.c are missing, particularly in newer code.

So all in all, here's a simple mechanism that avoids sending the same
annotation to the frontend more than once until gdb is ready to accept
further commands.

Tested on x86_64 Fedora 17.

2013-01-22  Pedro Alves  <palves@redhat.com>

	* annotate.c: Include "inferior.h".
	(frames_invalid_emitted)
	(breakpoints_invalid_emitted): New globals.
	(async_background_execution_p): New function.
	(annotate_breakpoints_changed, annotate_frames_invalid): Skip
	emitting the annotation if it has already been emitted.
	(annotate_display_prompt): New function.
	* annotate.h (annotate_display_prompt): New declaration.
	* event-top.c: Include annotate.h.
	(display_gdb_prompt): Call annotate_display_prompt.
All annotate_breakpoints_changed calls are along-side
observer_notify_breakpoints_changed calls.  All, except the
init_raw_breakpoint one.  But that one is actually wrong.  The
breakpoint is being constructed at that point, and hasn't been placed
on the breakpoint chain yet.  It would be better placed in
install_breakpoint, and I actually started out that way.  But once the
annotate_breakpoints_changed are parallel to the observer calls, we
can fully move annotations to observers too.

One issue is that this changes the order of annotations a bit.
Before, we'd emit the annotation, and after call "mention()" on the
breakpoint (which prints the breakpoint number, etc.).  But, we call
the observers _after_ mention is called, so the annotation output will
change a little:

void
install_breakpoint (int internal, struct breakpoint *b, int update_gll)
{
  add_to_breakpoint_chain (b);
  set_breakpoint_number (internal, b);
  if (is_tracepoint (b))
    set_tracepoint_count (breakpoint_count);
  if (!internal)
    mention (b);
  observer_notify_breakpoint_created (b);

  if (update_gll)
    update_global_location_list (1);
}

I believe this order doesn't really matter (the frontend needs to wait
for the prompt anyway), so I just adjust the expected output in the
tests.  Emacs in annotations mode doesn't seem to complain.  Couple
that with the previous patch that suppressed duplicated annotations,
and, the fact that some annotations calls were actually missing (were
we do have observer calls), more changes to the tests are needed
anyway.

Tested on x86_64 Fedora 17.

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

	* annotate.c (annotate_breakpoints_changed): Rename to ...
	(annotate_breakpoints_invalid): ... this.  Make static.
	(breakpoint_changed): Adjust.
	(_initialize_annotate): Always install the observers.  Install a
	"breakpoint_created" observer.
	* annotate.h (annotate_breakpoints_changed): Delete declaration.
	* breakpoint.c (set_breakpoint_condition)
	(breakpoint_set_commands, do_map_commands_command)
	(init_raw_breakpoint, clear_command, set_ignore_count)
	(enable_breakpoint_disp): No longer call
	annotate_breakpoints_changed.

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

	* gdb.base/annota1.exp (breakpoints_invalid): New variable.
	Adjust tests to breakpoints-invalid changes.
	* gdb.cp/annota2.exp (breakpoints_invalid, frames_invalid): New
	variables.
	Adjust tests to breakpoints-invalid changes.
If a breakpoint is not user visible, then there's no point in
bothering the frontend about it...  This is the exact same check MI
does.

I also smoke tested Emacs 23 in gud-gdb mode, both annotations=2
and annotations=3.  I didn't notice anything break.

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

	* annotate.c (breakpoint_changed): Skip if breakpoint is not
	user-visible.

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

	* gdb.base/annota1.exp (signal sent): No longer expect
	breakpoints-invalid.
	* gdb.cp/annota2.exp (continue until exit)
	(watch triggered on a.x): Ditto.
2013-01-22  Joel Sherrill <joel.sherrill@oarcorp.com>

	* libc/include/pthread.h: Add PTHREAD_RWLOCK_INITIALIZER.
	Fix typo on PTHREAD_COJND_INITIALIZER.
ld/
	* emultempl/elf32.em (gld${EMULATION_NAME}_before_parse): Set
	new_dtags to TRUE for *-*-nacl* targets.
daily update
*** empty log message ***
* miscfuncs.cc (__import_address): Avoid treating random instructions as import
jump.
* malloc_wrapper.cc (malloc_init): Remove comment about 64-bit.
* miscfuncs.cc (__import_address): Avoid NULL explicitly.
* exceptions.cc (exception::handle): Make attempt to recursively dump stack
fatal.
2013-01-23  Andreas Krebbel  <Andreas.Krebbel@de.ibm.com>

	* readelf.c: Add strings for NT_S390_LAST_BREAK and
	NT_S390_SYSTEM_CALL.
	* config.bfd (x86_64-*-rdos*): Remove targ_selvecs.
	* Makefile.am (ALL_64_EMULATION_SOURCES): Add eelf64rdos.c.
	(eelf64rdos.c): New rule.
	* emulparams/elf64rdos.sh: New file.
	* configure.tgt (x86_64-*-rdos*): Use above.
	* Makefile.in: Regenerate.
	PR ld/15037
	* scripttempl/avr.sc (.eeprom): Keep it.
	PR gas/15039
	* config/tc-avr.c: Include dwarf2dbg.h.
	* elf32-metag.c: Error on HIADDR16/LOADDR16 in shared link.
* miscfuncs.cc (__import_address): On second thought, the chance that this
pointer could be NULL is very low so don't bother checking for it.