summaryrefslogtreecommitdiffstats
path: root/TraceScreen.c
diff options
context:
space:
mode:
authorHisham Muhammad <hisham@gobolinux.org>2012-12-05 15:12:20 +0000
committerHisham Muhammad <hisham@gobolinux.org>2012-12-05 15:12:20 +0000
commit00b324bfc162030b575e03795dcfcaac56bd0b4d (patch)
treefbaada243839b0b67351856e2d02a2e8184bf65f /TraceScreen.c
parent2a73405cd060b543d56987650327b18078a137d7 (diff)
Changes in object model: separate class objects to store vtable. Also, nicer UTF-8 display of big numbers.
Diffstat (limited to 'TraceScreen.c')
-rw-r--r--TraceScreen.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/TraceScreen.c b/TraceScreen.c
index 5fc48023..89581a9b 100644
--- a/TraceScreen.c
+++ b/TraceScreen.c
@@ -46,7 +46,7 @@ static int tsEvents[] = {KEY_F(3), KEY_F(4), KEY_F(8), KEY_F(9), 27};
TraceScreen* TraceScreen_new(Process* process) {
TraceScreen* this = (TraceScreen*) malloc(sizeof(TraceScreen));
this->process = process;
- this->display = Panel_new(0, 1, COLS, LINES-2, LISTITEM_CLASS, false, ListItem_compare);
+ this->display = Panel_new(0, 1, COLS, LINES-2, false, Class(ListItem));
this->tracing = true;
return this;
}
@@ -106,7 +106,7 @@ void TraceScreen_run(TraceScreen* this) {
FunctionBar* bar = FunctionBar_new(tsFunctions, tsKeys, tsEvents);
IncSet* inc = IncSet_new(bar);
- Vector* lines = Vector_new(panel->items->type, true, DEFAULT_SIZE, ListItem_compare);
+ Vector* lines = Vector_new(panel->items->type, true, DEFAULT_SIZE);
TraceScreen_draw(this, inc);
@@ -122,11 +122,11 @@ void TraceScreen_run(TraceScreen* this) {
if (ch == ERR) {
fd_set fds;
FD_ZERO(&fds);
- FD_SET(STDIN_FILENO, &fds);
+// FD_SET(STDIN_FILENO, &fds);
FD_SET(fd_strace, &fds);
- //struct timeval tv;
- //tv.tv_sec = 0; tv.tv_usec = 500;
- int ready = select(fd_strace+1, &fds, NULL, NULL, NULL/*&tv*/);
+ struct timeval tv;
+ tv.tv_sec = 0; tv.tv_usec = 500;
+ int ready = select(fd_strace+1, &fds, NULL, NULL, &tv);
int nread = 0;
if (ready > 0 && FD_ISSET(fd_strace, &fds))
nread = fread(buffer, 1, 1000, strace);
@@ -218,6 +218,7 @@ void TraceScreen_run(TraceScreen* this) {
IncSet_delete(inc);
FunctionBar_delete((Object*)bar);
+ Vector_delete(lines);
kill(child, SIGTERM);
waitpid(child, NULL, 0);

© 2014-2024 Faster IT GmbH | imprint | privacy policy