2011-01-05 Michael Snyder <msnyder@msnyder-server.eng.vmware.com>

* gdbreplay.c: Shorten lines of >= 80 columns.
	* linux-low.c: Ditto.
	* linux-ppc-low.c: Ditto.
	* linux-s390-low.c: Ditto.
	* linux-sparc-low.c: Ditto.
	* linux-x86-low.c: Ditto.
	* linux-xtensa-low.c: Ditto.
	* mem-break.c: Ditto.
	* nto-low.c: Ditto.
	* regcache.h: Ditto.
	* remote-utils.c: Ditto.
	* server.c: Ditto.
	* server.h: Ditto.
	* thread-db.c: Ditto.
	* tracepoint.c: Ditto.
	* utils.c: Ditto.
	* win32-low.h: Ditto.
This commit is contained in:
Michael Snyder 2011-01-06 00:14:09 +00:00
parent b1ec4f36ab
commit 493e2a69a4
18 changed files with 151 additions and 66 deletions

View file

@ -1,3 +1,23 @@
2011-01-05 Michael Snyder <msnyder@msnyder-server.eng.vmware.com>
* gdbreplay.c: Shorten lines of >= 80 columns.
* linux-low.c: Ditto.
* linux-ppc-low.c: Ditto.
* linux-s390-low.c: Ditto.
* linux-sparc-low.c: Ditto.
* linux-x86-low.c: Ditto.
* linux-xtensa-low.c: Ditto.
* mem-break.c: Ditto.
* nto-low.c: Ditto.
* regcache.h: Ditto.
* remote-utils.c: Ditto.
* server.c: Ditto.
* server.h: Ditto.
* thread-db.c: Ditto.
* tracepoint.c: Ditto.
* utils.c: Ditto.
* win32-low.h: Ditto.
2011-01-05 Joel Brobecker <brobecker@adacore.com> 2011-01-05 Joel Brobecker <brobecker@adacore.com>
* gdbserver/configure.ac, gdbserver/gdbserver.1: Copyright year * gdbserver/configure.ac, gdbserver/gdbserver.1: Copyright year

View file

@ -243,7 +243,8 @@ remote_open (char *name)
/* Enable TCP keep alive process. */ /* Enable TCP keep alive process. */
tmp = 1; tmp = 1;
setsockopt (tmp_desc, SOL_SOCKET, SO_KEEPALIVE, (char *) &tmp, sizeof (tmp)); setsockopt (tmp_desc, SOL_SOCKET, SO_KEEPALIVE,
(char *) &tmp, sizeof (tmp));
/* Tell TCP not to delay small packets. This greatly speeds up /* Tell TCP not to delay small packets. This greatly speeds up
interactive response. */ interactive response. */
@ -254,8 +255,9 @@ remote_open (char *name)
#ifndef USE_WIN32API #ifndef USE_WIN32API
close (tmp_desc); /* No longer need this */ close (tmp_desc); /* No longer need this */
signal (SIGPIPE, SIG_IGN); /* If we don't do this, then gdbreplay simply signal (SIGPIPE, SIG_IGN); /* If we don't do this, then
exits when the remote side dies. */ gdbreplay simply exits when
the remote side dies. */
#else #else
closesocket (tmp_desc); /* No longer need this */ closesocket (tmp_desc); /* No longer need this */
#endif #endif
@ -419,7 +421,8 @@ gdbreplay_version (void)
{ {
printf ("GNU gdbreplay %s%s\n" printf ("GNU gdbreplay %s%s\n"
"Copyright (C) 2011 Free Software Foundation, Inc.\n" "Copyright (C) 2011 Free Software Foundation, Inc.\n"
"gdbreplay is free software, covered by the GNU General Public License.\n" "gdbreplay is free software, covered by "
"the GNU General Public License.\n"
"This gdbreplay was configured as \"%s\"\n", "This gdbreplay was configured as \"%s\"\n",
PKGVERSION, version, host_name); PKGVERSION, version, host_name);
} }

View file

