Re: [Zorba-coders] [Merge] lp:~zorba-coders/zorba/debugger_client_extras into lp:zorba

2012-01-09 Thread David Graf
Review: Approve

It works. Cool!
-- 
https://code.launchpad.net/~zorba-coders/zorba/debugger_client_extras/+merge/87817
Your team Zorba Coders is subscribed to branch lp:zorba.

-- 
Mailing list: https://launchpad.net/~zorba-coders
Post to : zorba-coders@lists.launchpad.net
Unsubscribe : https://launchpad.net/~zorba-coders
More help   : https://help.launchpad.net/ListHelp


[Zorba-coders] [Merge] lp:~zorba-coders/zorba/debugger_client_extras into lp:zorba

2012-01-09 Thread Gabriel Petrovay
The proposal to merge lp:~zorba-coders/zorba/debugger_client_extras into 
lp:zorba has been updated.

Status: Needs review = Approved

For more details, see:
https://code.launchpad.net/~zorba-coders/zorba/debugger_client_extras/+merge/87817
-- 
https://code.launchpad.net/~zorba-coders/zorba/debugger_client_extras/+merge/87817
Your team Zorba Coders is subscribed to branch lp:zorba.

-- 
Mailing list: https://launchpad.net/~zorba-coders
Post to : zorba-coders@lists.launchpad.net
Unsubscribe : https://launchpad.net/~zorba-coders
More help   : https://help.launchpad.net/ListHelp


[Zorba-coders] [Merge] lp:~zorba-coders/zorba/debugger_client_extras into lp:zorba

2012-01-09 Thread Zorba Build Bot
Validation queue starting for merge proposal.
Log at: 
http://zorbatest.lambda.nu:8080/remotequeue/debugger_client_extras-2012-01-09T15-36-08.398Z/log.html
-- 
https://code.launchpad.net/~zorba-coders/zorba/debugger_client_extras/+merge/87817
Your team Zorba Coders is subscribed to branch lp:zorba.

-- 
Mailing list: https://launchpad.net/~zorba-coders
Post to : zorba-coders@lists.launchpad.net
Unsubscribe : https://launchpad.net/~zorba-coders
More help   : https://help.launchpad.net/ListHelp


[Zorba-coders] [Merge] lp:~zorba-coders/zorba/debugger_client_extras into lp:zorba

2012-01-06 Thread Gabriel Petrovay
Gabriel Petrovay has proposed merging 
lp:~zorba-coders/zorba/debugger_client_extras into lp:zorba.

Requested reviews:
  Gabriel Petrovay (gabipetrovay)
  David Graf (davidagraf)

For more details, see:
https://code.launchpad.net/~zorba-coders/zorba/debugger_client_extras/+merge/87817

Fixed libedit search on mac issue.
Added history support from libedit for UNIX platforms.

-- 
https://code.launchpad.net/~zorba-coders/zorba/debugger_client_extras/+merge/87817
Your team Zorba Coders is subscribed to branch lp:zorba.
=== modified file 'bin/CMakeLists.txt'
--- bin/CMakeLists.txt	2012-01-03 12:10:06 +
+++ bin/CMakeLists.txt	2012-01-06 21:21:33 +
@@ -21,10 +21,10 @@
 IF (LIBEDIT_FOUND)
   INCLUDE_DIRECTORIES (${LIBEDIT_INCLUDE_DIRS})
   SET (LIBEDIT_LIBS ${LIBEDIT_LIBRARIES})
+  SET (ZORBA_HAVE_LIBEDIT_H ${LIBEDIT_FOUND})
 ENDIF (LIBEDIT_FOUND)
   ENDIF (NOT WIN32)
 
-  CHECK_INCLUDE_FILES (editline/readline.h ZORBA_HAVE_READLINE_H)
   CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/debugger/config.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/debugger/config.h)
   MESSAGE(STATUS configured ${CMAKE_CURRENT_SOURCE_DIR}/debugger/config.h.cmake -- ${CMAKE_CURRENT_BINARY_DIR}/debugger/config.h)
   INCLUDE_DIRECTORIES (BEFORE ${CMAKE_CURRENT_BINARY_DIR}/debugger)

=== modified file 'bin/debugger/command_prompt.cpp'
--- bin/debugger/command_prompt.cpp	2011-12-19 19:16:32 +
+++ bin/debugger/command_prompt.cpp	2012-01-06 21:21:33 +
@@ -20,19 +20,40 @@
 #include map
 #include iostream
 
-#include config.h
-
-#ifdef ZORBA_HAVE_READLINE_H
-# include editline/readline.h
-#endif
-
 #include command.h
 
 
 namespace zorba { namespace debugger {
 
+#ifdef ZORBA_HAVE_LIBEDIT_H
+const char*
+prompt(EditLine* aEl) {
+  return (xqdb) ;
+}
+#endif
+
+CommandPrompt::CommandPrompt()
+{
+#ifdef ZORBA_HAVE_LIBEDIT_H
+  theEditLine = el_init(xqdb, stdin, stdout, stderr);
+  theHistory = history_init();
+  HistEvent lHistoryEvent;
+  history(theHistory, lHistoryEvent, H_SETSIZE, 100);
+
+  el_set(theEditLine, EL_PROMPT, prompt);
+
+  el_set(theEditLine, EL_HIST, history, theHistory);
+  el_set(theEditLine, EL_EDITOR, emacs);
+#endif
+}
+
 CommandPrompt::~CommandPrompt()
 {
+#ifdef ZORBA_HAVE_LIBEDIT_H
+  history_end(theHistory);
+  el_end(theEditLine);
+#endif
+
   std::mapstd::string, UntypedCommand*::iterator lIter;
   for (lIter = theCommands.begin(); lIter != theCommands.end(); ++lIter) {
 delete lIter-second;
@@ -74,8 +95,11 @@
 CommandPrompt::execute()
 {
   for (;;) {
-#ifdef ZORBA_HAVE_READLINE_H
-std::string lCommandLine(readline((xqdb) ));
+#ifdef ZORBA_HAVE_LIBEDIT_H
+const char* lBuf;
+int lCharsRead = -1;
+lBuf = el_gets(theEditLine, lCharsRead);
+std::string lCommandLine(lBuf, lCharsRead - 1);
 #else
 std::cout  (xqdb) ;
 std::string lCommandLine;
@@ -94,6 +118,12 @@
 continue;
   }
 }
+#ifdef ZORBA_HAVE_LIBEDIT_H
+else {
+  HistEvent lHistoryEvent;
+  history(theHistory, lHistoryEvent, H_ENTER, lCommandLine.c_str());
+}
+#endif
 theLastArgs = lArgs;
 
 UntypedCommand* lCommand = NULL;

=== modified file 'bin/debugger/command_prompt.h'
--- bin/debugger/command_prompt.h	2011-11-16 09:32:47 +
+++ bin/debugger/command_prompt.h	2012-01-06 21:21:33 +
@@ -21,6 +21,12 @@
 #include map
 #include vector
 
+#include config.h
+
+#ifdef ZORBA_HAVE_LIBEDIT_H
+# include histedit.h
+#endif
+
 
 namespace zorba { namespace debugger {
 
@@ -29,6 +35,7 @@
 class CommandPrompt
 {
   public:
+CommandPrompt();
 ~CommandPrompt();
 
   public:
@@ -51,6 +58,11 @@
   private:
 std::mapstd::string, UntypedCommand*  theCommands;
 std::vectorstd::stringtheLastArgs;
+
+#ifdef ZORBA_HAVE_LIBEDIT_H
+EditLine*   theEditLine;
+History*theHistory;
+#endif
 };  
 
   

=== modified file 'bin/debugger/config.h.cmake'
--- bin/debugger/config.h.cmake	2011-12-19 19:16:32 +
+++ bin/debugger/config.h.cmake	2012-01-06 21:21:33 +
@@ -19,6 +19,6 @@
 #ifndef ZORBA_DEBUGGER_CONFIG_H
 #define ZORBA_DEBUGGER_CONFIG_H
 
-#cmakedefine ZORBA_HAVE_READLINE_H
+#cmakedefine ZORBA_HAVE_LIBEDIT_H
 
 #endif /* ZORBA_DEBUGGER_CONFIG_H */

-- 
Mailing list: https://launchpad.net/~zorba-coders
Post to : zorba-coders@lists.launchpad.net
Unsubscribe : https://launchpad.net/~zorba-coders
More help   : https://help.launchpad.net/ListHelp


Re: [Zorba-coders] [Merge] lp:~zorba-coders/zorba/debugger_client_extras into lp:zorba

2012-01-06 Thread Gabriel Petrovay
Review: Approve


-- 
https://code.launchpad.net/~zorba-coders/zorba/debugger_client_extras/+merge/87817
Your team Zorba Coders is subscribed to branch lp:zorba.

-- 
Mailing list: https://launchpad.net/~zorba-coders
Post to : zorba-coders@lists.launchpad.net
Unsubscribe : https://launchpad.net/~zorba-coders
More help   : https://help.launchpad.net/ListHelp