This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Style "pwd" output


>>>>> "Pedro" == Pedro Alves <palves@redhat.com> writes:

Pedro> I wish we didn't have to split the lines across different calls though.
Pedro> I know we don't officially do i18n yet (*), but these kinds of changes will
Pedro> only make it more difficult to get there.

Pedro> Maybe with something like:

Pedro>   if (strcmp (cwd.get (), current_directory) != 0)
Pedro>     printf_unfiltered (_("Working directory <style=filename>%s<style/>\n (canonically <style=filename>%s<style/>).\n"),
Pedro> 		       current_directory, cwd.get ());
Pedro>   else
Pedro>     printf_unfiltered (_("Working directory <style=filename>%s<style/>.\n"), current_directory);

Pedro> I'm sure you've considered something like that; I think we've discussed it
Pedro> before.  What are your current thoughts?

I think what would be nice is a gdb-specific printf extension for this,
e.g.:

    printf_unfiltered ("Working directory %<%s%>\n",
                       ui_out_style_kind::FILE, 
                       current_directory);

%< takes a style argument and %> does not.

However, for that to work, we'd need a GCC enhancement to let gdb modify
the printf format checking.


Note that if we want to be serious about i18n then there is also the
problem that the whole MI approach is not very i18n-friendly.  There are
spots that split calls like this, but which can't easily be unsplit
(even with a printf extension) due to MI.  So maybe something bigger is
needed.

Tom


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]