@ -1668,7 +1668,8 @@ linux_wait_for_event (ptid_t ptid, int *wstat, int options)
if (event_pid > 0 if (event_pid > 0
&& ptid_is_pid (ptid) && ptid_get_pid (ptid) != event_pid) && ptid_is_pid (ptid) && ptid_get_pid (ptid) != event_pid)
{ {
struct lwp_info *event_child = find_lwp_pid (pid_to_ptid (event_pid)); struct lwp_info *event_child
= find_lwp_pid (pid_to_ptid (event_pid));
if (! WIFSTOPPED (*wstat)) if (! WIFSTOPPED (*wstat))
mark_lwp_dead (event_child, *wstat); mark_lwp_dead (event_child, *wstat);
@ -2064,7 +2065,9 @@ retry:
ourstatus->value.integer = WEXITSTATUS (w); ourstatus->value.integer = WEXITSTATUS (w);
if (debug_threads) if (debug_threads)
fprintf (stderr, "\nChild exited with retcode = %x \n", WEXITSTATUS (w)); fprintf (stderr,
"\nChild exited with retcode = %x \n",
WEXITSTATUS (w));
} }
else else
{ {
@ -2072,7 +2075,9 @@ retry:
ourstatus->value.sig = target_signal_from_host (WTERMSIG (w)); ourstatus->value.sig = target_signal_from_host (WTERMSIG (w));
if (debug_threads) if (debug_threads)
fprintf (stderr, "\nChild terminated with signal = %x \n", WTERMSIG (w)); fprintf (stderr,
"\nChild terminated with signal = %x \n",
WTERMSIG (w));
} }
@ -2296,7 +2301,8 @@ Check if we're already there.\n",
report_to_gdb = (!maybe_internal_trap report_to_gdb = (!maybe_internal_trap
|| current_inferior->last_resume_kind == resume_step || current_inferior->last_resume_kind == resume_step
|| event_child->stopped_by_watchpoint || event_child->stopped_by_watchpoint
|| (!step_over_finished && !bp_explains_trap && !trace_event) || (!step_over_finished
&& !bp_explains_trap && !trace_event)
|| gdb_breakpoint_here (event_child->stop_pc)); || gdb_breakpoint_here (event_child->stop_pc));
/* We found no reason GDB would want us to stop. We either hit one /* We found no reason GDB would want us to stop. We either hit one
@ -3176,7 +3182,8 @@ need_step_over_p (struct inferior_list_entry *entry, void *dummy)
{ {
if (debug_threads) if (debug_threads)
fprintf (stderr, fprintf (stderr,
"Need step over [LWP %ld]? yes, found breakpoint at 0x%s\n", "Need step over [LWP %ld]? yes, "
"found breakpoint at 0x%s\n",
lwpid_of (lwp), paddress (pc)); lwpid_of (lwp), paddress (pc));
/* We've found an lwp that needs stepping over --- return 1 so /* We've found an lwp that needs stepping over --- return 1 so
@ -4045,9 +4052,13 @@ linux_write_memory (CORE_ADDR memaddr, const unsigned char *myaddr, int len)
register CORE_ADDR addr = memaddr & -(CORE_ADDR) sizeof (PTRACE_XFER_TYPE); register CORE_ADDR addr = memaddr & -(CORE_ADDR) sizeof (PTRACE_XFER_TYPE);
/* Round ending address up; get number of longwords that makes. */ /* Round ending address up; get number of longwords that makes. */
register int count register int count
= (((memaddr + len) - addr) + sizeof (PTRACE_XFER_TYPE) - 1) / sizeof (PTRACE_XFER_TYPE); = (((memaddr + len) - addr) + sizeof (PTRACE_XFER_TYPE) - 1)
/ sizeof (PTRACE_XFER_TYPE);
/* Allocate buffer of that many longwords. */ /* Allocate buffer of that many longwords. */
register PTRACE_XFER_TYPE *buffer = (PTRACE_XFER_TYPE *) alloca (count * sizeof (PTRACE_XFER_TYPE)); register PTRACE_XFER_TYPE *buffer = (PTRACE_XFER_TYPE *)
alloca (count * sizeof (PTRACE_XFER_TYPE));
int pid = lwpid_of (get_thread_lwp (current_inferior)); int pid = lwpid_of (get_thread_lwp (current_inferior));
if (debug_threads) if (debug_threads)
@ -4090,7 +4101,8 @@ linux_write_memory (CORE_ADDR memaddr, const unsigned char *myaddr, int len)
/* Copy data to be written over corresponding part of buffer. */ /* Copy data to be written over corresponding part of buffer. */
memcpy ((char *) buffer + (memaddr & (sizeof (PTRACE_XFER_TYPE) - 1)), myaddr, len); memcpy ((char *) buffer + (memaddr & (sizeof (PTRACE_XFER_TYPE) - 1)),
myaddr, len);
/* Write the entire buffer. */ /* Write the entire buffer. */

View file

