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

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

?? thread-packets.c

?? eCos操作系統源碼
?? C
?? 第 1 頁 / 共 3 頁
字號:
//========================================================================////      thread-packets.c////      Provides multi-threaded debug support////========================================================================//####ECOSGPLCOPYRIGHTBEGIN####// -------------------------------------------// This file is part of eCos, the Embedded Configurable Operating System.// Copyright (C) 1998, 1999, 2000, 2001, 2002 Red Hat, Inc.//// eCos is free software; you can redistribute it and/or modify it under// the terms of the GNU General Public License as published by the Free// Software Foundation; either version 2 or (at your option) any later version.//// eCos is distributed in the hope that it will be useful, but WITHOUT ANY// WARRANTY; without even the implied warranty of MERCHANTABILITY or// FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License// for more details.//// You should have received a copy of the GNU General Public License along// with eCos; if not, write to the Free Software Foundation, Inc.,// 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.//// As a special exception, if other files instantiate templates or use macros// or inline functions from this file, or you compile this file and link it// with other works to produce a work based on this file, this file does not// by itself cause the resulting work to be covered by the GNU General Public// License. However the source code for this file must still be made available// in accordance with section (3) of the GNU General Public License.//// This exception does not invalidate any other reasons why a work based on// this file might be covered by the GNU General Public License.//// Alternative licenses for eCos may be arranged by contacting Red Hat, Inc.// at http://sources.redhat.com/ecos/ecos-license/// -------------------------------------------//####ECOSGPLCOPYRIGHTEND####//========================================================================//#####DESCRIPTIONBEGIN####//// Author(s):     Red Hat, nickg// Contributors:  Red Hat, nickg// Date:          1998-08-25// Purpose:       // Description:   Provides multi-threaded debug support// Usage:         ////####DESCRIPTIONEND####////========================================================================// Define __ECOS__; allows all eCos specific additions to be easily identified.#define __ECOS__// #ifdef __ECOS__#include <pkgconf/hal.h>#if defined(CYGDBG_HAL_DEBUG_GDB_THREAD_SUPPORT) \    && defined(CYGDBG_HAL_DEBUG_GDB_INCLUDE_STUBS)// #endif // __ECOS__/* FIXME: Scan this module for correct sizes of fields in packets */#ifdef __ECOS__#include <cyg/hal/dbg-threads-api.h>#else  // __ECOS__#include "dbg-threads-api.h"#endif // __ECOS__/* This file should ALWAYS define debug thread support *//* Dont include the object in the link if you dont need the support *//* This is NOT the internal unit debug flag, it is a feature control */#if defined(DEBUG_THREADS)#undef DEBUG_THREADS#endif#define DEBUG_THREADS 1#define UNIT_TEST     0#define GDB_MOCKUP    0#define STUB_BUF_MAX 300 /* for range checking of packet lengths */     #include "thread-pkts.h"#ifdef __ECOS__// Use HAL rather than board.h in eCos#include <cyg/hal/hal_stub.h>#else  // __ECOS__#include "board.h"#endif // __ECOS__/* * Export the continue and "general" (context) thread IDs from GDB. */int _gdb_cont_thread ;int _gdb_general_thread ;#if !defined(PKT_DEBUG)#define PKT_DEBUG 0#endifextern void output_string(char * message) ;#if PKT_DEBUGvoid output_threadid(char * title,threadref * ref) ;#warning "PKT_DEBUG macros engaged"#define PKT_TRACE(title,packet) \{ output_string(title) ; output_string(packet) ; output_string("\n") ;}#else#define PKT_TRACE(title,packet) {}#endif /* This is going to be irregular because the various implementations   have adopted different names for registers.   It would be nice to fix them to have a common convention     _stub_registers     stub_registers     alt_stub_registers */extern target_register_t * _registers ;    /* A pointer to the current set of registers */extern target_register_t registers[]; /* The current saved registers */extern target_register_t alt_registers[] ;    /* Thread or saved process state */static void stub_copy_registers(                           target_register_t * dest,                           target_register_t *src                           ){  target_register_t * limit ;  limit = dest + NUMREGS ;  while (dest < limit)  *dest++ = *src++ ;}#ifdef __ECOS__void __stub_copy_registers(target_register_t * dest,                           target_register_t *src){    stub_copy_registers(dest, src);}#endif // __ECOS__extern int stubhex(char ch) ;/* ----- STUB_PACK_NAK ----------------------------------- *//* Pack an error response into the response packet */char * stub_pack_nak(char * outbuf){  *outbuf++ = 'E' ;  *outbuf++ = '0' ;  *outbuf++ = '2' ;  return outbuf ;} /* stub_pack_nak *//* ----- STUB_PACK_ACK -------------------------- *//* Pack an OK achnowledgement */char * stub_pack_ack(char * outbuf){  *outbuf++ = 'O' ;  *outbuf++ = 'K' ;  return outbuf ;} /* stub_pack_ack *//* ------- STUB_UNPACK_INT ------------------------------- *//* Unpack a few bytes and return its integer value         *//* This is where I wish functions could return several values   I would also advance the buffer pointer */int stub_unpack_int(char * buff,int fieldlength){  int retval = 0 ;  int nibble ;  while (fieldlength)    { nibble = stubhex(*buff++) ;      retval |= nibble ;      fieldlength-- ;      if (fieldlength) retval = retval << 4 ;    }  return retval ;} /* stub_unpack_int */static char * unpack_byte(char * buf, int * value){  *value = stub_unpack_int(buf,2) ;  return buf + 2 ;}static char * unpack_int(char * buf, int * value){  *value = stub_unpack_int(buf,8) ;  return buf + 8 ;}/* We are NOT depending upon extensive libraries */static int ishex(char ch,int *val){  if ((ch >= 'a') && (ch <= 'f'))    { *val =ch - 'a' + 10 ; return 1 ; }  if ((ch >= 'A') && (ch <= 'F'))    { *val = ch - 'A' + 10 ; return 1 ;}  if ((ch >= '0') && (ch <= '9'))    { *val = ch - '0' ; return 1 ; }  return 0 ;} /* ishex */static char * unpack_nibble(char * buf,int * val) {  ishex(*buf++,val) ;  return buf ;}static const char hexchars[] = "0123456789abcdef";static char * pack_hex_byte(char * pkt, unsigned char byte){  *pkt++ = hexchars[(byte >> 4) & 0xf] ;  *pkt++ = hexchars[(byte & 0xf)] ;  return pkt ;} /* pack_hex_byte */#ifndef __ECOS__/* ---- STUB_PACK_VARLEN_HEX ------------------------------------- *//* Format a variable length stream of hex bytes */static char * pack_varlen_hex(                       char * pkt,                       unsigned int value){  int i ;  static unsigned char n[8] ;  if (value == 0)    {      *pkt++ = '0' ;      return pkt ;    }  else    {      i = 8 ;      while (i-- >= 0 )  /* unpack nibbles into a char array */        {          n[i] = value & 0x0f ;          value = value >> 4 ;        }      i = 0 ;                  /* we had decrmented it to -1 */      while (n[i] == 0 ) i++ ; /* drop leading zeroes */      while (i++ < 8) *pkt++ = hexchars[n[i]] ; /* pack the number */    }  return pkt ;} /* pack_varlen_hex */#endif // !__ECOS__/* ------ STUB_UNPACK_VARLEN_HEX --------------------------------  *//* Parse a stream of hex bytes which may be of variable length     *//* return the pointer to the next char                             *//* modify a varparm containing the result                          *//* A failure would look like a non-increment of the buffer pointer *//* This unpacks hex strings that may have been packed using sprintf(%x) *//* We assume some non-hex delimits them */char * unpack_varlen_hex(                              char * buff,    /* packet to parse */                              int * result){  int nibble ;  int retval ;  retval = 0 ;  while (ishex(*buff,&nibble))    {      buff++ ;      retval = retval  << 4 ;      retval |= nibble & 0x0f ;    }  *result = retval ;  return buff ;} /* stub_unpack_varlen_int *//* ------ UNPACK_THREADID ------------------------------- *//* A threadid is a 64 bit quantity                        */#define BUFTHREADIDSIZ 16 /* encode 64 bits in 16 chars of hex */static char * unpack_threadid(char * inbuf, threadref * id){  char * altref ;  char * limit  = inbuf + BUFTHREADIDSIZ ;  int x,y ;  altref = (char *) id ;  while (inbuf < limit)    {      x = stubhex(*inbuf++) ;      y = stubhex(*inbuf++) ;      *altref++ = (x << 4) | y ;    }  return inbuf ;} /* unpack_threadid *//* Pack an integer use leading zeroes */static char * pack_int(char * buf,int value){  buf = pack_hex_byte(buf,(value>> 24)& 0xff) ;  buf = pack_hex_byte(buf,(value >>16)& 0xff) ;  buf = pack_hex_byte(buf,(value >>8) & 0x0ff) ;  buf = pack_hex_byte(buf,(value & 0xff)) ;  return buf ;} /* pack_int *//* -------- PACK_STRING ---------------------------------------------- *//* This stupid string better not contain any funny characters *//* Also, the GDB protocol will not cope with NULLs in the   string or at the end of it.   While is is posable to encapsulate the protocol in ays that   preclude filtering for # I am assuming this is a constraint.*/static char * pack_raw_string(char * pkt,char * string){  char ch ;  while (0 != (ch = *string++)) *pkt++ = ch ;  return pkt ;}static char * pack_string(                          char * pkt,                          char * string){  char ch ;#ifdef __ECOS__  int len = 0;  char *s = string;  while( *s++ ) len++;#else  // __ECOS__  int len ;  len = strlen(string) ;#endif // __ECOS  if (len > 200 ) len = 200 ; /* Bigger than most GDB packets, junk??? */  pkt = pack_hex_byte(pkt,len) ;  while (len-- > 0)    {        ch = *string++ ;       if ((ch == '\0') || (ch == '#')) ch = '*' ; /* Protect encapsulation */       *pkt++ = ch ;    }  return pkt ;} /* pack_string *//* ----- STUB_PACK_THREADID  --------------------------------------------- *//* Convert a binary 64 bit threadid  and pack it into a xmit buffer *//* Return the advanced buffer pointer */static char * pack_threadid(char * pkt, threadref * id){  char * limit ;  unsigned char * altid ;  altid = (unsigned char *) id ;  limit = pkt + BUFTHREADIDSIZ ;  while (pkt < limit) pkt = pack_hex_byte(pkt,*altid++) ;  return pkt ;} /* stub_pack_threadid *//* UNFORTUNATELY, not all of the extended debugging system has yet been   converted to 64 but thread references and process identifiers.   These routines do the conversion.   An array of bytes is the correct treatment of an opaque identifier.   ints have endian issues. */static void int_to_threadref(threadref * id, int value){  unsigned char * scan ;  scan = (unsigned char *) id ;   {    int i = 4 ;    while (i--) *scan++  = 0 ;  }  *scan++ = (value >> 24) & 0xff ;  *scan++ = (value >> 16) & 0xff ;  *scan++ = (value >> 8) & 0xff ;  *scan++ = (value & 0xff) ;}static int threadref_to_int(threadref * ref){  int value = 0 ;  unsigned char * scan ;  int i ;    scan = (char *) ref ;  scan += 4 ;  i = 4 ;  while (i-- > 0) value = (value << 8) | ((*scan++) & 0xff) ;  return value ;} /* threadref_to_int */void copy_threadref(threadref * dest, threadref * src){  int i ;  unsigned char * csrc, * cdest ;  csrc = (unsigned char *) src ;  cdest = (unsigned char *) dest ;  i = 8 ;  while (i--) *cdest++ = *csrc++ ;}int threadmatch(                threadref * dest ,                threadref * src                ){  unsigned char * srcp, * destp ;  int i , result ;  srcp = (char *) src ;  destp = (char *) dest ;  i = 8 ;  result = 1 ;  while (i-- > 0 ) result &= (*srcp++ == *destp++) ? 1 : 0 ;  return result ;} /* threadmatch */           static char * Tpkt_threadtag = "thread:" ;/* ----- STUB_PACK_TPKT_THREADID ------------------------------------ *//* retreive, tag and insert a thread identifier into a T packet. *//* Insert nothing if the thread identifier is not available */char * stub_pack_Tpkt_threadid(char * pkt){  static threadref thread ;  int fmt = 0 ; /* old format */  PKT_TRACE("Tpkt-id","---") ;  if (dbg_currthread(&thread))    {      pkt = pack_raw_string(pkt,Tpkt_threadtag) ;      if (fmt)        pkt = pack_threadid(pkt,&thread) ;      else          /* Until GDB lengthens its thread ids, we have to MASH             the threadid into somthing shorter. PLEASE FIX GDB */          pkt = pack_int(pkt,threadref_to_int(&thread)) ;      *pkt++ = ';'  ; /* terminate variable length int */      *pkt = '\0' ; /* Null terminate to allow string to be printed, no++ */    }  PKT_TRACE("packedTpkt","--") ;  return pkt ;} /* stub_pack_Tpkt_threadid */long stub_get_currthread (void){  threadref thread ;    if (dbg_currthread(&thread))

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
成人av网在线| 一本久久综合亚洲鲁鲁五月天 | 日韩av成人高清| 男女视频一区二区| 成人深夜视频在线观看| 一本大道久久a久久精二百 | 美女视频免费一区| 高清成人在线观看| 欧美高清视频www夜色资源网| 日韩精品一区二区三区在线| 欧美激情自拍偷拍| 日韩一区精品字幕| 93久久精品日日躁夜夜躁欧美| 3d成人h动漫网站入口| 中文字幕av资源一区| 日一区二区三区| 色一情一乱一乱一91av| 国产午夜亚洲精品理论片色戒| 洋洋成人永久网站入口| 国产宾馆实践打屁股91| 欧美日韩在线播放三区四区| 18欧美亚洲精品| 国产91富婆露脸刺激对白| 九九精品一区二区| 不卡一区二区三区四区| 欧美一区二区三区四区久久| 亚洲欧美电影一区二区| 成人免费三级在线| 欧美激情一区二区三区蜜桃视频| 国产在线精品免费av| 欧美一区二区三区男人的天堂| 午夜精品久久久久久| 欧美午夜免费电影| 亚洲国产色一区| 日韩午夜激情免费电影| 日本不卡视频在线观看| 日韩一级成人av| 国产电影一区二区三区| 国产日产欧产精品推荐色| 从欧美一区二区三区| 中文字幕中文在线不卡住| 91日韩一区二区三区| 一区二区三区在线视频观看58| 91国偷自产一区二区三区成为亚洲经典 | 久久免费的精品国产v∧| 国产乱码字幕精品高清av | 7777精品伊人久久久大香线蕉超级流畅 | 久久综合五月天婷婷伊人| 99视频精品在线| 视频在线观看一区二区三区| 欧美成人乱码一区二区三区| 国产精品一级二级三级| 一区二区三区欧美激情| 欧美xxxxx牲另类人与| kk眼镜猥琐国模调教系列一区二区 | 自拍偷在线精品自拍偷无码专区 | 欧美一区二区三级| 欧美亚洲综合另类| 蜜臀va亚洲va欧美va天堂| 中文字幕精品一区二区三区精品| 国产91露脸合集magnet| 午夜婷婷国产麻豆精品| 亚洲精品伦理在线| 久久久噜噜噜久久中文字幕色伊伊| 91视频一区二区三区| 国产成人综合在线播放| 亚洲尤物视频在线| 欧美高清在线一区| 欧美精品免费视频| 99国产欧美另类久久久精品| 久久国产精品99久久人人澡| 亚洲欧美色图小说| 欧美精品一区视频| 26uuu国产电影一区二区| 宅男噜噜噜66一区二区66| 欧美亚男人的天堂| av电影一区二区| 国产精品一区在线观看你懂的| 香蕉久久一区二区不卡无毒影院 | 欧美三日本三级三级在线播放| 美女网站色91| 国产91精品久久久久久久网曝门| 丝袜美腿一区二区三区| 日韩专区在线视频| 精东粉嫩av免费一区二区三区| 久久国产三级精品| 久久91精品国产91久久小草| 美女mm1313爽爽久久久蜜臀| 免费观看久久久4p| 懂色av一区二区三区蜜臀 | 精品精品国产高清a毛片牛牛| 宅男噜噜噜66一区二区66| 337p亚洲精品色噜噜| 欧美一区二区网站| 亚洲三级电影全部在线观看高清| 五月婷婷久久综合| 国产精品一区二区三区乱码 | 最新欧美精品一区二区三区| 一区二区三区在线播| 国产.欧美.日韩| 欧美大尺度电影在线| 亚洲国产精品一区二区久久恐怖片| 久草精品在线观看| 欧美日韩在线观看一区二区 | 欧美在线制服丝袜| 久久毛片高清国产| 日韩精品乱码av一区二区| 成人蜜臀av电影| 国产欧美日韩亚州综合| 欧美aaaaa成人免费观看视频| 国产成人精品aa毛片| 欧美色视频一区| 国产欧美一二三区| 午夜精品久久久久久| 懂色av中文一区二区三区| 69堂亚洲精品首页| 亚洲欧洲制服丝袜| 岛国精品在线播放| 欧美成人在线直播| 蜜臀av一级做a爰片久久| 欧美欧美午夜aⅴ在线观看| 亚洲国产视频一区| 欧美中文字幕亚洲一区二区va在线| 亚洲精品国产无天堂网2021| 在线精品视频一区二区三四 | 97精品久久久午夜一区二区三区| 国产欧美日韩在线看| 色欧美88888久久久久久影院| 亚洲图片一区二区| 欧美精品一区二区久久婷婷| 懂色av噜噜一区二区三区av| 久久精品在线免费观看| 91丨porny丨首页| 五月婷婷激情综合网| 国产清纯美女被跳蛋高潮一区二区久久w| 韩日av一区二区| 国产精品不卡一区| 欧美不卡一区二区| 不卡免费追剧大全电视剧网站| 亚洲一区免费视频| 国产欧美日韩不卡免费| 欧美图区在线视频| 久久国产视频网| 亚洲精品欧美综合四区| 日韩一区二区视频| 欧美曰成人黄网| 成人小视频在线观看| 蜜臂av日日欢夜夜爽一区| 亚洲成年人影院| 亚洲精品网站在线观看| 精品国产免费久久| 555夜色666亚洲国产免| 色综合天天视频在线观看| 精品一区二区三区在线播放 | 成人精品视频一区二区三区| 亚洲国产精品久久久久婷婷884| 国产精品毛片久久久久久久| 精品免费视频一区二区| 在线观看视频一区二区 | 久久国产综合精品| 日本一道高清亚洲日美韩| 亚洲国产日日夜夜| 日韩在线a电影| 国产真实乱子伦精品视频| 亚洲国产精品久久艾草纯爱| 亚洲日本免费电影| 亚洲国产精品久久人人爱 | 2019国产精品| 亚洲黄一区二区三区| 国产清纯白嫩初高生在线观看91 | 美女视频一区二区三区| 日本少妇一区二区| 麻豆成人在线观看| 国产乱子伦视频一区二区三区| 国内成人精品2018免费看| 成人免费视频播放| 欧洲一区在线观看| 精品捆绑美女sm三区| 国产精品狼人久久影院观看方式| 国产精品国产三级国产aⅴ中文 | 一区二区三区成人| 国产毛片精品国产一区二区三区| 丁香另类激情小说| 欧美一区二区不卡视频| 中文字幕精品一区二区精品绿巨人 | 亚洲一区欧美一区| 国产成人免费视频一区| 欧美一区二区三区在线电影| 国产精品午夜久久| 免费看欧美美女黄的网站| 国产裸体歌舞团一区二区| 7777女厕盗摄久久久| 国产精品网站导航| 美女国产一区二区| 欧美日韩一区二区三区免费看| 国产日本欧洲亚洲| 狠狠色综合色综合网络| 欧美日韩国产综合久久| 亚洲精品综合在线| 91天堂素人约啪|