diff options
author | nobody <> | 2003-04-03 16:34:49 +0000 |
---|---|---|
committer | nobody <> | 2003-04-03 16:34:49 +0000 |
commit | 56119ffba54ea99aed55aed353725346558b2696 (patch) | |
tree | 495e36fff104a35666f05eee0b17d6ef091abbe7 /gdb/linux-proc.c | |
parent | d355127720dea14eef250e2e2c3db273d97f0c0c (diff) | |
download | binutils-gdb-56119ffba54ea99aed55aed353725346558b2696.tar.gz |
This commit was manufactured by cvs2svn to create branchcagney_frameaddr-20030403-branchpoint
'cagney_frameaddr-20030403-branch'.
Sprout from cagney_framebase-20030326-branch 2003-03-29 23:29:48 UTC nobody 'This commit was manufactured by cvs2svn to create branch'
Cherrypick from cagney_framebase-20030326-branch 2003-03-26 20:19:13 UTC nobody 'This commit was manufactured by cvs2svn to create branch':
gdb/symtab.h
Cherrypick from master 2003-04-03 16:34:48 UTC Andrew Cagney <cagney@redhat.com> '2003-04-02 Andrew Cagney <cagney@redhat.com>':
bfd/ChangeLog
bfd/Makefile.am
bfd/Makefile.in
bfd/aoutx.h
bfd/archures.c
bfd/bfd-in.h
bfd/bfd-in2.h
bfd/coff-arm.c
bfd/coffcode.h
bfd/coffgen.c
bfd/config.bfd
bfd/configure
bfd/configure.in
bfd/cpu-arm.c
bfd/cpu-xtensa.c
bfd/dwarf2.c
bfd/elf-eh-frame.c
bfd/elf.c
bfd/elf32-arm.h
bfd/elf32-ppc.c
bfd/elf32-xtensa.c
bfd/elflink.h
bfd/elfxx-ia64.c
bfd/elfxx-mips.c
bfd/format.c
bfd/libbfd.h
bfd/libpei.h
bfd/linker.c
bfd/opncls.c
bfd/peXXigen.c
bfd/peicode.h
bfd/reloc.c
bfd/simple.c
bfd/targets.c
bfd/version.h
bfd/xtensa-isa.c
bfd/xtensa-modules.c
gdb/ChangeLog
gdb/MAINTAINERS
gdb/Makefile.in
gdb/NEWS
gdb/ada-lang.c
gdb/alpha-tdep.c
gdb/arm-linux-tdep.c
gdb/arm-tdep.c
gdb/avr-tdep.c
gdb/breakpoint.c
gdb/c-lang.c
gdb/config/i386/tm-symmetry.h
gdb/config/pa/hppabsd.mh
gdb/config/pa/hppabsd.mt
gdb/config/pa/hppaosf.mh
gdb/config/pa/hppaosf.mt
gdb/config/pa/hppapro.mt
gdb/config/pa/nm-hppab.h
gdb/config/pa/nm-hppah.h
gdb/config/pa/nm-hppao.h
gdb/config/pa/tm-hppa.h
gdb/config/pa/tm-hppa64.h
gdb/config/pa/tm-hppab.h
gdb/config/pa/tm-hppao.h
gdb/config/pa/tm-pro.h
gdb/config/pa/xm-hppab.h
gdb/config/pa/xm-hppah.h
gdb/config/pa/xm-pa.h
gdb/config/sparc/tm-sp64.h
gdb/config/sparc/tm-sparc.h
gdb/configure.host
gdb/configure.tgt
gdb/cris-tdep.c
gdb/d10v-tdep.c
gdb/doc/ChangeLog
gdb/doc/Makefile.in
gdb/doc/gdb.texinfo
gdb/doc/gdbint.texinfo
gdb/doc/observer.texi
gdb/dummy-frame.c
gdb/dummy-frame.h
gdb/dwarf2expr.c
gdb/dwarf2loc.c
gdb/f-lang.c
gdb/findvar.c
gdb/frame-base.c
gdb/frame-base.h
gdb/frame.c
gdb/frame.h
gdb/frv-tdep.c
gdb/gdbarch.c
gdb/gdbarch.h
gdb/gdbarch.sh
gdb/h8300-tdep.c
gdb/hppa-hpux-tdep.c
gdb/hppa-tdep.c
gdb/hppah-nat.c
gdb/hpread.c
gdb/i386-tdep.c
gdb/ia64-tdep.c
gdb/infcmd.c
gdb/inferior.h
gdb/infrun.c
gdb/infttrace.c
gdb/jv-lang.c
gdb/language.c
gdb/language.h
gdb/lin-lwp.c
gdb/linux-proc.c
gdb/m2-lang.c
gdb/m68hc11-tdep.c
gdb/m68k-tdep.c
gdb/maint.c
gdb/mcore-tdep.c
gdb/mi/ChangeLog
gdb/mi/mi-cmd-file.c
gdb/mi/mi-cmds.c
gdb/mi/mi-cmds.h
gdb/mi/mi-getopt.c
gdb/mi/mi-getopt.h
gdb/mips-tdep.c
gdb/mn10300-tdep.c
gdb/ns32k-tdep.c
gdb/objc-exp.y
gdb/objc-lang.c
gdb/objc-lang.h
gdb/p-lang.c
gdb/printcmd.c
gdb/regcache.c
gdb/remote.h
gdb/rs6000-tdep.c
gdb/s390-tdep.c
gdb/scm-lang.c
gdb/sh-tdep.c
gdb/signals/signals.c
gdb/somread.c
gdb/somsolib.h
gdb/sparc-tdep.c
gdb/stack.c
gdb/symfile.c
gdb/testsuite/ChangeLog
gdb/testsuite/gdb.base/call-rt-st.exp
gdb/testsuite/gdb.base/callfuncs.exp
gdb/testsuite/gdb.base/ending-run.exp
gdb/testsuite/gdb.base/list.exp
gdb/testsuite/gdb.base/pointers.exp
gdb/testsuite/gdb.base/ptype.c
gdb/testsuite/gdb.base/ptype.exp
gdb/testsuite/gdb.base/sizeof.c
gdb/testsuite/gdb.base/sizeof.exp
gdb/testsuite/gdb.c++/casts.exp
gdb/testsuite/gdb.mi/mi-file.exp
gdb/testsuite/lib/gdb.exp
gdb/testsuite/lib/mi-support.exp
gdb/thread.c
gdb/utils.c
gdb/v850-tdep.c
gdb/valops.c
gdb/value.h
gdb/vax-tdep.c
gdb/version.in
gdb/x86-64-tdep.c
gdb/xstormy16-tdep.c
include/ChangeLog
include/dis-asm.h
include/elf/ChangeLog
include/elf/arm.h
include/elf/common.h
include/elf/xtensa.h
include/gdb/ChangeLog
include/gdb/sim-arm.h
include/xtensa-config.h
include/xtensa-isa-internal.h
include/xtensa-isa.h
opcodes/ChangeLog
opcodes/Makefile.am
opcodes/Makefile.in
opcodes/arm-dis.c
opcodes/arm-opc.h
opcodes/configure
opcodes/configure.in
opcodes/disassemble.c
opcodes/xtensa-dis.c
sim/arm/ChangeLog
sim/arm/Makefile.in
sim/arm/armcopro.c
sim/arm/armdefs.h
sim/arm/armemu.c
sim/arm/arminit.c
sim/arm/armos.c
sim/arm/configure
sim/arm/configure.in
sim/arm/wrapper.c
sim/testsuite/ChangeLog
sim/testsuite/sim/arm/adc.cgs
sim/testsuite/sim/arm/add.cgs
sim/testsuite/sim/arm/allinsn.exp
sim/testsuite/sim/arm/and.cgs
sim/testsuite/sim/arm/b.cgs
sim/testsuite/sim/arm/bic.cgs
sim/testsuite/sim/arm/bl.cgs
sim/testsuite/sim/arm/bx.cgs
sim/testsuite/sim/arm/cmn.cgs
sim/testsuite/sim/arm/cmp.cgs
sim/testsuite/sim/arm/eor.cgs
sim/testsuite/sim/arm/hello.ms
sim/testsuite/sim/arm/iwmmxt/iwmmxt.exp
sim/testsuite/sim/arm/iwmmxt/tbcst.cgs
sim/testsuite/sim/arm/iwmmxt/testutils.inc
sim/testsuite/sim/arm/iwmmxt/textrm.cgs
sim/testsuite/sim/arm/iwmmxt/tinsr.cgs
sim/testsuite/sim/arm/iwmmxt/tmia.cgs
sim/testsuite/sim/arm/iwmmxt/tmiaph.cgs
sim/testsuite/sim/arm/iwmmxt/tmiaxy.cgs
sim/testsuite/sim/arm/iwmmxt/tmovmsk.cgs
sim/testsuite/sim/arm/iwmmxt/wacc.cgs
sim/testsuite/sim/arm/iwmmxt/wadd.cgs
sim/testsuite/sim/arm/iwmmxt/waligni.cgs
sim/testsuite/sim/arm/iwmmxt/walignr.cgs
sim/testsuite/sim/arm/iwmmxt/wand.cgs
sim/testsuite/sim/arm/iwmmxt/wandn.cgs
sim/testsuite/sim/arm/iwmmxt/wavg2.cgs
sim/testsuite/sim/arm/iwmmxt/wcmpeq.cgs
sim/testsuite/sim/arm/iwmmxt/wcmpgt.cgs
sim/testsuite/sim/arm/iwmmxt/wmac.cgs
sim/testsuite/sim/arm/iwmmxt/wmadd.cgs
sim/testsuite/sim/arm/iwmmxt/wmax.cgs
sim/testsuite/sim/arm/iwmmxt/wmin.cgs
sim/testsuite/sim/arm/iwmmxt/wmov.cgs
sim/testsuite/sim/arm/iwmmxt/wmul.cgs
sim/testsuite/sim/arm/iwmmxt/wor.cgs
sim/testsuite/sim/arm/iwmmxt/wpack.cgs
sim/testsuite/sim/arm/iwmmxt/wror.cgs
sim/testsuite/sim/arm/iwmmxt/wsad.cgs
sim/testsuite/sim/arm/iwmmxt/wshufh.cgs
sim/testsuite/sim/arm/iwmmxt/wsll.cgs
sim/testsuite/sim/arm/iwmmxt/wsra.cgs
sim/testsuite/sim/arm/iwmmxt/wsrl.cgs
sim/testsuite/sim/arm/iwmmxt/wsub.cgs
sim/testsuite/sim/arm/iwmmxt/wunpckeh.cgs
sim/testsuite/sim/arm/iwmmxt/wunpckel.cgs
sim/testsuite/sim/arm/iwmmxt/wunpckih.cgs
sim/testsuite/sim/arm/iwmmxt/wunpckil.cgs
sim/testsuite/sim/arm/iwmmxt/wxor.cgs
sim/testsuite/sim/arm/iwmmxt/wzero.cgs
sim/testsuite/sim/arm/ldm.cgs
sim/testsuite/sim/arm/ldr.cgs
sim/testsuite/sim/arm/ldrb.cgs
sim/testsuite/sim/arm/ldrh.cgs
sim/testsuite/sim/arm/ldrsb.cgs
sim/testsuite/sim/arm/ldrsh.cgs
sim/testsuite/sim/arm/misaligned1.ms
sim/testsuite/sim/arm/misaligned2.ms
sim/testsuite/sim/arm/misaligned3.ms
sim/testsuite/sim/arm/misc.exp
sim/testsuite/sim/arm/mla.cgs
sim/testsuite/sim/arm/mov.cgs
sim/testsuite/sim/arm/mrs.cgs
sim/testsuite/sim/arm/msr.cgs
sim/testsuite/sim/arm/mul.cgs
sim/testsuite/sim/arm/mvn.cgs
sim/testsuite/sim/arm/orr.cgs
sim/testsuite/sim/arm/rsb.cgs
sim/testsuite/sim/arm/rsc.cgs
sim/testsuite/sim/arm/sbc.cgs
sim/testsuite/sim/arm/smlal.cgs
sim/testsuite/sim/arm/smull.cgs
sim/testsuite/sim/arm/stm.cgs
sim/testsuite/sim/arm/str.cgs
sim/testsuite/sim/arm/strb.cgs
sim/testsuite/sim/arm/strh.cgs
sim/testsuite/sim/arm/sub.cgs
sim/testsuite/sim/arm/swi.cgs
sim/testsuite/sim/arm/swp.cgs
sim/testsuite/sim/arm/swpb.cgs
sim/testsuite/sim/arm/teq.cgs
sim/testsuite/sim/arm/testutils.inc
sim/testsuite/sim/arm/thumb/adc.cgs
sim/testsuite/sim/arm/thumb/add-hd-hs.cgs
sim/testsuite/sim/arm/thumb/add-hd-rs.cgs
sim/testsuite/sim/arm/thumb/add-rd-hs.cgs
sim/testsuite/sim/arm/thumb/add-sp.cgs
sim/testsuite/sim/arm/thumb/add.cgs
sim/testsuite/sim/arm/thumb/addi.cgs
sim/testsuite/sim/arm/thumb/addi8.cgs
sim/testsuite/sim/arm/thumb/allthumb.exp
sim/testsuite/sim/arm/thumb/and.cgs
sim/testsuite/sim/arm/thumb/asr.cgs
sim/testsuite/sim/arm/thumb/b.cgs
sim/testsuite/sim/arm/thumb/bcc.cgs
sim/testsuite/sim/arm/thumb/bcs.cgs
sim/testsuite/sim/arm/thumb/beq.cgs
sim/testsuite/sim/arm/thumb/bge.cgs
sim/testsuite/sim/arm/thumb/bgt.cgs
sim/testsuite/sim/arm/thumb/bhi.cgs
sim/testsuite/sim/arm/thumb/bic.cgs
sim/testsuite/sim/arm/thumb/bl-hi.cgs
sim/testsuite/sim/arm/thumb/bl-lo.cgs
sim/testsuite/sim/arm/thumb/ble.cgs
sim/testsuite/sim/arm/thumb/bls.cgs
sim/testsuite/sim/arm/thumb/blt.cgs
sim/testsuite/sim/arm/thumb/bmi.cgs
sim/testsuite/sim/arm/thumb/bne.cgs
sim/testsuite/sim/arm/thumb/bpl.cgs
sim/testsuite/sim/arm/thumb/bvc.cgs
sim/testsuite/sim/arm/thumb/bvs.cgs
sim/testsuite/sim/arm/thumb/bx-hs.cgs
sim/testsuite/sim/arm/thumb/bx-rs.cgs
sim/testsuite/sim/arm/thumb/cmn.cgs
sim/testsuite/sim/arm/thumb/cmp-hd-hs.cgs
sim/testsuite/sim/arm/thumb/cmp-hd-rs.cgs
sim/testsuite/sim/arm/thumb/cmp-rd-hs.cgs
sim/testsuite/sim/arm/thumb/cmp.cgs
sim/testsuite/sim/arm/thumb/eor.cgs
sim/testsuite/sim/arm/thumb/lda-pc.cgs
sim/testsuite/sim/arm/thumb/lda-sp.cgs
sim/testsuite/sim/arm/thumb/ldmia.cgs
sim/testsuite/sim/arm/thumb/ldr-imm.cgs
sim/testsuite/sim/arm/thumb/ldr-pc.cgs
sim/testsuite/sim/arm/thumb/ldr-sprel.cgs
sim/testsuite/sim/arm/thumb/ldr.cgs
sim/testsuite/sim/arm/thumb/ldrb-imm.cgs
sim/testsuite/sim/arm/thumb/ldrb.cgs
sim/testsuite/sim/arm/thumb/ldrh-imm.cgs
sim/testsuite/sim/arm/thumb/ldrh.cgs
sim/testsuite/sim/arm/thumb/ldsb.cgs
sim/testsuite/sim/arm/thumb/ldsh.cgs
sim/testsuite/sim/arm/thumb/lsl.cgs
sim/testsuite/sim/arm/thumb/lsr.cgs
sim/testsuite/sim/arm/thumb/mov-hd-hs.cgs
sim/testsuite/sim/arm/thumb/mov-hd-rs.cgs
sim/testsuite/sim/arm/thumb/mov-rd-hs.cgs
sim/testsuite/sim/arm/thumb/mov.cgs
sim/testsuite/sim/arm/thumb/mul.cgs
sim/testsuite/sim/arm/thumb/mvn.cgs
sim/testsuite/sim/arm/thumb/neg.cgs
sim/testsuite/sim/arm/thumb/orr.cgs
sim/testsuite/sim/arm/thumb/pop-pc.cgs
sim/testsuite/sim/arm/thumb/pop.cgs
sim/testsuite/sim/arm/thumb/push-lr.cgs
sim/testsuite/sim/arm/thumb/push.cgs
sim/testsuite/sim/arm/thumb/ror.cgs
sim/testsuite/sim/arm/thumb/sbc.cgs
sim/testsuite/sim/arm/thumb/stmia.cgs
sim/testsuite/sim/arm/thumb/str-imm.cgs
sim/testsuite/sim/arm/thumb/str-sprel.cgs
sim/testsuite/sim/arm/thumb/str.cgs
sim/testsuite/sim/arm/thumb/strb-imm.cgs
sim/testsuite/sim/arm/thumb/strb.cgs
sim/testsuite/sim/arm/thumb/strh-imm.cgs
sim/testsuite/sim/arm/thumb/strh.cgs
sim/testsuite/sim/arm/thumb/sub-sp.cgs
sim/testsuite/sim/arm/thumb/sub.cgs
sim/testsuite/sim/arm/thumb/subi.cgs
sim/testsuite/sim/arm/thumb/subi8.cgs
sim/testsuite/sim/arm/thumb/swi.cgs
sim/testsuite/sim/arm/thumb/testutils.inc
sim/testsuite/sim/arm/thumb/tst.cgs
sim/testsuite/sim/arm/tst.cgs
sim/testsuite/sim/arm/umlal.cgs
sim/testsuite/sim/arm/umull.cgs
sim/testsuite/sim/arm/xscale/blx.cgs
sim/testsuite/sim/arm/xscale/mia.cgs
sim/testsuite/sim/arm/xscale/miaph.cgs
sim/testsuite/sim/arm/xscale/miaxy.cgs
sim/testsuite/sim/arm/xscale/mra.cgs
sim/testsuite/sim/arm/xscale/testutils.inc
sim/testsuite/sim/arm/xscale/xscale.exp
Delete:
gdb/mi/gdbmi.texinfo
Diffstat (limited to 'gdb/linux-proc.c')
-rw-r--r-- | gdb/linux-proc.c | 205 |
1 files changed, 93 insertions, 112 deletions
diff --git a/gdb/linux-proc.c b/gdb/linux-proc.c index 00383e9a6ee..a9512964dab 100644 --- a/gdb/linux-proc.c +++ b/gdb/linux-proc.c @@ -21,17 +21,17 @@ #include "defs.h" #include "inferior.h" -#include <sys/param.h> /* for MAXPATHLEN */ -#include <sys/procfs.h> /* for elf_gregset etc. */ -#include "gdb_stat.h" /* for struct stat */ -#include <ctype.h> /* for isdigit */ -#include <unistd.h> /* for open, pread64 */ -#include <fcntl.h> /* for O_RDONLY */ -#include "regcache.h" /* for registers_changed */ -#include "gregset.h" /* for gregset */ -#include "gdbcore.h" /* for get_exec_file */ -#include "gdbthread.h" /* for struct thread_info etc. */ -#include "elf-bfd.h" /* for elfcore_write_* */ +#include <sys/param.h> /* for MAXPATHLEN */ +#include <sys/procfs.h> /* for elf_gregset etc. */ +#include "gdb_stat.h" /* for struct stat */ +#include <ctype.h> /* for isdigit */ +#include <unistd.h> /* for open, pread64 */ +#include <fcntl.h> /* for O_RDONLY */ +#include "regcache.h" /* for registers_changed */ +#include "gregset.h" /* for gregset */ +#include "gdbcore.h" /* for get_exec_file */ +#include "gdbthread.h" /* for struct thread_info etc. */ +#include "elf-bfd.h" /* for elfcore_write_* */ #include "cli/cli-decode.h" /* for add_info */ #include "gdb_string.h" @@ -69,28 +69,26 @@ child_pid_to_exec_file (int pid) * Service function for corefiles and info proc. */ -static int -read_mapping (FILE *mapfile, - long long *addr, - long long *endaddr, - char *permissions, - long long *offset, - char *device, - long long *inode, - char *filename) +static int +read_mapping (FILE *mapfile, + long long *addr, + long long *endaddr, + char *permissions, + long long *offset, + char *device, long long *inode, char *filename) { - int ret = fscanf (mapfile, "%llx-%llx %s %llx %s %llx", + int ret = fscanf (mapfile, "%llx-%llx %s %llx %s %llx", addr, endaddr, permissions, offset, device, inode); if (ret > 0 && ret != EOF && *inode != 0) { /* Eat everything up to EOL for the filename. This will prevent - weird filenames (such as one with embedded whitespace) from - confusing this code. It also makes this code more robust - in respect to annotations the kernel may add after the - filename. + weird filenames (such as one with embedded whitespace) from + confusing this code. It also makes this code more robust + in respect to annotations the kernel may add after the + filename. - Note the filename is used for informational purposes only. */ + Note the filename is used for informational purposes only. */ ret += fscanf (mapfile, "%[^\n]\n", filename); } else @@ -108,11 +106,9 @@ read_mapping (FILE *mapfile, */ static int -linux_find_memory_regions (int (*func) (CORE_ADDR, +linux_find_memory_regions (int (*func) (CORE_ADDR, unsigned long, - int, int, int, - void *), - void *obfd) + int, int, int, void *), void *obfd) { long long pid = PIDGET (inferior_ptid); char mapsfilename[MAXPATHLEN]; @@ -128,31 +124,29 @@ linux_find_memory_regions (int (*func) (CORE_ADDR, error ("Could not open %s\n", mapsfilename); if (info_verbose) - fprintf_filtered (gdb_stdout, + fprintf_filtered (gdb_stdout, "Reading memory regions from %s\n", mapsfilename); /* Now iterate until end-of-file. */ - while (read_mapping (mapsfile, &addr, &endaddr, &permissions[0], + while (read_mapping (mapsfile, &addr, &endaddr, &permissions[0], &offset, &device[0], &inode, &filename[0])) { size = endaddr - addr; /* Get the segment's permissions. */ - read = (strchr (permissions, 'r') != 0); + read = (strchr (permissions, 'r') != 0); write = (strchr (permissions, 'w') != 0); - exec = (strchr (permissions, 'x') != 0); + exec = (strchr (permissions, 'x') != 0); if (info_verbose) { - fprintf_filtered (gdb_stdout, - "Save segment, %lld bytes at 0x%s (%c%c%c)", - size, paddr_nz (addr), - read ? 'r' : ' ', - write ? 'w' : ' ', - exec ? 'x' : ' '); + fprintf_filtered (gdb_stdout, + "Save segment, %lld bytes at 0x%s (%c%c%c)", + size, paddr_nz (addr), + read ? 'r' : ' ', + write ? 'w' : ' ', exec ? 'x' : ' '); if (filename && filename[0]) - fprintf_filtered (gdb_stdout, - " for %s", filename); + fprintf_filtered (gdb_stdout, " for %s", filename); fprintf_filtered (gdb_stdout, "\n"); } @@ -169,7 +163,7 @@ linux_find_memory_regions (int (*func) (CORE_ADDR, */ static char * -linux_do_thread_registers (bfd *obfd, ptid_t ptid, +linux_do_thread_registers (bfd *obfd, ptid_t ptid, char *note_data, int *note_size) { gdb_gregset_t gregs; @@ -180,26 +174,23 @@ linux_do_thread_registers (bfd *obfd, ptid_t ptid, unsigned long merged_pid = ptid_get_tid (ptid) << 16 | ptid_get_pid (ptid); fill_gregset (&gregs, -1); - note_data = (char *) elfcore_write_prstatus (obfd, - note_data, - note_size, - merged_pid, - stop_signal, - &gregs); + note_data = (char *) elfcore_write_prstatus (obfd, + note_data, + note_size, + merged_pid, + stop_signal, &gregs); fill_fpregset (&fpregs, -1); - note_data = (char *) elfcore_write_prfpreg (obfd, - note_data, - note_size, - &fpregs, - sizeof (fpregs)); + note_data = (char *) elfcore_write_prfpreg (obfd, + note_data, + note_size, + &fpregs, sizeof (fpregs)); #ifdef FILL_FPXREGSET fill_fpxregset (&fpxregs, -1); - note_data = (char *) elfcore_write_prxfpreg (obfd, - note_data, - note_size, - &fpxregs, - sizeof (fpxregs)); + note_data = (char *) elfcore_write_prxfpreg (obfd, + note_data, + note_size, + &fpxregs, sizeof (fpxregs)); #endif return note_data; } @@ -228,9 +219,9 @@ linux_corefile_thread_callback (struct thread_info *ti, void *data) registers_changed (); target_fetch_registers (-1); /* FIXME should not be necessary; fill_gregset should do it automatically. */ - args->note_data = linux_do_thread_registers (args->obfd, - ti->ptid, - args->note_data, + args->note_data = linux_do_thread_registers (args->obfd, + ti->ptid, + args->note_data, args->note_size); args->num_notes++; inferior_ptid = saved_ptid; @@ -252,28 +243,24 @@ linux_make_note_section (bfd *obfd, int *note_size) { struct linux_corefile_thread_data thread_args; struct cleanup *old_chain; - char fname[16] = {'\0'}; - char psargs[80] = {'\0'}; + char fname[16] = { '\0' }; + char psargs[80] = { '\0' }; char *note_data = NULL; ptid_t current_ptid = inferior_ptid; if (get_exec_file (0)) { strncpy (fname, strrchr (get_exec_file (0), '/') + 1, sizeof (fname)); - strncpy (psargs, get_exec_file (0), - sizeof (psargs)); + strncpy (psargs, get_exec_file (0), sizeof (psargs)); if (get_inferior_args ()) { - strncat (psargs, " ", - sizeof (psargs) - strlen (psargs)); - strncat (psargs, get_inferior_args (), + strncat (psargs, " ", sizeof (psargs) - strlen (psargs)); + strncat (psargs, get_inferior_args (), sizeof (psargs) - strlen (psargs)); } - note_data = (char *) elfcore_write_prpsinfo (obfd, - note_data, - note_size, - fname, - psargs); + note_data = (char *) elfcore_write_prpsinfo (obfd, + note_data, + note_size, fname, psargs); } /* Dump information for threads. */ @@ -285,8 +272,8 @@ linux_make_note_section (bfd *obfd, int *note_size) if (thread_args.num_notes == 0) { /* iterate_over_threads didn't come up with any threads; - just use inferior_ptid. */ - note_data = linux_do_thread_registers (obfd, inferior_ptid, + just use inferior_ptid. */ + note_data = linux_do_thread_registers (obfd, inferior_ptid, note_data, note_size); } else @@ -420,33 +407,30 @@ linux_info_proc_cmd (char *args, int from_tty) if (TARGET_ADDR_BIT == 32) { header_fmt_string = "\t%10s %10s %10s %10s %7s\n"; - data_fmt_string = "\t%#10lx %#10lx %#10x %#10x %7s\n"; + data_fmt_string = "\t%#10lx %#10lx %#10x %#10x %7s\n"; } else { header_fmt_string = " %18s %18s %10s %10s %7s\n"; - data_fmt_string = " %#18lx %#18lx %#10x %#10x %7s\n"; + data_fmt_string = " %#18lx %#18lx %#10x %#10x %7s\n"; } printf_filtered ("Mapped address spaces:\n\n"); - printf_filtered (header_fmt_string, + printf_filtered (header_fmt_string, "Start Addr", " End Addr", - " Size", - " Offset", - "objfile"); - - while (read_mapping (procfile, &addr, &endaddr, &permissions[0], + " Size", " Offset", "objfile"); + + while (read_mapping (procfile, &addr, &endaddr, &permissions[0], &offset, &device[0], &inode, &filename[0])) { size = endaddr - addr; - printf_filtered (data_fmt_string, - (unsigned long) addr, /* FIXME: pr_addr */ - (unsigned long) endaddr, - (int) size, - (unsigned int) offset, + printf_filtered (data_fmt_string, (unsigned long) addr, /* FIXME: pr_addr */ + (unsigned long) endaddr, + (int) size, + (unsigned int) offset, filename[0] ? filename : ""); - + } fclose (procfile); @@ -463,7 +447,7 @@ linux_info_proc_cmd (char *args, int from_tty) printf_filtered (buffer); fclose (procfile); } - else + else warning ("unable to open /proc file '%s'", fname1); } if (stat_f || all) @@ -493,16 +477,16 @@ linux_info_proc_cmd (char *args, int from_tty) if (fscanf (procfile, "%u ", &itmp) > 0) printf_filtered ("Flags: 0x%x\n", itmp); if (fscanf (procfile, "%u ", &itmp) > 0) - printf_filtered ("Minor faults (no memory page): %u\n", + printf_filtered ("Minor faults (no memory page): %u\n", (unsigned int) itmp); if (fscanf (procfile, "%u ", &itmp) > 0) - printf_filtered ("Minor faults, children: %u\n", + printf_filtered ("Minor faults, children: %u\n", (unsigned int) itmp); if (fscanf (procfile, "%u ", &itmp) > 0) - printf_filtered ("Major faults (memory page faults): %u\n", + printf_filtered ("Major faults (memory page faults): %u\n", (unsigned int) itmp); if (fscanf (procfile, "%u ", &itmp) > 0) - printf_filtered ("Major faults, children: %u\n", + printf_filtered ("Major faults, children: %u\n", (unsigned int) itmp); if (fscanf (procfile, "%d ", &itmp) > 0) printf_filtered ("utime: %d\n", itmp); @@ -513,36 +497,34 @@ linux_info_proc_cmd (char *args, int from_tty) if (fscanf (procfile, "%d ", &itmp) > 0) printf_filtered ("stime, children: %d\n", itmp); if (fscanf (procfile, "%d ", &itmp) > 0) - printf_filtered ("jiffies remaining in current time slice: %d\n", + printf_filtered ("jiffies remaining in current time slice: %d\n", itmp); if (fscanf (procfile, "%d ", &itmp) > 0) printf_filtered ("'nice' value: %d\n", itmp); if (fscanf (procfile, "%u ", &itmp) > 0) - printf_filtered ("jiffies until next timeout: %u\n", + printf_filtered ("jiffies until next timeout: %u\n", (unsigned int) itmp); if (fscanf (procfile, "%u ", &itmp) > 0) - printf_filtered ("jiffies until next SIGALRM: %u\n", + printf_filtered ("jiffies until next SIGALRM: %u\n", (unsigned int) itmp); if (fscanf (procfile, "%d ", &itmp) > 0) - printf_filtered ("start time (jiffies since system boot): %d\n", + printf_filtered ("start time (jiffies since system boot): %d\n", itmp); if (fscanf (procfile, "%u ", &itmp) > 0) - printf_filtered ("Virtual memory size: %u\n", + printf_filtered ("Virtual memory size: %u\n", (unsigned int) itmp); if (fscanf (procfile, "%u ", &itmp) > 0) - printf_filtered ("Resident set size: %u\n", - (unsigned int) itmp); + printf_filtered ("Resident set size: %u\n", (unsigned int) itmp); if (fscanf (procfile, "%u ", &itmp) > 0) - printf_filtered ("rlim: %u\n", - (unsigned int) itmp); + printf_filtered ("rlim: %u\n", (unsigned int) itmp); if (fscanf (procfile, "%u ", &itmp) > 0) printf_filtered ("Start of text: 0x%x\n", itmp); if (fscanf (procfile, "%u ", &itmp) > 0) printf_filtered ("End of text: 0x%x\n", itmp); if (fscanf (procfile, "%u ", &itmp) > 0) printf_filtered ("Start of stack: 0x%x\n", itmp); -#if 0 /* Don't know how architecture-dependent the rest is... - Anyway the signal bitmap info is available from "status". */ +#if 0 /* Don't know how architecture-dependent the rest is... + Anyway the signal bitmap info is available from "status". */ if (fscanf (procfile, "%u ", &itmp) > 0) /* FIXME arch? */ printf_filtered ("Kernel stack pointer: 0x%x\n", itmp); if (fscanf (procfile, "%u ", &itmp) > 0) /* FIXME arch? */ @@ -574,7 +556,7 @@ _initialize_linux_proc (void) inftarg_set_find_memory_regions (linux_find_memory_regions); inftarg_set_make_corefile_notes (linux_make_note_section); - add_info ("proc", linux_info_proc_cmd, + add_info ("proc", linux_info_proc_cmd, "Show /proc process information about any running process.\n\ Specify any process id, or use the program being debugged by default.\n\ Specify any of the following keywords for detailed info:\n\ @@ -584,9 +566,9 @@ Specify any of the following keywords for detailed info:\n\ all -- list all available /proc info."); } -int linux_proc_xfer_memory (CORE_ADDR addr, char *myaddr, int len, int write, - struct mem_attrib *attrib, - struct target_ops *target) +int +linux_proc_xfer_memory (CORE_ADDR addr, char *myaddr, int len, int write, + struct mem_attrib *attrib, struct target_ops *target) { int fd, ret; char filename[64]; @@ -616,8 +598,7 @@ int linux_proc_xfer_memory (CORE_ADDR addr, char *myaddr, int len, int write, #ifdef HAVE_PREAD64 if (pread64 (fd, myaddr, len, addr) != len) #else - if (lseek (fd, addr, SEEK_SET) == -1 - || read (fd, myaddr, len) != len) + if (lseek (fd, addr, SEEK_SET) == -1 || read (fd, myaddr, len) != len) #endif ret = 0; else |