亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? porting.texi

?? 俄羅斯高人Mamaich的Pocket gcc編譯器(運行在PocketPC上)的全部源代碼。
?? TEXI
?? 第 1 頁 / 共 5 頁
字號:
* Memory Support::      Memory support.* Misc Support::        Other needed functions.* Debugging::            Useful Debugging Functions@end menu@node I/O Support, Memory Support, , Libc@subsection Making I/O work@node Memory Support, Misc Support, I/O Support, Libc@subsection Routines for dynamic memory allocationTo support using any of the memory functions, you need to implementsbrk(). @code{malloc()}, @code{calloc()}, and @code{realloc()} all call@code{sbrk()} at there lowest level. @code{caddr_t} is defined elsewhereas @code{char *}. @code{RAMSIZE} is presently a compile time option. Allthis does is move a pointer to heap memory and check for the upperlimit. @ref{glue.c,,Example libc support code}. @code{sbrk()} returns apointer to the previous value before more memory was allocated.@smallexample/* _end is set in the linker command file *extern caddr_t _end;//* just in case, most boards have at least some memory */#ifndef RAMSIZE#  define RAMSIZE             (caddr_t)0x100000#endif/* * sbrk -- changes heap size size. Get nbytes more *         RAM. We just increment a pointer in what's *         left of memory on the board. */caddr_tsbrk(nbytes)     int nbytes;@{  static caddr_t heap_ptr = NULL;  caddr_t        base;  if (heap_ptr == NULL) @{    heap_ptr = (caddr_t)&_end;  @}  if ((RAMSIZE - heap_ptr) >= 0) @{    base = heap_ptr;    heap_ptr += nbytes;    return (base);  @} else @{    errno = ENOMEM;    return ((caddr_t)-1);  @}@}@end smallexample@node Misc Support, Debugging, Memory Support, Libc@subsection Misc support routinesThese are called by @code{newlib} but don't apply to the embeddedenvironment. @code{isatty()} is self explanatory. @code{kill()} doesn'tapply either in an environment withno process control, so it justsexits, which is a similar enough behavior. @code{getpid()} can safelyreturn any value greater than 1. The value doesn't effect anything in@code{newlib} because once again there is no process control.@smallexample/* * isatty -- returns 1 if connected to a terminal device, *           returns 0 if not. Since we're hooked up to a *           serial port, we'll say yes and return a 1. */intisatty(fd)     int fd;@{  return (1);@}/* * getpid -- only one process, so just return 1. */#define __MYPID 1intgetpid()@{  return __MYPID;@}/* * kill -- go out via exit... */intkill(pid, sig)     int pid;     int sig;@{  if(pid == __MYPID)    _exit(sig);  return 0;@}@end smallexample@node Debugging, , Misc Support, Libc@subsection Useful debugging functionsThere are always a few useful functions for debugging your project inprogress. I typically implement a simple @code{print()} routine thatruns standalone in liblgoss, with no @code{newlib} support. The I/Ofunction @code{outbyte()} can also be used for low level debugging. Manytimes print will work when there are problems that cause @code{printf()} tocause an exception. @code{putnum()} is just to print out values in hexso they are easier to read.@smallexample/* * print -- do a raw print of a string */ intprint(ptr)char *ptr;@{  while (*ptr) @{    outbyte (*ptr++);  @}@}/* * putnum -- print a 32 bit number in hex */intputnum (num)unsigned int num;@{  char  buffer[9];  int   count;  char  *bufptr = buffer;  int   digit;    for (count = 7 ; count >= 0 ; count--) @{    digit = (num >> (count * 4)) & 0xf;        if (digit <= 9)      *bufptr++ = (char) ('0' + digit);    else      *bufptr++ = (char) ('a' - 10 + digit);  @}  *bufptr = (char) 0;  print (buffer);  return;@}@end smallexampleIf there are LEDs on the board, they can also be put to use fordebugging when the serial I/O code is being written. I usually implementa @code{zylons()} function, which strobes the LEDS (if there is morethan one) in sequence, creating a rotating effect. This is convenientbetween I/O to see if the target is still alive. Another useful LEDfunction is @code{led_putnum()}, which takes a digit and displays it asa bit pattern or number. These usually have to be written in assemblerfor each target board. Here are a number of C based routines that may beuseful.@code{led_putnum()} puts a number on a single digit segmentedLED display. This LED is set by setting a bit mask to an address, where1 turns the segment off, and 0 turns it on. There is also a littledecimal point on the LED display, so it gets the leftmost bit. The otherbits specify the segment location. The bits look like:@smallexample        [d.p | g | f | e | d | c | b | a ] is the byte.@end smallexampleThe locations are set up as:@smallexample              a           -----        f |     | b          |  g  |           -----          |     |        e |     | c           -----             d@end smallexampleThis takes a number that's already been converted to a string, andprints it. @smallexample#define LED_ADDR	0xd00003voidled_putnum ( num )char num;@{    static unsigned char *leds = (unsigned char *)LED_ADDR;    static unsigned char num_bits [18] = @{      0xff,						/* clear all */      0xc0, 0xf9, 0xa4, 0xb0, 0x99, 0x92, 0x82, 0xf8, 0x80, 0x98, /* numbers 0-9 */      0x98, 0x20, 0x3, 0x27, 0x21, 0x4, 0xe 		/* letters a-f */    @};    if (num >= '0' && num <= '9')      num = (num - '0') + 1;    if (num >= 'a' && num <= 'f')      num = (num - 'a') + 12;    if (num == ' ')      num = 0;    *leds = num_bits[num];@}/* * zylons -- draw a rotating pattern. NOTE: this function never returns. */voidzylons()@{  unsigned char *leds 	= (unsigned char *)LED_ADDR;  unsigned char curled = 0xfe;  while (1)    @{      *leds = curled;      curled = (curled >> 1) | (curled << 7);      delay ( 200 );    @}@}@end smallexample@node GDB, Binutils, Libraries, Top@chapter Writing a new GDB backendTypically, either the low-level I/O routines are used for debugging, orLEDs, if present. It is much easier to use GDb for debugging anapplication. There are several different techniques used to have GDB workremotely. Commonly more than one kind of GDB interface is used to cobera wide variety of development needs.The most common style of GDB backend is an exception handler forbreakpoints. This is also called a @emph{gdb stub}, and is requires thetwo additional lines of init code in your @code{main()} routine. The GDBstubs all use the GDB @emph{remote protocol}. When the application gets abreakpoint exception, it communicates to GDB on the host.Another common style of interfacing GDB to a target is by using anexisting ROM monitor. These break down into two main kinds, a similarprotocol to the GDB remote protocol, and an interface that uses the ROMmonitor directly. This kind has GDB simulating a human operator, and allGDB does is work as a command formatter and parser. @menu* GNU remote protocol::         The standard remote protocol.* Exception handler::           A linked in exception handler.* ROM monitors::                Using a ROM monitor as a backend.* Other remote protocols::      Adding support for new protocols.@end menu@node GNU remote protocol, Exception handler, ,GDB@section The standard remote protocolThe standard remote protocol is a simple, packet based scheme. A debugpacket whose contents are @emph{<data>} is encapsulated for transmissionin the form:@smallexample	$ <data> # CSUM1 CSUM2@end smallexample@emph{<data>} must be ASCII alphanumeric and cannot include characters@code{$} or @code{#}.  If @emph{<data>} starts with two charactersfollowed by @code{:}, then the existing stubs interpret this as asequence number. For example, the command @code{g} is used to read thevalues of the registers. So, a packet to do this would look like@smallexample        $g#67@end smallexample@emph{CSUM1} and @emph{CSUM2} are an ascii representation in hex of an8-bit checksum of @emph{<data>}, the most significant nibble is sent first.the hex digits 0-9,a-f are used.A simple protocol is used when communicating with the target. This ismainly to give a degree of error handling over the serial cable. Foreach packet transmitted successfully, the target responds with a@code{+} (@code{ACK}). If there was a transmission error, then the targetresponds with a @code{-} (@code{NAK}). An error is determined when thechecksum doesn't match the calculated checksum for that data record.Upon reciept of the @code{ACK}, @code{GDB} can then transmit the nextpacket. Here is a list of the main functions that need to be supported. Each datapacket is a command with a set number of bytes in the command packet.Most commands either return data, or respond with a @code{NAK}. Commandsthat don't return data respond with an @code{ACK}. All data values areascii hex digits. Every byte needs two hex digits to represent t. Thismeans that a byte with the value @samp{7} becomes @samp{07}. On a 32 bitmachine this works out to 8 characters per word. All of the bytes in aword are stored in the target byte order. When writing the host side ofthe GDB protocol, be careful of byte order, and make sure that the codewill run on both big and little endian hosts and produce the same answers.These functions are the minimum required to make a GDB backend work. Allother commands are optional, and not supported by all GDB backends.@table @samp@item  read registers  @code{g}returns @code{XXXXXXXX...}Registers are in the internal order for GDB, and the bytes in a registerare in the same order the machine uses. All values are in sequencestarting with register 0. All registers are listed in the same packet. Asample packet would look like @code{$g#}.@item	write registers	@code{GXXXXXXXX...}@code{XXXXXXXX} is the value to set the register to.  Registers are inthe internal order for GDB, and the bytes in a register are in the sameorder the machine uses. All values are in sequence starting withregister 0. All registers values are listed in the same packet. A samplepacket would look like @code{$G000000001111111122222222...#}returns @code{ACK} or @code{NAK}@item	read memory     @code{mAAAAAAAA,LLLL}@code{AAAAAAAA} is address, @code{LLLL} is length. A sample packet wouldlook like @code{$m00005556,0024#}. This would request 24 bytes startingat address @emph{00005556}returns @code{XXXXXXXX...}@code{XXXXXXXX} is the memory contents. Fewer bytes than requested willbe returned if only part of the data can be read. This can be determinedby counting the values till the end of packet @code{#} is seen andcomparing that with the total count of bytes that was requested.@item	write memory	@code{MAAAAAAAA,LLLL:XXXXXXXX}@code{AAAAAAAA} is the starting address, @code{LLLL} is the number ofbytes to be written, and @code{XXXXXXXX} is value to be written. Asample packet would look like@code{$M00005556,0024:101010101111111100000000...#}returns @code{ACK} or @code{NAK} for an error. @code{NAK} is alsoreturned when only part of the data is written.@item	continue	@code{cAAAAAAAAA}@code{AAAAAAAA} is address to resume execution at. If @code{AAAAAAAA} isomitted, resume at the curent address of the @code{pc} register.returns the same replay as @code{last signal}. There is no immediatereplay to @code{cont} until the next breakpoint is reached, and theprogram stops executing.@item	step		sAA..AA@code{AA..AA} is address to resumeIf @code{AA..AA} is omitted, resume at same address.returns the same replay as @code{last signal}. There is no immediatereplay to @code{step} until the next breakpoint is reached, and theprogram stops executing.@item	last signal     @code{?}This returns one of the following:@itemize @bullet@item @code{SAA}Where @code{AA} is the number of the last signal.Exceptions on the target are converted to the most similar Unix stylesignal number, like @code{SIGSEGV}. A sample response of this type wouldlook like @code{$S05#}.@item TAAnn:XXXXXXXX;nn:XXXXXXXX;nn:XXXXXXXX;@code{AA} is the signal number.@code{nn} is the register number.@code{XXXXXXXX} is the register value.@item WAAThe process exited, and @code{AA} is the exit status.  This is onlyapplicable for certains sorts of targets.@end itemizeThese are used in some GDB backends, but not all. @item write reg         @code{Pnn=XXXXXXXX}Write register @code{nn} with value @code{XXXXXXXX}.returns @code{ACK} or @code{NAK}@item	kill request	k@item	toggle debug	dtoggle debug flag (see 386 & 68k stubs)@item	reset		rreset -- see sparc stub.@item	reserved	@code{other}On other requests, the stub should ignore the request and send an emptyresponse @code{$#<checksum>}.  This way we can extend the protocol and GDBcan tell whether the stub it is	talking to uses the old or the new.@item	search		@code{tAA:PP,MM}Search backwards starting at address @code{AA} for a match with patternPP and mask @code{MM}. @code{PP} and @code{MM} are 4 bytes.

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
精品少妇一区二区三区日产乱码| 在线看国产日韩| 色婷婷av久久久久久久| 91麻豆精品国产91久久久久久 | 欧美综合天天夜夜久久| 91精品欧美综合在线观看最新| 国产欧美日韩综合精品一区二区| 亚洲aaa精品| 色综合久久88色综合天天免费| 日韩欧美在线1卡| 亚洲动漫第一页| 在线观看一区不卡| 日韩美女视频一区二区| 福利电影一区二区| 国产午夜久久久久| 国产一区二区免费视频| 欧美日韩久久一区| 亚洲国产日韩在线一区模特| 91香蕉国产在线观看软件| 国产亚洲综合色| 国产精品一区在线观看你懂的| 欧美刺激午夜性久久久久久久| 欧美一二三四在线| 亚洲一区二区三区四区在线观看 | 久久婷婷成人综合色| 婷婷成人激情在线网| 日本久久电影网| 成人欧美一区二区三区| 丰满少妇久久久久久久| 精品粉嫩超白一线天av| 久久99深爱久久99精品| 欧美α欧美αv大片| 奇米影视一区二区三区| 日韩一区二区在线看片| 亚洲成人动漫在线免费观看| 欧美视频中文字幕| 性久久久久久久久久久久| 欧美吻胸吃奶大尺度电影| 国产麻豆视频精品| 亚洲曰韩产成在线| 99在线精品观看| 亚洲美女精品一区| 欧美自拍偷拍午夜视频| 亚洲国产视频直播| 欧美一区二区三区不卡| 国产一区二区美女诱惑| 日本一区二区三区在线不卡| 91在线观看一区二区| 亚洲亚洲人成综合网络| 日韩一区二区三区在线| 国产盗摄精品一区二区三区在线 | 精品一区免费av| 久久精品视频一区二区| 91网址在线看| 亚洲成人手机在线| 精品国产一区二区三区不卡| 成人午夜电影小说| 1区2区3区国产精品| 日韩精品一区在线观看| av电影一区二区| 亚洲一区中文在线| 日韩欧美在线123| 不卡的av电影| 美女在线一区二区| 国产精品理论片| 欧美日韩色综合| 国产成人综合亚洲网站| 一区二区理论电影在线观看| 精品三级在线看| 欧美主播一区二区三区美女| 国产一区二区成人久久免费影院| 一区二区三区四区不卡视频 | 亚洲精品一区二区三区福利| 成人午夜视频在线| 日本伊人色综合网| 综合久久综合久久| 精品国产乱码久久久久久牛牛| www.久久久久久久久| 麻豆精品久久精品色综合| 亚洲男人电影天堂| 亚洲国产精品传媒在线观看| 欧美喷水一区二区| www.亚洲激情.com| 国产精品一区二区久激情瑜伽| 亚洲午夜成aⅴ人片| 国产亚洲精品免费| 日韩美女天天操| 欧美在线视频你懂得| 国产·精品毛片| 国产一区二区三区在线观看免费视频 | 国产精品麻豆久久久| 日韩一区二区三区视频| 在线一区二区三区| 风流少妇一区二区| 韩国毛片一区二区三区| 免费高清不卡av| 日韩国产精品大片| 亚洲二区视频在线| 亚洲综合激情网| 一区二区三区免费看视频| 国产精品乱人伦中文| 国产精品天干天干在观线 | 91精品国产综合久久香蕉麻豆| 91麻豆国产香蕉久久精品| 福利一区二区在线| 国产98色在线|日韩| 国产一区在线不卡| 国产一区二区三区四区五区美女| 天堂蜜桃一区二区三区| 亚洲福利视频导航| 日日摸夜夜添夜夜添亚洲女人| 亚洲一区二区三区国产| 亚洲尤物在线视频观看| 亚洲中国最大av网站| 亚洲国产精品一区二区久久| 一区二区三区精品在线观看| 亚洲成人免费在线| 石原莉奈一区二区三区在线观看| 天堂av在线一区| 欧美aⅴ一区二区三区视频| 日韩激情av在线| 另类调教123区| 国产在线看一区| 成人激情av网| 色婷婷国产精品综合在线观看| 色综合色综合色综合色综合色综合| 97精品视频在线观看自产线路二| 91福利精品第一导航| 欧美日本不卡视频| 欧美成人精精品一区二区频| 久久久久久久精| 亚洲蜜臀av乱码久久精品蜜桃| 亚洲国产精品嫩草影院| 看国产成人h片视频| 国产伦精品一区二区三区免费迷| 粉嫩av一区二区三区粉嫩| 91在线视频免费91| 91精品欧美综合在线观看最新 | 91 com成人网| 久久九九久久九九| 伊人色综合久久天天人手人婷| 日韩一区欧美二区| 国产91精品欧美| 欧美丰满少妇xxxbbb| 久久久久久久久岛国免费| 亚洲精品视频观看| 久久99国产精品久久99果冻传媒| 99久久国产免费看| 日韩免费视频线观看| 亚洲免费观看在线观看| 免费成人你懂的| 成人av集中营| 日韩一区二区三区电影| 亚洲三级在线看| 久久97超碰国产精品超碰| 日本道在线观看一区二区| 久久婷婷国产综合国色天香| 亚洲一区二区三区四区在线观看 | 亚洲欧洲日韩综合一区二区| 亚洲成在人线在线播放| 高清不卡在线观看| 91精品黄色片免费大全| 亚洲视频一区二区免费在线观看| 久久精品国产第一区二区三区| 91美女片黄在线| 国产日韩影视精品| 另类小说一区二区三区| 在线观看免费成人| 国产精品美女久久久久久| 美女爽到高潮91| 欧美性色aⅴ视频一区日韩精品| 国产精品午夜电影| 国产综合色精品一区二区三区| 欧美视频在线观看一区二区| 国产精品毛片高清在线完整版| 韩国女主播一区二区三区| 91精品在线观看入口| 亚洲综合色在线| 99久久免费国产| 中文字幕久久午夜不卡| 激情综合色综合久久综合| 91精品国产综合久久久久久久| 一区二区三区欧美亚洲| 99久久精品国产观看| 日本一区二区三区在线观看| 国产一区二区看久久| 精品福利视频一区二区三区| 免费人成精品欧美精品| 欧美二区三区91| 午夜精品久久久久久| 欧美男女性生活在线直播观看| 一区二区三区四区在线免费观看| av动漫一区二区| 亚洲欧洲综合另类| 99精品欧美一区二区三区小说 | 欧美一区二区视频在线观看2020| 亚洲欧美一区二区三区极速播放| 成人18精品视频| 中文字幕中文乱码欧美一区二区| 成人综合婷婷国产精品久久蜜臀|