binutils-gdb.git
11 years agodaily update
Alan Modra [Fri, 20 Sep 2013 00:00:04 +0000 (00:00 +0000)]
daily update

11 years agoFix regressions caused by thread-specific breakpoint deletion.
Pedro Alves [Thu, 19 Sep 2013 14:45:33 +0000 (14:45 +0000)]
Fix regressions caused by thread-specific breakpoint deletion.

The recent change to make GDB auto-delete thread-specific breakpoints
when the corresponding thread is deleted
(https://sourceware.org/ml/gdb-patches/2013-09/msg00038.html) caused
gdb.base/nextoverexit.exp to regress.

    Breakpoint 1, main () at .../gdb/testsuite/gdb.base/nextoverexit.c:21
    21        exit (0);
    (gdb) next
    [Inferior 1 (process 25208) exited normally]
    Thread-specific breakpoint -5 deleted - thread 1 is gone.
    Thread-specific breakpoint -6 deleted - thread 1 is gone.
    Thread-specific breakpoint -7 deleted - thread 1 is gone.
    Thread-specific breakpoint 0 deleted - thread 1 is gone.
    (gdb) FAIL: gdb.base/nextoverexit.exp: next over exit (the program exited)

We shouldn't be seeing this for internal or momentary breakpoints.  In
fact, we shouldn't even be trying to delete them, as whatever created
them will take care or it, and therefore it's dangerous to delete them
behind the creator's back.

I thought it'd still be good to tag thread-specific internal/momentary
breakpoints such that we'll no longer try to keep them insert in the
target, as they'll cause stops and thread hops in other threads, so I
tried disabling them instead.  That caused a problem when following a
child fork, and detaching from the parent, as we try to reset the
step-resume etc. breakpoints to the new child's thread
(breakpoint_re_set_thread), after the parent thread is already gone
(and the breakpoints are marked disabled).  I fixed that by
re-enabling internal/momentary breakpoints there, but, that didn't
feel super safe either (maybe we'd need a new flag in struct
breakpoint instead, to tag the thread-specific breakpoint as "not to
be inserted").  It felt like I was heading down a design rat hole,
and, other things will usually delete internal/momentary breakpoints
soon enough, so I left that little optimization for some other day.

So, internal/momentary breakpoints are no longer deleted/disabled at
all, and we end up with a one-liner fix.

Tested on x86_64 Fedora 17.

gdb/
2013-09-19  Pedro Alves  <palves@redhat.com>

* breakpoint.c (remove_threaded_breakpoints): Skip non-user
breakpoints.

11 years agognu-nat.c: Don't install a deprecated_xfer_memory method.
Thomas Schwinge [Thu, 19 Sep 2013 13:40:38 +0000 (13:40 +0000)]
gnu-nat.c: Don't install a deprecated_xfer_memory method.

This removes another instance of a deprecated_xfer_memory user.

gdb/
2013-09-19  Pedro Alves  <palves@redhat.com>
    Thomas Schwinge  <thomas@codesourcery.com>
    Yue Lu  <hacklu.newborn@gmail.com>

* gnu-nat.c (gnu_read_inferior, gnu_write_inferior): Make static.
Take a gdb_byte pointer instead of a char pointer.

* gnu-nat.c (gnu_xfer_memory): Adjust interface as
gnu_xfer_partial helper.
(gnu_xfer_partial): New function.
(gnu_target): Don't install a deprecated_xfer_memory hook.
Install a to_xfer_partial hook.

11 years agoMostly code cleanup: Constification.
Jan Kratochvil [Thu, 19 Sep 2013 12:44:46 +0000 (12:44 +0000)]
Mostly code cleanup: Constification.

gdb/
2013-09-19  Jan Kratochvil  <jan.kratochvil@redhat.com>

Constification.
* main.c (captured_main): Replace catch_command_errors by
catch_command_errors_const.  Twice.
* symfile.c (symbol_file_add_main_1): Make args parameter const.
(symbol_file_add): Make name parameter const.
(symbol_file_add_main, symbol_file_add_main_1): Make args parameter const.
(symfile_bfd_open): Make name parameter const, rename it to cname.  Add
variable name.  Change their usage accordingly.
* symfile.h (symbol_file_add, symfile_bfd_open): Make first parameter
const.
(symbol_file_add_main): Make args parameter const.

11 years agodaily update
Alan Modra [Thu, 19 Sep 2013 00:00:03 +0000 (00:00 +0000)]
daily update

11 years ago2013-09-18 Raunaq Bathija <raunaq12@in.ibm.com>
Ulrich Weigand [Wed, 18 Sep 2013 17:47:56 +0000 (17:47 +0000)]
2013-09-18  Raunaq Bathija  <raunaq12@in.ibm.com>
    Ulrich Weigand  <uweigand@de.ibm.com>

* xcoffread.c (struct coff_symbol): Use CORE_ADDR as type
of c_value member.
(read_xcoff_symtab): Use CORE_ADDR as type of fcn_start_addr.

11 years agoAlso mention Yue Lu in previous commit's entry.
Pedro Alves [Wed, 18 Sep 2013 14:49:43 +0000 (14:49 +0000)]
Also mention Yue Lu in previous commit's entry.

2013-09-18  Pedro Alves  <palves@redhat.com>
    Yue Lu  <hacklu.newborn@gmail.com>

* gnu-nat.c (inf_validate_procs, gnu_wait, gnu_resume)
(gnu_create_inferior)
(gnu_attach, gnu_thread_alive, gnu_pid_to_str, cur_thread)
(set_sig_thread_cmd): Use the lwpid field of ptids to
store/extract thread ids instead of the tid field.
* i386gnu-nat.c (gnu_fetch_registers): Adjust.

11 years agoSubject: [PATCH] [Hurd/gnu-nat.c] Use ptid_t.lwpid to store thread ids
Pedro Alves [Wed, 18 Sep 2013 14:47:51 +0000 (14:47 +0000)]
Subject: [PATCH] [Hurd/gnu-nat.c] Use ptid_t.lwpid to store thread ids
 instead of ptid_t.tid.

In preparation for reusing gnu-nat.c in gdbserver, switch to storing
thread ids in the lwpid field of ptid_t rather than in the tid
field.  The Hurd's thread model is 1:1, so it doesn't feel wrong
anyway.

gdb/
2013-09-18  Pedro Alves  <palves@redhat.com>

* gnu-nat.c (inf_validate_procs, gnu_wait, gnu_resume)
(gnu_create_inferior)
(gnu_attach, gnu_thread_alive, gnu_pid_to_str, cur_thread)
(set_sig_thread_cmd): Use the lwpid field of ptids to
store/extract thread ids instead of the tid field.
* i386gnu-nat.c (gnu_fetch_registers): Adjust.

11 years agoConsistent display of "<optimized out>" for register values.
Andrew Burgess [Wed, 18 Sep 2013 14:02:31 +0000 (14:02 +0000)]
Consistent display of "<optimized out>" for register values.

  https://sourceware.org/ml/gdb-patches/2013-08/msg00170.html

gdb/ChangeLog

        * infcmd.c (default_print_one_register_info): Add detection of
        optimized out values.
        (default_print_registers_info): Switch to using
        get_frame_register_value.

gdb/testsuite/ChangeLog

        * gdb.dwarf2/dw2-reg-undefined.exp: Change pattern for info
        register to "<optimized out>", and also print the registers.

11 years ago2013-09-18 Kyrylo Tkachov <kyrylo.tkachov@arm.com>
Kyrylo Tkachov [Wed, 18 Sep 2013 13:59:12 +0000 (13:59 +0000)]
2013-09-18  Kyrylo Tkachov  <kyrylo.tkachov@arm.com>

* ld-aarch64/eh-frame.d: Update expected output to allow for
64-bit addresses.

11 years agogdbserver --wrapper also doesn't work on Cygwin.
Pedro Alves [Wed, 18 Sep 2013 13:21:41 +0000 (13:21 +0000)]
gdbserver --wrapper also doesn't work on Cygwin.

Skip the test on Cygwin too.

2013-09-18  Pedro Alves  <palves@redhat.com>

PR server/15967
* gdb.server/wrapper.exp: Also return unsupported for Cygwin, and
change text.

11 years agoWhen reverse-stepping, only insert a resume breakpoint at ecs->stop_func_start
Markus Metzger [Wed, 18 Sep 2013 13:02:42 +0000 (13:02 +0000)]
When reverse-stepping, only insert a resume breakpoint at ecs->stop_func_start
if the function start is known.  Otherwise, keep single-stepping.

11 years ago[Hurd/gnu-nat] Fix old "signal-thread" command regression.
Pedro Alves [Wed, 18 Sep 2013 12:00:06 +0000 (12:00 +0000)]
[Hurd/gnu-nat] Fix old "signal-thread" command regression.

By inspection, I noticed that when I made the gnu-nat use
ptid(pid,0,tid) to represent a thread, instead of using ptid(tid,0,0),
in <https://sourceware.org/ml/gdb-patches/2008-08/msg00175.html>, I
introduced a bug.

The change was:

   else
     {
-      int tid = PIDGET (thread_id_to_pid (atoi (args)));
+      int tid = ptid_get_tid (thread_id_to_pid (atoi (args)));
       if (tid < 0)
  error (_("Thread ID %s not known.  Use the \"info threads\" command to\n"
         "see the IDs of currently known threads."), args);

and thread_id_to_pid does:

 ptid_t
 thread_id_to_pid (int num)
 {
   struct thread_info *thread = find_thread_id (num);

   if (thread)
     return thread->ptid;
   else
     return pid_to_ptid (-1);
 }

(pid_to_ptid (-1) is the same as minus_one_ptid.)

So before, we were really looking at the pid, where thread_id_to_pid
stores the -1.

The right fix is to compare the whole ptid to minus_one_ptid, of
course.

Completely untested, but I think it's obvious enough, so I went ahead
and put it in.

gdb/
2013-09-18  Pedro Alves  <palves@redhat.com>

* gnu-nat.c (set_sig_thread_cmd): Compare the thread's ptid to
minus_one_ptid instead of looking at the ptid's tid field and
comparing that to -1.

11 years agoFix whitespace error in previous commit.
Andrew Burgess [Wed, 18 Sep 2013 11:45:20 +0000 (11:45 +0000)]
Fix whitespace error in previous commit.

  https://sourceware.org/ml/gdb-cvs/2013-09/msg00108.html
  https://sourceware.org/ml/gdb-patches/2013-09/msg00225.html

gdb/ChangeLog

        * main.h (get_gdb_program_name): Remove extra whitespace.

11 years agoAdd new function to access gdb_program_name.
Andrew Burgess [Wed, 18 Sep 2013 11:41:38 +0000 (11:41 +0000)]
Add new function to access gdb_program_name.

  https://sourceware.org/ml/gdb-patches/2013-09/msg00225.html

gdb/ChangeLog

        * main.h (get_gdb_program_name): Add declaration.
        * main.c (get_gdb_program_name): Add definition.

11 years agobfd/
Tristan Gingold [Wed, 18 Sep 2013 11:02:05 +0000 (11:02 +0000)]
bfd/
2013-09-18  Tristan Gingold  <gingold@adacore.com>

* configure.in: Bump version to 2.24.51
* configure: Regenerate.

11 years agobinutils/
Tristan Gingold [Wed, 18 Sep 2013 10:39:38 +0000 (10:39 +0000)]
binutils/
2013-09-18  Tristan Gingold  <gingold@adacore.com>

* NEWS: Add marker for 2.24.

gas/
2013-09-18  Tristan Gingold  <gingold@adacore.com>

* NEWS: Add marker for 2.24.

ld/
2013-09-18  Tristan Gingold  <gingold@adacore.com>

* NEWS: Add marker for 2.24.

11 years ago2013-09-18 Tristan Gingold <gingold@adacore.com>
Tristan Gingold [Wed, 18 Sep 2013 10:33:02 +0000 (10:33 +0000)]
2013-09-18  Tristan Gingold  <gingold@adacore.com>

* Makefile.am (LEXLIB): Define.  Replase references to @LEXLIB@
by $(LEXLIB).
* Makefile.in: Regenerate.

11 years ago * config/tc-msp430.c (OPTION_MOVE_DATA): Define.
Nick Clifton [Wed, 18 Sep 2013 07:50:34 +0000 (07:50 +0000)]
* config/tc-msp430.c (OPTION_MOVE_DATA): Define.
(move_data): New variable.
(md_parse_option): Parse -md.
(msp430_section): New function.  Catch references to the .bss or
.data sections and generate a special symbol for use by the libcrt
library.
(md_pseudo_table): Intercept .section directives.
(md_longopt): Add -md
(md_show_usage): Likewise.
(msp430_operands): Generate a warning message if a NOP is inserted
into the instruction stream.
* doc/c-msp430.texi (node MSP430 Options): Document -md option.

11 years agogdb/gdbserver/
Yao Qi [Wed, 18 Sep 2013 01:59:59 +0000 (01:59 +0000)]
gdb/gdbserver/

2013-09-18  Yao Qi  <yao@codesourcery.com>

PR server/15959
* server.c (start_inferior): Clear 'resume_info'.

gdb/testsuite/

2013-09-18  Yao Qi  <yao@codesourcery.com>

* gdb.server/wrapper.c: New.
* gdb.server/wrapper.exp: New.

11 years agogdb/gdbserver/
Yao Qi [Wed, 18 Sep 2013 01:55:53 +0000 (01:55 +0000)]
gdb/gdbserver/

Fix ChangeLog format issue.

11 years agodaily update
Alan Modra [Wed, 18 Sep 2013 00:00:05 +0000 (00:00 +0000)]
daily update

11 years ago * dwarf2read.c: Move definitions of complaint functions to after
Doug Evans [Tue, 17 Sep 2013 22:12:55 +0000 (22:12 +0000)]
* dwarf2read.c: Move definitions of complaint functions to after
forward declarations of local functions.

11 years ago2013-09-17 Doug Gilmore <Doug.Gilmore@imgtec.com>
Steve Ellcey [Tue, 17 Sep 2013 21:09:27 +0000 (21:09 +0000)]
2013-09-17  Doug Gilmore  <Doug.Gilmore@imgtec.com>

* readelf.c (get_machine_flags): Handle EF_MIPS_FP64.

11 years ago2013-09-17 Doug Gilmore <Doug.Gilmore@imgtec.com>
Steve Ellcey [Tue, 17 Sep 2013 21:08:30 +0000 (21:08 +0000)]
2013-09-17  Doug Gilmore  <Doug.Gilmore@imgtec.com>

* config/tc-mips.c (mips_elf_final_processing): Set
EF_MIPS_FP64 for -mgp32 -mfp64, removing old FIXME.

11 years ago2013-09-17 Doug Gilmore <Doug.Gilmore@imgtec.com>
Steve Ellcey [Tue, 17 Sep 2013 21:07:13 +0000 (21:07 +0000)]
2013-09-17  Doug Gilmore  <Doug.Gilmore@imgtec.com>

* elfxx-mips.c (_bfd_mips_elf_print_private_bfd_data): Handle
EF_MIPS_FP64.

11 years ago2013-09-17 Doug Gilmore <Doug.Gilmore@imgtec.com>
Steve Ellcey [Tue, 17 Sep 2013 21:05:49 +0000 (21:05 +0000)]
2013-09-17  Doug Gilmore  <Doug.Gilmore@imgtec.com>

* mips.h (EF_MIPS_FP64): New e_flags bit.

11 years agoPR gdb/11568 - delete thread-specific breakpoints on thread exit
Pedro Alves [Tue, 17 Sep 2013 19:32:47 +0000 (19:32 +0000)]
PR gdb/11568 - delete thread-specific breakpoints on thread exit

PR gdb/11568 is about thread-specific breakpoints being left behind
when the corresponding thread exits.

Currently:

 (gdb) b start thread 2
 Breakpoint 3 at 0x400614: file thread-specific-bp.c, line 23.
 (gdb) b end
 Breakpoint 4 at 0x40061f: file thread-specific-bp.c, line 29.
 (gdb) c
 Continuing.
 [Thread 0x7ffff7fcb700 (LWP 14925) exited]
 [Switching to Thread 0x7ffff7fcc740 (LWP 14921)]

 Breakpoint 4, end () at thread-specific-bp.c:29
 29      }
 (gdb) info threads
   Id   Target Id         Frame
 * 1    Thread 0x7ffff7fcc740 (LWP 14921) "thread-specific" end () at thread-specific-bp.c:29
 (gdb) info breakpoints
 Num     Type           Disp Enb Address            What
 2       breakpoint     keep y   0x0000000000400614 in start at thread-specific-bp.c:23
         breakpoint already hit 1 time
 3       breakpoint     keep y   0x0000000000400614 in start at thread-specific-bp.c:23 thread 2
         stop only in thread 2
 4       breakpoint     keep y   0x000000000040061f in end at thread-specific-bp.c:29
         breakpoint already hit 1 time

Note that the thread-specific breakpoint 3 stayed around, even though
thread 2 is gone.

There's no way that breakpoint can trigger again (*), so the PR argues
that the breakpoint should just be removed, like local watchpoints.
I'm ambivalent on this -- it could be reasonable to disable the
breakpoint (kind of like breakpoint in shared library code when the
DSO is unloaded), so the user could still use it as visual template
for creating other breakpoints (copy/paste command lists, etc.), or we
could have a way to change to which thread a breakpoint applies.  But,
several people pushed this direction, and I don't plan on arguing...

(*) - actually, there is ...  thread numbers are reset on "run", so
the user could do "break foo thread 2", "run", and expect the
breakpoint to hit again on the second thread.  But given gdb's thread
numbering can't really be stable, that'd only work sufficiently well
for thread 1, so we'd better call it unsupported.

So with the patch, whenever a thread is deleted from GDB's list, GDB
goes through the thread-specific breakpoints and deletes corresponding
breakpoints.  Since this is user-visible, GDB prints out:

  Thread-specific breakpoint 3 deleted - thread 2 is gone.

And of course, we end up with:

 (gdb) info breakpoints
 Num     Type           Disp Enb Address            What
 2       breakpoint     keep y   0x0000000000400614 in start at thread-specific-bp.c:23
         breakpoint already hit 1 time
 4       breakpoint     keep y   0x000000000040061f in end at thread-specific-bp.c:29
         breakpoint already hit 1 time

2013-09-17  Muhammad Waqas <mwaqas@codesourcery.com>
    Pedro Alves  <palves@redhat.com>

PR gdb/11568
* breakpoint.c (remove_threaded_breakpoints): New function.
(_initialize_breakpoint): Attach remove_threaded_breakpoints
as thread_exit observer.

2013-09-17  Muhammad Waqas  <mwaqas@codesourccery.com>
    Jan Kratochvil  <jan.kartochvil@redhat.com>
    Pedro Alves  <palves@redhat.com>

PR gdb/11568
* gdb.thread/thread-specific-bp.c: New file.
* gdb.thread/thread-specific-bp.exp: New file.

11 years agoThis commit fixes a regression introduced by the new $_isvoid convenience
Sergio Durigan Junior [Tue, 17 Sep 2013 19:24:51 +0000 (19:24 +0000)]
This commit fixes a regression introduced by the new $_isvoid convenience
function.  It adds a check for $_isvoid during the test of "show convenience"
output.

gdb/testsuite/
2013-09-17  Sergio Durigan Junior  <sergiodj@redhat.com>

* gdb.base/defaults.exp (<show_conv_list>): Add check for $_isvoid
convenience function.

11 years agoPR gdb/15911: "info threads" changes the default source and line (for "break", "list")
Pedro Alves [Tue, 17 Sep 2013 18:26:41 +0000 (18:26 +0000)]
PR gdb/15911: "info threads" changes the default source and line (for "break", "list")

"info threads" changes the default source for "break" and "list", to
whatever the location of the first/bottom thread in the thread list
is...

 (gdb) b start
 (gdb) c
 ...
 (gdb) list
 *lists "start"*
 (gdb) b 23
 Breakpoint 3 at 0x400614: file test.c, line 23.
 (gdb) info threads
   Id   Target Id         Frame
 * 2    Thread 0x7ffff7fcb700 (LWP 1760) "test" start (arg=0x0) at test.c:23
   1    Thread 0x7ffff7fcc740 (LWP 1748) "test" 0x000000323dc08e60 in pthread_join (threadid=140737353922304, thread_return=0x0) at pthread_join.c:93
 (gdb) b 23
 Breakpoint 4 at 0x323dc08d90: file pthread_join.c, line 23.
                                    ^^^^^^^^^^^^^^^
 (gdb) list
 93          lll_wait_tid (pd->tid);
 94
 95
 96        /* Restore cancellation mode.  */
 97        CANCEL_RESET (oldtype);
 98
 99        /* Remove the handler.  */
 100       pthread_cleanup_pop (0);
 101
 102

The issue is that print_stack_frame always sets the current sal to the
frame's sal.  print_frame_info (which print_stack_frame calls to do
most of the work) also sets the last displayed sal, but only if
print_what isn't LOCATION.  Now the call in question, from within
thread.c:print_thread_info, does pass in LOCATION as print_what, but
print_stack_frame doesn't have the same check print_frame_info has.
We could consider adding it, but setting these globals depending on
print_what isn't very clean, IMO.  What we have is two logically
distinct operations mixed in the same function(s):

  #1 - print frame, in the format specified by {print_what,
    print_level and print_args}.

  #2 - We're displaying a frame to the user, and I want the default
    sal to point here, because the program stopped here, or the user
    did some context-changing command (up, down, etc.).

