2002-02-13 Michael Snyder <msnyder@redhat.com>
* procfs.c (procfs_make_note_section): Make the default implementation return an error. 2002-02-13 Rodney Brown <rbrown64@csc.com.au> * procfs.c (procfs_make_note_section): Provide a default definition (for alpha-dec-osf4.0f). Fix typos. 2002-02-11 Michael Snyder <msnyder@redhat.com> * procfs.c: Include elf-bfd.h (for elfcore_write functions). (gcore section): Ifdef for Solaris and Unixware only. (procfs_do_thread_registers): Unixware needs one lwpstatus per thread (not one prstatus or pstatus). (procfs_make_note_section): Iterate only over kernel threads (lwps), not over all gdb threads. For unixware, call elfcore_write_pstatus once before iterating over threads.
This commit is contained in:
parent
51316059cc
commit
65554feff8
|
@ -1,3 +1,13 @@
|
||||||
|
2002-02-13 Michael Snyder <msnyder@redhat.com>
|
||||||
|
|
||||||
|
* procfs.c (procfs_make_note_section): Make the default
|
||||||
|
implementation return an error.
|
||||||
|
|
||||||
|
2002-02-13 Rodney Brown <rbrown64@csc.com.au>
|
||||||
|
|
||||||
|
* procfs.c (procfs_make_note_section): Provide a default definition
|
||||||
|
(for alpha-dec-osf4.0f). Fix typos.
|
||||||
|
|
||||||
2002-02-13 Elena Zannoni <ezannoni@redhat.com>
|
2002-02-13 Elena Zannoni <ezannoni@redhat.com>
|
||||||
|
|
||||||
* linux-proc.c: Add include of regcache.h.
|
* linux-proc.c: Add include of regcache.h.
|
||||||
|
@ -6,8 +16,9 @@
|
||||||
2002-02-13 Andrew Cagney <ac131313@redhat.com>
|
2002-02-13 Andrew Cagney <ac131313@redhat.com>
|
||||||
|
|
||||||
From 2002-01-18 Greg McGary <greg@mcgary.org>:
|
From 2002-01-18 Greg McGary <greg@mcgary.org>:
|
||||||
* memattr.c (create_mem_region): Disallow useless empty region. Regions
|
* memattr.c (create_mem_region): Disallow useless empty region.
|
||||||
are half-open intervals, so allow [A..B) [B..C) as non-overlapping.
|
Regions are half-open intervals, so allow [A..B) [B..C) as
|
||||||
|
non-overlapping.
|
||||||
|
|
||||||
2002-02-13 Michael Chastain <mec@shout.net>
|
2002-02-13 Michael Chastain <mec@shout.net>
|
||||||
|
|
||||||
|
@ -57,6 +68,16 @@
|
||||||
* arm-linux-nat.c: Really include arm-tdep.h.
|
* arm-linux-nat.c: Really include arm-tdep.h.
|
||||||
* config/arm/tm-linux.h (struct type, struct value): Declare.
|
* config/arm/tm-linux.h (struct type, struct value): Declare.
|
||||||
|
|
||||||
|
2002-02-11 Michael Snyder <msnyder@redhat.com>
|
||||||
|
|
||||||
|
* procfs.c: Include elf-bfd.h (for elfcore_write functions).
|
||||||
|
(gcore section): Ifdef for Solaris and Unixware only.
|
||||||
|
(procfs_do_thread_registers): Unixware needs one lwpstatus
|
||||||
|
per thread (not one prstatus or pstatus).
|
||||||
|
(procfs_make_note_section): Iterate only over kernel threads (lwps),
|
||||||
|
not over all gdb threads. For unixware, call elfcore_write_pstatus
|
||||||
|
once before iterating over threads.
|
||||||
|
|
||||||
2002-02-11 Richard Earnshaw <rearnsha@arm.com>
|
2002-02-11 Richard Earnshaw <rearnsha@arm.com>
|
||||||
|
|
||||||
* arm-tdep.h: New file.
|
* arm-tdep.h: New file.
|
||||||
|
|
50
gdb/procfs.c
50
gdb/procfs.c
|
@ -23,6 +23,7 @@ Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
||||||
#include "inferior.h"
|
#include "inferior.h"
|
||||||
#include "target.h"
|
#include "target.h"
|
||||||
#include "gdbcore.h"
|
#include "gdbcore.h"
|
||||||
|
#include "elf-bfd.h" /* for elfcore_write_* */
|
||||||
#include "gdbcmd.h"
|
#include "gdbcmd.h"
|
||||||
#include "gdbthread.h"
|
#include "gdbthread.h"
|
||||||
|
|
||||||
|
@ -55,7 +56,7 @@ Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
||||||
* Unixware
|
* Unixware
|
||||||
* AIX5
|
* AIX5
|
||||||
*
|
*
|
||||||
* /proc works by immitating a file system: you open a simulated file
|
* /proc works by imitating a file system: you open a simulated file
|
||||||
* that represents the process you wish to interact with, and
|
* that represents the process you wish to interact with, and
|
||||||
* perform operations on that "file" in order to examine or change
|
* perform operations on that "file" in order to examine or change
|
||||||
* the state of the other process.
|
* the state of the other process.
|
||||||
|
@ -5704,7 +5705,7 @@ Specify keyword 'mappings' for detailed info on memory mappings.");
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/* miscelaneous stubs: */
|
/* miscellaneous stubs: */
|
||||||
/* The following satisfy a few random symbols mostly created by */
|
/* The following satisfy a few random symbols mostly created by */
|
||||||
/* the solaris threads implementation, which I will chase down */
|
/* the solaris threads implementation, which I will chase down */
|
||||||
/* later. */
|
/* later. */
|
||||||
|
@ -5721,6 +5722,8 @@ procfs_first_available (void)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* =================== GCORE .NOTE "MODULE" =================== */
|
/* =================== GCORE .NOTE "MODULE" =================== */
|
||||||
|
#if defined (UNIXWARE) || defined (PIOCOPENLWP) || defined (PCAGENT)
|
||||||
|
/* gcore only implemented on solaris and unixware (so far) */
|
||||||
|
|
||||||
static char *
|
static char *
|
||||||
procfs_do_thread_registers (bfd *obfd, ptid_t ptid,
|
procfs_do_thread_registers (bfd *obfd, ptid_t ptid,
|
||||||
|
@ -5733,12 +5736,21 @@ procfs_do_thread_registers (bfd *obfd, ptid_t ptid,
|
||||||
merged_pid = TIDGET (ptid) << 16 | PIDGET (ptid);
|
merged_pid = TIDGET (ptid) << 16 | PIDGET (ptid);
|
||||||
|
|
||||||
fill_gregset (&gregs, -1);
|
fill_gregset (&gregs, -1);
|
||||||
|
#if defined (UNIXWARE)
|
||||||
|
note_data = (char *) elfcore_write_lwpstatus (obfd,
|
||||||
|
note_data,
|
||||||
|
note_size,
|
||||||
|
merged_pid,
|
||||||
|
stop_signal,
|
||||||
|
&gregs);
|
||||||
|
#else
|
||||||
note_data = (char *) elfcore_write_prstatus (obfd,
|
note_data = (char *) elfcore_write_prstatus (obfd,
|
||||||
note_data,
|
note_data,
|
||||||
note_size,
|
note_size,
|
||||||
merged_pid,
|
merged_pid,
|
||||||
stop_signal,
|
stop_signal,
|
||||||
&gregs);
|
&gregs);
|
||||||
|
#endif
|
||||||
fill_fpregset (&fpregs, -1);
|
fill_fpregset (&fpregs, -1);
|
||||||
note_data = (char *) elfcore_write_prfpreg (obfd,
|
note_data = (char *) elfcore_write_prfpreg (obfd,
|
||||||
note_data,
|
note_data,
|
||||||
|
@ -5755,16 +5767,15 @@ struct procfs_corefile_thread_data {
|
||||||
};
|
};
|
||||||
|
|
||||||
static int
|
static int
|
||||||
procfs_corefile_thread_callback (struct thread_info *ti, void *data)
|
procfs_corefile_thread_callback (procinfo *pi, procinfo *thread, void *data)
|
||||||
{
|
{
|
||||||
struct procfs_corefile_thread_data *args = data;
|
struct procfs_corefile_thread_data *args = data;
|
||||||
procinfo *pi = find_procinfo (PIDGET (ti->ptid), TIDGET (ti->ptid));
|
|
||||||
|
|
||||||
if (pi != NULL && TIDGET (ti->ptid) != 0)
|
if (pi != NULL && thread->tid != 0)
|
||||||
{
|
{
|
||||||
ptid_t saved_ptid = inferior_ptid;
|
ptid_t saved_ptid = inferior_ptid;
|
||||||
inferior_ptid = ti->ptid;
|
inferior_ptid = MERGEPID (pi->pid, thread->tid);
|
||||||
args->note_data = procfs_do_thread_registers (args->obfd, ti->ptid,
|
args->note_data = procfs_do_thread_registers (args->obfd, inferior_ptid,
|
||||||
args->note_data,
|
args->note_data,
|
||||||
args->note_size);
|
args->note_size);
|
||||||
inferior_ptid = saved_ptid;
|
inferior_ptid = saved_ptid;
|
||||||
|
@ -5804,10 +5815,18 @@ procfs_make_note_section (bfd *obfd, int *note_size)
|
||||||
fname,
|
fname,
|
||||||
psargs);
|
psargs);
|
||||||
|
|
||||||
|
#ifdef UNIXWARE
|
||||||
|
fill_gregset (&gregs, -1);
|
||||||
|
note_data = elfcore_write_pstatus (obfd, note_data, note_size,
|
||||||
|
PIDGET (inferior_ptid),
|
||||||
|
stop_signal, &gregs);
|
||||||
|
#endif
|
||||||
|
|
||||||
thread_args.obfd = obfd;
|
thread_args.obfd = obfd;
|
||||||
thread_args.note_data = note_data;
|
thread_args.note_data = note_data;
|
||||||
thread_args.note_size = note_size;
|
thread_args.note_size = note_size;
|
||||||
iterate_over_threads (procfs_corefile_thread_callback, &thread_args);
|
proc_iterate_over_threads (pi, procfs_corefile_thread_callback, &thread_args);
|
||||||
|
|
||||||
if (thread_args.note_data == note_data)
|
if (thread_args.note_data == note_data)
|
||||||
{
|
{
|
||||||
/* iterate_over_threads didn't come up with any threads;
|
/* iterate_over_threads didn't come up with any threads;
|
||||||
|
@ -5823,5 +5842,12 @@ procfs_make_note_section (bfd *obfd, int *note_size)
|
||||||
make_cleanup (xfree, note_data);
|
make_cleanup (xfree, note_data);
|
||||||
return note_data;
|
return note_data;
|
||||||
}
|
}
|
||||||
|
#else /* !(Solaris or Unixware) */
|
||||||
|
static char *
|
||||||
|
procfs_make_note_section (bfd *obfd, int *note_size)
|
||||||
|
{
|
||||||
|
error ("gcore not implemented for this host.");
|
||||||
|
return NULL; /* lint */
|
||||||
|
}
|
||||||
|
#endif /* Solaris or Unixware */
|
||||||
/* =================== END GCORE .NOTE "MODULE" =================== */
|
/* =================== END GCORE .NOTE "MODULE" =================== */
|
||||||
|
|
Loading…
Reference in New Issue