[commit] Make add_setshow's print work
Andrew Cagney
cagney@gnu.org
Thu Feb 10 19:58:00 GMT 2005
Hello,
The attached implements the missing printing mechanims needed for i18n
printing of set|show variables.
The existing code uses:
/* Print doc minus "show" at start. */
print_doc_line (gdb_stdout, c->doc + 5);
ui_out_text (uiout, " is ");
ui_out_wrap_hint (uiout, " ");
if (quote)
ui_out_text (uiout, "\"");
ui_out_field_stream (uiout, "value", stb);
if (quote)
ui_out_text (uiout, "\"");
ui_out_text (uiout, ".\n");
do_cleanups (old_chain);
(note the "+ 5"). Knowing this I added:
const char *print
(e.x., "The value of foo is %s.") to the tentative inteface. There's a
problem though, the print statement:
fprintf_unfiltered (print, value);
attracts the wrath of gcc (A -Wformat error). Consequently, in
finishing this I've replaced "print" string with a proper function:
fprint_setshow_ftype *fprint_setshow
(void fprint_setshow (cmd_list_element *, ui_file *, const char *))
For the moment I've implemented only one such function -
fprint_setshow_complaints. For the others I've commented things out.
commited,
Andrew
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: diffs
URL: <http://sourceware.org/pipermail/gdb-patches/attachments/20050210/25e2097f/attachment.ksh>
More information about the Gdb-patches
mailing list