Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: steve@asicdesigners.com (Steve Watt)
To: gdb-patches@sources.redhat.com
Subject: Re: [patch rfc] Add NUM_REGS pseudo regs to MIPS
Date: Mon, 07 Jul 2003 20:01:00 -0000	[thread overview]
Message-ID: <200307072001.h67K1iMm054172@oberon.asicdesigners.com> (raw)

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 6545 bytes --]

Andrew Cagney wrote:
> [ ... ] This adds NUM_REGS pseudo registers to the MIPS [ ... ]

OK, not a direct reply to your rfc, but it's in the right part of the
forest to be causing my problem, so...

I've built a Linux cross MIPS toolchain from a combined source tree,
checked out of the sources.redhat.com tree yesterday (6 July), and when
I attempt to do anything in the sim with the register set, I hit an
assert:

../../combined/gdb/mips-tdep.c:5669: internal-error: mips_register_sim_regno: Assertion `regnum >= 0 && regnum < NUM_REGS' failed.

Setting breakpoints and doing a nested gdb on the thing reveals that
it's trying to display register 90.  The path there is kinda ugly,
but here's the trace into gdbarch_num_regs(), which is about to
return 90:

#0  gdbarch_num_regs (gdbarch=0x82fdc48) at ../../combined/gdb/gdbarch.c:3077
#1  0x080da346 in mips_print_registers_info (gdbarch=0x82fdc48, file=0x82fc890, 
    frame=0x82e0f40, regnum=-1, all=0) at ../../combined/gdb/mips-tdep.c:4345
#2  0x080c9fb3 in gdbarch_print_registers_info (gdbarch=0x82fdc48, file=0x82fc890, 
    frame=0x82e0f40, regnum=-1, all=0) at ../../combined/gdb/gdbarch.c:4007
#3  0x080b7e92 in registers_info (addr_exp=0x0, fpregs=0)
    at ../../combined/gdb/infcmd.c:1620
#4  0x0807e526 in do_cfunc (c=0x82d32d8, args=0x0, from_tty=1)
    at ../../combined/gdb/cli/cli-decode.c:53
#5  0x0807fd4e in cmd_func (cmd=0x82d32d8, args=0x0, from_tty=1)
    at ../../combined/gdb/cli/cli-decode.c:1517
#6  0x0810e0e3 in execute_command (p=0x82c6d5e "", from_tty=1)
    at ../../combined/gdb/top.c:716
#7  0x080c3a01 in command_handler (command=0x82c6d50 "info registers")
    at ../../combined/gdb/event-top.c:500
#8  0x080c4041 in command_line_handler (rl=0x82c7030 " ¯\027@ ¯\027@isters")
    at ../../combined/gdb/event-top.c:793
#9  0x081f426b in rl_callback_read_char () at ../../combined/readline/callback.c:123
#10 0x080c33ab in rl_callback_read_char_wrapper (client_data=0x0)
    at ../../combined/gdb/event-top.c:166
#11 0x080c38e2 in stdin_event_handler (error=0, client_data=0x0)
    at ../../combined/gdb/event-top.c:416
#12 0x080c2d10 in handle_file_event (event_file_desc=0)
    at ../../combined/gdb/event-loop.c:721
#13 0x080c27dc in process_event () at ../../combined/gdb/event-loop.c:334
#14 0x080c2821 in gdb_do_one_event (data=0x0) at ../../combined/gdb/event-loop.c:371
#15 0x0810dd6a in do_catch_errors (uiout=0x82f4f48, data=0xbffff4c8)
    at ../../combined/gdb/top.c:497
#16 0x0810dc52 in catcher (func=0x810dd5c <do_catch_errors>, func_uiout=0x82f4f48, 
    func_args=0xbffff4c8, func_val=0xbffff4c0, func_caught=0xbffff4c4, 
    errstring=0x8224580 "", mask=6) at ../../combined/gdb/top.c:429
#17 0x0810dda4 in catch_errors (func=0x80c27f8 <gdb_do_one_event>, func_args=0x0, 
    errstring=0x8224580 "", mask=6) at ../../combined/gdb/top.c:509
#18 0x080c285f in start_event_loop () at ../../combined/gdb/event-loop.c:422
#19 0x0807c547 in captured_command_loop (data=0x0) at ../../combined/gdb/main.c:97
#20 0x0810dd6a in do_catch_errors (uiout=0x82f4f48, data=0xbffff638)
    at ../../combined/gdb/top.c:497
#21 0x0810dc52 in catcher (func=0x810dd5c <do_catch_errors>, func_uiout=0x82f4f48, 
    func_args=0xbffff638, func_val=0xbffff630, func_caught=0xbffff634, 
    errstring=0x8207400 "", mask=6) at ../../combined/gdb/top.c:429
#22 0x0810dda4 in catch_errors (func=0x807c53c <captured_command_loop>, func_args=0x0, 
    errstring=0x8207400 "", mask=6) at ../../combined/gdb/top.c:509
#23 0x0807d0eb in captured_main (data=0xbffff920) at ../../combined/gdb/main.c:811
#24 0x0810dd6a in do_catch_errors (uiout=0x829f6e0, data=0xbffff8d8)
    at ../../combined/gdb/top.c:497
#25 0x0810dc52 in catcher (func=0x810dd5c <do_catch_errors>, func_uiout=0x829f6e0, 
    func_args=0xbffff8d8, func_val=0xbffff8d0, func_caught=0xbffff8d4, 
    errstring=0x8207400 "", mask=6) at ../../combined/gdb/top.c:429
#26 0x0810dda4 in catch_errors (func=0x807c574 <captured_main>, func_args=0xbffff920, 
    errstring=0x8207400 "", mask=6) at ../../combined/gdb/top.c:509
#27 0x0807d113 in gdb_main (args=0xbffff920) at ../../combined/gdb/main.c:820
#28 0x0807c539 in main (argc=2, argv=0xbffff9ac) at ../../combined/gdb/gdb.c:35
#29 0x4006e177 in __libc_start_main (main=0x807c510 <main>, argc=2, ubp_av=0xbffff9ac, 
    init=0x807b874 <_init>, fini=0x82073c0 <_fini>, rtld_fini=0x4000e184 <_dl_fini>, 
    stack_end=0xbffff99c) at ../sysdeps/generic/libc-start.c:129

Here's what the gdbarch structure looks like (well, the first bits, anyhow):

(top-gdb) print gdbarch
$8 = (struct gdbarch *) 0x82fdc48
(top-gdb) print *gdbarch
$9 = {initialized_p = 1, bfd_arch_info = 0x8286740, byte_order = 0, 
  osabi = GDB_OSABI_UNKNOWN, tdep = 0x82fdc18, dump_tdep = 0x80dcc9c <mips_dump_tdep>, 
  nr_data = 6, data = 0x82fded0, swap = 0x82fdef0, short_bit = 16, int_bit = 32, 
  long_bit = 32, long_long_bit = 64, float_bit = 32, double_bit = 64, 
  long_double_bit = 64, ptr_bit = 32, addr_bit = 32, bfd_vma_bit = 32, char_signed = 1, 
  read_pc = 0x80d53c8 <mips_read_pc>, write_pc = 0x8095214 <generic_target_write_pc>, 
  read_sp = 0x80d5204 <mips_read_sp>, 
  virtual_frame_pointer = 0x80ce958 <legacy_virtual_frame_pointer>, 
  pseudo_register_read = 0x80d4aec <mips_pseudo_register_read>, 
  pseudo_register_write = 0x80d4b78 <mips_pseudo_register_write>, num_regs = 90, 
  num_pseudo_regs = 90, sp_regnum = -1, pc_regnum = -1, ps_regnum = -1, fp0_regnum = -1, 
  npc_regnum = -1, stab_reg_to_regnum = 0x80dbda4 <mips_stab_reg_to_regnum>, 
  ecoff_reg_to_regnum = 0x80dbe0c <mips_dwarf_dwarf2_ecoff_reg_to_regnum>, 
  dwarf_reg_to_regnum = 0x80dbe0c <mips_dwarf_dwarf2_ecoff_reg_to_regnum>, 
  sdb_reg_to_regnum = 0x80ce8a4 <no_op_reg_to_regnum>, 
  dwarf2_reg_to_regnum = 0x80dbe0c <mips_dwarf_dwarf2_ecoff_reg_to_regnum>, 
  register_name = 0x80d48ec <mips_register_name>, 
  register_type = 0x80d5178 <mips_register_type>, deprecated_register_virtual_type = 0, 
[ etc etc ]

Being rather weak in gdb-fu, I thought I'd defer to an expert.  Or at least someone
who's generated patches in the vicinity.

If you'd like me to try some other stuff or provide more data, that can easily
be arranged.

(I'm not subscribed to gdb-patches, please cc.)

Thanks,

-- 
Steve Watt       KD6GGD  PP-ASEL-IA       Email at  home: steve@watt.com
Chelsio Communications   http://www.chelsio.com/    work: steve@chelsio.com
510 N. Pastoria Ave                                Voice: +1 408 962 3627
Sunnyvale, CA, USA, 94085                            Fax: +1 408 730 2580


             reply	other threads:[~2003-07-07 20:01 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-07-07 20:01 Steve Watt [this message]
2003-07-18 22:20 ` Andrew Cagney
  -- strict thread matches above, loose matches on Subject: below --
2003-07-21 22:57 Steve Watt
2003-07-21 18:20 Steve Watt
2003-07-21 22:38 ` Andrew Cagney
2003-07-19  0:13 Steve Watt
2003-07-21 15:26 ` Andrew Cagney
2003-06-16 15:35 Andrew Cagney
2003-06-16 15:44 ` Daniel Jacobowitz
2003-06-18  4:32 ` Kevin Buettner
2003-06-18 16:36   ` Andrew Cagney
2003-06-18 23:54     ` Kevin Buettner
2003-06-21 18:22 ` Andrew Cagney

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200307072001.h67K1iMm054172@oberon.asicdesigners.com \
    --to=steve@asicdesigners.com \
    --cc=gdb-patches@sources.redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox