Manual function call regression?

"Maciej W. Rozycki" <[email protected]>
Newsgroups gmane.comp.gdb.devel
Message-ID <[email protected]>
Hi,

 I've been trying, to no avail, to call a function within GDB in debugging 
GDB itself, current head.  Specifically:

(top-gdb) print gdbarch_tdep(arches->gdbarch)
A syntax error in expression, near `arches->gdbarch)'.
(top-gdb) print arches->gdbarch
$1 = (gdbarch *) 0x12435a930
(top-gdb) info functions gdbarch_tdep
All functions matching regular expression "gdbarch_tdep":

File .../gdb/common/poison.h:
static gdbarch_tdep *xcnew<gdbarch_tdep>();

File .../gdb/gdbarch.c:
gdbarch *gdbarch_alloc(gdbarch_info const*, gdbarch_tdep*);
gdbarch_tdep *gdbarch_tdep(gdbarch*);

File .../gdb/mips-tdep.c:
static int mips_mask_address_p(gdbarch_tdep*);
(top-gdb) info types gdbarch_tdep
All types matching regular expression "gdbarch_tdep":

File .../gdb/mips-tdep.h:
gdbarch_tdep;
(top-gdb) ptype gdbarch_tdep
type = struct gdbarch_tdep {
    int elf_flags;
    mips_abi mips_abi;
    mips_abi found_abi;
    mips_isa mips_isa;
    mips_fpu_type mips_fpu_type;
    int mips_last_arg_regnum;
    int mips_last_fp_arg_regnum;
    int default_mask_address_p;
    int mips64_transfers_32bit_regs_p;
    const mips_regnum *regnum;
    const char **mips_processor_reg_names;
    int register_size_valid_p;
    int register_size;
    CORE_ADDR (*syscall_next_pc)(frame_info *);
}
(top-gdb) 

So obviously we have a function called `gdbarch_tdep', defined in 
`gdb/gdbarch.c' and we also have `struct gdbarch_tdep', defined in
`gdb/mips-tdep.h'.  That I believe used to be no problem, and GDB 
obviously sees both the function and the structure.

 However I seem unable to call the function, and somehow I suspect that 
GDB interprets my attempt to call the function as an attempt to call the 
structure.  Have I been missing anything here?

 The manual does not help; the section on `print' and `call' is rather 
terse.

  Maciej
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.