From c2fa5b4c807adf2a857f28d53376f426ace088ee Mon Sep 17 00:00:00 2001 From: Arnaldo Carvalho de Melo Date: Thu, 28 Mar 2013 11:07:37 -0300 Subject: [PATCH] --- yaml --- r: 366015 b: refs/heads/master c: a403253634141137e9a0585a6044e7c059c92f1b h: refs/heads/master i: 366013: 8cdce6872c0c4204b7787ef21039cdcc18c8fed6 366011: 2f063513a82b10c5eb1a3f657c411608635fe77e 366007: df58ec2aa191b6b708aba1123ff664abb7d7afcf 365999: 18ead211622542e8ee2a6bd328f157e182272551 365983: af8aa0126aedf0ff4da903ad0edcabfffbf81f31 365951: 2e34205037129e67cc807c89ac1ea053f1c6fbf2 v: v3 --- [refs] | 2 +- trunk/tools/perf/ui/browsers/map.c | 44 ++++-------------------------- 2 files changed, 7 insertions(+), 39 deletions(-) diff --git a/[refs] b/[refs] index cf2e9079c342..947d1d446361 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 707ef2e69a53f2dc60cfa2ff5cb4bf5474206f33 +refs/heads/master: a403253634141137e9a0585a6044e7c059c92f1b diff --git a/trunk/tools/perf/ui/browsers/map.c b/trunk/tools/perf/ui/browsers/map.c index 98851d55a53e..10b549c0eefb 100644 --- a/trunk/tools/perf/ui/browsers/map.c +++ b/trunk/tools/perf/ui/browsers/map.c @@ -1,6 +1,5 @@ #include "../libslang.h" #include -#include #include #include #include @@ -10,41 +9,9 @@ #include "../../util/symbol.h" #include "../browser.h" #include "../helpline.h" +#include "../keysyms.h" #include "map.h" -static int ui_entry__read(const char *title, char *bf, size_t size, int width) -{ - struct newtExitStruct es; - newtComponent form, entry; - const char *result; - int err = -1; - - newtCenteredWindow(width, 1, title); - form = newtForm(NULL, NULL, 0); - if (form == NULL) - return -1; - - entry = newtEntry(0, 0, "0x", width, &result, NEWT_FLAG_SCROLL); - if (entry == NULL) - goto out_free_form; - - newtFormAddComponent(form, entry); - newtFormAddHotKey(form, NEWT_KEY_ENTER); - newtFormAddHotKey(form, NEWT_KEY_ESCAPE); - newtFormAddHotKey(form, NEWT_KEY_LEFT); - newtFormAddHotKey(form, CTRL('c')); - newtFormRun(form, &es); - - if (result != NULL) { - strncpy(bf, result, size); - err = 0; - } -out_free_form: - newtPopWindow(); - newtFormDestroy(form); - return err; -} - struct map_browser { struct ui_browser b; struct map *map; @@ -78,10 +45,11 @@ static int map_browser__search(struct map_browser *self) { char target[512]; struct symbol *sym; - int err = ui_entry__read("Search by name/addr", target, sizeof(target), 40); - - if (err) - return err; + int err = ui_browser__input_window("Search by name/addr", + "Prefix with 0x to search by address", + target, "ENTER: OK, ESC: Cancel", 0); + if (err != K_ENTER) + return -1; if (target[0] == '0' && tolower(target[1]) == 'x') { u64 addr = strtoull(target, NULL, 16);