This is the mail archive of the gdb@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Manual function call regression?


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]