diff options
author | Michael Snyder <msnyder@vmware.com> | 2002-02-14 01:57:36 +0000 |
---|---|---|
committer | Michael Snyder <msnyder@vmware.com> | 2002-02-14 01:57:36 +0000 |
commit | 6dbdc4a3629d75a46908c071d8caba9e66da03ab (patch) | |
tree | 5613ac9982b51135ed18ff75b44c8f277e261b88 /gdb/procfs.c | |
parent | 89d97283d3d7388b0d72ad67ceb3bd0ffc95dac7 (diff) | |
download | gdb-6dbdc4a3629d75a46908c071d8caba9e66da03ab.zip gdb-6dbdc4a3629d75a46908c071d8caba9e66da03ab.tar.gz gdb-6dbdc4a3629d75a46908c071d8caba9e66da03ab.tar.bz2 |
2002-02-13 Michael Snyder <msnyder@redhat.com>
* gcore.c (gcore_command): Use gcore_default_target instead of NULL.
(default_gcore_mach): Just return 0, work around a problem in bfd.
(default_gcore_target): OK to return NULL if exec_bfd is null.
(make_mem_sec): Use a cast, avoid a warning.
* procfs.c (find_memory_regions_callback): Use a cast instead of
calling host_pointer_to_address (which complains if
sizeof (host pointer) != sizeof (target pointer)).
(procfs_make_note_section): Avoid overflow in psargs string.
Diffstat (limited to 'gdb/procfs.c')
-rw-r--r-- | gdb/procfs.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/gdb/procfs.c b/gdb/procfs.c index aec61bc..55e0496 100644 --- a/gdb/procfs.c +++ b/gdb/procfs.c @@ -5388,7 +5388,7 @@ find_memory_regions_callback (struct prmap *map, void *), void *data) { - return (*func) (host_pointer_to_address ((void *) map->pr_vaddr), + return (*func) ((CORE_ADDR) map->pr_vaddr, map->pr_size, (map->pr_mflags & MA_READ) != 0, (map->pr_mflags & MA_WRITE) != 0, @@ -5793,6 +5793,7 @@ procfs_make_note_section (bfd *obfd, int *note_size) char psargs[80] = {'\0'}; procinfo *pi = find_procinfo_or_die (PIDGET (inferior_ptid), 0); char *note_data = NULL; + char *inf_args; struct procfs_corefile_thread_data thread_args; if (get_exec_file (0)) @@ -5800,11 +5801,14 @@ procfs_make_note_section (bfd *obfd, int *note_size) strncpy (fname, strrchr (get_exec_file (0), '/') + 1, sizeof (fname)); strncpy (psargs, get_exec_file (0), sizeof (psargs)); - if (get_inferior_args ()) + + inf_args = get_inferior_args (); + if (inf_args && *inf_args && + strlen (inf_args) < ((int) sizeof (psargs) - (int) strlen (psargs))) { strncat (psargs, " ", sizeof (psargs) - strlen (psargs)); - strncat (psargs, get_inferior_args (), + strncat (psargs, inf_args, sizeof (psargs) - strlen (psargs)); } } |