@ -255,7 +255,8 @@ ppc_get_pc (struct regcache *regcache)
{ {
unsigned int pc; unsigned int pc;
(*the_target->read_memory) (addr, (unsigned char *) &pc, 4); (*the_target->read_memory) (addr, (unsigned char *) &pc, 4);
return ((CORE_ADDR)1 << 63) | ((CORE_ADDR)fd << 32) | (CORE_ADDR) (pc - 4); return ((CORE_ADDR)1 << 63)
| ((CORE_ADDR)fd << 32) | (CORE_ADDR) (pc - 4);
} }
else if (register_size (0) == 4) else if (register_size (0) == 4)
{ {

View file

@ -73,10 +73,14 @@ static int s390_regmap[] = {
static int s390_regmap_3264[] = { static int s390_regmap_3264[] = {
PT_PSWMASK, PT_PSWADDR, PT_PSWMASK, PT_PSWADDR,
PT_GPR0, PT_GPR0, PT_GPR1, PT_GPR1, PT_GPR2, PT_GPR2, PT_GPR3, PT_GPR3, PT_GPR0, PT_GPR0, PT_GPR1, PT_GPR1,
PT_GPR4, PT_GPR4, PT_GPR5, PT_GPR5, PT_GPR6, PT_GPR6, PT_GPR7, PT_GPR7, PT_GPR2, PT_GPR2, PT_GPR3, PT_GPR3,
PT_GPR8, PT_GPR8, PT_GPR9, PT_GPR9, PT_GPR10, PT_GPR10, PT_GPR11, PT_GPR11, PT_GPR4, PT_GPR4, PT_GPR5, PT_GPR5,
PT_GPR12, PT_GPR12, PT_GPR13, PT_GPR13, PT_GPR14, PT_GPR14, PT_GPR15, PT_GPR15, PT_GPR6, PT_GPR6, PT_GPR7, PT_GPR7,
PT_GPR8, PT_GPR8, PT_GPR9, PT_GPR9,
PT_GPR10, PT_GPR10, PT_GPR11, PT_GPR11,
PT_GPR12, PT_GPR12, PT_GPR13, PT_GPR13,
PT_GPR14, PT_GPR14, PT_GPR15, PT_GPR15,
PT_ACR0, PT_ACR1, PT_ACR2, PT_ACR3, PT_ACR0, PT_ACR1, PT_ACR2, PT_ACR3,
PT_ACR4, PT_ACR5, PT_ACR6, PT_ACR7, PT_ACR4, PT_ACR5, PT_ACR6, PT_ACR7,
@ -138,7 +142,8 @@ s390_collect_ptrace_register (struct regcache *regcache, int regno, char *buf)
} }
static void static void
s390_supply_ptrace_register (struct regcache *regcache, int regno, const char *buf) s390_supply_ptrace_register (struct regcache *regcache,
int regno, const char *buf)
{ {
int size = register_size (regno); int size = register_size (regno);
if (size < sizeof (long)) if (size < sizeof (long))

View file

@ -40,7 +40,8 @@
#define SPARC_F_REGS_NUM 48 #define SPARC_F_REGS_NUM 48
#define SPARC_CONTROL_REGS_NUM 6 #define SPARC_CONTROL_REGS_NUM 6
#define sparc_num_regs (SPARC_R_REGS_NUM + SPARC_F_REGS_NUM + SPARC_CONTROL_REGS_NUM) #define sparc_num_regs \
(SPARC_R_REGS_NUM + SPARC_F_REGS_NUM + SPARC_CONTROL_REGS_NUM)
/* Each offset is multiplied by 8, because of the register size. /* Each offset is multiplied by 8, because of the register size.
These offsets apply to the buffer sent/filled by ptrace. These offsets apply to the buffer sent/filled by ptrace.
@ -67,7 +68,8 @@ static int sparc_regmap[] = {
17 *8, /* pc */ 17 *8, /* pc */
18 *8, /* npc */ 18 *8, /* npc */
16 *8, /* state */ 16 *8, /* state */
/* FSR offset also corresponds to GET/SETFPREGSET, ans is placed next to f62. */ /* FSR offset also corresponds to GET/SETFPREGSET, ans is placed
next to f62. */
32 *8, /* fsr */ 32 *8, /* fsr */
-1, /* fprs */ -1, /* fprs */
/* Y register is 32-bits length, but gdb takes care of that. */ /* Y register is 32-bits length, but gdb takes care of that. */
@ -141,7 +143,8 @@ sparc_fill_gregset (struct regcache *regcache, void *buf)
int range; int range;
for (range = 0; range < N_GREGS_RANGES; range++) for (range = 0; range < N_GREGS_RANGES; range++)
for (i = gregs_ranges[range].regno_start; i <= gregs_ranges[range].regno_end; i++) for (i = gregs_ranges[range].regno_start;
i <= gregs_ranges[range].regno_end; i++)
if (sparc_regmap[i] != -1) if (sparc_regmap[i] != -1)
collect_register (regcache, i, ((char *) buf) + sparc_regmap[i]); collect_register (regcache, i, ((char *) buf) + sparc_regmap[i]);
@ -155,7 +158,8 @@ sparc_fill_fpregset (struct regcache *regcache, void *buf)
int range; int range;
for (range = 0; range < N_FPREGS_RANGES; range++) for (range = 0; range < N_FPREGS_RANGES; range++)
for (i = fpregs_ranges[range].regno_start; i <= fpregs_ranges[range].regno_end; i++) for (i = fpregs_ranges[range].regno_start;
i <= fpregs_ranges[range].regno_end; i++)
collect_register (regcache, i, ((char *) buf) + sparc_regmap[i]); collect_register (regcache, i, ((char *) buf) + sparc_regmap[i]);
} }
@ -192,7 +196,8 @@ sparc_store_gregset (struct regcache *regcache, const void *buf)
memset (zerobuf, 0, sizeof(zerobuf)); memset (zerobuf, 0, sizeof(zerobuf));
for (range = 0; range < N_GREGS_RANGES; range++) for (range = 0; range < N_GREGS_RANGES; range++)
for (i = gregs_ranges[range].regno_start; i <= gregs_ranges[range].regno_end; i++) for (i = gregs_ranges[range].regno_start;
i <= gregs_ranges[range].regno_end; i++)
if (sparc_regmap[i] != -1) if (sparc_regmap[i] != -1)
supply_register (regcache, i, ((char *) buf) + sparc_regmap[i]); supply_register (regcache, i, ((char *) buf) + sparc_regmap[i]);
else else
@ -226,7 +231,9 @@ sparc_get_pc (struct regcache *regcache)
return pc; return pc;
} }
static const unsigned char sparc_breakpoint[INSN_SIZE] = { 0x91, 0xd0, 0x20, 0x01 }; static const unsigned char sparc_breakpoint[INSN_SIZE] = {
0x91, 0xd0, 0x20, 0x01
};
#define sparc_breakpoint_len INSN_SIZE #define sparc_breakpoint_len INSN_SIZE
@ -240,7 +247,8 @@ sparc_breakpoint_at (CORE_ADDR where)
if (memcmp(sparc_breakpoint, insn, sizeof(insn)) == 0) if (memcmp(sparc_breakpoint, insn, sizeof(insn)) == 0)
return 1; return 1;
/* If necessary, recognize more trap instructions here. GDB only uses TRAP Always. */ /* If necessary, recognize more trap instructions here. GDB only
uses TRAP Always. */
return 0; return 0;
} }

