Ecore_Getopt?

On Friday, June 29, 2012, Enlightenment SVN wrote:

> Log:
> elev8: Add JavaScript debugger support
>
>  To use the v8 debugger (d8), simply run elev8 with the "--debug"
> parameter,
>  then the script name.  On another terminal, run ``d8 --remote_debugger''
> --
>  when connected, breakpoints can be set, etc.  Type ``help'' on d8 command
>  line for available commands.  To resume execution, use ``continue''.
>
> Author:       acidx
> Date:         2012-06-29 10:03:05 -0700 (Fri, 29 Jun 2012)
> New Revision: 73048
> Trac:         http://trac.enlightenment.org/e/changeset/73048
>
> Modified:
>  trunk/PROTO/elev8/src/bin/main.cc
>
> Modified: trunk/PROTO/elev8/src/bin/main.cc
> ===================================================================
> --- trunk/PROTO/elev8/src/bin/main.cc   2012-06-29 17:03:02 UTC (rev 73047)
> +++ trunk/PROTO/elev8/src/bin/main.cc   2012-06-29 17:03:05 UTC (rev 73048)
> @@ -5,11 +5,12 @@
>  * then exit
>  */
>
> -#include <unistd.h>
>  #include <dlfcn.h>
>  #include <Ecore.h>
>  #include <elev8_common.h>
>  #include <elev8_utils.h>
> +#include <unistd.h>
> +#include <v8-debug.h>
>  #include "storage.h"
>  #include "timer.h"
>
> @@ -283,9 +284,25 @@
>    boom(message, *String::Utf8Value(message->Get()));
>  }
>
> +static Eina_Bool
> +debug_message_handler_idler_cb(void *)
> +{
> +   DBG("Processing debug messages");
> +   Debug::ProcessDebugMessages();
> +   return ECORE_CALLBACK_CANCEL;
> +}
> +
> +static void
> +debug_message_handler()
> +{
> +   ecore_idler_add(debug_message_handler_idler_cb, NULL);
> +}
> +
>  int
> -main(int argc, char **argv)
> +main(int argc, char *argv[])
>  {
> +   int script_arg = 1;
> +
>    eina_init();
>    elev8_log_domain = eina_log_domain_register("elev8", EINA_COLOR_ORANGE);
>    if (!elev8_log_domain)
> @@ -296,6 +313,10 @@
>      }
>    INF("elev8 Logging initialized. %d", elev8_log_domain);
>
> +   V8::SetFlagsFromCommandLine(&argc, argv, true);
> +   V8::AddMessageListener(message, Undefined());
> +   V8::SetCaptureStackTraceForUncaughtExceptions(true, 10,
> StackTrace::kDetailed);
> +
>    if (argc < 2)
>      {
>         ERR("%s: Error: no input file specified.", argv[0]);
> @@ -305,11 +326,14 @@
>              argv[0], argv[0]);
>         exit(-1);
>      }
> +   else if (argc >= 3 && !strcmp(argv[1], "--debug"))
> +     {
> +        printf("Awaiting connection from debugger on port 5858.");
> +        Debug::EnableAgent("elev8", 5858, true);
> +        Debug::SetDebugMessageDispatchHandler(debug_message_handler);
> +        script_arg = 2;
> +     }
>
> -   V8::SetFlagsFromCommandLine(&argc, argv, true);
> -   V8::AddMessageListener(message, Undefined());
> -   V8::SetCaptureStackTraceForUncaughtExceptions(true, 10,
> StackTrace::kDetailed);
> -
>    HandleScope handle_scope;
>    global = Persistent<ObjectTemplate>::New(ObjectTemplate::New());
>
> @@ -327,7 +351,7 @@
>
>    if (!run_script(PACKAGE_LIB_DIR "/../init.js"))
>      goto end;
> -   if (!run_script(argv[1]))
> +   if (!run_script(argv[script_arg]))
>      goto end;
>
>    ecore_main_loop_begin();
>
>
>
> ------------------------------------------------------------------------------
> Live Security Virtual Conference
> Exclusive live event will cover all the ways today's security and
> threat landscape has changed and how IT managers can respond. Discussions
> will include endpoint security, mobile security and the latest in malware
> threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
> _______________________________________________
> enlightenment-svn mailing list
> [email protected] <javascript:;>
> https://lists.sourceforge.net/lists/listinfo/enlightenment-svn
>


-- 
Gustavo Sverzut Barbieri
http://profusion.mobi embedded systems
--------------------------------------
MSN: [email protected]
Skype: gsbarbieri
Mobile: +55 (19) 9225-2202
------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
enlightenment-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel

Reply via email to