[Skyeye-developer] Fwd: SF.net SVN: skyeye: [282] skyeye-v1/trunk

Michael.Kang blackfin.kang at gmail.com
Wed Jul 25 15:58:57 CST 2007


---------- Forwarded message ----------
From: kangsh at users.sourceforge.net <kangsh at users.sourceforge.net>
Date: Jul 25, 2007 3:56 PM
Subject: SF.net SVN: skyeye: [282] skyeye-v1/trunk
To: blackfin.kang at gmail.com


Revision: 282
          http://skyeye.svn.sourceforge.net/skyeye/?rev=282&view=rev
Author:   kangsh
Date:     2007-07-25 00:56:25 -0700 (Wed, 25 Jul 2007)

Log Message:
-----------
Fix the compilation issue for "Make No_BFD"

Modified Paths:
--------------
    skyeye-v1/trunk/Makefile
    skyeye-v1/trunk/utils/main/skyeye.c

Modified: skyeye-v1/trunk/Makefile
===================================================================
--- skyeye-v1/trunk/Makefile    2007-07-25 07:23:00 UTC (rev 281)
+++ skyeye-v1/trunk/Makefile    2007-07-25 07:56:25 UTC (rev 282)
@@ -312,12 +312,15 @@
                        binary/skyeye_config.o \
                        binary/skyeye_options.o \
                        binary/skyeye.o \
-                       binary/symbol.o \
                        binary/skyeye_arch.o \
                        binary/skyeye_portable_mman.o \
                        binary/skyeye_portable_gettimeofday.o \
                        binary/skyeye_portable_usleep.o
+ifndef NO_BFD
+SIM_UTILS_OBJS +=      binary/symbol.o
+endif

+
 SIM_ARM = $(SIM_ARM_OBJS) \
        $(SIM_MMU_OBJS) \
        $(ARM2X86_O_FILES) \

Modified: skyeye-v1/trunk/utils/main/skyeye.c
===================================================================
--- skyeye-v1/trunk/utils/main/skyeye.c 2007-07-25 07:23:00 UTC (rev 281)
+++ skyeye-v1/trunk/utils/main/skyeye.c 2007-07-25 07:56:25 UTC (rev 282)
@@ -18,8 +18,6 @@
  *  teawater <c7code-uc at yahoo.com.cn> add elf load function in 2005.08.30
  */

-//#include "armdefs.h"
-//#include "armemu.h"

 #ifdef __CYGWIN__
 #include <getopt.h>
@@ -45,29 +43,37 @@

 #include <setjmp.h>

+/**
+ * A global variable , point to the current archtecture
+ */
 generic_arch_t *arch_instance;

+/**
+ *  name of current config file
+ */
 char *skyeye_config_filename = NULL;
+
+/*
+ *  the file description of log
+ */
 extern FILE *skyeye_logfd;
-static int verbosity;
 int big_endian = 0;
-static int mem_size = (1 << 21);
-static FILE *pf;
 int global_argc;
 char **global_argv;
 int stop_simulator = 0;
 int debugmode = 0;
 jmp_buf ctrl_c_cleanup;

-//chy 2005-08-01, borrow from wlm's 2005-07-26's change
 static void
 base_termios_exit (void)
 {
        //tcsetattr (STDIN_FILENO, TCSANOW, &(state->base_termios));
 }

-//chy 2005-08-01 ---------------------------------------------
 extern int init_register_type();
+/**
+ *  Initialize all the gloval variable
+ */
 static int
 init ()
 {
@@ -126,6 +132,9 @@
 extern ARMul_State * state;
 extern struct SkyEye_ICE skyeye_ice;

+/**
+ *  step run for the simulator
+ */
 void
 sim_resume (int step)
 {
@@ -180,19 +189,21 @@
                                WORD pc = arch_instance->get_pc();
                                if (pc >= skyeye_config.log.start &&
                                            pc <= skyeye_config.log.end) {
-                                       fprintf (skyeye_logfd,
-                                                         "pc=0x%x", pc);
+#ifndef NO_BFD
                                        char * func_name = get_sym(pc);
                                        if(func_name)
-                                               fprintf
(skyeye_logfd,", in %s", func_name);
+                                               fprintf
(skyeye_logfd,"\n in %s\n", func_name);
+#endif
                                /*
                                        if (skyeye_config.log.logon >= 2)
+                                               fprintf (skyeye_logfd,
+                                                         "pc=0x%x", pc);
+
                                                SKYEYE_OUTREGS (skyeye_logfd);
                                        if (skyeye_config.log.logon >= 3)
                                                SKYEYE_OUTMOREREGS
                                                        (skyeye_logfd);
                                */
-                                       fprintf (skyeye_logfd, "\n");
                                }
                        }/* if (skyeye_config.log.logon >= 1) */

@@ -200,7 +211,10 @@
                }while(!step);
        }
 }
-/* add by michael.Kang, to load elf file to another address */
+
+/**
+ * add by michael.Kang, to load elf file to another address
+ */
 static unsigned long load_addr = 0x0;
 static unsigned long load_addr_mask = 0xffffffff;

@@ -400,7 +414,7 @@
        printf ("exec file \"%s\"'s format is %s.\n", file,
                tmp_bfd->xvec->name);

-       //load
+       /* load the corresponding section to memory */
        for (s = tmp_bfd->sections; s; s = s->next) {
                if (bfd_get_section_flags (tmp_bfd, s) & (SEC_LOAD)) {
             if (bfd_section_lma (tmp_bfd, s) != bfd_section_vma (tmp_bfd, s)) {
@@ -537,6 +551,9 @@
 }
 #endif

+/**
+ *  The main function of skyeye
+ */

 int
 main (int argc, char **argv)
@@ -690,10 +707,12 @@
                        fprintf (stderr, "load \"%s\" error\n", exec_file);
                        goto exit_skyeye;
                }
+#ifndef NO_BFD
+               /* get its symbol to debug */
+               init_symbol_table(exec_file);
+#endif
        }
-       /* get its symbol to debug */
-       init_symbol_table(exec_file);
-//AJ2D--------------------------------------------------------------------------
+       //AJ2D--------------------------------------------------------------------------
        if (skyeye_config.start_address != 0){
                unsigned long addr = (skyeye_config.start_address &
load_addr_mask)|load_addr;
                arch_instance->set_pc (addr);


This was sent by the SourceForge.net collaborative development
platform, the world's largest Open Source development site.


-- 
www.skyeye.org



More information about the Skyeye-developer mailing list