This is the mail archive of the
gdb@sourceware.org
mailing list for the GDB project.
Re: [windows] build error on gdbserver
- From: asmwarrior <asmwarrior at gmail dot com>
- To: Ralf Corsepius <ralf dot corsepius at rtems dot org>
- Cc: gdb at sourceware dot org, Yao Qi <qiyaoltc at gmail dot com>
- Date: Thu, 24 Nov 2011 22:50:47 +0800
- Subject: Re: [windows] build error on gdbserver
- References: <4ECE427C.2010208@gmail.com> <4ECE507F.8020501@rtems.org>
On 2011-11-24 22:11, Ralf Corsepius wrote:
Use "configure --disable-werror ..."
For me, I think this is only a work around, the code snippet looks like below:
static void
cmd_qtstatus (char *packet)
{
char *stop_reason_rsp = NULL;
char *buf1, *buf2, *buf3, *str;
int slen;
/* Translate the plain text of the notes back into hex for
transmission. */
str = (tracing_user_name ? tracing_user_name : "");
slen = strlen (str);
buf1 = (char *) alloca (slen * 2 + 1);
hexify (buf1, str, slen);
str = (tracing_notes ? tracing_notes : "");
slen = strlen (str);
buf2 = (char *) alloca (slen * 2 + 1);
hexify (buf2, str, slen);
str = (tracing_stop_note ? tracing_stop_note : "");
slen = strlen (str);
buf3 = (char *) alloca (slen * 2 + 1);
hexify (buf3, str, slen);
trace_debug ("Returning trace status as %d, stop reason %s",
tracing, tracing_stop_reason);
if (in_process_agent_loaded ())
{
pause_all (1);
upload_fast_traceframes ();
unpause_all (1);
}
stop_reason_rsp = (char *) tracing_stop_reason;
/* The user visible error string in terror needs to be hex encoded.
We leave it as plain string in `tracing_stop_reason' to ease
debugging. */
if (strncmp (stop_reason_rsp, "terror:", strlen ("terror:")) == 0)
{
const char *result_name;
int hexstr_len;
char *p;
result_name = stop_reason_rsp + strlen ("terror:");
hexstr_len = strlen (result_name) * 2;
p = stop_reason_rsp = alloca (strlen ("terror:") + hexstr_len + 1);
strcpy (p, "terror:");
p += strlen (p);
convert_int_to_ascii ((gdb_byte *) result_name, p, strlen (result_name));
}
/* If this was a forced stop, include any stop note that was supplied. */
if (strcmp (stop_reason_rsp, "tstop") == 0)
{
stop_reason_rsp = alloca (strlen ("tstop:") + strlen (buf3) + 1);
strcpy (stop_reason_rsp, "tstop:");
strcat (stop_reason_rsp, buf3);
}
sprintf (packet,
"T%d;"
"%s:%x;"
"tframes:%x;tcreated:%x;"
"tfree:%x;tsize:%s;"
"circular:%d;"
"disconn:%d;"
"starttime:%llx;stoptime:%llx;"
"username:%s:;notes:%s:",
tracing ? 1 : 0,
stop_reason_rsp, tracing_stop_tpnum,
traceframe_count, traceframes_created,
free_space (), phex_nz (trace_buffer_hi - trace_buffer_lo, 0),
circular_trace_buffer,
disconnected_tracing,
tracing_start_time, tracing_stop_time,
buf1, buf2);
}
There is a sprintf call with many parameters. I have no idea about %llx ????