View file

@ -232,7 +232,8 @@ x86_get_thread_area (int lwpid, CORE_ADDR *addr)
idx = gs >> reg_thread_area; idx = gs >> reg_thread_area;
if (ptrace (PTRACE_GET_THREAD_AREA, if (ptrace (PTRACE_GET_THREAD_AREA,
lwpid_of (lwp), (void *) (long) idx, (unsigned long) &desc) < 0) lwpid_of (lwp),
(void *) (long) idx, (unsigned long) &desc) < 0)
return -1; return -1;
*addr = desc[1]; *addr = desc[1];
@ -659,7 +660,8 @@ x86_linux_prepare_to_resume (struct lwp_info *lwp)
int i; int i;
int pid = ptid_get_pid (ptid); int pid = ptid_get_pid (ptid);
struct process_info *proc = find_process_pid (pid); struct process_info *proc = find_process_pid (pid);
struct i386_debug_reg_state *state = &proc->private->arch_private->debug_reg_state; struct i386_debug_reg_state *state
= &proc->private->arch_private->debug_reg_state;
for (i = DR_FIRSTADDR; i <= DR_LASTADDR; i++) for (i = DR_FIRSTADDR; i <= DR_LASTADDR; i++)
x86_linux_dr_set (ptid, i, state->dr_mirror[i]); x86_linux_dr_set (ptid, i, state->dr_mirror[i]);

View file

