diff options
author | Thomas Schwinge <thomas@codesourcery.com> | 2016-12-08 18:42:03 +0100 |
---|---|---|
committer | Thomas Schwinge <thomas@codesourcery.com> | 2016-12-09 07:19:28 +0100 |
commit | 53488a6e194af11c2528e5e284facb8a6171b695 (patch) | |
tree | de5c606a80e4f2a02f70b2804733f32b2d0900d6 /gdb | |
parent | cfccf141f0db8de28ba21a8920939c30e123d73e (diff) | |
download | gdb-53488a6e194af11c2528e5e284facb8a6171b695.zip gdb-53488a6e194af11c2528e5e284facb8a6171b695.tar.gz gdb-53488a6e194af11c2528e5e284facb8a6171b695.tar.bz2 |
Avoid PATH_MAX usage
On GNU/Hurd, there is no "#define PATH_MAX", so this failed to build.
gdb/
* inferior.c (print_selected_inferior): Avoid PATH_MAX usage.
Diffstat (limited to 'gdb')
-rw-r--r-- | gdb/ChangeLog | 4 | ||||
-rw-r--r-- | gdb/inferior.c | 15 |
2 files changed, 9 insertions, 10 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 2bd99f1..302eb6e 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,7 @@ +2016-12-09 Thomas Schwinge <thomas@codesourcery.com> + + * inferior.c (print_selected_inferior): Avoid PATH_MAX usage. + 2016-12-08 Simon Marchi <simon.marchi@ericsson.com> Thomas Schwinge <thomas@codesourcery.com> diff --git a/gdb/inferior.c b/gdb/inferior.c index 9fcdbd3..af6f3af 100644 --- a/gdb/inferior.c +++ b/gdb/inferior.c @@ -556,17 +556,12 @@ inferior_pid_to_str (int pid) void print_selected_inferior (struct ui_out *uiout) { - char buf[PATH_MAX + 256]; struct inferior *inf = current_inferior (); - - xsnprintf (buf, sizeof (buf), - _("[Switching to inferior %d [%s] (%s)]\n"), - inf->num, - inferior_pid_to_str (inf->pid), - (inf->pspace->pspace_exec_filename != NULL - ? inf->pspace->pspace_exec_filename - : _("<noexec>"))); - ui_out_text (uiout, buf); + const char *filename = inf->pspace->pspace_exec_filename; + if (filename == NULL) + filename = _("<noexec>"); + ui_out_message (uiout, _("[Switching to inferior %d [%s] (%s)]\n"), + inf->num, inferior_pid_to_str (inf->pid), filename); } /* Prints the list of inferiors and their details on UIOUT. This is a |