Search
lxdream.org :: lxdream/src/main.c :: diff
lxdream 0.9.1
released Jun 29
Download Now
filename src/main.c
changeset 998:1754a8c6a9cf
prev968:6fb1481859a4
next1015:ad448bedc48a
author nkeynes
date Tue Mar 24 11:15:57 2009 +0000 (12 years ago)
permissions -rw-r--r--
last change Add preliminary implementation of the GDB remote debugging server - attaches to
either or both the SH4 and ARM
file annotate diff log raw
1.1 --- a/src/main.c Thu Jan 15 11:23:20 2009 +0000
1.2 +++ b/src/main.c Tue Mar 24 11:15:57 2009 +0000
1.3 @@ -34,14 +34,16 @@
1.4 #include "gdrom/gdrom.h"
1.5 #include "maple/maple.h"
1.6 #include "sh4/sh4.h"
1.7 +#include "aica/armdasm.h"
1.8
1.9 -
1.10 -char *option_list = "a:A:c:dhHl:m:npt:T:uvV:x?";
1.11 +char *option_list = "a:A:c:dg:G:hHl:m:npt:T:uvV:x?";
1.12 struct option longopts[] = {
1.13 { "aica", required_argument, NULL, 'a' },
1.14 { "audio", required_argument, NULL, 'A' },
1.15 { "config", required_argument, NULL, 'c' },
1.16 { "debugger", no_argument, NULL, 'D' },
1.17 + { "gdb-sh4", required_argument, NULL, 'g' },
1.18 + { "gdb-arm", required_argument, NULL, 'G' },
1.19 { "help", no_argument, NULL, 'h' },
1.20 { "headless", no_argument, NULL, 'H' },
1.21 { "log", required_argument, NULL,'l' },
1.22 @@ -56,6 +58,8 @@
1.23 char *display_driver_name = NULL;
1.24 char *audio_driver_name = NULL;
1.25 char *trace_regions = NULL;
1.26 +char *sh4_gdb_port = NULL;
1.27 +char *arm_gdb_port = NULL;
1.28 gboolean start_immediately = FALSE;
1.29 gboolean no_start = FALSE;
1.30 gboolean headless = FALSE;
1.31 @@ -78,6 +82,8 @@
1.32 printf( " -A, --audio=DRIVER %s\n", _("Use the specified audio driver (? to list)") );
1.33 printf( " -c, --config=CONFFILE %s\n", _("Load configuration from CONFFILE") );
1.34 printf( " -d, --debugger %s\n", _("Start in debugger mode") );
1.35 + printf( " -g, --gdb-sh4=PORT %s\n", _("Start GDB remote server on PORT for SH4") );
1.36 + printf( " -G, --gdb-arm=PORT %s\n", _("Start GDB remote server on PORT for ARM") );
1.37 printf( " -h, --help %s\n", _("Display this usage information") );
1.38 printf( " -H, --headless %s\n", _("Run in headless (no video) mode") );
1.39 printf( " -l, --log=LEVEL %s\n", _("Set the output log level") );
1.40 @@ -130,6 +136,12 @@
1.41 case 'd': /* Launch w/ debugger */
1.42 show_debugger = TRUE;
1.43 break;
1.44 + case 'g':
1.45 + sh4_gdb_port = optarg;
1.46 + break;
1.47 + case 'G':
1.48 + arm_gdb_port = optarg;
1.49 + break;
1.50 case 'h': /* help */
1.51 case '?':
1.52 print_usage();
1.53 @@ -242,6 +254,16 @@
1.54
1.55 sh4_translate_set_enabled( use_xlat );
1.56
1.57 + /* If requested, start the gdb server immediately before we go into the main
1.58 + * loop.
1.59 + */
1.60 + if( sh4_gdb_port != NULL ) {
1.61 + gdb_init_server( NULL, strtol(sh4_gdb_port,NULL,0), &sh4_cpu_desc, TRUE );
1.62 + }
1.63 + if( arm_gdb_port != NULL ) {
1.64 + gdb_init_server( NULL, strtol(arm_gdb_port,NULL,0), &arm_cpu_desc, TRUE );
1.65 + }
1.66 +
1.67 if( headless ) {
1.68 dreamcast_run();
1.69 } else {
.