So I added a new parameter to print_stack_frame & friends for point
#2, and went through all calls in the tree adjusting as necessary.

Tested on x86_64 Fedora 17.

gdb/
2013-09-17  Pedro Alves  <palves@redhat.com>

PR gdb/15911
* ada-tasks.c (task_command_1): Adjust call to print_stack_frame.
* bsd-kvm.c (bsd_kvm_open, bsd_kvm_proc_cmd, bsd_kvm_pcb_cmd):
* corelow.c (core_open):
* frame.h (print_stack_frame, print_frame_info): New
'set_current_sal' parameter.
* infcmd.c (finish_command, kill_command): Adjust call to
print_stack_frame.
* inferior.c (inferior_command): Likewise.
* infrun.c (normal_stop): Likewise.
* linux-fork.c (linux_fork_context): Likewise.
* record-full.c (record_full_goto_entry, record_full_restore):
Likewise.
* remote-mips.c (common_open): Likewise.
* stack.c (print_stack_frame): New 'set_current_sal' parameter.
Use it.
(print_frame_info): New 'set_current_sal' parameter.  Set the last
displayed sal depending on the new paremeter instead of looking at
print_what.
(backtrace_command_1, select_and_print_frame, frame_command)
(current_frame_command, up_command, down_command): Adjust call to
print_stack_frame.
* thread.c (print_thread_info, restore_selected_frame)
(do_captured_thread_select): Adjust call to print_stack_frame.
* tracepoint.c (tfind_1): Likewise.
* mi/mi-cmd-stack.c (mi_cmd_stack_list_frames)
(mi_cmd_stack_info_frame): Likewise.
* mi/mi-interp.c (mi_on_normal_stop): Likewise.
* mi/mi-main.c (mi_cmd_exec_return, mi_cmd_trace_find): Likewise.

