* [gdbserver/commit] fix whitespace.
@ 2009-03-23 0:22 Pedro Alves
2009-03-23 1:12 ` Pedro Alves
0 siblings, 1 reply; 9+ messages in thread
From: Pedro Alves @ 2009-03-23 0:22 UTC (permalink / raw)
To: gdb-patches
Okay, I just got annoyed enough about trying to make
whitespacing/tabbing correct in this other patch I was
preparing, that I went through all of gdbserver fixing up whitespace
for good. Thank goodness for whitespace-mode.
I'm checking this in as obvious.
--
Pedro Alves
2009-03-22 Pedro Alves <pedro@codesourcery.com>
Fix whitespace throughout.
* i387-fp.c, linux-arm-low.c, linux-cris-low.c,
linux-crisv32-low.c, linux-i386-low.c, linux-low.c,
linux-mips-low.c, linux-s390-low.c, linux-sparc-low.c,
linux-x86-64-low.c, linux-xtensa-low.c, proc-service.c,
regcache.c, remote-utils.c, server.c, spu-low.c, target.h,
thread-db.c, win32-low.c, xtensa-xtregs.c, gdbreplay.c,
Makefile.in, configure.ac: Fix whitespace throughout.
* configure: Regenerate.
---
gdb/gdbserver/Makefile.in | 12 +-
gdb/gdbserver/configure | 2
gdb/gdbserver/configure.ac | 6 -
gdb/gdbserver/gdbreplay.c | 2
gdb/gdbserver/i387-fp.c | 40 ++++----
gdb/gdbserver/linux-arm-low.c | 2
gdb/gdbserver/linux-cris-low.c | 4
gdb/gdbserver/linux-crisv32-low.c | 44 ++++-----
gdb/gdbserver/linux-i386-low.c | 4
gdb/gdbserver/linux-low.c | 175 +++++++++++++++++++-------------------
gdb/gdbserver/linux-mips-low.c | 2
gdb/gdbserver/linux-s390-low.c | 1
gdb/gdbserver/linux-sparc-low.c | 39 ++++----
gdb/gdbserver/linux-x86-64-low.c | 10 +-
gdb/gdbserver/linux-xtensa-low.c | 2
gdb/gdbserver/proc-service.c | 2
gdb/gdbserver/regcache.c | 5 -
gdb/gdbserver/remote-utils.c | 48 +++++-----
gdb/gdbserver/server.c | 42 ++++-----
gdb/gdbserver/spu-low.c | 8 -
gdb/gdbserver/target.h | 8 -
gdb/gdbserver/thread-db.c | 2
gdb/gdbserver/win32-low.c | 82 ++++++++---------
gdb/gdbserver/xtensa-xtregs.c | 1
24 files changed, 273 insertions(+), 270 deletions(-)
Index: src/gdb/gdbserver/Makefile.in
===================================================================
--- src.orig/gdb/gdbserver/Makefile.in 2009-03-22 23:15:04.000000000 +0000
+++ src/gdb/gdbserver/Makefile.in 2009-03-22 23:31:21.000000000 +0000
@@ -8,12 +8,12 @@
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
-#
+#
# This program 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 this program. If not, see <http://www.gnu.org/licenses/>.
@@ -57,7 +57,7 @@ srcdir = @srcdir@
VPATH = @srcdir@
# It is also possible that you will need to add -I/usr/include/sys to the
-# CFLAGS section if your system doesn't have fcntl.h in /usr/include (which
+# CFLAGS section if your system doesn't have fcntl.h in /usr/include (which
# is where it should be according to Posix).
# Set this up with gcc if you have gnu ld and the loader will print out
@@ -122,7 +122,7 @@ DEPFILES = @GDBSERVER_DEPFILES@
LIBOBJS = @LIBOBJS@
SOURCES = $(SFILES)
-TAGFILES = $(SOURCES) ${HFILES} ${ALLPARAM} ${POSSLIBS}
+TAGFILES = $(SOURCES) ${HFILES} ${ALLPARAM} ${POSSLIBS}
OBS = inferiors.o regcache.o remote-utils.o server.o signals.o target.o \
utils.o version.o \
@@ -146,12 +146,12 @@ XML_BUILTIN = @srv_xmlbuiltin@
all: gdbserver$(EXEEXT) gdbreplay$(EXEEXT)
# Traditionally "install" depends on "all". But it may be useful
-# not to; for example, if the user has made some trivial change to a
+# not to; for example, if the user has made some trivial change to a
# source file and doesn't care about rebuilding or just wants to save the
# time it takes for make to check that all is up to date.
# install-only is intended to address that need.
install: all install-only
-install-only:
+install-only:
n=`echo gdbserver | sed '$(program_transform_name)'`; \
if [ x$$n = x ]; then n=gdbserver; else true; fi; \
$(SHELL) $(srcdir)/../../mkinstalldirs $(DESTDIR)$(bindir); \
Index: src/gdb/gdbserver/configure
===================================================================
--- src.orig/gdb/gdbserver/configure 2009-03-22 23:15:02.000000000 +0000
+++ src/gdb/gdbserver/configure 2009-03-22 23:39:13.000000000 +0000
@@ -2984,7 +2984,7 @@ done
-for ac_header in sgtty.h termio.h termios.h sys/reg.h string.h proc_service.h sys/procfs.h thread_db.h linux/elf.h stdlib.h unistd.h errno.h fcntl.h signal.h sys/file.h malloc.h sys/ioctl.h netinet/in.h sys/socket.h netdb.h netinet/tcp.h arpa/inet.h sys/wait.h
+for ac_header in sgtty.h termio.h termios.h sys/reg.h string.h proc_service.h sys/procfs.h thread_db.h linux/elf.h stdlib.h unistd.h errno.h fcntl.h signal.h sys/file.h malloc.h sys/ioctl.h netinet/in.h sys/socket.h netdb.h netinet/tcp.h arpa/inet.h sys/wait.h
do
as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
if eval "test \"\${$as_ac_Header+set}\" = set"; then
Index: src/gdb/gdbserver/configure.ac
===================================================================
--- src.orig/gdb/gdbserver/configure.ac 2009-03-22 23:15:02.000000000 +0000
+++ src/gdb/gdbserver/configure.ac 2009-03-22 23:38:17.000000000 +0000
@@ -39,7 +39,7 @@ AC_HEADER_STDC
AC_CHECK_HEADERS(sgtty.h termio.h termios.h sys/reg.h string.h dnl
proc_service.h sys/procfs.h thread_db.h linux/elf.h dnl
stdlib.h unistd.h dnl
- errno.h fcntl.h signal.h sys/file.h malloc.h dnl
+ errno.h fcntl.h signal.h sys/file.h malloc.h dnl
sys/ioctl.h netinet/in.h sys/socket.h netdb.h dnl
netinet/tcp.h arpa/inet.h sys/wait.h)
AC_CHECK_FUNCS(pread pwrite pread64)
@@ -159,8 +159,8 @@ if test "$srv_linux_thread_db" = "yes";
USE_THREAD_DB="-DUSE_THREAD_DB"
AC_CACHE_CHECK([for TD_VERSION], gdbsrv_cv_have_td_version,
[AC_TRY_COMPILE([#include <thread_db.h>], [TD_VERSION;],
- [gdbsrv_cv_have_td_version=yes],
- [gdbsrv_cv_have_td_version=no])])
+ [gdbsrv_cv_have_td_version=yes],
+ [gdbsrv_cv_have_td_version=no])])
if test $gdbsrv_cv_have_td_version = yes; then
AC_DEFINE(HAVE_TD_VERSION, 1, [Define if TD_VERSION is available.])
fi
Index: src/gdb/gdbserver/gdbreplay.c
===================================================================
--- src.orig/gdb/gdbserver/gdbreplay.c 2009-03-22 23:15:03.000000000 +0000
+++ src/gdb/gdbserver/gdbreplay.c 2009-03-22 23:37:07.000000000 +0000
@@ -236,7 +236,7 @@ remote_open (char *name)
setsockopt (tmp_desc, SOL_SOCKET, SO_KEEPALIVE, (char *) &tmp, sizeof (tmp));
/* Tell TCP not to delay small packets. This greatly speeds up
- interactive response. */
+ interactive response. */
tmp = 1;
setsockopt (remote_desc, IPPROTO_TCP, TCP_NODELAY,
(char *) &tmp, sizeof (tmp));
Index: src/gdb/gdbserver/i387-fp.c
===================================================================
--- src.orig/gdb/gdbserver/i387-fp.c 2009-03-22 23:15:03.000000000 +0000
+++ src/gdb/gdbserver/i387-fp.c 2009-03-22 23:36:38.000000000 +0000
@@ -124,7 +124,7 @@ i387_fsave_to_cache (const void *buf)
supply_register_by_name ("fioff", &fp->fioff);
supply_register_by_name ("fooff", &fp->fooff);
-
+
/* Some registers are 16-bit. */
val = fp->fctrl & 0xFFFF;
supply_register_by_name ("fctrl", &val);
@@ -163,7 +163,7 @@ i387_cache_to_fxsave (void *buf)
collect_register_by_name ("fioff", &fp->fioff);
collect_register_by_name ("fooff", &fp->fooff);
collect_register_by_name ("mxcsr", &fp->mxcsr);
-
+
/* This one's 11 bits... */
collect_register_by_name ("fop", &val2);
fp->fop = (val2 & 0x7FF) | (fp->fop & 0xF800);
@@ -207,7 +207,7 @@ i387_ftag (struct i387_fxsave *fp, int r
exponent = (((raw[9] & 0x7f) << 8) | raw[8]);
fraction[0] = ((raw[3] << 24) | (raw[2] << 16) | (raw[1] << 8) | raw[0]);
fraction[1] = (((raw[7] & 0x7f) << 24) | (raw[6] << 16)
- | (raw[5] << 8) | raw[4]);
+ | (raw[5] << 8) | raw[4]);
if (exponent == 0x7fff)
{
@@ -217,28 +217,28 @@ i387_ftag (struct i387_fxsave *fp, int r
else if (exponent == 0x0000)
{
if (fraction[0] == 0x0000 && fraction[1] == 0x0000 && !integer)
- {
- /* Zero. */
- return (1);
- }
+ {
+ /* Zero. */
+ return (1);
+ }
else
- {
- /* Special. */
- return (2);
- }
+ {
+ /* Special. */
+ return (2);
+ }
}
else
{
if (integer)
- {
- /* Valid. */
- return (0);
- }
+ {
+ /* Valid. */
+ return (0);
+ }
else
- {
- /* Special. */
- return (2);
- }
+ {
+ /* Special. */
+ return (2);
+ }
}
}
@@ -259,7 +259,7 @@ i387_fxsave_to_cache (const void *buf)
supply_register_by_name ("fioff", &fp->fioff);
supply_register_by_name ("fooff", &fp->fooff);
supply_register_by_name ("mxcsr", &fp->mxcsr);
-
+
/* Some registers are 16-bit. */
val = fp->fctrl & 0xFFFF;
supply_register_by_name ("fctrl", &val);
Index: src/gdb/gdbserver/linux-arm-low.c
===================================================================
--- src.orig/gdb/gdbserver/linux-arm-low.c 2009-03-22 23:15:03.000000000 +0000
+++ src/gdb/gdbserver/linux-arm-low.c 2009-03-22 23:35:48.000000000 +0000
@@ -195,7 +195,7 @@ arm_reinsert_addr ()
ps_err_e
ps_get_thread_area (const struct ps_prochandle *ph,
- lwpid_t lwpid, int idx, void **base)
+ lwpid_t lwpid, int idx, void **base)
{
if (ptrace (PTRACE_GET_THREAD_AREA, lwpid, NULL, base) != 0)
return PS_ERR;
Index: src/gdb/gdbserver/linux-cris-low.c
===================================================================
--- src.orig/gdb/gdbserver/linux-cris-low.c 2009-03-22 23:15:03.000000000 +0000
+++ src/gdb/gdbserver/linux-cris-low.c 2009-03-22 23:35:41.000000000 +0000
@@ -38,7 +38,7 @@ static int cris_regmap[] = {
-1, 17*4, -1, 16*4,
-1, -1, -1, 18*4,
-1, 17*4, -1, -1
-
+
};
static int
@@ -46,7 +46,7 @@ cris_cannot_store_register (int regno)
{
if (cris_regmap[regno] == -1)
return 1;
-
+
return (regno >= cris_num_regs);
}
Index: src/gdb/gdbserver/linux-crisv32-low.c
===================================================================
--- src.orig/gdb/gdbserver/linux-crisv32-low.c 2009-03-22 23:15:03.000000000 +0000
+++ src/gdb/gdbserver/linux-crisv32-low.c 2009-03-22 23:35:33.000000000 +0000
@@ -44,11 +44,11 @@ static int cris_regmap[] = {
25*4,
- 26*4, -1, -1, 29*4,
+ 26*4, -1, -1, 29*4,
30*4, 31*4, 32*4, 33*4,
34*4, 35*4, 36*4, 37*4,
38*4, 39*4, 40*4, -1
-
+
};
extern int debug_threads;
@@ -143,7 +143,7 @@ cris_insert_watchpoint (char type, CORE_
unsigned long bp_ctrl;
unsigned long start, end;
unsigned long ccs;
-
+
/* Breakpoint/watchpoint types (GDB terminology):
0 = memory breakpoint for instructions
(not supported; done via memory write instead)
@@ -151,8 +151,8 @@ cris_insert_watchpoint (char type, CORE_
2 = write watchpoint (supported)
3 = read watchpoint (supported)
4 = access watchpoint (supported). */
-
- if (type < '2' || type > '4')
+
+ if (type < '2' || type > '4')
{
/* Unsupported. */
return 1;
@@ -172,17 +172,17 @@ cris_insert_watchpoint (char type, CORE_
be used. Also, if a watch for a region that is already
covered by one or more existing watchpoints, a new
watchpoint will be used. */
-
+
/* First, find a free data watchpoint. */
for (bp = 0; bp < 6; bp++)
{
/* Each data watchpoint's control registers occupy 2 bits
(hence the 3), starting at bit 2 for D0 (hence the 2)
with 4 bits between for each watchpoint (yes, the 4). */
- if (!(bp_ctrl & (0x3 << (2 + (bp * 4)))))
+ if (!(bp_ctrl & (0x3 << (2 + (bp * 4)))))
break;
}
-
+
if (bp > 5)
{
/* We're out of watchpoints. */
@@ -195,15 +195,15 @@ cris_insert_watchpoint (char type, CORE_
/* Trigger on read. */
bp_ctrl |= (1 << (2 + bp * 4));
}
- if (type == '2' || type == '4')
+ if (type == '2' || type == '4')
{
/* Trigger on write. */
bp_ctrl |= (2 << (2 + bp * 4));
}
-
+
/* Setup the configuration register. */
supply_register_by_name ("s0", &bp_ctrl);
-
+
/* Setup the range. */
start = addr;
end = addr + len - 1;
@@ -225,7 +225,7 @@ cris_remove_watchpoint (char type, CORE_
int bp;
unsigned long bp_ctrl;
unsigned long start, end;
-
+
/* Breakpoint/watchpoint types:
0 = memory breakpoint for instructions
(not supported; done via memory write instead)
@@ -235,18 +235,18 @@ cris_remove_watchpoint (char type, CORE_
4 = access watchpoint (supported). */
if (type < '2' || type > '4')
return -1;
-
+
/* Read watchpoints are set as access watchpoints, because of GDB's
inability to deal with pure read watchpoints. */
if (type == '3')
type = '4';
-
+
/* Get the configuration register. */
collect_register_by_name ("s0", &bp_ctrl);
/* Try to find a watchpoint that is configured for the
specified range, then check that read/write also matches. */
-
+
/* Ugly pointer arithmetic, since I cannot rely on a
single switch (addr) as there may be several watchpoints with
the same start address for example. */
@@ -267,19 +267,19 @@ cris_remove_watchpoint (char type, CORE_
collect_register_by_name ("s13", &bp_d_regs[10]);
collect_register_by_name ("s14", &bp_d_regs[11]);
- for (bp = 0; bp < 6; bp++)
+ for (bp = 0; bp < 6; bp++)
{
- if (bp_d_regs[bp * 2] == addr
+ if (bp_d_regs[bp * 2] == addr
&& bp_d_regs[bp * 2 + 1] == (addr + len - 1)) {
/* Matching range. */
int bitpos = 2 + bp * 4;
int rw_bits;
-
+
/* Read/write bits for this BP. */
rw_bits = (bp_ctrl & (0x3 << bitpos)) >> bitpos;
-
+
if ((type == '3' && rw_bits == 0x1)
- || (type == '2' && rw_bits == 0x2)
+ || (type == '2' && rw_bits == 0x2)
|| (type == '4' && rw_bits == 0x3))
{
/* Read/write matched. */
@@ -287,13 +287,13 @@ cris_remove_watchpoint (char type, CORE_
}
}
}
-
+
if (bp > 5)
{
/* No watchpoint matched. */
return -1;
}
-
+
/* Found a matching watchpoint. Now, deconfigure it by
both disabling read/write in bp_ctrl and zeroing its
start/end addresses. */
Index: src/gdb/gdbserver/linux-i386-low.c
===================================================================
--- src.orig/gdb/gdbserver/linux-i386-low.c 2009-03-22 23:15:03.000000000 +0000
+++ src/gdb/gdbserver/linux-i386-low.c 2009-03-22 23:34:36.000000000 +0000
@@ -45,7 +45,7 @@ void init_registers_i386_linux (void);
/* Mapping between the general-purpose registers in `struct user'
format and GDB's register array layout. */
-static int i386_regmap[] =
+static int i386_regmap[] =
{
EAX * 4, ECX * 4, EDX * 4, EBX * 4,
UESP * 4, EBP * 4, ESI * 4, EDI * 4,
@@ -56,7 +56,7 @@ static int i386_regmap[] =
/* Called by libthread_db. */
ps_err_e
-ps_get_thread_area (const struct ps_prochandle *ph,
+ps_get_thread_area (const struct ps_prochandle *ph,
lwpid_t lwpid, int idx, void **base)
{
unsigned int desc[4];
Index: src/gdb/gdbserver/linux-low.c
===================================================================
--- src.orig/gdb/gdbserver/linux-low.c 2009-03-22 23:15:03.000000000 +0000
+++ src/gdb/gdbserver/linux-low.c 2009-03-22 23:24:00.000000000 +0000
@@ -340,25 +340,25 @@ linux_attach_lwp (unsigned long pid)
There are several cases to consider here:
1) gdbserver has already attached to the process and is being notified
- of a new thread that is being created.
- In this case we should ignore that SIGSTOP and resume the process.
- This is handled below by setting stop_expected = 1.
+ of a new thread that is being created.
+ In this case we should ignore that SIGSTOP and resume the process.
+ This is handled below by setting stop_expected = 1.
2) This is the first thread (the process thread), and we're attaching
- to it via attach_inferior.
- In this case we want the process thread to stop.
- This is handled by having linux_attach clear stop_expected after
- we return.
- ??? If the process already has several threads we leave the other
- threads running.
+ to it via attach_inferior.
+ In this case we want the process thread to stop.
+ This is handled by having linux_attach clear stop_expected after
+ we return.
+ ??? If the process already has several threads we leave the other
+ threads running.
3) GDB is connecting to gdbserver and is requesting an enumeration of all
- existing threads.
- In this case we want the thread to stop.
- FIXME: This case is currently not properly handled.
- We should wait for the SIGSTOP but don't. Things work apparently
- because enough time passes between when we ptrace (ATTACH) and when
- gdb makes the next ptrace call on the thread.
+ existing threads.
+ In this case we want the thread to stop.
+ FIXME: This case is currently not properly handled.
+ We should wait for the SIGSTOP but don't. Things work apparently
+ because enough time passes between when we ptrace (ATTACH) and when
+ gdb makes the next ptrace call on the thread.
On the other hand, if we are currently trying to stop all threads, we
should treat the new thread as if we had sent it a SIGSTOP. This works
@@ -900,11 +900,11 @@ linux_wait_for_event (struct thread_info
/* If we were single-stepping, we definitely want to report the
SIGTRAP. The single-step operation has completed, so also
- clear the stepping flag; in general this does not matter,
+ clear the stepping flag; in general this does not matter,
because the SIGTRAP will be reported to the client, which
will give us a new action for this thread, but clear it for
consistency anyway. It's safe to clear the stepping flag
- because the only consumer of get_stop_pc () after this point
+ because the only consumer of get_stop_pc () after this point
is check_removed_breakpoint, and pending_is_breakpoint is not
set. It might be wiser to use a step_completed flag instead. */
if (event_child->stepping)
@@ -989,7 +989,8 @@ retry:
{
if (WIFEXITED (w))
{
- fprintf (stderr, "\nChild exited with retcode = %x \n", WEXITSTATUS (w));
+ fprintf (stderr, "\nChild exited with retcode = %x \n",
+ WEXITSTATUS (w));
*status = 'W';
clear_inferiors ();
free (all_lwps.head);
@@ -998,7 +999,8 @@ retry:
}
else if (!WIFSTOPPED (w))
{
- fprintf (stderr, "\nChild terminated with signal = %x \n", WTERMSIG (w));
+ fprintf (stderr, "\nChild terminated with signal = %x \n",
+ WTERMSIG (w));
*status = 'X';
clear_inferiors ();
free (all_lwps.head);
@@ -1031,7 +1033,7 @@ kill_lwp (unsigned long lwpid, int signo
{
int ret = syscall (SYS_tkill, lwpid, signo);
if (errno != ENOSYS)
- return ret;
+ return ret;
errno = 0;
tkill_failed = 1;
}
@@ -1160,8 +1162,8 @@ linux_resume_one_lwp (struct inferior_li
current_inferior = get_lwp_thread (lwp);
if (debug_threads)
- fprintf (stderr, "Resuming lwp %ld (%s, signal %d, stop %s)\n", inferior_pid,
- step ? "step" : "continue", signal,
+ fprintf (stderr, "Resuming lwp %ld (%s, signal %d, stop %s)\n",
+ inferior_pid, step ? "step" : "continue", signal,
lwp->stop_expected ? "expected" : "not expected");
/* This bit needs some thinking about. If we get a signal that
@@ -1423,8 +1425,8 @@ fetch_register (int regno)
regaddr = register_addr (regno);
if (regaddr == -1)
return;
- size = (register_size (regno) + sizeof (PTRACE_XFER_TYPE) - 1)
- & - sizeof (PTRACE_XFER_TYPE);
+ size = ((register_size (regno) + sizeof (PTRACE_XFER_TYPE) - 1)
+ & - sizeof (PTRACE_XFER_TYPE));
buf = alloca (size);
for (i = 0; i < size; i += sizeof (PTRACE_XFER_TYPE))
{
@@ -1502,9 +1504,10 @@ usr_store_inferior_registers (int regno)
*(PTRACE_XFER_TYPE *) (buf + i));
if (errno != 0)
{
- /* At this point, ESRCH should mean the process is already gone,
- in which case we simply ignore attempts to change its registers.
- See also the related comment in linux_resume_one_lwp. */
+ /* At this point, ESRCH should mean the process is
+ already gone, in which case we simply ignore attempts
+ to change its registers. See also the related
+ comment in linux_resume_one_lwp. */
if (errno == ESRCH)
return;
@@ -1621,9 +1624,9 @@ regsets_store_inferior_registers ()
/* Only now do we write the register set. */
#ifndef __sparc__
- res = ptrace (regset->set_request, inferior_pid, 0, buf);
+ res = ptrace (regset->set_request, inferior_pid, 0, buf);
#else
- res = ptrace (regset->set_request, inferior_pid, buf, 0);
+ res = ptrace (regset->set_request, inferior_pid, buf, 0);
#endif
}
@@ -1638,9 +1641,10 @@ regsets_store_inferior_registers ()
}
else if (errno == ESRCH)
{
- /* At this point, ESRCH should mean the process is already gone,
- in which case we simply ignore attempts to change its registers.
- See also the related comment in linux_resume_one_lwp. */
+ /* At this point, ESRCH should mean the process is
+ already gone, in which case we simply ignore attempts
+ to change its registers. See also the related
+ comment in linux_resume_one_lwp. */
return 0;
}
else
@@ -1740,13 +1744,16 @@ linux_read_memory (CORE_ADDR memaddr, un
for (i = 0; i < count; i++, addr += sizeof (PTRACE_XFER_TYPE))
{
errno = 0;
- buffer[i] = ptrace (PTRACE_PEEKTEXT, inferior_pid, (PTRACE_ARG3_TYPE) addr, 0);
+ buffer[i] = ptrace (PTRACE_PEEKTEXT, inferior_pid,
+ (PTRACE_ARG3_TYPE) addr, 0);
if (errno)
return errno;
}
/* Copy appropriate bytes out of the buffer. */
- memcpy (myaddr, (char *) buffer + (memaddr & (sizeof (PTRACE_XFER_TYPE) - 1)), len);
+ memcpy (myaddr,
+ (char *) buffer + (memaddr & (sizeof (PTRACE_XFER_TYPE) - 1)),
+ len);
return 0;
}
@@ -2059,17 +2066,17 @@ linux_read_offsets (CORE_ADDR *text_p, C
if (errno == 0)
{
/* Both text and data offsets produced at compile-time (and so
- used by gdb) are relative to the beginning of the program,
- with the data segment immediately following the text segment.
- However, the actual runtime layout in memory may put the data
- somewhere else, so when we send gdb a data base-address, we
- use the real data base address and subtract the compile-time
- data base-address from it (which is just the length of the
- text segment). BSS immediately follows data in both
- cases. */
+ used by gdb) are relative to the beginning of the program,
+ with the data segment immediately following the text segment.
+ However, the actual runtime layout in memory may put the data
+ somewhere else, so when we send gdb a data base-address, we
+ use the real data base address and subtract the compile-time
+ data base-address from it (which is just the length of the
+ text segment). BSS immediately follows data in both
+ cases. */
*text_p = text;
*data_p = data - (text_end - text);
-
+
return 1;
}
#endif
@@ -2079,8 +2086,8 @@ linux_read_offsets (CORE_ADDR *text_p, C
static int
linux_qxfer_osdata (const char *annex,
- unsigned char *readbuf, unsigned const char *writebuf,
- CORE_ADDR offset, int len)
+ unsigned char *readbuf, unsigned const char *writebuf,
+ CORE_ADDR offset, int len)
{
/* We make the process list snapshot when the object starts to be
read. */
@@ -2108,40 +2115,40 @@ linux_qxfer_osdata (const char *annex,
dirp = opendir ("/proc");
if (dirp)
{
- struct dirent *dp;
- while ((dp = readdir (dirp)) != NULL)
- {
- struct stat statbuf;
- char procentry[sizeof ("/proc/4294967295")];
-
- if (!isdigit (dp->d_name[0])
- || strlen (dp->d_name) > sizeof ("4294967295") - 1)
- continue;
-
- sprintf (procentry, "/proc/%s", dp->d_name);
- if (stat (procentry, &statbuf) == 0
- && S_ISDIR (statbuf.st_mode))
- {
- char pathname[128];
- FILE *f;
- char cmd[MAXPATHLEN + 1];
- struct passwd *entry;
-
- sprintf (pathname, "/proc/%s/cmdline", dp->d_name);
- entry = getpwuid (statbuf.st_uid);
-
- if ((f = fopen (pathname, "r")) != NULL)
- {
- size_t len = fread (cmd, 1, sizeof (cmd) - 1, f);
- if (len > 0)
- {
- int i;
- for (i = 0; i < len; i++)
- if (cmd[i] == '\0')
- cmd[i] = ' ';
- cmd[len] = '\0';
+ struct dirent *dp;
+ while ((dp = readdir (dirp)) != NULL)
+ {
+ struct stat statbuf;
+ char procentry[sizeof ("/proc/4294967295")];
+
+ if (!isdigit (dp->d_name[0])
+ || strlen (dp->d_name) > sizeof ("4294967295") - 1)
+ continue;
+
+ sprintf (procentry, "/proc/%s", dp->d_name);
+ if (stat (procentry, &statbuf) == 0
+ && S_ISDIR (statbuf.st_mode))
+ {
+ char pathname[128];
+ FILE *f;
+ char cmd[MAXPATHLEN + 1];
+ struct passwd *entry;
+
+ sprintf (pathname, "/proc/%s/cmdline", dp->d_name);
+ entry = getpwuid (statbuf.st_uid);
+
+ if ((f = fopen (pathname, "r")) != NULL)
+ {
+ size_t len = fread (cmd, 1, sizeof (cmd) - 1, f);
+ if (len > 0)
+ {
+ int i;
+ for (i = 0; i < len; i++)
+ if (cmd[i] == '\0')
+ cmd[i] = ' ';
+ cmd[len] = '\0';
- buffer_xml_printf (
+ buffer_xml_printf (
&buffer,
"<item>"
"<column name=\"pid\">%s</column>"
@@ -2151,13 +2158,13 @@ linux_qxfer_osdata (const char *annex,
dp->d_name,
entry ? entry->pw_name : "?",
cmd);
- }
- fclose (f);
- }
- }
- }
+ }
+ fclose (f);
+ }
+ }
+ }
- closedir (dirp);
+ closedir (dirp);
}
buffer_grow_str0 (&buffer, "</osdata>\n");
buf = buffer_finish (&buffer);
Index: src/gdb/gdbserver/linux-mips-low.c
===================================================================
--- src.orig/gdb/gdbserver/linux-mips-low.c 2009-03-22 23:15:03.000000000 +0000
+++ src/gdb/gdbserver/linux-mips-low.c 2009-03-22 23:34:00.000000000 +0000
@@ -167,7 +167,7 @@ mips_breakpoint_at (CORE_ADDR where)
ps_err_e
ps_get_thread_area (const struct ps_prochandle *ph,
- lwpid_t lwpid, int idx, void **base)
+ lwpid_t lwpid, int idx, void **base)
{
if (ptrace (PTRACE_GET_THREAD_AREA, lwpid, NULL, base) != 0)
return PS_ERR;
Index: src/gdb/gdbserver/linux-s390-low.c
===================================================================
--- src.orig/gdb/gdbserver/linux-s390-low.c 2009-03-22 23:15:04.000000000 +0000
+++ src/gdb/gdbserver/linux-s390-low.c 2009-03-22 23:33:48.000000000 +0000
@@ -225,4 +225,3 @@ struct linux_target_ops the_low_target =
s390_collect_ptrace_register,
s390_supply_ptrace_register,
};
-
Index: src/gdb/gdbserver/linux-sparc-low.c
===================================================================
--- src.orig/gdb/gdbserver/linux-sparc-low.c 2009-03-22 23:15:04.000000000 +0000
+++ src/gdb/gdbserver/linux-sparc-low.c 2009-03-22 23:33:38.000000000 +0000
@@ -49,10 +49,10 @@
static int sparc_regmap[] = {
/* These offsets correspond to GET/SETREGSET. */
- -1, 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, /* g0 .. g7 */
- 7*8, 8*8, 9*8, 10*8, 11*8, 12*8, 13*8, 14*8, /* o0 .. o5, sp, o7 */
- -1, -1, -1, -1, -1, -1, -1, -1, /* l0 .. l7 */
- -1, -1, -1, -1, -1, -1, -1, -1, /* i0 .. i5, fp, i7 */
+ -1, 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, /* g0 .. g7 */
+ 7*8, 8*8, 9*8, 10*8, 11*8, 12*8, 13*8, 14*8, /* o0 .. o5, sp, o7 */
+ -1, -1, -1, -1, -1, -1, -1, -1, /* l0 .. l7 */
+ -1, -1, -1, -1, -1, -1, -1, -1, /* i0 .. i5, fp, i7 */
/* Floating point registers offsets correspond to GET/SETFPREGSET. */
0*4, 1*4, 2*4, 3*4, 4*4, 5*4, 6*4, 7*4, /* f0 .. f7 */
@@ -61,8 +61,8 @@ static int sparc_regmap[] = {
24*4, 25*4, 26*4, 27*4, 28*4, 29*4, 30*4, 31*4, /* f24 .. f31 */
/* F32 offset starts next to f31: 31*4+4 = 16 * 8. */
- 16*8, 17*8, 18*8, 19*8, 20*8, 21*8, 22*8, 23*8, /* f32 .. f46 */
- 24*8, 25*8, 26*8, 27*8, 28*8, 29*8, 30*8, 31*8, /* f48 .. f62 */
+ 16*8, 17*8, 18*8, 19*8, 20*8, 21*8, 22*8, 23*8, /* f32 .. f46 */
+ 24*8, 25*8, 26*8, 27*8, 28*8, 29*8, 30*8, 31*8, /* f48 .. f62 */
17 *8, /* pc */
18 *8, /* npc */
@@ -125,7 +125,7 @@ sparc_fill_gregset_to_stack (const void
memcpy(&addr, ((char *) buf) + sparc_regmap[find_regno("sp")], sizeof(addr));
addr += BIAS;
-
+
for (i = l0_regno; i <= i7_regno; i++)
{
collect_register (i, tmp_reg_buf);
@@ -139,12 +139,12 @@ sparc_fill_gregset (void *buf)
{
int i;
int range;
-
+
for (range = 0; range < N_GREGS_RANGES; range++)
for (i = gregs_ranges[range].regno_start; i <= gregs_ranges[range].regno_end; i++)
if (sparc_regmap[i] != -1)
- collect_register (i, ((char *) buf) + sparc_regmap[i]);
-
+ collect_register (i, ((char *) buf) + sparc_regmap[i]);
+
sparc_fill_gregset_to_stack (buf);
}
@@ -153,11 +153,11 @@ sparc_fill_fpregset (void *buf)
{
int i;
int range;
-
+
for (range = 0; range < N_FPREGS_RANGES; range++)
for (i = fpregs_ranges[range].regno_start; i <= fpregs_ranges[range].regno_end; i++)
collect_register (i, ((char *) buf) + sparc_regmap[i]);
-
+
}
static void
@@ -173,7 +173,7 @@ sparc_store_gregset_from_stack (const vo
memcpy(&addr, ((char *) buf) + sparc_regmap[find_regno("sp")], sizeof(addr));
addr += BIAS;
-
+
for (i = l0_regno; i <= i7_regno; i++)
{
(*the_target->read_memory) (addr, tmp_reg_buf, sizeof(tmp_reg_buf));
@@ -190,14 +190,14 @@ sparc_store_gregset (const void *buf)
int range;
memset (zerobuf, 0, sizeof(zerobuf));
-
+
for (range = 0; range < N_GREGS_RANGES; range++)
for (i = gregs_ranges[range].regno_start; i <= gregs_ranges[range].regno_end; i++)
if (sparc_regmap[i] != -1)
- supply_register (i, ((char *) buf) + sparc_regmap[i]);
+ supply_register (i, ((char *) buf) + sparc_regmap[i]);
else
- supply_register (i, zerobuf);
-
+ supply_register (i, zerobuf);
+
sparc_store_gregset_from_stack (buf);
}
@@ -206,7 +206,7 @@ sparc_store_fpregset (const void *buf)
{
int i;
int range;
-
+
for (range = 0; range < N_FPREGS_RANGES; range++)
for (i = fpregs_ranges[range].regno_start; i <= fpregs_ranges[range].regno_end; i++)
supply_register (i, ((char *) buf) + sparc_regmap[i]);
@@ -234,7 +234,7 @@ sparc_breakpoint_at (CORE_ADDR where)
unsigned char insn[INSN_SIZE];
(*the_target->read_memory) (where, (unsigned char *) insn, sizeof(insn));
-
+
if (memcmp(sparc_breakpoint, insn, sizeof(insn)) == 0)
return 1;
@@ -284,4 +284,3 @@ struct linux_target_ops the_low_target =
NULL, NULL, NULL, NULL,
NULL, NULL
};
-
Index: src/gdb/gdbserver/linux-x86-64-low.c
===================================================================
--- src.orig/gdb/gdbserver/linux-x86-64-low.c 2009-03-22 23:15:04.000000000 +0000
+++ src/gdb/gdbserver/linux-x86-64-low.c 2009-03-22 23:31:56.000000000 +0000
@@ -50,7 +50,7 @@ static int x86_64_regmap[] = {
RSI * 8, RDI * 8, RBP * 8, RSP * 8,
R8 * 8, R9 * 8, R10 * 8, R11 * 8,
R12 * 8, R13 * 8, R14 * 8, R15 * 8,
- RIP * 8, EFLAGS * 8, CS * 8, SS * 8,
+ RIP * 8, EFLAGS * 8, CS * 8, SS * 8,
DS * 8, ES * 8, FS * 8, GS * 8,
-1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1,
@@ -65,7 +65,7 @@ static int x86_64_regmap[] = {
ps_err_e
ps_get_thread_area (const struct ps_prochandle *ph,
- lwpid_t lwpid, int idx, void **base)
+ lwpid_t lwpid, int idx, void **base)
{
switch (idx)
{
@@ -127,7 +127,7 @@ struct regset_info target_regsets[] = {
static const unsigned char x86_64_breakpoint[] = { 0xCC };
#define x86_64_breakpoint_len 1
-
+
extern int debug_threads;
static CORE_ADDR
@@ -170,9 +170,9 @@ struct linux_target_ops the_low_target =
NULL,
x86_64_get_pc,
x86_64_set_pc,
- x86_64_breakpoint,
+ x86_64_breakpoint,
x86_64_breakpoint_len,
- NULL,
+ NULL,
1,
x86_64_breakpoint_at,
NULL,
Index: src/gdb/gdbserver/linux-xtensa-low.c
===================================================================
--- src.orig/gdb/gdbserver/linux-xtensa-low.c 2009-03-22 23:15:04.000000000 +0000
+++ src/gdb/gdbserver/linux-xtensa-low.c 2009-03-22 23:31:30.000000000 +0000
@@ -33,7 +33,7 @@ enum regnum {
R_LBEG, R_LEND, R_LCOUNT,
R_SAR,
R_WS, R_WB,
- R_A0 = 64
+ R_A0 = 64
};
static void
Index: src/gdb/gdbserver/proc-service.c
===================================================================
--- src.orig/gdb/gdbserver/proc-service.c 2009-03-22 23:15:04.000000000 +0000
+++ src/gdb/gdbserver/proc-service.c 2009-03-22 23:30:20.000000000 +0000
@@ -159,5 +159,3 @@ ps_getpid (gdb_ps_prochandle_t ph)
{
return ph->pid;
}
-
-
Index: src/gdb/gdbserver/regcache.c
===================================================================
--- src.orig/gdb/gdbserver/regcache.c 2009-03-22 23:15:04.000000000 +0000
+++ src/gdb/gdbserver/regcache.c 2009-03-22 23:30:10.000000000 +0000
@@ -132,7 +132,7 @@ void
set_register_cache (struct reg *regs, int n)
{
int offset, i;
-
+
reg_defs = regs;
num_registers = n;
@@ -169,7 +169,8 @@ registers_from_string (char *buf)
if (len != register_bytes * 2)
{
- warning ("Wrong sized register packet (expected %d bytes, got %d)", 2*register_bytes, len);
+ warning ("Wrong sized register packet (expected %d bytes, got %d)",
+ 2*register_bytes, len);
if (len > register_bytes * 2)
len = register_bytes * 2;
}
Index: src/gdb/gdbserver/remote-utils.c
===================================================================
--- src.orig/gdb/gdbserver/remote-utils.c 2009-03-22 23:15:04.000000000 +0000
+++ src/gdb/gdbserver/remote-utils.c 2009-03-22 23:29:48.000000000 +0000
@@ -256,7 +256,7 @@ remote_open (char *name)
(char *) &tmp, sizeof (tmp));
/* Tell TCP not to delay small packets. This greatly speeds up
- interactive response. */
+ interactive response. */
tmp = 1;
setsockopt (remote_desc, IPPROTO_TCP, TCP_NODELAY,
(char *) &tmp, sizeof (tmp));
@@ -272,8 +272,8 @@ remote_open (char *name)
#endif
/* Convert IP address to string. */
- fprintf (stderr, "Remote debugging from host %s\n",
- inet_ntoa (sockaddr.sin_addr));
+ fprintf (stderr, "Remote debugging from host %s\n",
+ inet_ntoa (sockaddr.sin_addr));
transport_is_reliable = 1;
}
@@ -319,11 +319,11 @@ unhexify (char *bin, const char *hex, in
for (i = 0; i < count; i++)
{
if (hex[0] == 0 || hex[1] == 0)
- {
- /* Hex string is short, or of uneven length.
- Return the count that has been converted so far. */
- return i;
- }
+ {
+ /* Hex string is short, or of uneven length.
+ Return the count that has been converted so far. */
+ return i;
+ }
*bin++ = fromhex (hex[0]) * 16 + fromhex (hex[1]);
hex += 2;
}
@@ -1198,7 +1198,7 @@ look_up_one_symbol (const char *name, CO
if (len < 0)
return -1;
}
-
+
if (strncmp (own_buf, "qSymbol:", strlen ("qSymbol:")) != 0)
{
warning ("Malformed response to qSymbol, ignoring: %s\n", own_buf);
@@ -1368,21 +1368,21 @@ buffer_xml_printf (struct buffer *buffer
{
if (percent)
{
- switch (*f)
- {
- case 's':
- {
- char *p;
- char *a = va_arg (ap, char *);
- buffer_grow (buffer, prev, f - prev - 1);
- p = xml_escape_text (a);
- buffer_grow_str (buffer, p);
- free (p);
- prev = f + 1;
- }
- break;
- }
- percent = 0;
+ switch (*f)
+ {
+ case 's':
+ {
+ char *p;
+ char *a = va_arg (ap, char *);
+ buffer_grow (buffer, prev, f - prev - 1);
+ p = xml_escape_text (a);
+ buffer_grow_str (buffer, p);
+ free (p);
+ prev = f + 1;
+ }
+ break;
+ }
+ percent = 0;
}
else if (*f == '%')
percent = 1;
Index: src/gdb/gdbserver/server.c
===================================================================
--- src.orig/gdb/gdbserver/server.c 2009-03-22 23:15:04.000000000 +0000
+++ src/gdb/gdbserver/server.c 2009-03-22 23:17:33.000000000 +0000
@@ -331,7 +331,7 @@ monitor_show_help (void)
{
monitor_output ("The following monitor commands are supported:\n");
monitor_output (" set debug <0|1>\n");
- monitor_output (" Enable general debugging messages\n");
+ monitor_output (" Enable general debugging messages\n");
monitor_output (" set remote-debug <0|1>\n");
monitor_output (" Enable remote protocol debugging messages\n");
monitor_output (" exit\n");
@@ -523,7 +523,8 @@ handle_query (char *own_buf, int packet_
{
require_running (own_buf);
thread_ptr = all_threads.head;
- sprintf (own_buf, "m%x", thread_to_gdb_id ((struct thread_info *)thread_ptr));
+ sprintf (own_buf, "m%x",
+ thread_to_gdb_id ((struct thread_info *)thread_ptr));
thread_ptr = thread_ptr->next;
return;
}
@@ -533,7 +534,8 @@ handle_query (char *own_buf, int packet_
require_running (own_buf);
if (thread_ptr != NULL)
{
- sprintf (own_buf, "m%x", thread_to_gdb_id ((struct thread_info *)thread_ptr));
+ sprintf (own_buf, "m%x",
+ thread_to_gdb_id ((struct thread_info *)thread_ptr));
thread_ptr = thread_ptr->next;
return;
}
@@ -556,7 +558,7 @@ handle_query (char *own_buf, int packet_
(long)text, (long)data, (long)data);
else
write_enn (own_buf);
-
+
return;
}
@@ -577,15 +579,15 @@ handle_query (char *own_buf, int packet_
len = PBUFSIZ - 2;
spu_buf = malloc (len + 1);
if (!spu_buf)
- return;
+ return;
n = (*the_target->qxfer_spu) (annex, spu_buf, NULL, ofs, len + 1);
- if (n < 0)
+ if (n < 0)
write_enn (own_buf);
else if (n > len)
*new_packet_len_p = write_qxfer_response
(own_buf, spu_buf, len, 1);
- else
+ else
*new_packet_len_p = write_qxfer_response
(own_buf, spu_buf, n, 0);
@@ -606,7 +608,7 @@ handle_query (char *own_buf, int packet_
strcpy (own_buf, "E00");
spu_buf = malloc (packet_len - 15);
if (!spu_buf)
- return;
+ return;
if (decode_xfer_write (own_buf + 16, packet_len - 16, &annex,
&ofs, &len, spu_buf) < 0)
{
@@ -614,7 +616,7 @@ handle_query (char *own_buf, int packet_
return;
}
- n = (*the_target->qxfer_spu)
+ n = (*the_target->qxfer_spu)
(annex, NULL, (unsigned const char *)spu_buf, ofs, len);
if (n < 0)
write_enn (own_buf);
@@ -794,17 +796,15 @@ handle_query (char *own_buf, int packet_
len = PBUFSIZ - 2;
workbuf = malloc (len + 1);
if (!workbuf)
- return;
+ return;
n = (*the_target->qxfer_osdata) (annex, workbuf, NULL, ofs, len + 1);
if (n < 0)
write_enn (own_buf);
else if (n > len)
- *new_packet_len_p = write_qxfer_response
- (own_buf, workbuf, len, 1);
+ *new_packet_len_p = write_qxfer_response (own_buf, workbuf, len, 1);
else
- *new_packet_len_p = write_qxfer_response
- (own_buf, workbuf, n, 0);
+ *new_packet_len_p = write_qxfer_response (own_buf, workbuf, n, 0);
free (workbuf);
return;
@@ -835,7 +835,7 @@ handle_query (char *own_buf, int packet_
len = PBUFSIZ - 2;
data = malloc (len + 1);
if (!data)
- return;
+ return;
n = (*the_target->qxfer_siginfo) (annex, data, NULL, ofs, len + 1);
if (n < 0)
write_enn (own_buf);
@@ -862,7 +862,7 @@ handle_query (char *own_buf, int packet_
strcpy (own_buf, "E00");
data = malloc (packet_len - 19);
if (!data)
- return;
+ return;
if (decode_xfer_write (own_buf + 20, packet_len - 20, &annex,
&ofs, &len, data) < 0)
{
@@ -910,7 +910,7 @@ handle_query (char *own_buf, int packet_
strcat (own_buf, ";QStartNoAckMode+");
if (the_target->qxfer_osdata != NULL)
- strcat (own_buf, ";qXfer:osdata:read+");
+ strcat (own_buf, ";qXfer:osdata:read+");
return;
}
@@ -1254,7 +1254,7 @@ handle_v_run (char *own_buf, char *statu
/* FIXME: new_argv memory leak */
write_enn (own_buf);
return 0;
- }
+ }
}
/* Free the old argv and install the new one. */
@@ -1898,7 +1898,7 @@ main (int argc, char *argv[])
response_needed = 0;
/* Restarting the inferior is only supported in the
- extended protocol. */
+ extended protocol. */
if (extended_protocol)
{
if (target_running ())
@@ -1931,8 +1931,8 @@ main (int argc, char *argv[])
default:
/* It is a request we don't understand. Respond with an
- empty packet so that gdb knows that we don't support this
- request. */
+ empty packet so that gdb knows that we don't support this
+ request. */
own_buf[0] = '\0';
break;
}
Index: src/gdb/gdbserver/spu-low.c
===================================================================
--- src.orig/gdb/gdbserver/spu-low.c 2009-03-22 23:15:04.000000000 +0000
+++ src/gdb/gdbserver/spu-low.c 2009-03-22 23:27:58.000000000 +0000
@@ -33,7 +33,7 @@
/* Some older glibc versions do not define this. */
#ifndef __WNOTHREAD
#define __WNOTHREAD 0x20000000 /* Don't wait on children of other
- threads in this group */
+ threads in this group */
#endif
#define PTRACE_TYPE_RET long
@@ -90,7 +90,7 @@ fetch_ppc_register (int regno)
errno = 0;
res = ptrace (PT_READ_U, tid,
- (PTRACE_TYPE_ARG3) (regno * sizeof (PTRACE_TYPE_RET)), 0);
+ (PTRACE_TYPE_ARG3) (regno * sizeof (PTRACE_TYPE_RET)), 0);
if (errno != 0)
{
char mess[128];
@@ -190,7 +190,7 @@ store_ppc_memory (CORE_ADDR memaddr, cha
return ret;
memcpy ((char *) buffer + (memaddr & (sizeof (PTRACE_TYPE_RET) - 1)),
- myaddr, len);
+ myaddr, len);
for (i = 0; i < count; i++, addr += sizeof (PTRACE_TYPE_RET))
if ((ret = store_ppc_memory_1 (tid, addr, buffer[i])) != 0)
@@ -203,7 +203,7 @@ store_ppc_memory (CORE_ADDR memaddr, cha
/* If the PPU thread is currently stopped on a spu_run system call,
return to FD and ADDR the file handle and NPC parameter address
used with the system call. Return non-zero if successful. */
-static int
+static int
parse_spufs_run (int *fd, CORE_ADDR *addr)
{
char buf[4];
Index: src/gdb/gdbserver/target.h
===================================================================
--- src.orig/gdb/gdbserver/target.h 2009-03-22 23:15:04.000000000 +0000
+++ src/gdb/gdbserver/target.h 2009-03-22 23:27:26.000000000 +0000
@@ -147,7 +147,7 @@ struct target_ops
unsigned int len);
/* Insert and remove a hardware watchpoint.
- Returns 0 on success, -1 on failure and 1 on unsupported.
+ Returns 0 on success, -1 on failure and 1 on unsupported.
The type is coded as follows:
2 = write watchpoint
3 = read watchpoint
@@ -161,7 +161,7 @@ struct target_ops
int (*stopped_by_watchpoint) (void);
- /* Returns the address associated with the watchpoint that hit, if any;
+ /* Returns the address associated with the watchpoint that hit, if any;
returns 0 otherwise. */
CORE_ADDR (*stopped_data_address) (void);
@@ -169,7 +169,7 @@ struct target_ops
/* Reports the text, data offsets of the executable. This is
needed for uclinux where the executable is relocated during load
time. */
-
+
int (*read_offsets) (CORE_ADDR *text, CORE_ADDR *data);
/* Fetch the address associated with a specific thread local storage
@@ -191,7 +191,7 @@ struct target_ops
/* Read/Write OS data using qXfer packets. */
int (*qxfer_osdata) (const char *annex, unsigned char *readbuf,
- unsigned const char *writebuf, CORE_ADDR offset,
+ unsigned const char *writebuf, CORE_ADDR offset,
int len);
/* Read/Write extra signal info. */
Index: src/gdb/gdbserver/thread-db.c
===================================================================
--- src.orig/gdb/gdbserver/thread-db.c 2009-03-22 23:15:04.000000000 +0000
+++ src/gdb/gdbserver/thread-db.c 2009-03-22 23:27:01.000000000 +0000
@@ -196,7 +196,7 @@ thread_db_enable_reporting ()
if (err != TD_OK)
{
warning ("Unable to set global thread event mask: %s",
- thread_db_err_str (err));
+ thread_db_err_str (err));
return 0;
}
Index: src/gdb/gdbserver/win32-low.c
===================================================================
--- src.orig/gdb/gdbserver/win32-low.c 2009-03-22 23:15:05.000000000 +0000
+++ src/gdb/gdbserver/win32-low.c 2009-03-22 23:26:38.000000000 +0000
@@ -458,15 +458,15 @@ create_process (const char *program, cha
mbstowcs (wargs, args, argslen + 1);
ret = CreateProcessW (wprogram, /* image name */
- wargs, /* command line */
- NULL, /* security, not supported */
- NULL, /* thread, not supported */
- FALSE, /* inherit handles, not supported */
- flags, /* start flags */
- NULL, /* environment, not supported */
- NULL, /* current directory, not supported */
- NULL, /* start info, not supported */
- pi); /* proc info */
+ wargs, /* command line */
+ NULL, /* security, not supported */
+ NULL, /* thread, not supported */
+ FALSE, /* inherit handles, not supported */
+ flags, /* start flags */
+ NULL, /* environment, not supported */
+ NULL, /* current directory, not supported */
+ NULL, /* start info, not supported */
+ pi); /* proc info */
#else
STARTUPINFOA si = { sizeof (STARTUPINFOA) };
@@ -537,7 +537,7 @@ win32_create_inferior (char *program, ch
for (argc = 1; program_args[argc]; argc++)
{
/* FIXME: Can we do better about quoting? How does Cygwin
- handle this? */
+ handle this? */
strcat (args, " ");
strcat (args, program_args[argc]);
}
@@ -609,7 +609,7 @@ win32_attach (unsigned long pid)
DebugSetProcessKillOnExit (FALSE);
/* win32_wait needs to know we're attaching. */
- attaching = 1;
+ attaching = 1;
do_initial_child_stuff (h, pid);
return 0;
}
@@ -642,7 +642,7 @@ handle_output_debug_string (struct targe
if (current_event.u.DebugString.fUnicode)
{
/* The event tells us how many bytes, not chars, even
- in Unicode. */
+ in Unicode. */
WCHAR buffer[(READ_BUFFER_LEN + 1) / sizeof (WCHAR)] = { 0 };
if (read_inferior_memory (addr, (unsigned char *) buffer, nbytes) != 0)
return;
@@ -695,9 +695,9 @@ win32_kill (void)
break;
else if (current_event.dwDebugEventCode == OUTPUT_DEBUG_STRING_EVENT)
{
- struct target_waitstatus our_status = { 0 };
+ struct target_waitstatus our_status = { 0 };
handle_output_debug_string (&our_status);
- }
+ }
}
win32_clear_inferiors ();
@@ -1242,7 +1242,7 @@ handle_exception (struct target_waitstat
#ifdef _WIN32_WCE
/* Remove the initial breakpoint. */
check_breakpoints ((CORE_ADDR) (long) current_event
- .u.Exception.ExceptionRecord.ExceptionAddress);
+ .u.Exception.ExceptionRecord.ExceptionAddress);
#endif
break;
case DBG_CONTROL_C:
@@ -1354,37 +1354,37 @@ get_child_debug_event (struct target_wai
if (attaching)
{
/* WinCE doesn't set an initial breakpoint automatically. To
- stop the inferior, we flush all currently pending debug
- events -- the thread list and the dll list are always
- reported immediatelly without delay, then, we suspend all
- threads and pretend we saw a trap at the current PC of the
- main thread.
-
- Contrary to desktop Windows, Windows CE *does* report the dll
- names on LOAD_DLL_DEBUG_EVENTs resulting from a
- DebugActiveProcess call. This limits the way we can detect
- if all the dlls have already been reported. If we get a real
- debug event before leaving attaching, the worst that will
- happen is the user will see a spurious breakpoint. */
+ stop the inferior, we flush all currently pending debug
+ events -- the thread list and the dll list are always
+ reported immediatelly without delay, then, we suspend all
+ threads and pretend we saw a trap at the current PC of the
+ main thread.
+
+ Contrary to desktop Windows, Windows CE *does* report the dll
+ names on LOAD_DLL_DEBUG_EVENTs resulting from a
+ DebugActiveProcess call. This limits the way we can detect
+ if all the dlls have already been reported. If we get a real
+ debug event before leaving attaching, the worst that will
+ happen is the user will see a spurious breakpoint. */
current_event.dwDebugEventCode = 0;
if (!WaitForDebugEvent (¤t_event, 0))
- {
- OUTMSG2(("no attach events left\n"));
- fake_breakpoint_event ();
- attaching = 0;
- }
+ {
+ OUTMSG2(("no attach events left\n"));
+ fake_breakpoint_event ();
+ attaching = 0;
+ }
else
- OUTMSG2(("got attach event\n"));
+ OUTMSG2(("got attach event\n"));
}
else
#endif
{
/* Keep the wait time low enough for confortable remote
- interruption, but high enough so gdbserver doesn't become a
- bottleneck. */
+ interruption, but high enough so gdbserver doesn't become a
+ bottleneck. */
if (!WaitForDebugEvent (¤t_event, 250))
- return 0;
+ return 0;
}
gotevent:
@@ -1537,7 +1537,7 @@ win32_wait (char *status)
win32_clear_inferiors ();
return our_status.value.integer;
case TARGET_WAITKIND_STOPPED:
- case TARGET_WAITKIND_LOADED:
+ case TARGET_WAITKIND_LOADED:
OUTMSG2 (("Child Stopped with signal = %d \n",
our_status.value.sig));
@@ -1555,11 +1555,11 @@ win32_wait (char *status)
}
return our_status.value.sig;
- default:
+ default:
OUTMSG (("Ignoring unknown internal event, %d\n", our_status.kind));
- /* fall-through */
- case TARGET_WAITKIND_SPURIOUS:
- case TARGET_WAITKIND_EXECD:
+ /* fall-through */
+ case TARGET_WAITKIND_SPURIOUS:
+ case TARGET_WAITKIND_EXECD:
/* do nothing, just continue */
child_continue (DBG_CONTINUE, -1);
break;
Index: src/gdb/gdbserver/xtensa-xtregs.c
===================================================================
--- src.orig/gdb/gdbserver/xtensa-xtregs.c 2009-03-22 23:15:05.000000000 +0000
+++ src/gdb/gdbserver/xtensa-xtregs.c 2009-03-22 23:25:06.000000000 +0000
@@ -35,4 +35,3 @@ const xtensa_regtable_t xtensa_regmap_t
{ 44, 176, 0, 0, 4, -1, 0x020c, "scompare1" },
{ 0 }
};
-
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [gdbserver/commit] fix whitespace.
2009-03-23 0:22 [gdbserver/commit] fix whitespace Pedro Alves
@ 2009-03-23 1:12 ` Pedro Alves
2009-03-23 1:26 ` Joel Brobecker
0 siblings, 1 reply; 9+ messages in thread
From: Pedro Alves @ 2009-03-23 1:12 UTC (permalink / raw)
To: gdb-patches
I'm also applying these further fixes.
--
Pedro Alves
2009-03-23 Pedro Alves <pedro@codesourcery.com>
* server.c (handle_query) Whitespace and formatting.
---
gdb/gdbserver/server.c | 18 ++++++++----------
1 file changed, 8 insertions(+), 10 deletions(-)
Index: src/gdb/gdbserver/server.c
===================================================================
--- src.orig/gdb/gdbserver/server.c 2009-03-23 00:18:18.000000000 +0000
+++ src/gdb/gdbserver/server.c 2009-03-23 00:19:50.000000000 +0000
@@ -574,7 +574,7 @@ handle_query (char *own_buf, int packet_
require_running (own_buf);
strcpy (own_buf, "E00");
if (decode_xfer_read (own_buf + 15, &annex, &ofs, &len) < 0)
- return;
+ return;
if (len > PBUFSIZ - 2)
len = PBUFSIZ - 2;
spu_buf = malloc (len + 1);
@@ -585,11 +585,9 @@ handle_query (char *own_buf, int packet_
if (n < 0)
write_enn (own_buf);
else if (n > len)
- *new_packet_len_p = write_qxfer_response
- (own_buf, spu_buf, len, 1);
+ *new_packet_len_p = write_qxfer_response (own_buf, spu_buf, len, 1);
else
- *new_packet_len_p = write_qxfer_response
- (own_buf, spu_buf, n, 0);
+ *new_packet_len_p = write_qxfer_response (own_buf, spu_buf, n, 0);
free (spu_buf);
return;
@@ -791,20 +789,20 @@ handle_query (char *own_buf, int packet_
strcpy (own_buf, "E00");
if (decode_xfer_read (own_buf + 18, &annex, &ofs, &len) < 0)
- return;
+ return;
if (len > PBUFSIZ - 2)
- len = PBUFSIZ - 2;
+ len = PBUFSIZ - 2;
workbuf = malloc (len + 1);
if (!workbuf)
return;
n = (*the_target->qxfer_osdata) (annex, workbuf, NULL, ofs, len + 1);
if (n < 0)
- write_enn (own_buf);
+ write_enn (own_buf);
else if (n > len)
- *new_packet_len_p = write_qxfer_response (own_buf, workbuf, len, 1);
+ *new_packet_len_p = write_qxfer_response (own_buf, workbuf, len, 1);
else
- *new_packet_len_p = write_qxfer_response (own_buf, workbuf, n, 0);
+ *new_packet_len_p = write_qxfer_response (own_buf, workbuf, n, 0);
free (workbuf);
return;
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [gdbserver/commit] fix whitespace.
2009-03-23 1:12 ` Pedro Alves
@ 2009-03-23 1:26 ` Joel Brobecker
2009-03-23 1:31 ` Pedro Alves
` (3 more replies)
0 siblings, 4 replies; 9+ messages in thread
From: Joel Brobecker @ 2009-03-23 1:26 UTC (permalink / raw)
To: Pedro Alves; +Cc: gdb-patches
> I'm also applying these further fixes.
(I can't help myself, sorry)
You know, the current whitespace rule has been really bugging me
since day one. I would be a very very happy camper if we got rid
of tabs and just used spaces. Tabs make it hard for everything:
hard to edit/navigate in your editor (unless you have a mode that
makes it transparent for you?), and harder to read patches
(space display can get off because of the extra character that is
being put on the first column of each line of the diff).
Iiiiiiihhh!
(nervous breakdown)
--
Joel
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [gdbserver/commit] fix whitespace.
2009-03-23 1:26 ` Joel Brobecker
@ 2009-03-23 1:31 ` Pedro Alves
2009-03-23 3:54 ` Thiago Jung Bauermann
` (2 subsequent siblings)
3 siblings, 0 replies; 9+ messages in thread
From: Pedro Alves @ 2009-03-23 1:31 UTC (permalink / raw)
To: Joel Brobecker; +Cc: gdb-patches
On Monday 23 March 2009 01:12:02, Joel Brobecker wrote:
> > I'm also applying these further fixes.
>
> (I can't help myself, sorry)
>
> You know, the current whitespace rule has been really bugging me
> since day one. I would be a very very happy camper if we got rid
> of tabs and just used spaces.
I suspect that the interim period between using tabs and not using
tabs would take a while, and would be a bigger mess, unless we
did wholesale conversion.
> Tabs make it hard for everything:
> hard to edit/navigate in your editor (unless you have a mode that
> makes it transparent for you?),
I can't tell if this was real question? Emacs makes it mostly
transparent.
I also use this mode to easily spot breakage:
http://www.emacswiki.org/emacs/WhiteSpace
> and harder to read patches
> (space display can get off because of the extra character that is
> being put on the first column of each line of the diff).
>
> Iiiiiiihhh!
>
> (nervous breakdown)
>
:-) :-)
Yeah... I can't say I love them either, but...
as long as we have them, might as well be consistent, m'kay?
--
Pedro Alves
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [gdbserver/commit] fix whitespace.
2009-03-23 1:26 ` Joel Brobecker
2009-03-23 1:31 ` Pedro Alves
@ 2009-03-23 3:54 ` Thiago Jung Bauermann
2009-03-23 6:28 ` Eli Zaretskii
2009-03-23 4:24 ` Eli Zaretskii
2009-03-23 12:49 ` Mark Kettenis
3 siblings, 1 reply; 9+ messages in thread
From: Thiago Jung Bauermann @ 2009-03-23 3:54 UTC (permalink / raw)
To: Joel Brobecker; +Cc: Pedro Alves, gdb-patches
El dom, 22-03-2009 a las 18:12 -0700, Joel Brobecker escribió:
> > I'm also applying these further fixes.
>
> (I can't help myself, sorry)
>
> You know, the current whitespace rule has been really bugging me
> since day one. I would be a very very happy camper if we got rid
> of tabs and just used spaces. Tabs make it hard for everything:
> hard to edit/navigate in your editor (unless you have a mode that
> makes it transparent for you?), and harder to read patches
> (space display can get off because of the extra character that is
> being put on the first column of each line of the diff).
FWIW, I agree that using just spaces is saner. But it doesn't bother me
as much.
> Iiiiiiihhh!
>
> (nervous breakdown)
Since we're in group therapy mode:
What bothers me the most is the insistence on old-fashioned English
"rules" which apparently were taught in schools back then, like the
silly "two spaces after period" mantra, and "the passive voice shall
NEVER be used!!!11!".
The latter may perhaps still apply to current English (I'm not sure),
but it certainly isn't so clear-cut in other languages. In Portuguese, I
believe it's still bad if you heavily use passive voice in a text, but
using it every now and then it's certainly not a problem. It may even be
more appropriate to what you're trying to convey (which is why I use it
occasionally).
There, I said it. I feel better now. :-)
--
[]'s
Thiago Jung Bauermann
IBM Linux Technology Center
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [gdbserver/commit] fix whitespace.
2009-03-23 1:26 ` Joel Brobecker
2009-03-23 1:31 ` Pedro Alves
2009-03-23 3:54 ` Thiago Jung Bauermann
@ 2009-03-23 4:24 ` Eli Zaretskii
2009-03-23 12:49 ` Mark Kettenis
3 siblings, 0 replies; 9+ messages in thread
From: Eli Zaretskii @ 2009-03-23 4:24 UTC (permalink / raw)
To: Joel Brobecker; +Cc: pedro, gdb-patches
> Date: Sun, 22 Mar 2009 18:12:02 -0700
> From: Joel Brobecker <brobecker@adacore.com>
> Cc: gdb-patches@sourceware.org
>
> You know, the current whitespace rule has been really bugging me
> since day one. I would be a very very happy camper if we got rid
> of tabs and just used spaces.
Unless we also change every source file to have an Emacs Local
Variables section that sets this up automagically, I will object such
a change. I cannot afford setting that mode in Emacs manually every
time I touch a source file.
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [gdbserver/commit] fix whitespace.
2009-03-23 3:54 ` Thiago Jung Bauermann
@ 2009-03-23 6:28 ` Eli Zaretskii
0 siblings, 0 replies; 9+ messages in thread
From: Eli Zaretskii @ 2009-03-23 6:28 UTC (permalink / raw)
To: Thiago Jung Bauermann; +Cc: brobecker, pedro, gdb-patches
> From: Thiago Jung Bauermann <bauerman@br.ibm.com>
> Cc: Pedro Alves <pedro@codesourcery.com>, gdb-patches@sourceware.org
> Date: Sun, 22 Mar 2009 23:12:32 -0300
>
> Since we're in group therapy mode:
>
> What bothers me the most is the insistence on old-fashioned English
> "rules" which apparently were taught in schools back then, like the
> silly "two spaces after period" mantra, and "the passive voice shall
> NEVER be used!!!11!".
Your friendly therapist says: the silly "two spaces" rule is for Emacs
movement by sentence, and avoiding passive voice in English makes
shorter and less complicated sentences, and thus makes the text easier
to comprehend, especially to non-native English speakers.
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [gdbserver/commit] fix whitespace.
2009-03-23 1:26 ` Joel Brobecker
` (2 preceding siblings ...)
2009-03-23 4:24 ` Eli Zaretskii
@ 2009-03-23 12:49 ` Mark Kettenis
2009-03-23 14:30 ` Joel Brobecker
3 siblings, 1 reply; 9+ messages in thread
From: Mark Kettenis @ 2009-03-23 12:49 UTC (permalink / raw)
To: brobecker; +Cc: pedro, gdb-patches
> Date: Sun, 22 Mar 2009 18:12:02 -0700
> From: Joel Brobecker <brobecker@adacore.com>
>
> > I'm also applying these further fixes.
>
> (I can't help myself, sorry)
>
> You know, the current whitespace rule has been really bugging me
> since day one. I would be a very very happy camper if we got rid
> of tabs and just used spaces. Tabs make it hard for everything:
> hard to edit/navigate in your editor (unless you have a mode that
> makes it transparent for you?), and harder to read patches
> (space display can get off because of the extra character that is
> being put on the first column of each line of the diff).
>
> Iiiiiiihhh!
>
> (nervous breakdown)
I smell another bikeshed, sigh.
If you're really serious, get all the other GNU projects to agree,
convince the GNU emacs developers to make this the default, and wait a
couple of years for the new version of emacs to be released and
adopted.
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [gdbserver/commit] fix whitespace.
2009-03-23 12:49 ` Mark Kettenis
@ 2009-03-23 14:30 ` Joel Brobecker
0 siblings, 0 replies; 9+ messages in thread
From: Joel Brobecker @ 2009-03-23 14:30 UTC (permalink / raw)
To: Mark Kettenis; +Cc: pedro, gdb-patches
Sorry - I probably shouldn't have sent this complaint. Just to be clear,
I wasn't seriously suggesting that we change this part of the GNU coding
style. It was just an attempt at humor over something that seriously
annoys me. I just need the equivalent mode but for vim...
--
Joel
^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2009-03-23 14:23 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-03-23 0:22 [gdbserver/commit] fix whitespace Pedro Alves
2009-03-23 1:12 ` Pedro Alves
2009-03-23 1:26 ` Joel Brobecker
2009-03-23 1:31 ` Pedro Alves
2009-03-23 3:54 ` Thiago Jung Bauermann
2009-03-23 6:28 ` Eli Zaretskii
2009-03-23 4:24 ` Eli Zaretskii
2009-03-23 12:49 ` Mark Kettenis
2009-03-23 14:30 ` Joel Brobecker
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox