aboutsummaryrefslogtreecommitdiff
path: root/gdb/exec.c
diff options
context:
space:
mode:
authorJoel Brobecker <brobecker@gnat.com>2002-09-12 19:49:56 +0000
committerJoel Brobecker <brobecker@gnat.com>2002-09-12 19:49:56 +0000
commit3db26b01ffb7bebae01c937865b6d25d0d28ed6f (patch)
tree12cb63f791d4ca078aa04373f65a205d8429a552 /gdb/exec.c
parent17c5ed2cf3447bc9ce167f0ebc87bdd528026521 (diff)
downloadgdb-3db26b01ffb7bebae01c937865b6d25d0d28ed6f.zip
gdb-3db26b01ffb7bebae01c937865b6d25d0d28ed6f.tar.gz
gdb-3db26b01ffb7bebae01c937865b6d25d0d28ed6f.tar.bz2
* exec.c (xfer_memory): Fix compilation warning with old versions
of GCC. * tracepoint.c (trace_find_tracepoint_command): Likewise.
Diffstat (limited to 'gdb/exec.c')
-rw-r--r--gdb/exec.c42
1 files changed, 22 insertions, 20 deletions
diff --git a/gdb/exec.c b/gdb/exec.c
index 0228f41..3a3e888 100644
--- a/gdb/exec.c
+++ b/gdb/exec.c
@@ -507,26 +507,28 @@ xfer_memory (CORE_ADDR memaddr, char *myaddr, int len, int write,
strcmp (section->name, p->the_bfd_section->name) != 0)
continue; /* not the section we need */
if (memaddr >= p->addr)
- if (memend <= p->endaddr)
- {
- /* Entire transfer is within this section. */
- res = xfer_fn (p->bfd, p->the_bfd_section, myaddr,
- memaddr - p->addr, len);
- return (res != 0) ? len : 0;
- }
- else if (memaddr >= p->endaddr)
- {
- /* This section ends before the transfer starts. */
- continue;
- }
- else
- {
- /* This section overlaps the transfer. Just do half. */
- len = p->endaddr - memaddr;
- res = xfer_fn (p->bfd, p->the_bfd_section, myaddr,
- memaddr - p->addr, len);
- return (res != 0) ? len : 0;
- }
+ {
+ if (memend <= p->endaddr)
+ {
+ /* Entire transfer is within this section. */
+ res = xfer_fn (p->bfd, p->the_bfd_section, myaddr,
+ memaddr - p->addr, len);
+ return (res != 0) ? len : 0;
+ }
+ else if (memaddr >= p->endaddr)
+ {
+ /* This section ends before the transfer starts. */
+ continue;
+ }
+ else
+ {
+ /* This section overlaps the transfer. Just do half. */
+ len = p->endaddr - memaddr;
+ res = xfer_fn (p->bfd, p->the_bfd_section, myaddr,
+ memaddr - p->addr, len);
+ return (res != 0) ? len : 0;
+ }
+ }
else
nextsectaddr = min (nextsectaddr, p->addr);
}