gdb/testsuite/
* gdb.threads/info-threads-cur-sal-2.c: New file.
* gdb.threads/info-threads-cur-sal.c: New file.
* gdb.threads/info-threads-cur-sal.exp: New file.

11 years ago Fix ChangeLog entry missing a ':' char.
Luis Machado [Tue, 17 Sep 2013 15:06:01 +0000 (15:06 +0000)]
Fix ChangeLog entry missing a ':' char.

11 years ago gdbserver/ChangeLog
Jiong Wang [Tue, 17 Sep 2013 14:00:30 +0000 (14:00 +0000)]
  gdbserver/ChangeLog

* linux-tile-low.c (tile_regsets): Modify the size field to 64-bit
for each register.

11 years ago PR ld/15957
Nick Clifton [Tue, 17 Sep 2013 13:57:21 +0000 (13:57 +0000)]
PR ld/15957
* deffilep.y (def_file_add_directive): Avoid readin past end of
buffer.

11 years ago2013-09-16 Jiong Wang <jiwang@tilera.com>
Jiong Wang [Tue, 17 Sep 2013 13:56:54 +0000 (13:56 +0000)]
2013-09-16  Jiong Wang  <jiwang@tilera.com>

  gdbserver/ChangeLog

        * configure.srv <tilegx*-*-linux*>: Remove linux-osdata.o from and add
linux-tile-low.o to srv_tgtobj.

11 years agoopcodes/
Richard Sandiford [Tue, 17 Sep 2013 09:02:37 +0000 (09:02 +0000)]
opcodes/
* s390-opc.txt (clih): Make the immediate unsigned.

gas/testsuite/
* gas/s390/zarch-z196.s, gas/s390/zarch-z196.d: Test CLIH with
4000000000.

11 years agogdb/testsuite/
Yao Qi [Tue, 17 Sep 2013 07:00:50 +0000 (07:00 +0000)]
gdb/testsuite/

* gdb.base/catch-load.c: Remove the include of "dlfcn.h".
 [__WIN32__]: Include "windows.h" and define macro dlopen
 and dlclose.
[!__WIN32__]: Include "dlfcn.h".
* gdb.base/catch-load.exp (one_catch_load_test): Match
directory separator.

11 years agodaily update
Alan Modra [Tue, 17 Sep 2013 00:00:04 +0000 (00:00 +0000)]
daily update

11 years ago * lib/gdb.exp (using_fission): New proc.
Doug Evans [Mon, 16 Sep 2013 23:59:02 +0000 (23:59 +0000)]
* lib/gdb.exp (using_fission): New proc.
* gdb.base/info-macros.exp: Skip test if using Fission.

11 years ago * gdb.base/break-interp.exp: Fix indentation.
Doug Evans [Mon, 16 Sep 2013 23:42:58 +0000 (23:42 +0000)]
* gdb.base/break-interp.exp: Fix indentation.

11 years agoThe error message in the function was saying
Sergio Durigan Junior [Mon, 16 Sep 2013 21:07:14 +0000 (21:07 +0000)]
The error message in the function was saying
"You should provide one parameter..." while it should be saying "... one
argument...".  Replaced.

2013-09-16  Sergio Durigan Junior  <sergiodj@redhat.com>

* value.c (isvoid_internal_fn): Replace "parameter" with
"argument".

11 years ago * README: Update references to writing code for GDB.
Stan Shebs [Mon, 16 Sep 2013 18:00:34 +0000 (18:00 +0000)]
* README: Update references to writing code for GDB.
* configure.ac (build_warnings): Remove obsolete comment.
* configure: Regenerate.
* gdbarch.sh: Remove references to gdbint.texinfo.
* gdbarch.h: Regenerate.
* gdbtypes.c (objfile_type): Remove comments referencing internals
manual and D10V.

[gdb/doc]
Remove the internals manual gdbint.texinfo.
* Makefile.in (INFO_DEPS): Remove gdbint.info.
(PDFFILES): Remove gdbint.pdf.
(HTMLFILES): Remove gdbint/index.html.
(HTMLFILES_INSTALL): Remove gdbint.
(GDBINT_DOC_FILES): Remove.
(dvi): Remove gdbint.dvi.
(ps): Remove gdbint.ps.
* gdbint.texinfo: Remove file.
* gdb.texinfo (Maintenance Commands): Remove reference to gdbint.