@ -172,7 +172,8 @@ xtensa_breakpoint_at (CORE_ADDR where)
(*the_target->read_memory) (where, (unsigned char *) &insn, (*the_target->read_memory) (where, (unsigned char *) &insn,
xtensa_breakpoint_len); xtensa_breakpoint_len);
return memcmp((char *)&insn, xtensa_breakpoint, xtensa_breakpoint_len) == 0; return memcmp((char *) &insn,
xtensa_breakpoint, xtensa_breakpoint_len) == 0;
} }
struct linux_target_ops the_low_target = { struct linux_target_ops the_low_target = {

View file

@ -357,7 +357,8 @@ set_fast_tracepoint_jump (CORE_ADDR where,
the current shadow contents, because write_inferior_memory the current shadow contents, because write_inferior_memory
updates any shadow memory with what we pass here, and we want updates any shadow memory with what we pass here, and we want
that to be a nop. */ that to be a nop. */
err = write_inferior_memory (where, fast_tracepoint_jump_shadow (jp), length); err = write_inferior_memory (where, fast_tracepoint_jump_shadow (jp),
length);
if (err != 0) if (err != 0)
{ {
if (debug_threads) if (debug_threads)

View file

@ -635,7 +635,8 @@ nto_fetch_registers (struct regcache *regcache, int regno)
{ {
const unsigned int registeroffset const unsigned int registeroffset
= the_low_target.register_offset (regno); = the_low_target.register_offset (regno);
supply_register (regcache, regno, ((char *)&greg) + registeroffset); supply_register (regcache, regno,
((char *)&greg) + registeroffset);
} }
} }
else else

View file

@ -93,6 +93,7 @@ void collect_register (struct regcache *regcache, int n, void *buf);
void collect_register_as_string (struct regcache *regcache, int n, char *buf); void collect_register_as_string (struct regcache *regcache, int n, char *buf);
void collect_register_by_name (struct regcache *regcache, const char *name, void *buf); void collect_register_by_name (struct regcache *regcache,
const char *name, void *buf);
#endif /* REGCACHE_H */ #endif /* REGCACHE_H */

View file

@ -328,7 +328,8 @@ remote_open (char *name)
if (port == 0) if (port == 0)
{ {
socklen_t len = sizeof (sockaddr); socklen_t len = sizeof (sockaddr);
if (getsockname (listen_desc, (struct sockaddr *) &sockaddr, &len) < 0 if (getsockname (listen_desc,
(struct sockaddr *) &sockaddr, &len) < 0
|| len < sizeof (sockaddr)) || len < sizeof (sockaddr))
perror_with_name ("Can't determine port"); perror_with_name ("Can't determine port");
port = ntohs (sockaddr.sin_port); port = ntohs (sockaddr.sin_port);
@ -971,7 +972,8 @@ readchar (void)
if (readchar_bufcnt == 0) if (readchar_bufcnt == 0)
{ {
readchar_bufcnt = read (remote_desc, readchar_buf, sizeof (readchar_buf)); readchar_bufcnt = read (remote_desc, readchar_buf,
sizeof (readchar_buf));
if (readchar_bufcnt <= 0) if (readchar_bufcnt <= 0)
{ {
@ -1083,7 +1085,9 @@ getpkt (char *buf)
if (noack_mode) if (noack_mode)
{ {
fprintf (stderr, "Bad checksum, sentsum=0x%x, csum=0x%x, buf=%s [no-ack-mode, Bad medium?]\n", fprintf (stderr,
"Bad checksum, sentsum=0x%x, csum=0x%x, "
"buf=%s [no-ack-mode, Bad medium?]\n",
(c1 << 4) + c2, csum, buf); (c1 << 4) + c2, csum, buf);
/* Not much we can do, GDB wasn't expecting an ack/nac. */ /* Not much we can do, GDB wasn't expecting an ack/nac. */
break; break;

View file

@ -654,7 +654,8 @@ handle_search_memory_1 (CORE_ADDR start_addr, CORE_ADDR search_space_len,
if (gdb_read_memory (read_addr, search_buf + keep_len, if (gdb_read_memory (read_addr, search_buf + keep_len,
nr_to_read) != 0) nr_to_read) != 0)
{ {
warning ("Unable to access target memory at 0x%lx, halting search.", warning ("Unable to access target memory "
"at 0x%lx, halting search.",
(long) read_addr); (long) read_addr);
return -1; return -1;
} }
@ -1638,7 +1639,8 @@ handle_query (char *own_buf, int packet_len, int *new_packet_len_p)
return; return;
} }
if (strncmp ("qSearch:memory:", own_buf, sizeof ("qSearch:memory:") - 1) == 0) if (strncmp ("qSearch:memory:", own_buf,
sizeof ("qSearch:memory:") - 1) == 0)
{ {
require_running (own_buf); require_running (own_buf);
handle_search_memory (own_buf, packet_len); handle_search_memory (own_buf, packet_len);
@ -2164,7 +2166,8 @@ queue_stop_reply_callback (struct inferior_list_entry *entry, void *arg)
if (thread_stopped (thread)) if (thread_stopped (thread))
{ {
if (debug_threads) if (debug_threads)
fprintf (stderr, "Reporting thread %s as already stopped with %s\n", fprintf (stderr,
"Reporting thread %s as already stopped with %s\n",
target_pid_to_str (entry->id), target_pid_to_str (entry->id),
target_waitstatus_to_string (&thread->last_status)); target_waitstatus_to_string (&thread->last_status));
@ -2264,7 +2267,8 @@ gdbserver_version (void)
{ {
printf ("GNU gdbserver %s%s\n" printf ("GNU gdbserver %s%s\n"
"Copyright (C) 2011 Free Software Foundation, Inc.\n" "Copyright (C) 2011 Free Software Foundation, Inc.\n"
"gdbserver is free software, covered by the GNU General Public License.\n" "gdbserver is free software, covered by the "
"GNU General Public License.\n"
"This gdbserver was configured as \"%s\"\n", "This gdbserver was configured as \"%s\"\n",
PKGVERSION, version, host_name); PKGVERSION, version, host_name);
} }
@ -2295,7 +2299,8 @@ gdbserver_show_disableable (FILE *stream)
" vCont \tAll vCont packets\n" " vCont \tAll vCont packets\n"
" qC \tQuerying the current thread\n" " qC \tQuerying the current thread\n"
" qfThreadInfo\tThread listing\n" " qfThreadInfo\tThread listing\n"
" Tthread \tPassing the thread specifier in the T stop reply packet\n" " Tthread \tPassing the thread specifier in the "
"T stop reply packet\n"
" threads \tAll of the above\n"); " threads \tAll of the above\n");
} }

View file

@ -71,7 +71,8 @@ int vsnprintf(char *str, size_t size, const char *format, va_list ap);
#endif #endif
#ifndef ATTR_NORETURN #ifndef ATTR_NORETURN
#if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 7)) #if defined(__GNUC__) && (__GNUC__ > 2 \
|| (__GNUC__ == 2 && __GNUC_MINOR__ >= 7))
#define ATTR_NORETURN __attribute__ ((noreturn)) #define ATTR_NORETURN __attribute__ ((noreturn))
#else #else
#define ATTR_NORETURN /* nothing */ #define ATTR_NORETURN /* nothing */
@ -79,7 +80,8 @@ int vsnprintf(char *str, size_t size, const char *format, va_list ap);
#endif #endif
#ifndef ATTR_FORMAT #ifndef ATTR_FORMAT
#if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 4)) #if defined(__GNUC__) && (__GNUC__ > 2 \
|| (__GNUC__ == 2 && __GNUC_MINOR__ >= 4))
#define ATTR_FORMAT(type, x, y) __attribute__ ((format(type, x, y))) #define ATTR_FORMAT(type, x, y) __attribute__ ((format(type, x, y)))
#else #else
#define ATTR_FORMAT(type, x, y) /* nothing */ #define ATTR_FORMAT(type, x, y) /* nothing */
@ -427,7 +429,8 @@ int decode_xfer_write (char *buf, int packet_len, char **annex,
int decode_search_memory_packet (const char *buf, int packet_len, int decode_search_memory_packet (const char *buf, int packet_len,
CORE_ADDR *start_addrp, CORE_ADDR *start_addrp,
CORE_ADDR *search_space_lenp, CORE_ADDR *search_space_lenp,
gdb_byte *pattern, unsigned int *pattern_lenp); gdb_byte *pattern,
unsigned int *pattern_lenp);
int unhexify (char *bin, const char *hex, int count); int unhexify (char *bin, const char *hex, int count);
int hexify (char *hex, const char *bin, int count); int hexify (char *hex, const char *bin, int count);

View file

@ -428,7 +428,8 @@ thread_db_find_new_threads (void)
err = thread_db->td_ta_thr_iter_p (thread_db->thread_agent, err = thread_db->td_ta_thr_iter_p (thread_db->thread_agent,
find_new_threads_callback, find_new_threads_callback,
&new_thread_count, &new_thread_count,
TD_THR_ANY_STATE, TD_THR_LOWEST_PRIORITY, TD_THR_ANY_STATE,
TD_THR_LOWEST_PRIORITY,
TD_SIGNO_MASK, TD_THR_ANY_USER_FLAGS); TD_SIGNO_MASK, TD_THR_ANY_USER_FLAGS);
if (debug_threads) if (debug_threads)
fprintf (stderr, "Found %d threads in iteration %d.\n", fprintf (stderr, "Found %d threads in iteration %d.\n",

View file

@ -130,8 +130,10 @@ trace_vdebug (const char *fmt, ...)
# define traceframes_created gdb_agent_traceframes_created # define traceframes_created gdb_agent_traceframes_created
# define trace_state_variables gdb_agent_trace_state_variables # define trace_state_variables gdb_agent_trace_state_variables
# define get_raw_reg gdb_agent_get_raw_reg # define get_raw_reg gdb_agent_get_raw_reg
# define get_trace_state_variable_value gdb_agent_get_trace_state_variable_value # define get_trace_state_variable_value \
# define set_trace_state_variable_value gdb_agent_set_trace_state_variable_value gdb_agent_get_trace_state_variable_value
# define set_trace_state_variable_value \
gdb_agent_set_trace_state_variable_value
# define ust_loaded gdb_agent_ust_loaded # define ust_loaded gdb_agent_ust_loaded
# define helper_thread_id gdb_agent_helper_thread_id # define helper_thread_id gdb_agent_helper_thread_id
# define cmd_buf gdb_agent_cmd_buf # define cmd_buf gdb_agent_cmd_buf
@ -4070,7 +4072,9 @@ get_context_regcache (struct tracepoint_hit_ctx *ctx)
#ifdef HAVE_UST #ifdef HAVE_UST
if (ctx->type == static_tracepoint) if (ctx->type == static_tracepoint)
{ {
struct static_tracepoint_ctx *sctx = (struct static_tracepoint_ctx *) ctx; struct static_tracepoint_ctx *sctx
= (struct static_tracepoint_ctx *) ctx;
if (!sctx->regcache_initted) if (!sctx->regcache_initted)
{ {
sctx->regcache_initted = 1; sctx->regcache_initted = 1;
@ -4895,7 +4899,8 @@ traceframe_read_mem (int tfnum, CORE_ADDR addr,
/* Iterate through a traceframe's blocks, looking for memory. */ /* Iterate through a traceframe's blocks, looking for memory. */
while ((dataptr = traceframe_find_block_type (dataptr, while ((dataptr = traceframe_find_block_type (dataptr,
datasize - (dataptr - database), datasize
- (dataptr - database),
tfnum, 'M')) != NULL) tfnum, 'M')) != NULL)
{ {
memcpy (&maddr, dataptr, sizeof (maddr)); memcpy (&maddr, dataptr, sizeof (maddr));
@ -4957,7 +4962,8 @@ traceframe_read_tsv (int tsvnum, LONGEST *val)
/* Iterate through a traceframe's blocks, looking for the tsv. */ /* Iterate through a traceframe's blocks, looking for the tsv. */
while ((dataptr = traceframe_find_block_type (dataptr, while ((dataptr = traceframe_find_block_type (dataptr,
datasize - (dataptr - database), datasize
- (dataptr - database),
tfnum, 'V')) != NULL) tfnum, 'V')) != NULL)
{ {
memcpy (&vnum, dataptr, sizeof (vnum)); memcpy (&vnum, dataptr, sizeof (vnum));
@ -5149,7 +5155,8 @@ fast_tracepoint_collecting (CORE_ADDR thread_area,
&ipa_gdb_jump_pad_buffer_end)) &ipa_gdb_jump_pad_buffer_end))
fatal ("error extracting `gdb_jump_pad_buffer_end'"); fatal ("error extracting `gdb_jump_pad_buffer_end'");
if (ipa_gdb_jump_pad_buffer <= stop_pc && stop_pc < ipa_gdb_jump_pad_buffer_end) if (ipa_gdb_jump_pad_buffer <= stop_pc
&& stop_pc < ipa_gdb_jump_pad_buffer_end)
{ {
/* We can tell which tracepoint(s) the thread is collecting by /* We can tell which tracepoint(s) the thread is collecting by
matching the jump pad address back to the tracepoint. */ matching the jump pad address back to the tracepoint. */
@ -5539,7 +5546,8 @@ emit_void_call_2 (CORE_ADDR fn, int arg1)
static enum eval_result_type compile_bytecodes (struct agent_expr *aexpr); static enum eval_result_type compile_bytecodes (struct agent_expr *aexpr);
static void static void
compile_tracepoint_condition (struct tracepoint *tpoint, CORE_ADDR *jump_entry) compile_tracepoint_condition (struct tracepoint *tpoint,
CORE_ADDR *jump_entry)
{ {
CORE_ADDR entry_point = *jump_entry; CORE_ADDR entry_point = *jump_entry;
enum eval_result_type err; enum eval_result_type err;
@ -6183,7 +6191,8 @@ download_trace_state_variables (void)
if (prev_ptr != 0) if (prev_ptr != 0)
{ {
/* Fixup the next pointer in the last item in the list. */ /* Fixup the next pointer in the last item in the list. */
write_inferior_data_ptr (prev_ptr + offsetof (struct trace_state_variable, write_inferior_data_ptr (prev_ptr
+ offsetof (struct trace_state_variable,
next), 0); next), 0);
} }
} }
@ -6222,8 +6231,10 @@ upload_fast_traceframes (void)
return; return;
trace_debug ("ipa_traceframe_count (racy area): %d (w=%d, r=%d)", trace_debug ("ipa_traceframe_count (racy area): %d (w=%d, r=%d)",
ipa_traceframe_write_count_racy - ipa_traceframe_read_count_racy, ipa_traceframe_write_count_racy
ipa_traceframe_write_count_racy, ipa_traceframe_read_count_racy); - ipa_traceframe_read_count_racy,
ipa_traceframe_write_count_racy,
ipa_traceframe_read_count_racy);
if (ipa_traceframe_write_count_racy == ipa_traceframe_read_count_racy) if (ipa_traceframe_write_count_racy == ipa_traceframe_read_count_racy)
return; return;
@ -6368,7 +6379,8 @@ upload_fast_traceframes (void)
block = add_traceframe_block (tframe, ipa_tframe.data_size); block = add_traceframe_block (tframe, ipa_tframe.data_size);
if (block != NULL) if (block != NULL)
{ {
if (read_inferior_memory (tf + offsetof (struct traceframe, data), if (read_inferior_memory (tf
+ offsetof (struct traceframe, data),
block, ipa_tframe.data_size)) block, ipa_tframe.data_size))
error ("Uploading: Couldn't read traceframe data at %s\n", error ("Uploading: Couldn't read traceframe data at %s\n",
paddress (tf + offsetof (struct traceframe, data))); paddress (tf + offsetof (struct traceframe, data)));
@ -6416,7 +6428,8 @@ upload_fast_traceframes (void)
curr_tbctrl_idx, curr_tbctrl_idx,
(int) (ipa_trace_buffer_ctrl.start - ipa_trace_buffer_lo), (int) (ipa_trace_buffer_ctrl.start - ipa_trace_buffer_lo),
(int) (ipa_trace_buffer_ctrl.free - ipa_trace_buffer_lo), (int) (ipa_trace_buffer_ctrl.free - ipa_trace_buffer_lo),
(int) (ipa_trace_buffer_ctrl.end_free - ipa_trace_buffer_lo), (int) (ipa_trace_buffer_ctrl.end_free
- ipa_trace_buffer_lo),
(int) (ipa_trace_buffer_ctrl.wrap - ipa_trace_buffer_lo), (int) (ipa_trace_buffer_ctrl.wrap - ipa_trace_buffer_lo),
(int) (ipa_trace_buffer_hi - ipa_trace_buffer_lo)); (int) (ipa_trace_buffer_hi - ipa_trace_buffer_lo));
} }
@ -7137,7 +7150,8 @@ probe_marker_at (char *packet)
"ltt_marker_connect (marker = %s/%s)", "ltt_marker_connect (marker = %s/%s)",
m->channel, m->name); m->channel, m->name);
result = USTF(ltt_marker_connect) (m->channel, m->name, GDB_PROBE_NAME); result = USTF(ltt_marker_connect) (m->channel, m->name,
GDB_PROBE_NAME);
if (result && result != -EEXIST) if (result && result != -EEXIST)
trace_debug ("ltt_marker_connect (marker = %s/%s, errno = %d)", trace_debug ("ltt_marker_connect (marker = %s/%s, errno = %d)",
m->channel, m->name, -result); m->channel, m->name, -result);

View file

@ -40,7 +40,8 @@ static void malloc_failure (size_t size) ATTR_NORETURN;
static void static void
malloc_failure (size_t size) malloc_failure (size_t size)
{ {
fprintf (stderr, PREFIX "ran out of memory while trying to allocate %lu bytes\n", fprintf (stderr,
PREFIX "ran out of memory while trying to allocate %lu bytes\n",
(unsigned long) size); (unsigned long) size);
exit (1); exit (1);
} }

View file

@ -55,10 +55,12 @@ struct win32_target_ops
void (*initial_stuff) (void); void (*initial_stuff) (void);
/* Fetch the context from the inferior. */ /* Fetch the context from the inferior. */
void (*get_thread_context) (win32_thread_info *th, DEBUG_EVENT *current_event); void (*get_thread_context) (win32_thread_info *th,
DEBUG_EVENT *current_event);
/* Flush the context back to the inferior. */ /* Flush the context back to the inferior. */
void (*set_thread_context) (win32_thread_info *th, DEBUG_EVENT *current_event); void (*set_thread_context) (win32_thread_info *th,
DEBUG_EVENT *current_event);
/* Called when a thread was added. */ /* Called when a thread was added. */
void (*thread_added) (win32_thread_info *th); void (*thread_added) (win32_thread_info *th);