激情欧美日韩一区二区,浪货撅高贱屁股求主人调教视频,精品无码成人片一区二区98,国产高清av在线播放,色翁荡息又大又硬又粗视频

Gdb/Armulator 源代碼分析

時(shí)間:2024-05-09 00:10:45 理工畢業(yè)論文 我要投稿
  • 相關(guān)推薦

Gdb/Armulator 源代碼分析

作者Email: Anti_chen2000@sohu.com

摘要

Gdb/Armulator 是Gdb自帶的arm7模擬器,是調試arm程序的一個(gè)好工具.而了解它的原碼結構對擴展它的IO功能有重要意義.本文介紹了從Armulator的啟動(dòng)到其內部運作和IO擴展的大部分原代碼功能.

說(shuō)明

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

A.和GDB間的通迅

Armulator一般和Gdb通訊有兩種方式,其一是在Gdb內部直接調用模擬器的相關(guān)函數,另一方法則是用pipe或socket傳遞RDP協(xié)議來(lái)連接Gdb和Amulator.而第一種方法是現在Gdb/Armulator所真正使用的(第二種是早期使用的方法),下面就分析了函數直接調用法.

函數直接調用

這個(gè)方法是由Steve (sac@cygnus.com) 修改原RDP方法而來(lái)的,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是在A(yíng)rmulator和Gdb的通信中起著(zhù)至關(guān)重要做用的幾個(gè)文件.所有的Gdb調試命令最后都是通過(guò)在target.h里定義的target_ops結構中的函數指針調用在/sim/arm/wrapper.c中型如sim_xxx的函數完成的.以前這些sim_xxx函數是位于/sim/common中的,是建立RDP通訊的關(guān)鍵,代碼修改后此目錄中的文件不再有用,被wrapper.c取而代之了.

以下是RDP 通訊和直接函數調用的圖示:

要清楚Armulator的執行過(guò)程就要從它的啟動(dòng)說(shuō)起,當你在Gdb中鍵入target sim 去激活Amulator后Gdb首先進(jìn)行命令行解釋,并將current_target指針指向sim變量,即將Armulator的調試函數集賦予Gdb,隨后的函數調用堆棧如下:

--àgdbsim_open (…) in remote-sim.c.
--àsim_open(…) in /sim/arm/wrapper.c/*這里Amulator對調用參數進(jìn)行分析處理*/
--à*current_target-

【Gdb/Armulator 源代碼分析】相關(guān)文章:

免費vc++網(wǎng)上尋呼QICQ源代碼(附帶論文)(一)11-22

delphi源代碼+可執行文件+考試系統(一)03-07

delphi+access網(wǎng)絡(luò )考試系統[開(kāi)題報告+論文+源代碼+答辯ppt+03-07

分析哲學(xué)與哲學(xué)分析03-07

分析魏晉文人的生命的價(jià)值分析03-18

“案例分析”應重在分析-關(guān)于搞好“案例分析”的若干想法12-03

分析魏晉文人的生命的價(jià)值分析論文11-16

論聚類(lèi)分析在市場(chǎng)分析中的應用03-19

談聚類(lèi)分析在市場(chǎng)分析中的應用03-18

激情欧美日韩一区二区,浪货撅高贱屁股求主人调教视频,精品无码成人片一区二区98,国产高清av在线播放,色翁荡息又大又硬又粗视频