2008-10-09 Pedro Alves <pedro@codesourcery.com>
Make it compile without warnings. * procfs.c (create_procinfo): Initialize `parent'. (dead_procinfo): Pass a constant string as format to error. (procfs_address_to_host_pointer): Add cast to gdb_type *. (procfs_find_LDT_entry): Adjust format string to long int ptid.tid. (procfs_xfer_partial): Adjust prototype. Add gdb_byte* cast. (procfs_xfer_memory): Adjust prototype. (info_mappings_callback, info_proc_mappings): Adjust to not pass a variable as printf_filtered format. (procfs_make_note_section): Change type of auxv local to gdb_byte. * Makefile.in: Remove special rule.
This commit is contained in:
parent
c67d8df719
commit
0b62613e31
|
@ -1,3 +1,19 @@
|
||||||
|
2008-10-09 Pedro Alves <pedro@codesourcery.com>
|
||||||
|
|
||||||
|
Make it compile without warnings.
|
||||||
|
|
||||||
|
* procfs.c (create_procinfo): Initialize `parent'.
|
||||||
|
(dead_procinfo): Pass a constant string as format to error.
|
||||||
|
(procfs_address_to_host_pointer): Add cast to gdb_type *.
|
||||||
|
(procfs_find_LDT_entry): Adjust format string to long int
|
||||||
|
ptid.tid.
|
||||||
|
(procfs_xfer_partial): Adjust prototype. Add gdb_byte* cast.
|
||||||
|
(procfs_xfer_memory): Adjust prototype.
|
||||||
|
(info_mappings_callback, info_proc_mappings): Adjust to not pass a
|
||||||
|
variable as printf_filtered format.
|
||||||
|
(procfs_make_note_section): Change type of auxv local to gdb_byte.
|
||||||
|
* Makefile.in: Remove special rule.
|
||||||
|
|
||||||
2008-10-09 Pedro Alves <pedro@codesourcery.com>
|
2008-10-09 Pedro Alves <pedro@codesourcery.com>
|
||||||
Daniel Jacobowitz <dan@codesourcery.com>
|
Daniel Jacobowitz <dan@codesourcery.com>
|
||||||
|
|
||||||
|
|
|
@ -1380,12 +1380,6 @@ printcmd.o: $(srcdir)/printcmd.c
|
||||||
$(GDB_WERROR_CFLAGS) $(COMPILE.post) $(srcdir)/printcmd.c
|
$(GDB_WERROR_CFLAGS) $(COMPILE.post) $(srcdir)/printcmd.c
|
||||||
$(POSTCOMPILE)
|
$(POSTCOMPILE)
|
||||||
|
|
||||||
# FIXME: Procfs.o gets -Wformat errors because things like pid_t don't
|
|
||||||
# match output format strings.
|
|
||||||
procfs.o: $(srcdir)/procfs.c
|
|
||||||
$(COMPILE.pre) $(INTERNAL_WARN_CFLAGS) $(COMPILE.post) $(srcdir)/procfs.c
|
|
||||||
$(POSTCOMPILE)
|
|
||||||
|
|
||||||
# Message files. Based on code in gcc/Makefile.in.
|
# Message files. Based on code in gcc/Makefile.in.
|
||||||
|
|
||||||
# Rules for generating translated message descriptions. Disabled by
|
# Rules for generating translated message descriptions. Disabled by
|
||||||
|
|
91
gdb/procfs.c
91
gdb/procfs.c
|
@ -126,13 +126,13 @@ static void procfs_kill_inferior (void);
|
||||||
static void procfs_mourn_inferior (void);
|
static void procfs_mourn_inferior (void);
|
||||||
static void procfs_create_inferior (char *, char *, char **, int);
|
static void procfs_create_inferior (char *, char *, char **, int);
|
||||||
static ptid_t procfs_wait (ptid_t, struct target_waitstatus *);
|
static ptid_t procfs_wait (ptid_t, struct target_waitstatus *);
|
||||||
static int procfs_xfer_memory (CORE_ADDR, char *, int, int,
|
static int procfs_xfer_memory (CORE_ADDR, gdb_byte *, int, int,
|
||||||
struct mem_attrib *attrib,
|
struct mem_attrib *attrib,
|
||||||
struct target_ops *);
|
struct target_ops *);
|
||||||
static LONGEST procfs_xfer_partial (struct target_ops *ops,
|
static LONGEST procfs_xfer_partial (struct target_ops *ops,
|
||||||
enum target_object object,
|
enum target_object object,
|
||||||
const char *annex,
|
const char *annex,
|
||||||
void *readbuf, const void *writebuf,
|
gdb_byte *readbuf, const gdb_byte *writebuf,
|
||||||
ULONGEST offset, LONGEST len);
|
ULONGEST offset, LONGEST len);
|
||||||
|
|
||||||
static int procfs_thread_alive (ptid_t);
|
static int procfs_thread_alive (ptid_t);
|
||||||
|
@ -715,7 +715,7 @@ open_procinfo_files (procinfo *pi, int which)
|
||||||
static procinfo *
|
static procinfo *
|
||||||
create_procinfo (int pid, int tid)
|
create_procinfo (int pid, int tid)
|
||||||
{
|
{
|
||||||
procinfo *pi, *parent;
|
procinfo *pi, *parent = NULL;
|
||||||
|
|
||||||
if ((pi = find_procinfo (pid, tid)))
|
if ((pi = find_procinfo (pid, tid)))
|
||||||
return pi; /* Already exists, nothing to do. */
|
return pi; /* Already exists, nothing to do. */
|
||||||
|
@ -866,7 +866,7 @@ dead_procinfo (procinfo *pi, char *msg, int kill_p)
|
||||||
kill (pi->pid, SIGKILL);
|
kill (pi->pid, SIGKILL);
|
||||||
|
|
||||||
destroy_procinfo (pi);
|
destroy_procinfo (pi);
|
||||||
error ((msg));
|
error ("%s", msg);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -2902,7 +2902,8 @@ procfs_address_to_host_pointer (CORE_ADDR addr)
|
||||||
void *ptr;
|
void *ptr;
|
||||||
|
|
||||||
gdb_assert (sizeof (ptr) == TYPE_LENGTH (ptr_type));
|
gdb_assert (sizeof (ptr) == TYPE_LENGTH (ptr_type));
|
||||||
gdbarch_address_to_pointer (target_gdbarch, ptr_type, &ptr, addr);
|
gdbarch_address_to_pointer (target_gdbarch, ptr_type,
|
||||||
|
(gdb_byte *) &ptr, addr);
|
||||||
return ptr;
|
return ptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3064,14 +3065,14 @@ procfs_find_LDT_entry (ptid_t ptid)
|
||||||
/* Find procinfo for the lwp. */
|
/* Find procinfo for the lwp. */
|
||||||
if ((pi = find_procinfo (PIDGET (ptid), TIDGET (ptid))) == NULL)
|
if ((pi = find_procinfo (PIDGET (ptid), TIDGET (ptid))) == NULL)
|
||||||
{
|
{
|
||||||
warning (_("procfs_find_LDT_entry: could not find procinfo for %d:%d."),
|
warning (_("procfs_find_LDT_entry: could not find procinfo for %d:%ld."),
|
||||||
PIDGET (ptid), TIDGET (ptid));
|
PIDGET (ptid), TIDGET (ptid));
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
/* get its general registers. */
|
/* get its general registers. */
|
||||||
if ((gregs = proc_get_gregs (pi)) == NULL)
|
if ((gregs = proc_get_gregs (pi)) == NULL)
|
||||||
{
|
{
|
||||||
warning (_("procfs_find_LDT_entry: could not read gregs for %d:%d."),
|
warning (_("procfs_find_LDT_entry: could not read gregs for %d:%ld."),
|
||||||
PIDGET (ptid), TIDGET (ptid));
|
PIDGET (ptid), TIDGET (ptid));
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
@ -4375,18 +4376,18 @@ wait_again:
|
||||||
|
|
||||||
static LONGEST
|
static LONGEST
|
||||||
procfs_xfer_partial (struct target_ops *ops, enum target_object object,
|
procfs_xfer_partial (struct target_ops *ops, enum target_object object,
|
||||||
const char *annex, void *readbuf,
|
const char *annex, gdb_byte *readbuf,
|
||||||
const void *writebuf, ULONGEST offset, LONGEST len)
|
const gdb_byte *writebuf, ULONGEST offset, LONGEST len)
|
||||||
{
|
{
|
||||||
switch (object)
|
switch (object)
|
||||||
{
|
{
|
||||||
case TARGET_OBJECT_MEMORY:
|
case TARGET_OBJECT_MEMORY:
|
||||||
if (readbuf)
|
if (readbuf)
|
||||||
return (*ops->deprecated_xfer_memory) (offset, readbuf, len,
|
return (*ops->deprecated_xfer_memory) (offset, readbuf,
|
||||||
0/*read*/, NULL, ops);
|
len, 0/*read*/, NULL, ops);
|
||||||
if (writebuf)
|
if (writebuf)
|
||||||
return (*ops->deprecated_xfer_memory) (offset, writebuf, len,
|
return (*ops->deprecated_xfer_memory) (offset, (gdb_byte *) writebuf,
|
||||||
1/*write*/, NULL, ops);
|
len, 1/*write*/, NULL, ops);
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
#ifdef NEW_PROC_API
|
#ifdef NEW_PROC_API
|
||||||
|
@ -4415,7 +4416,7 @@ procfs_xfer_partial (struct target_ops *ops, enum target_object object,
|
||||||
negative values, but this capability isn't implemented here.) */
|
negative values, but this capability isn't implemented here.) */
|
||||||
|
|
||||||
static int
|
static int
|
||||||
procfs_xfer_memory (CORE_ADDR memaddr, char *myaddr, int len, int dowrite,
|
procfs_xfer_memory (CORE_ADDR memaddr, gdb_byte *myaddr, int len, int dowrite,
|
||||||
struct mem_attrib *attrib, struct target_ops *target)
|
struct mem_attrib *attrib, struct target_ops *target)
|
||||||
{
|
{
|
||||||
procinfo *pi;
|
procinfo *pi;
|
||||||
|
@ -5780,23 +5781,28 @@ mappingflags (long flags)
|
||||||
static int
|
static int
|
||||||
info_mappings_callback (struct prmap *map, int (*ignore) (), void *unused)
|
info_mappings_callback (struct prmap *map, int (*ignore) (), void *unused)
|
||||||
{
|
{
|
||||||
char *data_fmt_string;
|
unsigned int pr_off;
|
||||||
|
|
||||||
|
#ifdef PCAGENT /* Horrible hack: only defined on Solaris 2.6+ */
|
||||||
|
pr_off = (unsigned int) map->pr_offset;
|
||||||
|
#else
|
||||||
|
pr_off = map->pr_off;
|
||||||
|
#endif
|
||||||
|
|
||||||
if (gdbarch_addr_bit (current_gdbarch) == 32)
|
if (gdbarch_addr_bit (current_gdbarch) == 32)
|
||||||
data_fmt_string = "\t%#10lx %#10lx %#10x %#10x %7s\n";
|
printf_filtered ("\t%#10lx %#10lx %#10x %#10x %7s\n",
|
||||||
|
(unsigned long) map->pr_vaddr,
|
||||||
|
(unsigned long) map->pr_vaddr + map->pr_size - 1,
|
||||||
|
map->pr_size,
|
||||||
|
pr_off,
|
||||||
|
mappingflags (map->pr_mflags));
|
||||||
else
|
else
|
||||||
data_fmt_string = " %#18lx %#18lx %#10x %#10x %7s\n";
|
printf_filtered (" %#18lx %#18lx %#10x %#10x %7s\n",
|
||||||
|
(unsigned long) map->pr_vaddr,
|
||||||
printf_filtered (data_fmt_string,
|
(unsigned long) map->pr_vaddr + map->pr_size - 1,
|
||||||
(unsigned long) map->pr_vaddr,
|
map->pr_size,
|
||||||
(unsigned long) map->pr_vaddr + map->pr_size - 1,
|
pr_off,
|
||||||
map->pr_size,
|
mappingflags (map->pr_mflags));
|
||||||
#ifdef PCAGENT /* Horrible hack: only defined on Solaris 2.6+ */
|
|
||||||
(unsigned int) map->pr_offset,
|
|
||||||
#else
|
|
||||||
map->pr_off,
|
|
||||||
#endif
|
|
||||||
mappingflags (map->pr_mflags));
|
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -5810,23 +5816,24 @@ info_mappings_callback (struct prmap *map, int (*ignore) (), void *unused)
|
||||||
static void
|
static void
|
||||||
info_proc_mappings (procinfo *pi, int summary)
|
info_proc_mappings (procinfo *pi, int summary)
|
||||||
{
|
{
|
||||||
char *header_fmt_string;
|
|
||||||
|
|
||||||
if (gdbarch_ptr_bit (current_gdbarch) == 32)
|
|
||||||
header_fmt_string = "\t%10s %10s %10s %10s %7s\n";
|
|
||||||
else
|
|
||||||
header_fmt_string = " %18s %18s %10s %10s %7s\n";
|
|
||||||
|
|
||||||
if (summary)
|
if (summary)
|
||||||
return; /* No output for summary mode. */
|
return; /* No output for summary mode. */
|
||||||
|
|
||||||
printf_filtered (_("Mapped address spaces:\n\n"));
|
printf_filtered (_("Mapped address spaces:\n\n"));
|
||||||
printf_filtered (header_fmt_string,
|
if (gdbarch_ptr_bit (current_gdbarch) == 32)
|
||||||
"Start Addr",
|
printf_filtered ("\t%10s %10s %10s %10s %7s\n",
|
||||||
" End Addr",
|
"Start Addr",
|
||||||
" Size",
|
" End Addr",
|
||||||
" Offset",
|
" Size",
|
||||||
"Flags");
|
" Offset",
|
||||||
|
"Flags");
|
||||||
|
else
|
||||||
|
printf_filtered (" %18s %18s %10s %10s %7s\n",
|
||||||
|
"Start Addr",
|
||||||
|
" End Addr",
|
||||||
|
" Size",
|
||||||
|
" Offset",
|
||||||
|
"Flags");
|
||||||
|
|
||||||
iterate_over_mappings (pi, NULL, NULL, info_mappings_callback);
|
iterate_over_mappings (pi, NULL, NULL, info_mappings_callback);
|
||||||
printf_filtered ("\n");
|
printf_filtered ("\n");
|
||||||
|
@ -6150,7 +6157,7 @@ procfs_make_note_section (bfd *obfd, int *note_size)
|
||||||
char *note_data = NULL;
|
char *note_data = NULL;
|
||||||
char *inf_args;
|
char *inf_args;
|
||||||
struct procfs_corefile_thread_data thread_args;
|
struct procfs_corefile_thread_data thread_args;
|
||||||
char *auxv;
|
gdb_byte *auxv;
|
||||||
int auxv_len;
|
int auxv_len;
|
||||||
|
|
||||||
if (get_exec_file (0))
|
if (get_exec_file (0))
|
||||||
|
|
Loading…
Reference in New Issue