• 公众演讲
  • 竞聘演讲
  • 就职演说
  • 安全生产
  • 爱国演讲
  • 英语演讲
  • 开幕闭幕
  • 庆典致辞
  • 领导讲话
  • 婚丧嫁娶
  • 祝福祝贺
  • 主持词
  • 广播稿
  • 贺电慰问
  • 会议发言
  • 国旗下讲话
  • 标语大全
  • 导游词
  • 经典语录
  • 您现在的位置:站轩范文网 > 演讲稿 > 主持词 > 正文

    Gdb/Armulator,源代码分析_spss主成分分析步骤

    来源:站轩范文网 时间:2018-08-25

    作者Email: Anti_chen2000@sohu.com

        摘要

        Gdb/Armulator 是Gdb自带的arm7模拟器,是调试arm程序的一个好工具.而了解它的原码结构对扩展它的IO功能有重要意义.本文介绍了从Armulator的启动到其内部运作和IO扩展的大部分原代码功能.

        说明

        源代码用的是gdb-5.0.tar+ gdb-5.0-uclinux-armulator-20021127.patch

        A. 和GDB间的通迅

        Armulator一般和Gdb通讯有两种方式,其一是在Gdb内部直接调用模拟器的相关函数,另一方法则是用pipe或socket传递RDP协议来连接Gdb和Amulator.而第一种方法是现在Gdb/Armulator所真正使用的(第二种是早期使用的方法),下面就分析了函数直接调用法.

        函数直接调用

    这个方法是由Steve (sac@cygnus.com) 修改原RDP方法而来的,Steve本人的描述如下:
    /******************************************************
    This directory contains the standard release of the ARMulator from
    Advanced RISC Machines, and was ftp"d from.

    ftp.cl.cam.ac.uk:/arm/gnu

    It likes to use TCP/IP between the simulator and the host, which is
    nice, but is a pain to use under anything non-unix.

    I"ve added created a new Makefile.in (the original in Makefile.orig)
    to build a version of the simulator without the TCP/IP stuff, and a
    wrapper.c to link directly into gdb and the run command.

    It should be possible (barring major changes in the layout of
    the armulator) to upgrade the simulator by copying all the files
    out of a release into this directory and renaming the Makefile.

    (Except that I changed armos.c to work more simply with our
    simulator rigs)
    ********************************************************/
    /gdb/target.c,/gdb/remote_sim.c以及在/sim/arm/wrapper.c是在Armulator和Gdb的通信中起着至关重要做用的几个文件.所有的Gdb调试命令最后都是通过在target.h里定义的target_ops结构中的函数指针调用在/sim/arm/wrapper.c中型如sim_xxx的函数完成的.以前这些sim_xxx函数是位于/sim/common中的,是建立RDP通讯的关键,代码修改后此目录中的文件不再有用,被wrapper.c取而代之了.

    以下是RDP 通讯和直接函数调用的图示:

    要清楚Armulator的执行过程就要从它的启动说起,当你在Gdb中键入target sim 去激活Amulator后Gdb首先进行命令行解释,并将current_target指针指向sim变量,即将Armulator的调试函数集赋予Gdb,随后的函数调用堆栈如下:

    --àgdbsim_open (…) in remote-sim.c.
    --àsim_open(…) in /sim/arm/wrapper.c /*这里Amulator对调用参数进行分析处理*/
    --à*current_target->to_fetch_registers(-1) /*此函数指针实

    [1] [2] [3] [4] [5] [6] [7] [8] 下一页

    推荐访问:源代码分析 gdb性能分析