本文整理汇总了C++中putDebugChar函数的典型用法代码示例。如果您正苦于以下问题:C++ putDebugChar函数的具体用法?C++ putDebugChar怎么用?C++ putDebugChar使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了putDebugChar函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: putpacket
/*
* send the packet in buffer.
*/
static void putpacket(char *buffer)
{
unsigned char checksum;
int count;
unsigned char ch;
/*
* $<packet info>#<checksum>.
*/
do {
putDebugChar('$');
checksum = 0;
count = 0;
while ((ch = buffer[count]) != 0) {
if (!(putDebugChar(ch)))
return;
checksum += ch;
count += 1;
}
putDebugChar('#');
putDebugChar(hexchars[checksum >> 4]);
putDebugChar(hexchars[checksum & 0xf]);
}
while ((getDebugChar() & 0x7f) != '+');
}
开发者ID:274914765,项目名称:C,代码行数:32,代码来源:gdb-stub.c
示例2: while
static unsigned char *stub_puts(unsigned char *buffer)
{
unsigned char c, sum;
int i;
while (1) {
putDebugChar('$');
i = 0;
sum = 0;
while ((c = buffer[i++]) != '\0') {
putDebugChar(c);
sum += c;
}
putDebugChar('#');
putDebugChar(h2a((sum >> 4) & 0xf));
putDebugChar(h2a(sum & 0xf));
if (getDebugChar() == '+')
break;
}
return buffer;
}
开发者ID:forest1040,项目名称:kozos,代码行数:25,代码来源:stub.c
示例3: putpacket
/* send the packet in buffer. */
int putpacket(char *buffer)
{
unsigned char checksum;
int count;
unsigned char ch;
/* $<packet info>#<checksum>. */
do
{
if(putDebugChar('$'))
return 1;
checksum = 0;
count = 0;
while((ch = (buffer[count])))
{
if(putDebugChar(ch))
return 1;
checksum += ch;
count += 1;
}
if(putDebugChar('#') || putDebugChar(hexchars[checksum >> 4])
|| putDebugChar(hexchars[checksum & 0xf]))
return 1;
if(getDebugChar(&ch))
return 1;
}
while(ch != '+');
return 0;
}
开发者ID:LiberH,项目名称:BEST-ppcmod,代码行数:35,代码来源:gdbServerInterface.cpp
示例4: putpacket
void putpacket (char *buffer) {
unsigned char checksum;
int count;
char ch;
/* $<packet info>#<checksum>. */
do
{
putDebugChar ('$');
checksum = 0;
count = 0;
while (ch = buffer[count])
{
putDebugChar (ch);
checksum += ch;
count += 1;
}
putDebugChar ('#');
putDebugChar (hexchars[checksum >> 4]);
putDebugChar (hexchars[checksum % 16]);
}
while (getDebugChar () != '+');
}
开发者ID:aitorvs,项目名称:ercos,代码行数:27,代码来源:M68K-stub.c
示例5: getpacket
/* scan for the sequence $<data>#<checksum> */
static void
getpacket(char *buffer)
{
unsigned char checksum;
unsigned char xmitcsum;
int i;
int count;
unsigned char ch;
do {
/* wait around for the start character, ignore all other
* characters */
while ((ch = (getDebugChar() & 0x7f)) != '$') {
#ifdef KGDB_DEBUG
if (kdebug)
putc(ch);
#endif
;
}
checksum = 0;
xmitcsum = -1;
count = 0;
/* now, read until a # or end of buffer is found */
while (count < BUFMAX) {
ch = getDebugChar() & 0x7f;
if (ch == '#')
break;
checksum = checksum + ch;
buffer[count] = ch;
count = count + 1;
}
if (count >= BUFMAX)
continue;
buffer[count] = 0;
if (ch == '#') {
xmitcsum = hex(getDebugChar() & 0x7f) << 4;
xmitcsum |= hex(getDebugChar() & 0x7f);
if (checksum != xmitcsum)
putDebugChar('-'); /* failed checksum */
else {
putDebugChar('+'); /* successful transfer */
/* if a sequence char is present, reply the ID */
if (buffer[2] == ':') {
putDebugChar(buffer[0]);
putDebugChar(buffer[1]);
/* remove sequence chars from buffer */
count = strlen(buffer);
for (i=3; i <= count; i++)
buffer[i-3] = buffer[i];
}
}
}
} while (checksum != xmitcsum);
}
开发者ID:kipr,项目名称:u-boot-2009.07-silvermoon,代码行数:61,代码来源:kgdb.c
示例6: putpacket
/* send the packet in buffer. */
static void
putpacket(unsigned char *buffer)
{
unsigned char checksum;
int count;
unsigned char ch, recv;
/* $<packet info>#<checksum>. */
do {
putDebugChar('$');
checksum = 0;
count = 0;
while ((ch = buffer[count])) {
putDebugChar(ch);
checksum += ch;
count += 1;
}
putDebugChar('#');
putDebugChar(hexchars[checksum >> 4]);
putDebugChar(hexchars[checksum & 0xf]);
recv = getDebugChar();
} while ((recv & 0x7f) != '+');
}
开发者ID:kipr,项目名称:u-boot-2009.07-silvermoon,代码行数:26,代码来源:kgdb.c
示例7: serialtest
static int serialtest()
{
int i,j;
printf("serial test\n");
initserial(0);
initserial(1);
for(i=0;i<16;i++)
{
if(testDebugChar(0))getDebugChar(0);
else break;
}
for(i=0;i<16;j++)
{
if(testDebugChar(1))getDebugChar(1);
else break;
}
printf("serial 0 send data to serial 1...");
for(i=0;i<10;i++)
{
putDebugChar(0,'a'+i);
for(j=0;j<TIMEOUT;j++)
{
if(testDebugChar(1))break;
}
if(j==TIMEOUT){printf("timeout");break;}
printf("%c",getDebugChar(1));
}
printf("\n");
for(i=0;i<16;i++)
{
if(testDebugChar(0))getDebugChar(0);
else break;
}
for(i=0;i<16;j++)
{
if(testDebugChar(1))getDebugChar(1);
else break;
}
printf("serial 1 send data to serial 0...");
for(i=0;i<10;i++)
{
putDebugChar(1,'a'+i);
for(j=0;j<TIMEOUT;j++)
{
if(testDebugChar(0))break;
}
if(j==TIMEOUT){printf("timeout");break;}
printf("%c",getDebugChar(0));
}
printf("\n");
return 0;
}
开发者ID:kisom,项目名称:pmon,代码行数:59,代码来源:serial.c
示例8: imx6_uart_putchar
void
imx6_uart_putchar(char c)
{
putDebugChar(c);
if (c == '\n') {
putDebugChar('\r');
}
}
开发者ID:KGG814,项目名称:AOS,代码行数:8,代码来源:io.c
示例9: am335x_uart_putchar
void
am335x_uart_putchar(char c)
{
putDebugChar(c);
if (c == '\n') {
putDebugChar('\r');
}
}
开发者ID:KGG814,项目名称:AOS,代码行数:8,代码来源:io.c
示例10: putDebugString
void putDebugString(char* str)
{
while (*str != '\0') {
putDebugChar(*str);
str++;
}
putDebugChar('\r');
return;
}
开发者ID:sarnobat,项目名称:knoppix,代码行数:9,代码来源:gen550_kgdb.c
示例11: putDebugStr
void
putDebugStr(const char *str)
{
while (*str != '\0') {
if (*str == '\n')
putDebugChar('\r');
putDebugChar(*str++);
}
}
开发者ID:GWARDAR,项目名称:OpenPLi-1,代码行数:9,代码来源:serial.c
示例12: getpacket
/* Await the sequence $<data>#<checksum> and store <data> in the array buffer
returned. */
static void
getpacket (char *buffer)
{
unsigned char checksum;
unsigned char xmitcsum;
int i;
int count;
char ch;
do {
while ((ch = getDebugChar ()) != '$')
/* Wait for the start character $ and ignore all other characters */;
checksum = 0;
xmitcsum = -1;
count = 0;
/* Read until a # or the end of the buffer is reached */
while (count < BUFMAX) {
ch = getDebugChar ();
if (ch == '#')
break;
checksum = checksum + ch;
buffer[count] = ch;
count = count + 1;
}
buffer[count] = '\0';
if (ch == '#') {
xmitcsum = hex (getDebugChar ()) << 4;
xmitcsum += hex (getDebugChar ());
if (checksum != xmitcsum) {
/* Wrong checksum */
putDebugChar ('-');
}
else {
/* Correct checksum */
putDebugChar ('+');
/* If sequence characters are received, reply with them */
if (buffer[2] == ':') {
putDebugChar (buffer[0]);
putDebugChar (buffer[1]);
/* Remove the sequence characters from the buffer */
count = gdb_cris_strlen (buffer);
for (i = 3; i <= count; i++)
buffer[i - 3] = buffer[i];
}
}
}
} while (checksum != xmitcsum);
}
开发者ID:0x000000FF,项目名称:Linux4Edison,代码行数:50,代码来源:kgdb.c
示例13: putDebugChar
void
putDebugChar(const char c)
{
volatile scc_uart_t *up;
volatile cbd_t *tbdf;
volatile immap_t *im;
if (c == '\n')
putDebugChar ('\r');
im = (immap_t *)CONFIG_SYS_IMMR;
up = (scc_uart_t *)&im->im_dprambase[KGDB_PROFF_SCC];
tbdf = (cbd_t *)&im->im_dprambase[up->scc_genscc.scc_tbase];
/* Wait for last character to go.
*/
while (tbdf->cbd_sc & BD_SC_READY)
;
/* Load the character into the transmit buffer.
*/
*(volatile char *)tbdf->cbd_bufaddr = c;
tbdf->cbd_datlen = 1;
tbdf->cbd_sc |= BD_SC_READY;
}
开发者ID:247a,项目名称:lenovo_b6000-8000_kernel_source,代码行数:25,代码来源:serial_scc.c
示例14: set_debug_traps
/* this function is used to set up exception handlers for tracing and
breakpoints */
void
set_debug_traps (void)
{
stackPtr = &remcomStack[STACKSIZE / sizeof (int) - 1];
exceptionHandler (0, _catchException0);
exceptionHandler (1, _catchException1);
exceptionHandler (3, _catchException3);
exceptionHandler (4, _catchException4);
exceptionHandler (5, _catchException5);
exceptionHandler (6, _catchException6);
exceptionHandler (7, _catchException7);
exceptionHandler (8, _catchException8);
exceptionHandler (9, _catchException9);
exceptionHandler (10, _catchException10);
exceptionHandler (11, _catchException11);
exceptionHandler (12, _catchException12);
exceptionHandler (13, _catchException13);
exceptionHandler (14, _catchException14);
exceptionHandler (16, _catchException16);
/* In case GDB is started before us, ack any packets (presumably
"$?#xx") sitting there. */
putDebugChar ('+');
initialized = true;
}
开发者ID:FullMentalPanic,项目名称:RTEMS_NEW_TOOL_CHAIN,代码行数:30,代码来源:i386-stub.c
示例15: putDebugStr
void
putDebugStr (const char *s)
{
while (*s) {
putDebugChar (*s++);
}
}
开发者ID:Adrizcorp,项目名称:ARM_SOC_FPGA,代码行数:7,代码来源:serial_smc.c
示例16: putpacket
static void
putpacket (char *buffer)
{
unsigned char checksum;
int count;
unsigned char ch;
if (strlen(buffer) >= BUFMAX)
panic("kgdb: buffer overflow");
/* $<packet info>#<checksum>. */
do
{
/*
* This is a non-standard hack to allow use of the serial console for
* operation as well as debugging. Simply turn on 'remotechat' in gdb.
*
* This extension is not part of the Cygnus protocol, is kinda gross,
* but gets the job done.
*/
#ifdef GDB_REMOTE_CHAT
putDebugChar ('|');
putDebugChar ('|');
putDebugChar ('|');
putDebugChar ('|');
#endif
putDebugChar ('$');
checksum = 0;
count = 0;
while ((ch=buffer[count]) != 0)
{
putDebugChar (ch);
checksum += ch;
count += 1;
}
putDebugChar ('#');
putDebugChar (hexchars[checksum >> 4]);
putDebugChar (hexchars[checksum & 0xf]);
}
while ((getDebugChar () & 0x7f) != '+');
}
开发者ID:UnitedMarsupials,项目名称:kame,代码行数:43,代码来源:alpha-gdbstub.c
示例17: putEncodedChar
static void putEncodedChar(unsigned char c)
{
switch (c) {
case ESCAPE:
putDebugChar(ESCAPE);
putDebugChar(ESCAPE_ESCAPE);
break;
case START:
putDebugChar(ESCAPE);
putDebugChar(START_ESCAPE);
break;
case END:
putDebugChar(ESCAPE);
putDebugChar(END_ESCAPE);
break;
default:
if (c < 20) {
putDebugChar(ESCAPE);
putDebugChar(c + 20);
} else {
putDebugChar(c);
}
}
}
开发者ID:scan,项目名称:seL4,代码行数:24,代码来源:capdl.c
示例18: set_debug_traps
/*
* Set up exception handlers for tracing and breakpoints
*/
void set_debug_traps(void)
{
// unsigned long flags;
unsigned char c;
// save_and_cli(flags);
/*
* In case GDB is started before us, ack any packets
* (presumably "$?#xx") sitting there.
*/
while((c = getDebugChar()) != '$');
while((c = getDebugChar()) != '#');
c = getDebugChar(); /* eat first csum byte */
c = getDebugChar(); /* eat second csum byte */
putDebugChar('+'); /* ack it */
gdb_stub_initialised = TRUE;
// restore_flags(flags);
}
开发者ID:SimonKagstrom,项目名称:mci500h-linux-2.4.27,代码行数:22,代码来源:gdb-stub.c
示例19: cmd_serial
static int cmd_serial(int argc,char **argv)
{
int line;
if(argc!=3)return -1;
line=argv[2][0]-'0';
switch(argv[1][0])
{
case 'i':
initserial(line);
break;
case 'r':
printf("%c\n",getDebugChar(line));break;
case 'w':
putDebugChar(line,'a');
break;
case 't':
printf("%d\n",testDebugChar(line));
break;
}
return 0;
}
开发者ID:kisom,项目名称:pmon,代码行数:23,代码来源:serial.c
示例20: putDebugChar
void
putDebugChar(const char c)
{
volatile cbd_t *tbdf;
volatile char *buf;
volatile smc_uart_t *up;
volatile immap_t *im = (immap_t *)CONFIG_SYS_IMMR;
if (c == '\n')
putDebugChar ('\r');
up = (smc_uart_t *)&(im->im_dprambase[KGDB_PROFF_SMC]);
tbdf = (cbd_t *)&im->im_dprambase[up->smc_tbase];
/* Wait for last character to go. */
buf = (char *)tbdf->cbd_bufaddr;
while (tbdf->cbd_sc & BD_SC_READY)
;
*buf = c;
tbdf->cbd_datlen = 1;
tbdf->cbd_sc |= BD_SC_READY;
}
开发者ID:Adrizcorp,项目名称:ARM_SOC_FPGA,代码行数:24,代码来源:serial_smc.c
注:本文中的putDebugChar函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论