11 years agoBased on the discussion at:
Sergio Durigan Junior [Mon, 16 Sep 2013 17:47:30 +0000 (17:47 +0000)]
Based on the discussion at:

<https://sourceware.org/ml/gdb-patches/2013-09/msg00301.html>
<https://sourceware.org/ml/gdb-patches/2013-09/msg00383.html>

This patch adds a new convenience function called $_isvoid, whose
only purpose is to check whether an expression is void or not.
This became necessary because the new convenience variable
$_exitsignal (not yet approved) has a mutual exclusive behavior
with $_exitcode, i.e., when one is "defined" (i.e., non-void),
the other is cleared (i.e., becomes void).  Doug wanted a way to
identify which variable to use, and checking for voidness is the
obvious solution.

It is worth mentioning that my first attempt, after a conversation with
Doug, was to actually implement a new $_isdefined() convenience
function.  I would do that (for convenience variables) by calling
lookup_only_internalvar.  However, I found a few problems:

- Whenever I called $_isdefined ($variable), $variable became defined
  (with a void value), and $_isdefined always returned true.

- Then, I tried to implement $_isdefined ("variable"), and do the "$" +
  "variable" inside GDB, thus making it impossible for GDB to create the
  convenience variable.  However, it was hard to extract the string
  without having to mess with values and their idiossincrasies.
  Therefore, I decided to abandon this attempt (specially because I
  didn't want to spend too much time struggling with it).

Anyway, after talking to Doug again we decided that it would be easier
to implement $_isvoid, and this will probably help in cases like
<http://stackoverflow.com/questions/3744554/testing-if-a-gdb-convenience-variable-is-defined>.

I wrote a NEWS entry for it, and some new lines on the documentation.

gdb/
2013-09-16  Sergio Durigan Junior  <sergiodj@redhat.com>

* NEWS: Mention new convenience function $_isvoid.
* value.c (isvoid_internal_fn): New function.
(_initialize_values): Add new convenience function $_isvoid.

gdb/doc/
2013-09-16  Sergio Durigan Junior  <sergiodj@redhat.com>

* gdb.texinfo (Convenience Functions): Mention new convenience
function $_isvoid.

gdb/testsuite/
2013-09-16  Sergio Durigan Junior  <sergiodj@redhat.com>

* gdb.base/gdbvars.c (foo_void): New function.
(foo_int): Likewise.
* gdb.base/gdbvars.exp (test_convenience_functions): New
function.  Call it.

11 years agogdbserver, aarch64: Zero out regs in aarch64_linux_set_debug_regs.
Will Newton [Mon, 16 Sep 2013 14:22:19 +0000 (14:22 +0000)]
gdbserver, aarch64: Zero out regs in aarch64_linux_set_debug_regs.

Apply the same fix that was applied to aarch64-linux-nat.c.

2013-09-16  Will Newton  <will.newton@linaro.org>

* linux-aarch64-low.c (aarch64_linux_set_debug_regs): Zero
out regs.

11 years ago * arm-linux-tdep.c: Add "elf/common.h" header.
Pierre Muller [Mon, 16 Sep 2013 11:28:53 +0000 (11:28 +0000)]
* arm-linux-tdep.c: Add "elf/common.h" header.
Remove AT_HWCAP macro definintion as it is provided in
added include file.
* s390-tdep.c: Remove system header <elf.h>
Add "elf/common.h" header for AT_HWCAP definition.
(s390_core_read_description): Use correct CORE_ADDR
for hwcap local variable used as third parameter
of function target_auxv_search.

11 years agogas/config/tc-arm.c: Fix parsing of NEON load/store element sizes.
Will Newton [Mon, 16 Sep 2013 09:34:30 +0000 (09:34 +0000)]
gas/config/tc-arm.c: Fix parsing of NEON load/store element sizes.

The existing code would accept VLD2.64 and similar undefined
instructions.

gas/ChangeLog:

2013-09-16  Will Newton  <will.newton@linaro.org>

* config/tc-arm.c (do_neon_ld_st_interleave): Add constraint
disallowing element size 64 with interleave other than 1.

gas/testsuite/ChangeLog:

2013-09-16  Will Newton  <will.newton@linaro.org>

* gas/arm/neon-ldst-es.d: Add VLD1.64 instructions.
* gas/arm/neon-ldst-es.s: Likewise.
* testsuite/gas/arm/neon-ldst-es-bad.d: New file.
* testsuite/gas/arm/neon-ldst-es-bad.l: Likewise.
* testsuite/gas/arm/neon-ldst-es-bad.s: Likewise.

11 years agodaily update
Alan Modra [Mon, 16 Sep 2013 00:00:04 +0000 (00:00 +0000)]
daily update

11 years agodaily update
Alan Modra [Sun, 15 Sep 2013 00:00:04 +0000 (00:00 +0000)]
daily update

11 years ago * common/filestuff.c (gdb_fopen_cloexec): Do not try to use "e"
Pierre Muller [Sat, 14 Sep 2013 06:26:35 +0000 (06:26 +0000)]
* common/filestuff.c (gdb_fopen_cloexec): Do not try to use "e"
mode if operating system doesn't know O_CLOEXEC.

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

11 years agoCode cleanup: Move variable.
Jan Kratochvil [Fri, 13 Sep 2013 14:21:03 +0000 (14:21 +0000)]
Code cleanup: Move variable.

gdb/
2013-09-13  Jan Kratochvil  <jan.kratochvil@redhat.com>

Code cleanup.
* symfile.c (reread_symbols): Move variable obfd_filename to a more
inner block.

11 years agogdb/ChangeLog:
Ulrich Weigand [Fri, 13 Sep 2013 14:17:31 +0000 (14:17 +0000)]
gdb/ChangeLog:
2013-09-13  Andreas Arnez  <arnez@linux.vnet.ibm.com>

* NEWS: Mention TDB support.
* features/s390-tdb.xml: New file.
* features/s390-te-linux64.xml: New file.
* features/s390x-te-linux64.xml: New file.
* features/Makefile (WHICH): Add new tdescs above.
(s390-te-linux64-expedite): Set.
(s390x-te-linux64-expedite): Set.
* features/s390-te-linux64.c: New file (generated).
* features/s390x-te-linux64.c: New file (generated).
* regformats/s390-te-linux64.dat: New file (generated).
* regformats/s390x-te-linux64.dat: New file (generated).
* s390-tdep.h (HWCAP_S390_HIGH_GPRS): Define.
(HWCAP_S390_TE): Likewise.
(S390_TDB_DWORD0_REGNUM): Likewise.
(S390_TDB_DWORD0_REGNUM): Likewise.
(S390_TDB_ABORT_CODE_REGNUM): Likewise.
(S390_TDB_CONFLICT_TOKEN_REGNUM): Likewise.
(S390_TDB_ATIA_REGNUM): Likewise.
(S390_TDB_R0_REGNUM): Likewise.
(S390_TDB_R1_REGNUM): Likewise.
(S390_TDB_R2_REGNUM): Likewise.
(S390_TDB_R3_REGNUM): Likewise.
(S390_TDB_R4_REGNUM): Likewise.
(S390_TDB_R5_REGNUM): Likewise.
(S390_TDB_R6_REGNUM): Likewise.
(S390_TDB_R7_REGNUM): Likewise.
(S390_TDB_R8_REGNUM): Likewise.
(S390_TDB_R9_REGNUM): Likewise.
(S390_TDB_R10_REGNUM): Likewise.
(S390_TDB_R11_REGNUM): Likewise.
(S390_TDB_R12_REGNUM): Likewise.
(S390_TDB_R13_REGNUM): Likewise.
(S390_TDB_R14_REGNUM): Likewise.
(S390_TDB_R15_REGNUM): Likewise.
(S390_NUM_REGS): Increase.
(S390_IS_TDBREGSET_REGNUM): New macro.
(s390_regmap_tdb): Declare.
(s390_sizeof_tdbregset): Define.
(tdesc_s390_te_linux64): Declare.
(tdesc_s390x_te_linux64): Likewise.
* s390-tdep.c: Add includes for "auxv.h", <elf.h>,
"features/s390-te-linux64.c", and "features/s390x-te-linux64.c".
(s390_regmap_tdb): New regmap.
(s390_supply_tdb_regset): New function.
(s390_tdb_regset): New regset.
(s390_linux64v2_regset_sections): Add TDB regset to list.
(s390x_linux64v2_regset_sections): Likewise.
(s390_regset_from_core_section): Recognize TDB core note section.
(s390_core_read_description): If HWCAP indicates TE support,
select tdesc_s390_te_linux64 or tdesc_s390_s390x_te_linux64.
(s390_gdbarch_init): Handle TDB regset.
(_initialize_s390_tdep): Initialize new tdescs.
* s390-nat.c (HWCAP_S390_HIGH_GPRS): Remove define.
(have_regset_tdb): New variable.
(s390_native_supply): Support register invalidation.
(fetch_regset): Invalidate registers if ptrace yields ENODATA.
(check_regset): Treat ENODATA as "regset exists".
(s390_linux_fetch_inferior_registers): Add TDB.
(s390_read_description): Check for TDB existence and select
appropriate tdesc.
* gdbserver/Makefile.in (clean): Add removal of new makefile
targets.
(s390-te-linux64.c): New makefile target.
(s390x-te-linux64.c): Likewise.
* gdbserver/configure.srv (srv_regobj): Append new objects
s390-te-linux64.o and s390x-te-linux64.o.
(srv_xmlfiles): Append new files s390-te-linux64.xml,
s390x-te-linux64.xml, and s390-tdb.xml.
* gdbserver/linux-s390-low.c (init_registers_s390_te_linux64): New
declaration.
(tdesc_s390_te_linux64): Likewise.
(init_registers_s390x_te_linux64): Likewise.
(tdesc_s390x_te_linux64): Likewise.
(s390_check_regset): Treat ENODATA as "regset exists".
(s390_arch_setup): Add TDB regset support.
(initialize_low_arch): Initialize registers for new tdescs.

gdb/doc/ChangeLog:
2013-09-13  Andreas Arnez  <arnez@linux.vnet.ibm.com>

* gdb.texinfo (Decimal Floating Point format): Mention S/390.
(Standard Target Features): Add new node to menu.
(S/390 and System z Features): New node.

gdb/testsuite/ChangeLog:
2013-09-13  Andreas Arnez  <arnez@linux.vnet.ibm.com>

* gdb.arch/s390-tdbregs.c: New file.
* gdb.arch/s390-tdbregs.exp: New file.

11 years ago2013-09-13 Andreas Arnez <arnez@linux.vnet.ibm.com>
Ulrich Weigand [Fri, 13 Sep 2013 14:11:15 +0000 (14:11 +0000)]
2013-09-13  Andreas Arnez  <arnez@linux.vnet.ibm.com>

* s390-tdep.h (S390_IS_GREGSET_REGNUM): New macro.
(S390_IS_FPREGSET_REGNUM): New macro.
* s390-tdep.c (s390_dwarf_regmap): Make const.
(regnum_is_gpr_full): New function for replacing repeated code.
(s390_pseudo_register_name): Use it.
(s390_pseudo_register_type): Likewise.
(s390_pseudo_register_read): Likewise.
(s390_pseudo_register_write): Likewise.
(s390_unwind_pseudo_register): Likewise.
(s390_regmap_gregset): New format for regmap.
(s390x_regmap_gregset): Likewise.
(s390_regmap_fpregset): Likewise.
(s390_regmap_upper): Likewise.
(s390_regmap_last_break): Likewise.
(s390_regmap_system_call): Likewise.
(s390_supply_regset): Adjust to new regmap format.
(s390_collect_regset): Likewise.
* s390-nat.c (s390_native_supply): Adjust to new regmap format.
(s390_native_collect): Likewise.
(supply_gregset): Likewise.
(fill_gregset): Likewise.
(supply_fpregset): Likewise.
(fill_fpregset): Likewise.
(fetch_regset): Likewise.
(store_regset): Likewise.
(s390_linux_fetch_inferior_registers): Likewise.
(s390_linux_fetch_inferior_registers): Likewise.

11 years agodoc,mi: example refers to -list-features instead of -list-target-features
Sanimir Agovic [Fri, 13 Sep 2013 08:04:02 +0000 (08:04 +0000)]
doc,mi: example refers to -list-features instead of -list-target-features

Corrected mi documentation about -list-target-features, example now uses the
correct mi command.

2013-09-13  Sanimir Agovic  <sanimir.agovic@intel.com>

* gdb.texinfo (GDB/MI Miscellaneous Commands): Use
-list-target-features in the example.

11 years agodaily update
Alan Modra [Fri, 13 Sep 2013 00:00:04 +0000 (00:00 +0000)]
daily update

11 years ago * README: New file.
Stan Shebs [Thu, 12 Sep 2013 22:51:16 +0000 (22:51 +0000)]
* README: New file.

11 years ago * gdb.python/py-events.py (new_objfile_handler): Remove accidentally
Doug Evans [Thu, 12 Sep 2013 22:39:26 +0000 (22:39 +0000)]
* gdb.python/py-events.py (new_objfile_handler): Remove accidentally
added code to print event.inferior.

11 years ago2013-09-12 Chao-ying Fu <Chao-ying.Fu@imgtec.com>
Chao-ying Fu [Thu, 12 Sep 2013 21:45:04 +0000 (21:45 +0000)]
2013-09-12  Chao-ying Fu  <Chao-ying.Fu@imgtec.com>

* gas/mips/bltzal.s: New file.
* gas/mips/bltzal.l: New file.
* gas/mips/mips.exp: Run the bltzal test.

11 years ago2013-09-12 Chao-ying Fu <Chao-ying.Fu@imgtec.com>
Chao-ying Fu [Thu, 12 Sep 2013 21:41:09 +0000 (21:41 +0000)]
2013-09-12  Chao-ying Fu  <Chao-ying.Fu@imgtec.com>

* config/tc-mips.c (match_insn): Set error when $31 is used for
bltzal* and bgezal*.

11 years agomerge from gcc
DJ Delorie [Thu, 12 Sep 2013 16:08:09 +0000 (16:08 +0000)]
merge from gcc

11 years ago * dwarf.c (dwarf_vmatoa): Rename to dwarf_vmatoa_1 and add a
Nick Clifton [Thu, 12 Sep 2013 09:14:47 +0000 (09:14 +0000)]
* dwarf.c (dwarf_vmatoa): Rename to dwarf_vmatoa_1 and add a
precision parameter.
(dwarf_vmatoa): New wrapper for dwarf_vmatoa_1.
(print_dwarf_vma): Use dwarf_vmatoa_1.
(SAFE_BYTE_GET): Add check that VAL is big enough to contain
AMOUNT bytes.
(process_debug_info): Use an unsigned int for the offset size.
(process_debug_pubnames): Likewise.
(display_debug_aranges): Likewise.
(struct Frame_Chunk): Use dwarf_vma type for pc_begin and pc_range
fields.
(frame_display_row): Use print_dwarf_vma to display dwarf_vma
values.
(display_debug_frames): Likewise.

* binutils-all/x86-64/compressed-1a.d: Update expected output to
allow for 64-bit addresses.

* ld-elf/eh1.d: Update expected output to allow for
64-bit addresses.
* ld-elf/eh2.d: Likewise.
* ld-elf/eh3.d: Likewise.
* ld-elf/eh4.d: Likewise.
* ld-elf/eh5.d: Likewise.
* ld-elf/eh6.d: Likewise.
* ld-mips-elf/eh-frame1-n64.d: Likewise.
* ld-mips-elf/eh-frame2-n64.d: Likewise.
* ld-mips-elf/eh-frame3.d: Likewise.

* gas/cfi/cfi-alpha-1.d: Update expected output to allow for
64-bit addresses.
* gas/cfi/cfi-alpha-3.d: Likewise.
* gas/cfi/cfi-arm-1.d: Likewise.
* gas/cfi/cfi-common-1.d: Likewise.
* gas/cfi/cfi-common-2.d: Likewise.
* gas/cfi/cfi-common-3.d: Likewise.
* gas/cfi/cfi-common-4.d: Likewise.
* gas/cfi/cfi-common-5.d: Likewise.
* gas/cfi/cfi-common-6.d: Likewise.
* gas/cfi/cfi-common-7.d: Likewise.
* gas/cfi/cfi-hppa-1.d: Likewise.
* gas/cfi/cfi-i386-2.d: Likewise.
* gas/cfi/cfi-i386.d: Likewise.
* gas/cfi/cfi-m68k.d: Likewise.
* gas/cfi/cfi-mips-1.d: Likewise.
* gas/cfi/cfi-ppc-1.d: Likewise.
* gas/cfi/cfi-s390-1.d: Likewise.
* gas/cfi/cfi-s390x-1.d: Likewise.
* gas/cfi/cfi-sh-1.d: Likewise.
* gas/cfi/cfi-sparc-1.d: Likewise.
* gas/cfi/cfi-sparc64-1.d: Likewise.
* gas/cfi/cfi-x86_64.d: Likewise.

11 years ago2013-09-12 Andrew Pinski <apinski@cavium.com>
Andrew Pinski [Thu, 12 Sep 2013 07:14:37 +0000 (07:14 +0000)]
2013-09-12  Andrew Pinski  <apinski@cavium.com>

* aarch64-linux-nat.c (aarch64_linux_set_debug_regs): Zero out regs.

11 years agodaily update
Alan Modra [Thu, 12 Sep 2013 00:00:04 +0000 (00:00 +0000)]
daily update

11 years agominidebuginfo: Fix stripping/debuginfo
Jan Kratochvil [Wed, 11 Sep 2013 08:31:44 +0000 (08:31 +0000)]
minidebuginfo: Fix stripping/debuginfo

gdb/doc/
2013-09-11  Jan Kratochvil  <jan.kratochvil@redhat.com>

* gdb.texinfo (MiniDebugInfo): Prepare file debug and use it to create
mini_debuginfo.  Strip binary before adding mini_debuginfo to it.

gdb/testsuite/
2013-09-11  Jan Kratochvil  <jan.kratochvil@redhat.com>

* gdb.base/gnu-debugdata.exp (objcopy 1): Move it lower and use only
debug part of the binary.

11 years agominidebuginfo: ppc64 sync testcase->doc
Jan Kratochvil [Wed, 11 Sep 2013 08:29:46 +0000 (08:29 +0000)]
minidebuginfo: ppc64 sync testcase->doc

gdb/doc/
2013-09-11  Jan Kratochvil  <jan.kratochvil@redhat.com>

Sync documentation with gdb.base/gnu-debugdata.exp.
* gdb.texinfo (MiniDebugInfo): Add comment and "D" in the example.

11 years agominidebuginfo: Obvious changes
Jan Kratochvil [Wed, 11 Sep 2013 08:28:04 +0000 (08:28 +0000)]
minidebuginfo: Obvious changes

gdb/doc/
2013-09-11  Jan Kratochvil  <jan.kratochvil@redhat.com>

* gdb.texinfo (MiniDebugInfo): Fix two trailing dots.

gdb/testsuite/
2013-09-11  Jan Kratochvil  <jan.kratochvil@redhat.com>

* gdb.base/gnu-debugdata.exp (strip): Add -R .comment.
(addlink): Add comment.

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

11 years agomerge from gcc
DJ Delorie [Tue, 10 Sep 2013 19:01:22 +0000 (19:01 +0000)]
merge from gcc

11 years ago * dwarf.c (display_debug_frames): Check for DW64_CIE_ID when
Nick Clifton [Tue, 10 Sep 2013 16:19:08 +0000 (16:19 +0000)]
* dwarf.c (display_debug_frames): Check for DW64_CIE_ID when
parsing 64-bit frames.

11 years agomerge from gcc
DJ Delorie [Tue, 10 Sep 2013 16:05:02 +0000 (16:05 +0000)]
merge from gcc

11 years ago2013-09-10 Andreas Arnez <arnez@linux.vnet.ibm.com>
Ulrich Weigand [Tue, 10 Sep 2013 15:05:23 +0000 (15:05 +0000)]
2013-09-10  Andreas Arnez  <arnez@linux.vnet.ibm.com>

* config/s390/s390.mh (NATDEPFILES): Add linux-waitpid.o.

11 years agotest: adjust 'cd' regexpr to match an optional canonically pathname
Sanimir Agovic [Tue, 10 Sep 2013 07:32:25 +0000 (07:32 +0000)]
test: adjust 'cd' regexpr to match an optional canonically pathname

New regexpr now correctly deals with trailing canonical pathname.

Before only the following output was matched:
(gdb) cd
Working directory /users/foo

In addition it now matches an optional trailing canonical pathname:
(gdb) cd
Working directory /users/foo
 (canonically /nfs/users/foo).

Triggered by `realpath .` != `pwd`

2013-09-10  Sanimir Agovic  <sanimir.agovic@intel.com>

testsuite/
* gdb.base/default.exp: Adjust regexpr for 'cd' to match optional
canonical pathname.

11 years agodaily update
Alan Modra [Tue, 10 Sep 2013 00:00:04 +0000 (00:00 +0000)]
daily update

11 years agoRemove use of deprecated_init_ui_hook from quit_confirm.
Andrew Burgess [Mon, 9 Sep 2013 12:13:58 +0000 (12:13 +0000)]
Remove use of deprecated_init_ui_hook from quit_confirm.

  https://sourceware.org/ml/gdb-patches/2013-09/msg00224.html

gdb/ChangeLog

        * top.c (quit_confirm): Remove use of deprecated_init_ui_hook.

11 years agodaily update
Alan Modra [Mon, 9 Sep 2013 00:00:04 +0000 (00:00 +0000)]
daily update

11 years agodaily update
Alan Modra [Sun, 8 Sep 2013 00:00:04 +0000 (00:00 +0000)]
daily update

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

11 years agoremote-sim.c: Send debug output to gdb_stdlog.
Pedro Alves [Fri, 6 Sep 2013 18:29:42 +0000 (18:29 +0000)]
remote-sim.c: Send debug output to gdb_stdlog.

Tested by building for --target=arm-eabi, and playing with the debug
output a bit.

gdb/
2013-09-06  Pedro Alves <palves@redhat.com>

* remote-sim.c (dump_mem, gdbsim_fetch_register)
(gdbsim_store_register, gdbsim_kill, gdbsim_load)
(gdbsim_create_inferior, gdbsim_open, gdbsim_close)
(gdbsim_detach, gdbsim_resume_inferior, gdbsim_wait)
(gdbsim_files_info, gdbsim_mourn_inferior): Send debug output to
gdb_stdlog.

11 years agoremote-sim.c: Don't install a deprecated_xfer_memory method.
Pedro Alves [Fri, 6 Sep 2013 18:10:39 +0000 (18:10 +0000)]
remote-sim.c: Don't install a deprecated_xfer_memory method.

Manually tested with a --target=arm-eabi build, and doing things like:

$ arm-eabi-gcc ~/gdb/tests/main.c -o a.out -c -g
$ ./gdb a.out
...
(gdb) tar sim
(gdb) load
(gdb) disassemble 0
Dump of assembler code for function main:
   0x00000000 <+0>:     mov     r12, sp
   0x00000004 <+4>:     push    {r11, r12, lr, pc}
   0x00000008 <+8>:     sub     r11, r12, #4
   0x0000000c <+12>:    sub     sp, sp, #8
   0x00000010 <+16>:    str     r0, [r11, #-16]
   0x00000014 <+20>:    str     r1, [r11, #-20]
   0x00000018 <+24>:    mov     r3, #0
   0x0000001c <+28>:    mov     r0, r3
   0x00000020 <+32>:    sub     sp, r11, #12
   0x00000024 <+36>:    ldm     sp, {r11, sp, pc}
End of assembler dump.
(gdb) p *0 = 1
        0x00000001

gdb/
2013-09-06  Pedro Alves  <palves@redhat.com>

* remote-sim.c (dump_mem): Constify buf parameter.
gdbsim_xfer_inferior_memory): Rename to ...
(gdbsim_xfer_memory): ... this.  Adjust interface as
target_xfer_partial helper.
(gdbsim_xfer_partial): New function.
(init_gdbsim_ops): Don't install a deprecated_xfer_memory hook.
Install a to_xfer_partial hook.  Send output to gdb_stdlog.

11 years agoremote-sim.c: cleanup debug output code.
Pedro Alves [Fri, 6 Sep 2013 17:41:50 +0000 (17:41 +0000)]
remote-sim.c: cleanup debug output code.

Manually tested with a --target=arm-eabi build, and doing

$ arm-eabi-gcc ~/gdb/tests/main.c -o a.out -c -g
$ ./gdb a.out
...
(gdb) tar sim
(gdb) load
(gdb) set debug remote 1
(gdb) disassemble 0
Dump of assembler code for function main:
gdbsim_xfer_inferior_memory: myaddr 0x7fffffffd400, memaddr 0x0, len 4, write 0
   0x00000000 <+0>:             0xe1a0c00d
mov     r12, sp
gdbsim_xfer_inferior_memory: myaddr 0x7fffffffd400, memaddr 0x4, len 4, write 0
   0x00000004 <+4>:             0xe92dd800
push    {r11, r12, lr, pc}
gdbsim_xfer_inferior_memory: myaddr 0x7fffffffd400, memaddr 0x8, len 4, write 0
   0x00000008 <+8>:             0xe24cb004
sub     r11, r12, #4
gdbsim_xfer_inferior_memory: myaddr 0x7fffffffd400, memaddr 0xc, len 4, write 0
   0x0000000c <+12>:            0xe24dd008
sub     sp, sp, #8
gdbsim_xfer_inferior_memory: myaddr 0x7fffffffd400, memaddr 0x10, len 4, write 0
   0x00000010 <+16>:            0xe50b0010
str     r0, [r11, #-16]
gdbsim_xfer_inferior_memory: myaddr 0x7fffffffd400, memaddr 0x14, len 4, write 0
   0x00000014 <+20>:            0xe50b1014
str     r1, [r11, #-20]
gdbsim_xfer_inferior_memory: myaddr 0x7fffffffd400, memaddr 0x18, len 4, write 0
   0x00000018 <+24>:            0xe3a03000
mov     r3, #0
gdbsim_xfer_inferior_memory: myaddr 0x7fffffffd400, memaddr 0x1c, len 4, write 0
   0x0000001c <+28>:            0xe1a00003
mov     r0, r3
gdbsim_xfer_inferior_memory: myaddr 0x7fffffffd400, memaddr 0x20, len 4, write 0
   0x00000020 <+32>:            0xe24bd00c
sub     sp, r11, #12
gdbsim_xfer_inferior_memory: myaddr 0x7fffffffd400, memaddr 0x24, len 4, write 0
   0x00000024 <+36>:            0xe89da800
ldm     sp, {r11, sp, pc}
End of assembler dump.
(gdb) p *0 = 1
gdbsim_xfer_inferior_memory: myaddr 0xc69bc0, memaddr 0x0, len 4, write 1
        0x00000001
$1 = 1

Which happens to differ from before, I think due to stdout line buffering:

(gdb) disassemble 0
Dump of assembler code for function main:
   0x00000000 <+0>:     gdbsim_xfer_inferior_memory: myaddr 0x0x7fffffffd400, memaddr 0x0, len 4, write 0
        0xe1a0c00d

But the new output looks reasonable to me, better even.

gdb/
2013-09-06  Pedro Alves  <palves@redhat.com>

* remote-sim.c (gdbsim_xfer_inferior_memory): Use
host_address_to_string, and send debug output to gdb_stdlog.

11 years ago[gdbserver] Garbage collect unused dependency-tracking Makefile variables.
Pedro Alves [Fri, 6 Sep 2013 12:04:56 +0000 (12:04 +0000)]
[gdbserver] Garbage collect unused dependency-tracking Makefile variables.

These used to be necessary for manual rule dependency tracking.
Nothing uses them anymore.  (regdat_sh is still needed.)

gdb/gdbserver/
2013-09-06  Pedro Alves  <palves@redhat.com>

* Makefile.in (gdb_proc_service_h, regdef_h, regcache_h)
(signals_def, signals_h, ptid_h, ax_h, agent_h, linux_btrace_h)
(linux_osdata_h, vec_h, gdb_vecs_h, host_defs_h, libiberty_h)
(server_h, gdbthread_h, linux_low_h, linux_ptrace_h)
(gdb_thread_db_h, linux_procfs_h, lynx_low_h, nto_low_h)
(mips_linux_watch_h, i386_low_h, win32_low_h): Delete.

11 years ago[gdbserver] Update a couple Makefile rules.
Pedro Alves [Fri, 6 Sep 2013 11:54:07 +0000 (11:54 +0000)]
[gdbserver] Update a couple Makefile rules.

These two are still written in the pre-auto-dependency-tracking style.
They probably were written before that, and committed afterwards
without adjustment.  An easy oversight to make.

gdb/gdbserver/
2013-09-06  Pedro Alves  <palves@redhat.com>

* Makefile.in (linux-btrace.o, mips-linux-watch.o): Remove
explicit header dependencies and use $COMPILE/$POSTCOMPILE.

11 years ago[gdbserver] Fix IPA build.
Pedro Alves [Fri, 6 Sep 2013 10:58:11 +0000 (10:58 +0000)]
[gdbserver] Fix IPA build.

Somehow, my builds yesterdays didn't trip on this...

../src/gdb/gdbserver/linux-amd64-ipa.c: In function ‘initialize_low_tracepoint’:
../src/gdb/gdbserver/linux-amd64-ipa.c:172:3: error: ‘ipa_tdesc’ undeclared (first use in this function)
../src/gdb/gdbserver/linux-amd64-ipa.c:172:3: note: each undeclared identifier is reported only once for each function it appears in

gdb/gdbserver/
2013-09-06  Pedro Alves  <palves@redhat.com>

* linux-amd64-ipa.c: Include tracepoint.h.
* linux-i386-ipa.c: Include tracepoint.h.

11 years agoExtract Linux-specific portitions of cris-tdep.c to a new file.
Ricard Wanderlof [Fri, 6 Sep 2013 10:50:10 +0000 (10:50 +0000)]
Extract Linux-specific portitions of cris-tdep.c to a new file.
This brings in some standard functionality hitherdo missing from
the CRIS/CRISv32 port thanks to the new call to gdbarch_init_osabi,
as well as clearly showing that there is Linux support for this
platform by virtue of the existence of a cris-linux-tdep.c file.

2013-09-06  Ricard Wanderlof  <ricardw@axis.com>

* Makefile.in (ALL_TARGET_OBS): Add cris-linux-tdep.o.
* configure.tgt: Add cris-linux-tdep.o and linux-tdep.o to
gdb_target_obs for cris target.
* cris-tdep.c (struct gdbarch_tdep): Move to cris-tdep.h.
(cris_gdbarch_init): Move calls to
set_gdbarch_fetch_tls_load_module_address and
set_solib_svr4_fetch_link_map_offsets to cris-linux-tdep.c.
Add call to gdbarch_init_osabi.
* cris-linux-tdep.c: New file.
* cris-tdep.h: New file.

11 years agoOBVIOUS: Remove legacy comment referring to deprecated_init_ui_hook.
Andrew Burgess [Fri, 6 Sep 2013 10:12:20 +0000 (10:12 +0000)]
OBVIOUS: Remove legacy comment referring to deprecated_init_ui_hook.

gdb/ChangeLog

* tui/tui-io.c (tui_initialize_io): Remove legacy comment referring
to deprecated_init_ui_hook.

11 years agoGive every interpreter a command_loop_proc.
Andrew Burgess [Fri, 6 Sep 2013 08:53:09 +0000 (08:53 +0000)]
Give every interpreter a command_loop_proc.

  https://sourceware.org/ml/gdb-patches/2013-09/msg00179.html

gdb/ChangeLog

        * cli/cli-interp.c (_initialize_cli_interp): Add a
        command_loop_proc to interp_procs.
        * event-top.c (cli_command_loop): Change signature to match
        interp_command_loop_ftype.
        * event-top.h (cli_command_loop): Same.
        * interps.c (interp_new): Require every interpreter to have a
        command_loop_proc.
        (current_interp_command_loop): Just call the command_loop_proc on
        the current interpreter.
        * tui/tui-interp.c (_initialize_tui_interp): Add a
        command_loop_proc to interp_procs.

11 years agoAdd support for threaded debugging for CRISv32.
Ricard Wanderlof [Fri, 6 Sep 2013 08:37:17 +0000 (08:37 +0000)]
Add support for threaded debugging for CRISv32.

2013-09-06  Ricard Wanderlof  <ricardw@axis.com>

* cris-tdep.c (cris_gdbarch_init): Add call to
get_gdbarch_fetch_tls_load_module_address.

gdbserver

* linux-crisv32-low.c (PTRACE_GET_THREAD_AREA): New macro.
(ps_get_thread_area): New function.

11 years agoFix filename format in previous ChangeLog entry.
Andrew Burgess [Fri, 6 Sep 2013 08:25:25 +0000 (08:25 +0000)]
Fix filename format in previous ChangeLog entry.

I used the wrong format for the filenames in a previous changelog entry, I
incorrectly included the "gdb/" prefix.

11 years agoCosmetic clean up of names of *elf_greg_t types for CRIS/CRISv32.
Ricard Wanderlof [Fri, 6 Sep 2013 08:23:46 +0000 (08:23 +0000)]
Cosmetic clean up of names of *elf_greg_t types for CRIS/CRISv32.

2013-09-06  Ricard Wanderlof  <ricardw@axis.com>

* cris-tdep.c (cris_elf_greg_t): Rename from elf_greg_t.
(cris_elf_gregset_t): Rename from elf_gregset_t.
(crisv32_elf_gregset_t): Adjust.
(cris_supply_gregset, fetch_core_registers): Adjust.

11 years agoTrivial patch to remove dependency on host unsigned long type
Ricard Wanderlof [Fri, 6 Sep 2013 08:14:33 +0000 (08:14 +0000)]
Trivial patch to remove dependency on host unsigned long type
from cris-tdep.c.

2013-09-06  Ricard Wanderlof  <ricardw@axis.com>

* cris-tdep.c (elf_greg_t): Change typedef to unsigned char[4]

11 years agoFix compilation for target gdbserver on CRISv32 platform.
Ricard Wanderlof [Fri, 6 Sep 2013 08:04:19 +0000 (08:04 +0000)]
Fix compilation for target gdbserver on CRISv32 platform.

One misspelled function call, and one superfluous typedef. The latter
causes an error of the following type when building:

linux-crisv32-low.c:372: error: conflicting types for 'elf_gregset_t'
/.../target/include/asm/elf.h:36:
error: previous declaration of 'elf_gregset_t' was here

2013-09-06  Ricard Wanderlof  <ricardw@axis.com>

* linux-crisv32-low.c (elf_gregset_t): Delete typedef.
(initialize_low_arch): Call init_registers_crisv32 rather than
init_register_crisv32.

11 years agodaily update
Alan Modra [Fri, 6 Sep 2013 00:00:04 +0000 (00:00 +0000)]
daily update

11 years agoAdd missing new files from these previous commits:
Pedro Alves [Thu, 5 Sep 2013 22:18:48 +0000 (22:18 +0000)]
Add missing new files from these previous commits:

2013-09-05  Pedro Alves  <palves@redhat.com>

* server.h (handle_vFile, hostio_last_error_from_errno): Move
to ...
* hostio.h: ... this new file.
* hostio.c, server.c, linux-low.c, nto-low.c, spu-low,
win32-low.c: Include hostio.h.

2013-09-05  Pedro Alves  <palves@redhat.com>

* server.h (gdb_client_data, handler_func, callback_handler_func)
(delete_file_handler, add_file_handler, append_callback_event)
(delete_callback_event, start_event_loop, initialize_event_loop):
Move to event-loop.h and include it.
* event-loop.h: New file.

2013-09-05  Pedro Alves  <palves@redhat.com>

* dll.c, inferiors.c, remote-utils.c, server.c: Include "dll.h".
* server.h (struct dll_info, all_dlls, dlls_changed, clear_dlls)
(loaded_dll, unloaded_dll): Move to ...
* dll.h: ... this new file.
* inferiors.c, remote-utils.c, win32-low.c: Include "dll.h".

2013-09-05  Pedro Alves  <palves@redhat.com>

* server.h (current_process, get_thread_process, all_processes)
(add_inferior_to_list, for_each_inferior, current_inferior)
(remove_inferior, add_process, remove_process, find_process_pid)
(have_started_inferiors_p, have_attached_inferiors_p)
(thread_id_to_gdb_id, thread_to_gdb_id, gdb_id_to_thread_id)
(clear_inferiors, find_inferior, find_inferior_id)
(inferior_target_data, set_inferior_target_data)
(inferior_regcache_data, set_inferior_regcache_data): Move to
inferiors.h, and include it.
* inferiors.h: New file.

2013-09-05  Pedro Alves  <palves@redhat.com>

* ax.c, linux-low.c, linux-x86-low.c, server.c: Include
tracepoint.h.
* server.h (IPA_BUFSIZ, initialize_tracepoint, tracing)
(disconnected_tracing, tracepoint_look_up_symbols, stop_tracing
(handle_tracepoint_general_set, handle_tracepoint_query)
(tracepoint_finished_step, tracepoint_was_hit)
(release_while_stepping_state_list, current_traceframe)
(in_readonly_region, traceframe_read_mem)
(fetch_traceframe_registers, traceframe_read_sdata)
(traceframe_read_info, struct fast_tpoint_collect_status)
(fast_tracepoint_collecting, force_unlock_trace_buffer)
(handle_tracepoit_bkpts, initialize_low_tracepoint)
(supply_fast_tracepoint_registers)
(supply_static_tracepoint_registers, set_trampoline_buffer_space)
(ipa_tdesc, claim_trampoline_space)
(have_fast_tracepoint_trampoline_buffer, gdb_agent_about_to_close)
(agent_mem_read, agent_get_trace_state_variable_value)
(agent_set_trace_state_variable_value, agent_tsv_read)
(agent_mem_read_string, get_raw_reg_func_addr)
(get_get_tsv_func_addr, get_set_tsv_func_addr): Move to ...
* tracepoint.h: ... this new file.

2013-09-05  Pedro Alves  <palves@redhat.com>

* server.h (perror_with_name, error, fatal, warning, paddress)
(pulongest, plongest, phex_nz, pfildes): Move to utils.h, and
include it.
* utils.h: New file.

2013-09-05  Pedro Alves  <palves@redhat.com>

* server.h (remote_debug, noack_mode, transport_is_reliable)
(gdb_connected, STDIO_CONNECTION_NAME, remote_connection_is_stdio)
(read_ptid, write_ptid, putpkt, putpkt_binary, putpkt_notif)
(getpkt, remote_prepare, remote_open, remote_close, write_ok)
(write_enn, initialize_async_io, enable_async_io)
(disable_async_io, check_remote_input_interrupt_request)
(convert_ascii_to_int, convert_int_to_ascii, new_thread_notify)
(dead_thread_notify, prepare_resume_reply)
(decode_address_to_semicolon, decode_address, decode_m_packet)
(decode_M_packet, decode_X_packet, decode_xfer_write)
(decode_search_memory_packet, unhexify, hexify)
(remote_escape_output, unpack_varlen_hex, clear_symbol_cache)
(look_up_one_symbol, relocate_instruction)
(monitor_output): Move to remote-utils.h, and include it.
* remote-utils.h: New file.

11 years ago[gdbserver] Split a new hostio.h file out of server.h.
Pedro Alves [Thu, 5 Sep 2013 20:45:39 +0000 (20:45 +0000)]
[gdbserver] Split a new hostio.h file out of server.h.

gdb/gdbserver/
2013-09-05  Pedro Alves  <palves@redhat.com>

* server.h (handle_vFile, hostio_last_error_from_errno): Move
to ...
* hostio.h: ... this new file.
* hostio.c, server.c, linux-low.c, nto-low.c, spu-low,
win32-low.c: Include hostio.h.

11 years ago[gdbserver] Split a new event-loop.h file out of server.h.
Pedro Alves [Thu, 5 Sep 2013 20:42:52 +0000 (20:42 +0000)]
[gdbserver] Split a new event-loop.h file out of server.h.

gdb/gdbserver/
2013-09-05  Pedro Alves  <palves@redhat.com>

* server.h (gdb_client_data, handler_func, callback_handler_func)
(delete_file_handler, add_file_handler, append_callback_event)
(delete_callback_event, start_event_loop, initialize_event_loop):
Move to event-loop.h and include it.
* event-loop.h: New file.

11 years ago[gdbserver] Split a new dll.h file out of server.h.
Pedro Alves [Thu, 5 Sep 2013 20:41:55 +0000 (20:41 +0000)]
[gdbserver] Split a new dll.h file out of server.h.

gdb/gdbserver/
2013-09-05  Pedro Alves  <palves@redhat.com>

* dll.c, inferiors.c, remote-utils.c, server.c: Include "dll.h".
* server.h (struct dll_info, all_dlls, dlls_changed, clear_dlls)
(loaded_dll, unloaded_dll): Move to ...
* dll.h: ... this new file.
* inferiors.c, remote-utils.c, win32-low.c: Include "dll.h".

11 years ago[gdbserver] Split a new inferiors.h file out of server.h.
Pedro Alves [Thu, 5 Sep 2013 20:41:22 +0000 (20:41 +0000)]
[gdbserver] Split a new inferiors.h file out of server.h.

gdb/gdbserver/
2013-09-05  Pedro Alves  <palves@redhat.com>

* server.h (current_process, get_thread_process, all_processes)
(add_inferior_to_list, for_each_inferior, current_inferior)
(remove_inferior, add_process, remove_process, find_process_pid)
(have_started_inferiors_p, have_attached_inferiors_p)
(thread_id_to_gdb_id, thread_to_gdb_id, gdb_id_to_thread_id)
(clear_inferiors, find_inferior, find_inferior_id)
(inferior_target_data, set_inferior_target_data)
(inferior_regcache_data, set_inferior_regcache_data): Move to
inferiors.h, and include it.
* inferiors.h: New file.

11 years ago[gdbserver] Move bytecode compilation bits from server.h to ax.h.
Pedro Alves [Thu, 5 Sep 2013 20:40:58 +0000 (20:40 +0000)]
[gdbserver] Move bytecode compilation bits from server.h to ax.h.

gdb/gdbserver/
2013-09-05  Pedro Alves  <palves@redhat.com>

* server.h (struct emit_ops, current_insn_ptr, emit_error):
Move ...
        * ax.h: ... here.

11 years ago[gdbserver] Split a new tracepoint.h file out of server.h.
Pedro Alves [Thu, 5 Sep 2013 20:40:33 +0000 (20:40 +0000)]
[gdbserver] Split a new tracepoint.h file out of server.h.

gdb/gdbserver/
2013-09-05  Pedro Alves  <palves@redhat.com>

* ax.c, linux-low.c, linux-x86-low.c, server.c: Include
tracepoint.h.
* server.h (IPA_BUFSIZ, initialize_tracepoint, tracing)
(disconnected_tracing, tracepoint_look_up_symbols, stop_tracing
(handle_tracepoint_general_set, handle_tracepoint_query)
(tracepoint_finished_step, tracepoint_was_hit)
(release_while_stepping_state_list, current_traceframe)
(in_readonly_region, traceframe_read_mem)
(fetch_traceframe_registers, traceframe_read_sdata)
(traceframe_read_info, struct fast_tpoint_collect_status)
(fast_tracepoint_collecting, force_unlock_trace_buffer)
(handle_tracepoit_bkpts, initialize_low_tracepoint)
(supply_fast_tracepoint_registers)
(supply_static_tracepoint_registers, set_trampoline_buffer_space)
(ipa_tdesc, claim_trampoline_space)
(have_fast_tracepoint_trampoline_buffer, gdb_agent_about_to_close)
(agent_mem_read, agent_get_trace_state_variable_value)
(agent_set_trace_state_variable_value, agent_tsv_read)
(agent_mem_read_string, get_raw_reg_func_addr)
(get_get_tsv_func_addr, get_set_tsv_func_addr): Move to ...
* tracepoint.h: ... this new file.

11 years ago[gdbserver] Split a new utils.h file out of server.h.
Pedro Alves [Thu, 5 Sep 2013 20:39:48 +0000 (20:39 +0000)]
[gdbserver] Split a new utils.h file out of server.h.

gdb/gdbserver/
2013-09-05  Pedro Alves  <palves@redhat.com>

* server.h (perror_with_name, error, fatal, warning, paddress)
(pulongest, plongest, phex_nz, pfildes): Move to utils.h, and
include it.
* utils.h: New file.

11 years ago[gdbserver] Split a new remote-utils.h file out of server.h.
Pedro Alves [Thu, 5 Sep 2013 20:39:17 +0000 (20:39 +0000)]
[gdbserver] Split a new remote-utils.h file out of server.h.

gdb/gdbserver/
2013-09-05  Pedro Alves  <palves@redhat.com>

* server.h (remote_debug, noack_mode, transport_is_reliable)
(gdb_connected, STDIO_CONNECTION_NAME, remote_connection_is_stdio)
(read_ptid, write_ptid, putpkt, putpkt_binary, putpkt_notif)
(getpkt, remote_prepare, remote_open, remote_close, write_ok)
(write_enn, initialize_async_io, enable_async_io)
(disable_async_io, check_remote_input_interrupt_request)
(convert_ascii_to_int, convert_int_to_ascii, new_thread_notify)
(dead_thread_notify, prepare_resume_reply)
(decode_address_to_semicolon, decode_address, decode_m_packet)
(decode_M_packet, decode_X_packet, decode_xfer_write)
(decode_search_memory_packet, unhexify, hexify)
(remote_escape_output, unpack_varlen_hex, clear_symbol_cache)
(look_up_one_symbol, relocate_instruction)
(monitor_output): Move to remote-utils.h, and include it.
* remote-utils.h: New file.