core: add option "libs" for command /debug, add signal "debug_libs"

v2.8-utf8proc
Sebastien Helleu 2013-11-17 20:49:37 +01:00
parent e0890b376c
commit 8d64b658df
25 changed files with 170 additions and 65 deletions

View File

@ -11,6 +11,7 @@ http://weechat.org/files/releasenotes/ReleaseNotes-devel.html[release notes]
== Version 0.4.3 (under dev)
* core: add option "libs" for command /debug
* core: apply color attributes when clearing a window (patch #8236)
* core: set option weechat.look.paste_bracketed to "on" by default
* core: fix truncated text when pasting several long lines (bug #40210)

View File

@ -191,23 +191,24 @@ Beispiele:
mouse|cursor [verbose]
hdata [free]
list: zeigt alle Erweiterungen mit Debuglevel an
set: setzt den Level der Protokollierung für eine Erweiterung
plugin: Name der Erweiterung ("core" für den WeeChat Kern)
level: Debuglevel der Erweiterung (0 = deaktiviert Debug)
dump: Speicherabbild in die WeeChat Protokolldatei schreiben (wie bei einem Programmabsturz)
buffer: speichert den Bufferinhalt als hexadezimale Ausgabe in die Protokolldatei
color: zeigt Informationen über die aktuellen Farbpaarungen an
cursor: schaltet den debug-Modus für den Cursor-Modus ein/aus
dirs: Verzeichnisse werden angezeigt
hdata: zeigt Informationen zu hdata an (mittels free werden alle hdata Informationen aus dem Speicher entfernt)
hooks: zeigt die aktiven Hooks an
infolists: zeigt Information über die Infolists an
memory: gibt Informationen über den genutzten Speicher aus
mouse: schaltet den debug-Modus für den Maus-Modus ein/aus
tags: zeigt für jede einzelne Zeile die dazugehörigen Schlagwörter an
term: gibt Informationen über das Terminal und verfügbare Farben aus
windows: zeigt die Fensterstruktur an
list: list plugins with debug levels
set: set debug level for plugin
plugin: name of plugin ("core" for WeeChat core)
level: debug level for plugin (0 = disable debug)
dump: save memory dump in WeeChat log file (same dump is written when WeeChat crashes)
buffer: dump buffer content with hexadecimal values in log file
color: display infos about current color pairs
cursor: toggle debug for cursor mode
dirs: display directories
hdata: display infos about hdata (with free: remove all hdata in memory)
hooks: display infos about hooks
infolists: display infos about infolists
libs: display infos about external libraries used
memory: display infos about memory usage
mouse: toggle debug for mouse
tags: display tags for lines
term: display infos about terminal
windows: display windows tree
----
[[command_weechat_eval]]

View File

@ -203,6 +203,7 @@ Examples:
hdata: display infos about hdata (with free: remove all hdata in memory)
hooks: display infos about hooks
infolists: display infos about infolists
libs: display infos about external libraries used
memory: display infos about memory usage
mouse: toggle debug for mouse
tags: display tags for lines

View File

@ -7743,6 +7743,10 @@ Arguments:
String: plugin name |
Dump request
| weechat | debug_libs |
- |
Display external libraries used
| weechat | filter_added |
Pointer: filter |
Filter added

View File

@ -203,6 +203,7 @@ extension: nom de l'extension ("core" pour le cœur de WeeChat)
hdata: afficher des infos sur les hdata (avec free: supprimer tous les hdata en mémoire)
hooks: afficher des infos sur les hooks
infolists: afficher des infos sur les infolists
libs: afficher des infos sur les bibliothèques externes utilisées
memory: afficher des infos sur l'utilisation de la mémoire
mouse: activer/désactiver le debug pour la souris
tags: afficher les étiquettes pour les lignes

View File

@ -7861,6 +7861,10 @@ Paramètres :
Chaîne : nom d'extension |
Requête de "dump"
| weechat | debug_libs |
- |
Affichage des bibliothèques externes utilisées
| weechat | filter_added |
Pointeur : filtre |
Filtre ajouté

View File

@ -191,23 +191,24 @@ Esempi:
mouse|cursor [verbose]
hdata [free]
list: elenca i plugin con i livelli di debug
set: imposta il livello di debug per il plugin
plugin: nome del plugin ("core" per il core di WeeChat)
livello: livello di debug per il plugin (0 = disattiva debug)
dump: salva un dump della memoria nel file di log di WeeChat (lo stesso dump viene salvato in caso di crash di WeeChat)
buffer: esegue un dump del contenuto del buffer con valori esadecimali nel file di log
color: mostra informazioni sulle coppie di colore correnti
cursor: abilita/disabilita debug per la modalità cursore
dirs: mostra le directory
hdata: mostra informazioni su hdata (con free: rimuove tutti gli hdata in memoria)
hooks: mostra informazioni sugli hook
infolists: mostra informazioni sulle liste info
memory: mostra informazioni sull'uso della memoria
mouse: abilita/disabilita debug per il mouse
tags: mostra tag per le righe
term: mostra informazioni sul terminale
windows: mostra l'albero delle finestre
list: list plugins with debug levels
set: set debug level for plugin
plugin: name of plugin ("core" for WeeChat core)
level: debug level for plugin (0 = disable debug)
dump: save memory dump in WeeChat log file (same dump is written when WeeChat crashes)
buffer: dump buffer content with hexadecimal values in log file
color: display infos about current color pairs
cursor: toggle debug for cursor mode
dirs: display directories
hdata: display infos about hdata (with free: remove all hdata in memory)
hooks: display infos about hooks
infolists: display infos about infolists
libs: display infos about external libraries used
memory: display infos about memory usage
mouse: toggle debug for mouse
tags: display tags for lines
term: display infos about terminal
windows: display windows tree
----
[[command_weechat_eval]]

View File

@ -7836,6 +7836,11 @@ Argomenti:
Stringa: nome plugin |
Richiesta di dump
// TRANSLATION MISSING
| weechat | debug_libs |
- |
Display external libraries used
| weechat | filter_added |
Puntatore: filtro |
Filtro aggiunto

View File

@ -191,23 +191,24 @@ stop: カーソルモードを終了
mouse|cursor [verbose]
hdata [free]
list: デバッグレベルの設定されたプラグインをリストアップ
set: プラグインのデバッグレベルを設定
plugin: プラグインの名前 ("core" は WeeChat コアを意味する)
level: プラグインのデバッグレベル (0 はデバッグの無効化)
dump: WeeChat ログファイルにメモリダンプを保存 (WeeChat がクラッシュした場合と同じダンプが書き込まれます)
buffer: ログファイルに 16 進値でバッファの内容をダンプ
color: 現在の色ペアに関する情報を表示
cursor: カーソルモードのデバッグを切り替え
dirs: ディレクトリを表示
hdata: hdata に関する情報を表示 (free を付ければ: メモリから全ての hdata を削除)
hooks: フックに関する情報を表示
infolists: infolist に関する情報を表示
memory: メモリ使用量に関する情報を表示
mouse: マウスのデバックを切り替え
tags: 行のタグを表示
term: ターミナルに関する情報を表示
windows: ウィンドウツリーの情報を表示
list: list plugins with debug levels
set: set debug level for plugin
plugin: name of plugin ("core" for WeeChat core)
level: debug level for plugin (0 = disable debug)
dump: save memory dump in WeeChat log file (same dump is written when WeeChat crashes)
buffer: dump buffer content with hexadecimal values in log file
color: display infos about current color pairs
cursor: toggle debug for cursor mode
dirs: display directories
hdata: display infos about hdata (with free: remove all hdata in memory)
hooks: display infos about hooks
infolists: display infos about infolists
libs: display infos about external libraries used
memory: display infos about memory usage
mouse: toggle debug for mouse
tags: display tags for lines
term: display infos about terminal
windows: display windows tree
----
[[command_weechat_eval]]

View File

@ -20,7 +20,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2013-11-09 17:01+0100\n"
"POT-Creation-Date: 2013-11-17 13:58+0100\n"
"PO-Revision-Date: 2013-11-09 10:18+0100\n"
"Last-Translator: Jiri Golembiovsky <golemj@gmail.com>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@ -1257,6 +1257,7 @@ msgid ""
"memory)\n"
" hooks: display infos about hooks\n"
"infolists: display infos about infolists\n"
" libs: display infos about external libraries used\n"
" memory: display infos about memory usage\n"
" mouse: toggle debug for mouse\n"
" tags: display tags for lines\n"

View File

@ -22,7 +22,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat 0.4.3-dev\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2013-11-09 17:01+0100\n"
"POT-Creation-Date: 2013-11-17 13:58+0100\n"
"PO-Revision-Date: 2013-11-09 10:18+0100\n"
"Last-Translator: Nils Görs <weechatter@arcor.de>\n"
"Language-Team: German <weechatter@arcor.de>\n"
@ -1283,6 +1283,7 @@ msgstr ""
"list || set <plugin> <level> || dump [<plugin>] || buffer|color|infolists|"
"memory|tags|term|windows || mouse|cursor [verbose] || hdata [free]"
#, fuzzy
msgid ""
" list: list plugins with debug levels\n"
" set: set debug level for plugin\n"
@ -1298,6 +1299,7 @@ msgid ""
"memory)\n"
" hooks: display infos about hooks\n"
"infolists: display infos about infolists\n"
" libs: display infos about external libraries used\n"
" memory: display infos about memory usage\n"
" mouse: toggle debug for mouse\n"
" tags: display tags for lines\n"

View File

@ -22,7 +22,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2013-11-09 17:01+0100\n"
"POT-Creation-Date: 2013-11-17 13:58+0100\n"
"PO-Revision-Date: 2013-11-09 10:18+0100\n"
"Last-Translator: Elián Hanisch <lambdae2@gmail.com>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@ -1286,6 +1286,7 @@ msgid ""
"memory)\n"
" hooks: display infos about hooks\n"
"infolists: display infos about infolists\n"
" libs: display infos about external libraries used\n"
" memory: display infos about memory usage\n"
" mouse: toggle debug for mouse\n"
" tags: display tags for lines\n"

View File

@ -21,8 +21,8 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2013-11-09 17:01+0100\n"
"PO-Revision-Date: 2013-11-09 17:02+0100\n"
"POT-Creation-Date: 2013-11-17 13:58+0100\n"
"PO-Revision-Date: 2013-11-17 20:18+0100\n"
"Last-Translator: Sebastien Helleu <flashcode@flashtux.org>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
"Language: fr\n"
@ -1277,6 +1277,7 @@ msgid ""
"memory)\n"
" hooks: display infos about hooks\n"
"infolists: display infos about infolists\n"
" libs: display infos about external libraries used\n"
" memory: display infos about memory usage\n"
" mouse: toggle debug for mouse\n"
" tags: display tags for lines\n"
@ -1298,6 +1299,7 @@ msgstr ""
"hdata en mémoire)\n"
" hooks: afficher des infos sur les hooks\n"
"infolists: afficher des infos sur les infolists\n"
" libs: afficher des infos sur les bibliothèques externes utilisées\n"
" memory: afficher des infos sur l'utilisation de la mémoire\n"
" mouse: activer/désactiver le debug pour la souris\n"
" tags: afficher les étiquettes pour les lignes\n"

View File

@ -20,7 +20,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2013-11-09 17:01+0100\n"
"POT-Creation-Date: 2013-11-17 13:58+0100\n"
"PO-Revision-Date: 2013-11-09 10:18+0100\n"
"Last-Translator: Andras Voroskoi <voroskoi@frugalware.org>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@ -1193,6 +1193,7 @@ msgid ""
"memory)\n"
" hooks: display infos about hooks\n"
"infolists: display infos about infolists\n"
" libs: display infos about external libraries used\n"
" memory: display infos about memory usage\n"
" mouse: toggle debug for mouse\n"
" tags: display tags for lines\n"

View File

@ -20,7 +20,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2013-11-09 17:01+0100\n"
"POT-Creation-Date: 2013-11-17 13:58+0100\n"
"PO-Revision-Date: 2013-11-09 10:18+0100\n"
"Last-Translator: Esteban I. Ruiz Moreno <exio4.com@gmail.com>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@ -1243,6 +1243,7 @@ msgstr ""
"list || set <plugin> <livello> || dump [<plugin>] || buffer|color|infolists|"
"memory|tags|term|windows || mouse|cursor [verbose] || hdata [free]"
#, fuzzy
msgid ""
" list: list plugins with debug levels\n"
" set: set debug level for plugin\n"
@ -1258,6 +1259,7 @@ msgid ""
"memory)\n"
" hooks: display infos about hooks\n"
"infolists: display infos about infolists\n"
" libs: display infos about external libraries used\n"
" memory: display infos about memory usage\n"
" mouse: toggle debug for mouse\n"
" tags: display tags for lines\n"

View File

@ -20,7 +20,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2013-11-09 17:01+0100\n"
"POT-Creation-Date: 2013-11-17 13:58+0100\n"
"PO-Revision-Date: 2013-11-09 10:18+0100\n"
"Last-Translator: AYANOKOUZI, Ryuunosuke <i38w7i3@yahoo.co.jp>\n"
"Language-Team: Japanese <https://github.com/l/WeeChat>\n"
@ -1232,6 +1232,7 @@ msgstr ""
"list || set <plugin> <level> || dump [<plugin>] || buffer|color|infolists|"
"memory|tags|term|windows || mouse|cursor [verbose] || hdata [free]"
#, fuzzy
msgid ""
" list: list plugins with debug levels\n"
" set: set debug level for plugin\n"
@ -1247,6 +1248,7 @@ msgid ""
"memory)\n"
" hooks: display infos about hooks\n"
"infolists: display infos about infolists\n"
" libs: display infos about external libraries used\n"
" memory: display infos about memory usage\n"
" mouse: toggle debug for mouse\n"
" tags: display tags for lines\n"

View File

@ -21,7 +21,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2013-11-09 17:01+0100\n"
"POT-Creation-Date: 2013-11-17 13:58+0100\n"
"PO-Revision-Date: 2013-11-11 09:07+0100\n"
"Last-Translator: Krzysztof Korościk <soltys@szluug.org>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@ -1262,6 +1262,7 @@ msgstr ""
"list || set <wtyczka> <poziom> || dump [<wtyczka>] || buffer|color|infolists|"
"memory|tags|term|windows || mouse|cursor [verbose] || hdata [free]"
#, fuzzy
msgid ""
" list: list plugins with debug levels\n"
" set: set debug level for plugin\n"
@ -1277,6 +1278,7 @@ msgid ""
"memory)\n"
" hooks: display infos about hooks\n"
"infolists: display infos about infolists\n"
" libs: display infos about external libraries used\n"
" memory: display infos about memory usage\n"
" mouse: toggle debug for mouse\n"
" tags: display tags for lines\n"

View File

@ -21,7 +21,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2013-11-09 17:01+0100\n"
"POT-Creation-Date: 2013-11-17 13:58+0100\n"
"PO-Revision-Date: 2013-11-09 10:18+0100\n"
"Last-Translator: Sergio Durigan Junior <sergiosdj@gmail.com>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@ -1301,6 +1301,7 @@ msgid ""
"memory)\n"
" hooks: display infos about hooks\n"
"infolists: display infos about infolists\n"
" libs: display infos about external libraries used\n"
" memory: display infos about memory usage\n"
" mouse: toggle debug for mouse\n"
" tags: display tags for lines\n"

View File

@ -21,7 +21,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2013-11-09 17:01+0100\n"
"POT-Creation-Date: 2013-11-17 13:58+0100\n"
"PO-Revision-Date: 2013-11-09 10:18+0100\n"
"Last-Translator: Aleksey V Zapparov AKA ixti <ixti@member.fsf.org>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@ -1214,6 +1214,7 @@ msgid ""
"memory)\n"
" hooks: display infos about hooks\n"
"infolists: display infos about infolists\n"
" libs: display infos about external libraries used\n"
" memory: display infos about memory usage\n"
" mouse: toggle debug for mouse\n"
" tags: display tags for lines\n"

View File

@ -20,7 +20,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2013-11-09 17:01+0100\n"
"POT-Creation-Date: 2013-11-17 13:58+0100\n"
"PO-Revision-Date: 2013-11-09 10:13+0100\n"
"Last-Translator: Hasan Kiran <sunder67@hotmail.com>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@ -1061,6 +1061,7 @@ msgid ""
"memory)\n"
" hooks: display infos about hooks\n"
"infolists: display infos about infolists\n"
" libs: display infos about external libraries used\n"
" memory: display infos about memory usage\n"
" mouse: toggle debug for mouse\n"
" tags: display tags for lines\n"

View File

@ -21,7 +21,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat 0.4.1-dev\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2013-11-09 17:01+0100\n"
"POT-Creation-Date: 2013-11-17 13:58+0100\n"
"PO-Revision-Date: 2013-02-14 18:20+0100\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@ -1067,6 +1067,7 @@ msgid ""
"memory)\n"
" hooks: display infos about hooks\n"
"infolists: display infos about infolists\n"
" libs: display infos about external libraries used\n"
" memory: display infos about memory usage\n"
" mouse: toggle debug for mouse\n"
" tags: display tags for lines\n"

View File

@ -1410,6 +1410,12 @@ COMMAND_CALLBACK(debug)
{
debug_infolists ();
}
else if (string_strcasecmp (argv[1], "libs") == 0)
{
gui_chat_printf (NULL, "");
gui_chat_printf (NULL, "Libs:");
hook_signal_send ("debug_libs", WEECHAT_HOOK_SIGNAL_STRING, NULL);
}
else if (string_strcasecmp (argv[1], "memory") == 0)
{
debug_memory ();
@ -6359,6 +6365,7 @@ command_init ()
"all hdata in memory)\n"
" hooks: display infos about hooks\n"
"infolists: display infos about infolists\n"
" libs: display infos about external libraries used\n"
" memory: display infos about memory usage\n"
" mouse: toggle debug for mouse\n"
" tags: display tags for lines\n"
@ -6374,6 +6381,7 @@ command_init ()
" || hdata free"
" || hooks"
" || infolists"
" || libs"
" || memory"
" || mouse verbose"
" || tags"

View File

@ -29,6 +29,13 @@
#endif
#include <string.h>
#include <time.h>
#include <gcrypt.h>
#include <curl/curl.h>
#include <zlib.h>
#ifdef HAVE_GNUTLS
#include <gnutls/gnutls.h>
#endif
#include "weechat.h"
#include "wee-backtrace.h"
@ -496,6 +503,42 @@ debug_infolists ()
}
}
/*
* Callback for signal "debug_libs": displays infos about external libraries
* used (called when command "/debug libs" is issued).
*
* Note: this function displays libraries for WeeChat core only: plugins can
* catch this signal to display their external libraries.
*/
int
debug_libs_cb (void *data, const char *signal, const char *type_data,
void *signal_data)
{
/* make C compiler happy */
(void) data;
(void) signal;
(void) type_data;
(void) signal_data;
gui_chat_printf (NULL, " core:");
gui_main_debug_libs ();
gui_chat_printf (NULL, " gcrypt: v%s%s",
GCRYPT_VERSION,
(weechat_no_gcrypt) ? " (not initialized)" : "");
#ifdef HAVE_GNUTLS
gui_chat_printf (NULL, " gnutls: v%s%s",
GNUTLS_VERSION,
(weechat_no_gnutls) ? " (not initialized)" : "");
#else
gui_chat_printf (NULL, " gnutls: (not available)");
#endif
gui_chat_printf (NULL, " curl: v%s", LIBCURL_VERSION);
gui_chat_printf (NULL, " zlib: v%s", ZLIB_VERSION);
return WEECHAT_RC_OK;
}
/*
* Displays WeeChat directories.
*/
@ -519,5 +562,11 @@ debug_directories ()
void
debug_init ()
{
hook_signal (NULL, "debug_dump", &debug_dump_cb, NULL);
/*
* hook signals with high priority, to be sure they will be used before
* plugins (they should anyway because this function is called before load
* of plugins)
*/
hook_signal (NULL, "2000|debug_dump", &debug_dump_cb, NULL);
hook_signal (NULL, "2000|debug_libs", &debug_libs_cb, NULL);
}

View File

@ -297,6 +297,17 @@ gui_main_signal_sigwinch ()
gui_window_ask_refresh (2);
}
/*
* Displays infos about ncurses lib.
*/
void
gui_main_debug_libs ()
{
gui_chat_printf (NULL, " ncurses: v%s (patch %d)",
NCURSES_VERSION, NCURSES_VERSION_PATCH);
}
/*
* Refreshs for windows, buffers, bars.
*/

View File

@ -25,6 +25,7 @@
extern void gui_main_get_password (const char *prompt1, const char *prompt2,
const char *prompt3,
char *password, int size);
extern void gui_main_debug_libs ();
extern void gui_main_loop ();
extern void gui_main_pre_init (int *argc, char **argv[]);
extern void gui_main_init ();