* [SH] regs command
@ 2012-05-16 13:56 Thomas Schwinge
2012-05-16 14:26 ` Joel Brobecker
0 siblings, 1 reply; 30+ messages in thread
From: Thomas Schwinge @ 2012-05-16 13:56 UTC (permalink / raw)
To: gdb-patches; +Cc: Kevin Buettner, Maciej W. Rozycki
[-- Attachment #1: Type: text/plain, Size: 1354 bytes --]
Hi!
There are issues with sh-tdep's regs command (»Print all registers«):
(gdb) regs
PC 295568c0 SR 00008000 PR 00000000 MACH 00000000
Register 19 is not available
(After PC, SR, PR, MACH, this should print the values of the GBR, VBR
(this is register 19), MACL, then R0..R15.) Evidently this code is not
prepared to cope with frame_unwind_register raising NOT_AVAILABLE_ERROR.
Now, the question is, why does the regs command exist at all? It's been
present since the very first revision of sh-tdep.c, but as far as I can
tell, »info registers«/»info all-registers« can display all the register
information just fine, for example:
(gdb) info all-registers
r0 0x0 0
[...]
r15 0x7bab5c60 2074827872
pc 0x295568c0 693463232
pr 0x0 0
gbr 0x29690678 694748792
vbr *value not available*
mach 0x0 0
macl 0x0 0
sr 0x8000 32768
I therefore propose to remove sh_show_regs_command et al. from sh-tdep.c.
If nobody objects, can it just go silently, or should invoking it then
cause an error message, like »Please use the »info all-registers« command
instead of »regs«.«?
Grüße,
Thomas
[-- Attachment #2: Type: application/pgp-signature, Size: 489 bytes --]
^ permalink raw reply [flat|nested] 30+ messages in thread* Re: [SH] regs command 2012-05-16 13:56 [SH] regs command Thomas Schwinge @ 2012-05-16 14:26 ` Joel Brobecker 2012-05-16 16:32 ` Thomas Schwinge 0 siblings, 1 reply; 30+ messages in thread From: Joel Brobecker @ 2012-05-16 14:26 UTC (permalink / raw) To: Thomas Schwinge; +Cc: gdb-patches, Kevin Buettner, Maciej W. Rozycki > I therefore propose to remove sh_show_regs_command et al. from sh-tdep.c. > If nobody objects, can it just go silently, or should invoking it then > cause an error message, like »Please use the »info all-registers« command > instead of »regs«.«? Make it an alias of "info reg" or "info all-registers", and make the alias deprecated, so that users get a warning when they use it? We can make that command deprecated for 7.5, and then remove it from HEAD after 7.5 is branched, in a few weeks. -- Joel ^ permalink raw reply [flat|nested] 30+ messages in thread
* Re: [SH] regs command 2012-05-16 14:26 ` Joel Brobecker @ 2012-05-16 16:32 ` Thomas Schwinge 2012-05-16 16:58 ` Joel Brobecker ` (3 more replies) 0 siblings, 4 replies; 30+ messages in thread From: Thomas Schwinge @ 2012-05-16 16:32 UTC (permalink / raw) To: Joel Brobecker; +Cc: gdb-patches, Kevin Buettner, Maciej W. Rozycki [-- Attachment #1: Type: text/plain, Size: 45401 bytes --] Hi! On Wed, 16 May 2012 07:26:33 -0700, Joel Brobecker <brobecker@adacore.com> wrote: > > I therefore propose to remove sh_show_regs_command et al. from sh-tdep.c. > > If nobody objects, can it just go silently, or should invoking it then > > cause an error message, like »Please use the »info all-registers« command > > instead of »regs«.«? > > Make it an alias of "info reg" or "info all-registers", and make > the alias deprecated, so that users get a warning when they use it? > We can make that command deprecated for 7.5, and then remove it > from HEAD after 7.5 is branched, in a few weeks. Sounds good, and thusly implemented, OK to commit? I have not verified (and I'm not able to verify) for all possible configurations that `info all-registers' prints all the registers' contents that `regs' used to print -- but I'd say if something is missing From `info all-registers' then that's a separate bug on its own. gdb/ * sh-tdep.c (sh_show_regs): Remove variable. (sh_generic_show_regs, sh3_show_regs, sh2e_show_regs, sh2a_show_regs) (sh2a_nofpu_show_regs, sh3e_show_regs, sh3_dsp_show_regs) (sh4_show_regs, sh4_nofpu_show_regs, sh_dsp_show_regs) (sh_show_regs_command): Remove functions. (sh_gdbarch_init): Don't set sh_show_regs. (_initialize_sh_tdep): Make the `regs' command an deprecated alias to `info all-registers'. * sh64-tdep.c (sh64_show_media_regs, sh64_show_compact_regs) (sh64_show_regs): Remove functions. * sh64-tdep.h (sh64_show_regs): Remove function declaration. * NEWS: Document the deprecation. gdb/doc/ * gdb.texinfo: Document the deprecation. Index: gdb/NEWS =================================================================== RCS file: /cvs/src/src/gdb/NEWS,v retrieving revision 1.507 diff -u -p -r1.507 NEWS --- gdb/NEWS 11 Apr 2012 05:50:40 -0000 1.507 +++ gdb/NEWS 16 May 2012 16:16:42 -0000 @@ -98,6 +98,11 @@ expressions. These commands are available only if GDB is configured with '--with-python'. +* Deprecated commands + + ** For the Renesas Super-H architecture, the "regs" command has been + deprecated, and "info all-registers" should be used instead. + * New targets Renesas RL78 rl78-*-elf Index: gdb/sh-tdep.c =================================================================== RCS file: /cvs/src/src/gdb/sh-tdep.c,v retrieving revision 1.242 diff -u -p -r1.242 sh-tdep.c --- gdb/sh-tdep.c 5 Mar 2012 15:16:39 -0000 1.242 +++ gdb/sh-tdep.c 16 May 2012 16:16:42 -0000 @@ -69,8 +69,6 @@ static const char *const sh_cc_enum[] = static const char *sh_active_calling_convention = sh_cc_gcc; -static void (*sh_show_regs) (struct frame_info *); - #define SH_NUM_REGS 67 struct sh_frame_cache @@ -1427,714 +1425,6 @@ sh_return_value_fpu (struct gdbarch *gdb return RETURN_VALUE_REGISTER_CONVENTION; } -/* Print the registers in a form similar to the E7000. */ - -static void -sh_generic_show_regs (struct frame_info *frame) -{ - printf_filtered - (" PC %s SR %08lx PR %08lx MACH %08lx\n", - phex (get_frame_register_unsigned (frame, - gdbarch_pc_regnum - (get_frame_arch (frame))), 4), - (long) get_frame_register_unsigned (frame, SR_REGNUM), - (long) get_frame_register_unsigned (frame, PR_REGNUM), - (long) get_frame_register_unsigned (frame, MACH_REGNUM)); - - printf_filtered - (" GBR %08lx VBR %08lx MACL %08lx\n", - (long) get_frame_register_unsigned (frame, GBR_REGNUM), - (long) get_frame_register_unsigned (frame, VBR_REGNUM), - (long) get_frame_register_unsigned (frame, MACL_REGNUM)); - - printf_filtered - ("R0-R7 %08lx %08lx %08lx %08lx %08lx %08lx %08lx %08lx\n", - (long) get_frame_register_unsigned (frame, 0), - (long) get_frame_register_unsigned (frame, 1), - (long) get_frame_register_unsigned (frame, 2), - (long) get_frame_register_unsigned (frame, 3), - (long) get_frame_register_unsigned (frame, 4), - (long) get_frame_register_unsigned (frame, 5), - (long) get_frame_register_unsigned (frame, 6), - (long) get_frame_register_unsigned (frame, 7)); - printf_filtered - ("R8-R15 %08lx %08lx %08lx %08lx %08lx %08lx %08lx %08lx\n", - (long) get_frame_register_unsigned (frame, 8), - (long) get_frame_register_unsigned (frame, 9), - (long) get_frame_register_unsigned (frame, 10), - (long) get_frame_register_unsigned (frame, 11), - (long) get_frame_register_unsigned (frame, 12), - (long) get_frame_register_unsigned (frame, 13), - (long) get_frame_register_unsigned (frame, 14), - (long) get_frame_register_unsigned (frame, 15)); -} - -static void -sh3_show_regs (struct frame_info *frame) -{ - printf_filtered - (" PC %s SR %08lx PR %08lx MACH %08lx\n", - phex (get_frame_register_unsigned (frame, - gdbarch_pc_regnum - (get_frame_arch (frame))), 4), - (long) get_frame_register_unsigned (frame, SR_REGNUM), - (long) get_frame_register_unsigned (frame, PR_REGNUM), - (long) get_frame_register_unsigned (frame, MACH_REGNUM)); - - printf_filtered - (" GBR %08lx VBR %08lx MACL %08lx\n", - (long) get_frame_register_unsigned (frame, GBR_REGNUM), - (long) get_frame_register_unsigned (frame, VBR_REGNUM), - (long) get_frame_register_unsigned (frame, MACL_REGNUM)); - printf_filtered - (" SSR %08lx SPC %08lx\n", - (long) get_frame_register_unsigned (frame, SSR_REGNUM), - (long) get_frame_register_unsigned (frame, SPC_REGNUM)); - - printf_filtered - ("R0-R7 %08lx %08lx %08lx %08lx %08lx %08lx %08lx %08lx\n", - (long) get_frame_register_unsigned (frame, 0), - (long) get_frame_register_unsigned (frame, 1), - (long) get_frame_register_unsigned (frame, 2), - (long) get_frame_register_unsigned (frame, 3), - (long) get_frame_register_unsigned (frame, 4), - (long) get_frame_register_unsigned (frame, 5), - (long) get_frame_register_unsigned (frame, 6), - (long) get_frame_register_unsigned (frame, 7)); - printf_filtered - ("R8-R15 %08lx %08lx %08lx %08lx %08lx %08lx %08lx %08lx\n", - (long) get_frame_register_unsigned (frame, 8), - (long) get_frame_register_unsigned (frame, 9), - (long) get_frame_register_unsigned (frame, 10), - (long) get_frame_register_unsigned (frame, 11), - (long) get_frame_register_unsigned (frame, 12), - (long) get_frame_register_unsigned (frame, 13), - (long) get_frame_register_unsigned (frame, 14), - (long) get_frame_register_unsigned (frame, 15)); -} - -static void -sh2e_show_regs (struct frame_info *frame) -{ - struct gdbarch *gdbarch = get_frame_arch (frame); - printf_filtered - (" PC %s SR %08lx PR %08lx MACH %08lx\n", - phex (get_frame_register_unsigned (frame, - gdbarch_pc_regnum (gdbarch)), 4), - (long) get_frame_register_unsigned (frame, SR_REGNUM), - (long) get_frame_register_unsigned (frame, PR_REGNUM), - (long) get_frame_register_unsigned (frame, MACH_REGNUM)); - - printf_filtered - (" GBR %08lx VBR %08lx MACL %08lx\n", - (long) get_frame_register_unsigned (frame, GBR_REGNUM), - (long) get_frame_register_unsigned (frame, VBR_REGNUM), - (long) get_frame_register_unsigned (frame, MACL_REGNUM)); - printf_filtered - (" SSR %08lx SPC %08lx FPUL %08lx FPSCR %08lx\n", - (long) get_frame_register_unsigned (frame, SSR_REGNUM), - (long) get_frame_register_unsigned (frame, SPC_REGNUM), - (long) get_frame_register_unsigned (frame, FPUL_REGNUM), - (long) get_frame_register_unsigned (frame, FPSCR_REGNUM)); - - printf_filtered - ("R0-R7 %08lx %08lx %08lx %08lx %08lx %08lx %08lx %08lx\n", - (long) get_frame_register_unsigned (frame, 0), - (long) get_frame_register_unsigned (frame, 1), - (long) get_frame_register_unsigned (frame, 2), - (long) get_frame_register_unsigned (frame, 3), - (long) get_frame_register_unsigned (frame, 4), - (long) get_frame_register_unsigned (frame, 5), - (long) get_frame_register_unsigned (frame, 6), - (long) get_frame_register_unsigned (frame, 7)); - printf_filtered - ("R8-R15 %08lx %08lx %08lx %08lx %08lx %08lx %08lx %08lx\n", - (long) get_frame_register_unsigned (frame, 8), - (long) get_frame_register_unsigned (frame, 9), - (long) get_frame_register_unsigned (frame, 10), - (long) get_frame_register_unsigned (frame, 11), - (long) get_frame_register_unsigned (frame, 12), - (long) get_frame_register_unsigned (frame, 13), - (long) get_frame_register_unsigned (frame, 14), - (long) get_frame_register_unsigned (frame, 15)); - - printf_filtered - ("FP0-FP7 %08lx %08lx %08lx %08lx %08lx %08lx %08lx %08lx\n", - (long) get_frame_register_unsigned - (frame, gdbarch_fp0_regnum (gdbarch) + 0), - (long) get_frame_register_unsigned - (frame, gdbarch_fp0_regnum (gdbarch) + 1), - (long) get_frame_register_unsigned - (frame, gdbarch_fp0_regnum (gdbarch) + 2), - (long) get_frame_register_unsigned - (frame, gdbarch_fp0_regnum (gdbarch) + 3), - (long) get_frame_register_unsigned - (frame, gdbarch_fp0_regnum (gdbarch) + 4), - (long) get_frame_register_unsigned - (frame, gdbarch_fp0_regnum (gdbarch) + 5), - (long) get_frame_register_unsigned - (frame, gdbarch_fp0_regnum (gdbarch) + 6), - (long) get_frame_register_unsigned - (frame, gdbarch_fp0_regnum (gdbarch) + 7)); - printf_filtered - ("FP8-FP15 %08lx %08lx %08lx %08lx %08lx %08lx %08lx %08lx\n", - (long) get_frame_register_unsigned - (frame, gdbarch_fp0_regnum (gdbarch) + 8), - (long) get_frame_register_unsigned - (frame, gdbarch_fp0_regnum (gdbarch) + 9), - (long) get_frame_register_unsigned - (frame, gdbarch_fp0_regnum (gdbarch) + 10), - (long) get_frame_register_unsigned - (frame, gdbarch_fp0_regnum (gdbarch) + 11), - (long) get_frame_register_unsigned - (frame, gdbarch_fp0_regnum (gdbarch) + 12), - (long) get_frame_register_unsigned - (frame, gdbarch_fp0_regnum (gdbarch) + 13), - (long) get_frame_register_unsigned - (frame, gdbarch_fp0_regnum (gdbarch) + 14), - (long) get_frame_register_unsigned - (frame, gdbarch_fp0_regnum (gdbarch) + 15)); -} - -static void -sh2a_show_regs (struct frame_info *frame) -{ - struct gdbarch *gdbarch = get_frame_arch (frame); - int pr = get_frame_register_unsigned (frame, FPSCR_REGNUM) & 0x80000; - - printf_filtered - (" PC %s SR %08lx PR %08lx MACH %08lx\n", - phex (get_frame_register_unsigned (frame, - gdbarch_pc_regnum (gdbarch)), 4), - (long) get_frame_register_unsigned (frame, SR_REGNUM), - (long) get_frame_register_unsigned (frame, PR_REGNUM), - (long) get_frame_register_unsigned (frame, MACH_REGNUM)); - - printf_filtered - (" GBR %08lx VBR %08lx TBR %08lx MACL %08lx\n", - (long) get_frame_register_unsigned (frame, GBR_REGNUM), - (long) get_frame_register_unsigned (frame, VBR_REGNUM), - (long) get_frame_register_unsigned (frame, TBR_REGNUM), - (long) get_frame_register_unsigned (frame, MACL_REGNUM)); - printf_filtered - (" SSR %08lx SPC %08lx FPUL %08lx FPSCR %08lx\n", - (long) get_frame_register_unsigned (frame, SSR_REGNUM), - (long) get_frame_register_unsigned (frame, SPC_REGNUM), - (long) get_frame_register_unsigned (frame, FPUL_REGNUM), - (long) get_frame_register_unsigned (frame, FPSCR_REGNUM)); - - printf_filtered - ("R0-R7 %08lx %08lx %08lx %08lx %08lx %08lx %08lx %08lx\n", - (long) get_frame_register_unsigned (frame, 0), - (long) get_frame_register_unsigned (frame, 1), - (long) get_frame_register_unsigned (frame, 2), - (long) get_frame_register_unsigned (frame, 3), - (long) get_frame_register_unsigned (frame, 4), - (long) get_frame_register_unsigned (frame, 5), - (long) get_frame_register_unsigned (frame, 6), - (long) get_frame_register_unsigned (frame, 7)); - printf_filtered - ("R8-R15 %08lx %08lx %08lx %08lx %08lx %08lx %08lx %08lx\n", - (long) get_frame_register_unsigned (frame, 8), - (long) get_frame_register_unsigned (frame, 9), - (long) get_frame_register_unsigned (frame, 10), - (long) get_frame_register_unsigned (frame, 11), - (long) get_frame_register_unsigned (frame, 12), - (long) get_frame_register_unsigned (frame, 13), - (long) get_frame_register_unsigned (frame, 14), - (long) get_frame_register_unsigned (frame, 15)); - - printf_filtered - (pr ? "DR0-DR6 %08lx%08lx %08lx%08lx %08lx%08lx %08lx%08lx\n" - : "FP0-FP7 %08lx %08lx %08lx %08lx %08lx %08lx %08lx %08lx\n", - (long) get_frame_register_unsigned - (frame, gdbarch_fp0_regnum (gdbarch) + 0), - (long) get_frame_register_unsigned - (frame, gdbarch_fp0_regnum (gdbarch) + 1), - (long) get_frame_register_unsigned - (frame, gdbarch_fp0_regnum (gdbarch) + 2), - (long) get_frame_register_unsigned - (frame, gdbarch_fp0_regnum (gdbarch) + 3), - (long) get_frame_register_unsigned - (frame, gdbarch_fp0_regnum (gdbarch) + 4), - (long) get_frame_register_unsigned - (frame, gdbarch_fp0_regnum (gdbarch) + 5), - (long) get_frame_register_unsigned - (frame, gdbarch_fp0_regnum (gdbarch) + 6), - (long) get_frame_register_unsigned - (frame, gdbarch_fp0_regnum (gdbarch) + 7)); - printf_filtered - (pr ? "DR8-DR14 %08lx%08lx %08lx%08lx %08lx%08lx %08lx%08lx\n" - : "FP8-FP15 %08lx %08lx %08lx %08lx %08lx %08lx %08lx %08lx\n", - (long) get_frame_register_unsigned - (frame, gdbarch_fp0_regnum (gdbarch) + 8), - (long) get_frame_register_unsigned - (frame, gdbarch_fp0_regnum (gdbarch) + 9), - (long) get_frame_register_unsigned - (frame, gdbarch_fp0_regnum (gdbarch) + 10), - (long) get_frame_register_unsigned - (frame, gdbarch_fp0_regnum (gdbarch) + 11), - (long) get_frame_register_unsigned - (frame, gdbarch_fp0_regnum (gdbarch) + 12), - (long) get_frame_register_unsigned - (frame, gdbarch_fp0_regnum (gdbarch) + 13), - (long) get_frame_register_unsigned - (frame, gdbarch_fp0_regnum (gdbarch) + 14), - (long) get_frame_register_unsigned - (frame, gdbarch_fp0_regnum (gdbarch) + 15)); - printf_filtered - ("BANK=%-3d\n", (int) get_frame_register_unsigned (frame, BANK_REGNUM)); - printf_filtered - ("R0b-R7b %08lx %08lx %08lx %08lx %08lx %08lx %08lx %08lx\n", - (long) get_frame_register_unsigned (frame, R0_BANK0_REGNUM + 0), - (long) get_frame_register_unsigned (frame, R0_BANK0_REGNUM + 1), - (long) get_frame_register_unsigned (frame, R0_BANK0_REGNUM + 2), - (long) get_frame_register_unsigned (frame, R0_BANK0_REGNUM + 3), - (long) get_frame_register_unsigned (frame, R0_BANK0_REGNUM + 4), - (long) get_frame_register_unsigned (frame, R0_BANK0_REGNUM + 5), - (long) get_frame_register_unsigned (frame, R0_BANK0_REGNUM + 6), - (long) get_frame_register_unsigned (frame, R0_BANK0_REGNUM + 7)); - printf_filtered - ("R8b-R14b %08lx %08lx %08lx %08lx %08lx %08lx %08lx\n", - (long) get_frame_register_unsigned (frame, R0_BANK0_REGNUM + 8), - (long) get_frame_register_unsigned (frame, R0_BANK0_REGNUM + 9), - (long) get_frame_register_unsigned (frame, R0_BANK0_REGNUM + 10), - (long) get_frame_register_unsigned (frame, R0_BANK0_REGNUM + 11), - (long) get_frame_register_unsigned (frame, R0_BANK0_REGNUM + 12), - (long) get_frame_register_unsigned (frame, R0_BANK0_REGNUM + 13), - (long) get_frame_register_unsigned (frame, R0_BANK0_REGNUM + 14)); - printf_filtered - ("MACHb=%08lx IVNb=%08lx PRb=%08lx GBRb=%08lx MACLb=%08lx\n", - (long) get_frame_register_unsigned (frame, R0_BANK0_REGNUM + 15), - (long) get_frame_register_unsigned (frame, R0_BANK0_REGNUM + 16), - (long) get_frame_register_unsigned (frame, R0_BANK0_REGNUM + 17), - (long) get_frame_register_unsigned (frame, R0_BANK0_REGNUM + 18), - (long) get_frame_register_unsigned (frame, R0_BANK0_REGNUM + 19)); -} - -static void -sh2a_nofpu_show_regs (struct frame_info *frame) -{ - int pr = get_frame_register_unsigned (frame, FPSCR_REGNUM) & 0x80000; - - printf_filtered - (" PC %s SR %08lx PR %08lx MACH %08lx\n", - phex (get_frame_register_unsigned (frame, - gdbarch_pc_regnum - (get_frame_arch (frame))), 4), - (long) get_frame_register_unsigned (frame, SR_REGNUM), - (long) get_frame_register_unsigned (frame, PR_REGNUM), - (long) get_frame_register_unsigned (frame, MACH_REGNUM)); - - printf_filtered - (" GBR %08lx VBR %08lx TBR %08lx MACL %08lx\n", - (long) get_frame_register_unsigned (frame, GBR_REGNUM), - (long) get_frame_register_unsigned (frame, VBR_REGNUM), - (long) get_frame_register_unsigned (frame, TBR_REGNUM), - (long) get_frame_register_unsigned (frame, MACL_REGNUM)); - printf_filtered - (" SSR %08lx SPC %08lx FPUL %08lx FPSCR %08lx\n", - (long) get_frame_register_unsigned (frame, SSR_REGNUM), - (long) get_frame_register_unsigned (frame, SPC_REGNUM), - (long) get_frame_register_unsigned (frame, FPUL_REGNUM), - (long) get_frame_register_unsigned (frame, FPSCR_REGNUM)); - - printf_filtered - ("R0-R7 %08lx %08lx %08lx %08lx %08lx %08lx %08lx %08lx\n", - (long) get_frame_register_unsigned (frame, 0), - (long) get_frame_register_unsigned (frame, 1), - (long) get_frame_register_unsigned (frame, 2), - (long) get_frame_register_unsigned (frame, 3), - (long) get_frame_register_unsigned (frame, 4), - (long) get_frame_register_unsigned (frame, 5), - (long) get_frame_register_unsigned (frame, 6), - (long) get_frame_register_unsigned (frame, 7)); - printf_filtered - ("R8-R15 %08lx %08lx %08lx %08lx %08lx %08lx %08lx %08lx\n", - (long) get_frame_register_unsigned (frame, 8), - (long) get_frame_register_unsigned (frame, 9), - (long) get_frame_register_unsigned (frame, 10), - (long) get_frame_register_unsigned (frame, 11), - (long) get_frame_register_unsigned (frame, 12), - (long) get_frame_register_unsigned (frame, 13), - (long) get_frame_register_unsigned (frame, 14), - (long) get_frame_register_unsigned (frame, 15)); - - printf_filtered - ("BANK=%-3d\n", (int) get_frame_register_unsigned (frame, BANK_REGNUM)); - printf_filtered - ("R0b-R7b %08lx %08lx %08lx %08lx %08lx %08lx %08lx %08lx\n", - (long) get_frame_register_unsigned (frame, R0_BANK0_REGNUM + 0), - (long) get_frame_register_unsigned (frame, R0_BANK0_REGNUM + 1), - (long) get_frame_register_unsigned (frame, R0_BANK0_REGNUM + 2), - (long) get_frame_register_unsigned (frame, R0_BANK0_REGNUM + 3), - (long) get_frame_register_unsigned (frame, R0_BANK0_REGNUM + 4), - (long) get_frame_register_unsigned (frame, R0_BANK0_REGNUM + 5), - (long) get_frame_register_unsigned (frame, R0_BANK0_REGNUM + 6), - (long) get_frame_register_unsigned (frame, R0_BANK0_REGNUM + 7)); - printf_filtered - ("R8b-R14b %08lx %08lx %08lx %08lx %08lx %08lx %08lx\n", - (long) get_frame_register_unsigned (frame, R0_BANK0_REGNUM + 8), - (long) get_frame_register_unsigned (frame, R0_BANK0_REGNUM + 9), - (long) get_frame_register_unsigned (frame, R0_BANK0_REGNUM + 10), - (long) get_frame_register_unsigned (frame, R0_BANK0_REGNUM + 11), - (long) get_frame_register_unsigned (frame, R0_BANK0_REGNUM + 12), - (long) get_frame_register_unsigned (frame, R0_BANK0_REGNUM + 13), - (long) get_frame_register_unsigned (frame, R0_BANK0_REGNUM + 14)); - printf_filtered - ("MACHb=%08lx IVNb=%08lx PRb=%08lx GBRb=%08lx MACLb=%08lx\n", - (long) get_frame_register_unsigned (frame, R0_BANK0_REGNUM + 15), - (long) get_frame_register_unsigned (frame, R0_BANK0_REGNUM + 16), - (long) get_frame_register_unsigned (frame, R0_BANK0_REGNUM + 17), - (long) get_frame_register_unsigned (frame, R0_BANK0_REGNUM + 18), - (long) get_frame_register_unsigned (frame, R0_BANK0_REGNUM + 19)); -} - -static void -sh3e_show_regs (struct frame_info *frame) -{ - struct gdbarch *gdbarch = get_frame_arch (frame); - printf_filtered - (" PC %s SR %08lx PR %08lx MACH %08lx\n", - phex (get_frame_register_unsigned (frame, - gdbarch_pc_regnum (gdbarch)), 4), - (long) get_frame_register_unsigned (frame, SR_REGNUM), - (long) get_frame_register_unsigned (frame, PR_REGNUM), - (long) get_frame_register_unsigned (frame, MACH_REGNUM)); - - printf_filtered - (" GBR %08lx VBR %08lx MACL %08lx\n", - (long) get_frame_register_unsigned (frame, GBR_REGNUM), - (long) get_frame_register_unsigned (frame, VBR_REGNUM), - (long) get_frame_register_unsigned (frame, MACL_REGNUM)); - printf_filtered - (" SSR %08lx SPC %08lx FPUL %08lx FPSCR %08lx\n", - (long) get_frame_register_unsigned (frame, SSR_REGNUM), - (long) get_frame_register_unsigned (frame, SPC_REGNUM), - (long) get_frame_register_unsigned (frame, FPUL_REGNUM), - (long) get_frame_register_unsigned (frame, FPSCR_REGNUM)); - - printf_filtered - ("R0-R7 %08lx %08lx %08lx %08lx %08lx %08lx %08lx %08lx\n", - (long) get_frame_register_unsigned (frame, 0), - (long) get_frame_register_unsigned (frame, 1), - (long) get_frame_register_unsigned (frame, 2), - (long) get_frame_register_unsigned (frame, 3), - (long) get_frame_register_unsigned (frame, 4), - (long) get_frame_register_unsigned (frame, 5), - (long) get_frame_register_unsigned (frame, 6), - (long) get_frame_register_unsigned (frame, 7)); - printf_filtered - ("R8-R15 %08lx %08lx %08lx %08lx %08lx %08lx %08lx %08lx\n", - (long) get_frame_register_unsigned (frame, 8), - (long) get_frame_register_unsigned (frame, 9), - (long) get_frame_register_unsigned (frame, 10), - (long) get_frame_register_unsigned (frame, 11), - (long) get_frame_register_unsigned (frame, 12), - (long) get_frame_register_unsigned (frame, 13), - (long) get_frame_register_unsigned (frame, 14), - (long) get_frame_register_unsigned (frame, 15)); - - printf_filtered - ("FP0-FP7 %08lx %08lx %08lx %08lx %08lx %08lx %08lx %08lx\n", - (long) get_frame_register_unsigned - (frame, gdbarch_fp0_regnum (gdbarch) + 0), - (long) get_frame_register_unsigned - (frame, gdbarch_fp0_regnum (gdbarch) + 1), - (long) get_frame_register_unsigned - (frame, gdbarch_fp0_regnum (gdbarch) + 2), - (long) get_frame_register_unsigned - (frame, gdbarch_fp0_regnum (gdbarch) + 3), - (long) get_frame_register_unsigned - (frame, gdbarch_fp0_regnum (gdbarch) + 4), - (long) get_frame_register_unsigned - (frame, gdbarch_fp0_regnum (gdbarch) + 5), - (long) get_frame_register_unsigned - (frame, gdbarch_fp0_regnum (gdbarch) + 6), - (long) get_frame_register_unsigned - (frame, gdbarch_fp0_regnum (gdbarch) + 7)); - printf_filtered - ("FP8-FP15 %08lx %08lx %08lx %08lx %08lx %08lx %08lx %08lx\n", - (long) get_frame_register_unsigned - (frame, gdbarch_fp0_regnum (gdbarch) + 8), - (long) get_frame_register_unsigned - (frame, gdbarch_fp0_regnum (gdbarch) + 9), - (long) get_frame_register_unsigned - (frame, gdbarch_fp0_regnum (gdbarch) + 10), - (long) get_frame_register_unsigned - (frame, gdbarch_fp0_regnum (gdbarch) + 11), - (long) get_frame_register_unsigned - (frame, gdbarch_fp0_regnum (gdbarch) + 12), - (long) get_frame_register_unsigned - (frame, gdbarch_fp0_regnum (gdbarch) + 13), - (long) get_frame_register_unsigned - (frame, gdbarch_fp0_regnum (gdbarch) + 14), - (long) get_frame_register_unsigned - (frame, gdbarch_fp0_regnum (gdbarch) + 15)); -} - -static void -sh3_dsp_show_regs (struct frame_info *frame) -{ - printf_filtered - (" PC %s SR %08lx PR %08lx MACH %08lx\n", - phex (get_frame_register_unsigned (frame, - gdbarch_pc_regnum - (get_frame_arch (frame))), 4), - (long) get_frame_register_unsigned (frame, SR_REGNUM), - (long) get_frame_register_unsigned (frame, PR_REGNUM), - (long) get_frame_register_unsigned (frame, MACH_REGNUM)); - - printf_filtered - (" GBR %08lx VBR %08lx MACL %08lx\n", - (long) get_frame_register_unsigned (frame, GBR_REGNUM), - (long) get_frame_register_unsigned (frame, VBR_REGNUM), - (long) get_frame_register_unsigned (frame, MACL_REGNUM)); - - printf_filtered - (" SSR %08lx SPC %08lx DSR %08lx\n", - (long) get_frame_register_unsigned (frame, SSR_REGNUM), - (long) get_frame_register_unsigned (frame, SPC_REGNUM), - (long) get_frame_register_unsigned (frame, DSR_REGNUM)); - - printf_filtered - ("R0-R7 %08lx %08lx %08lx %08lx %08lx %08lx %08lx %08lx\n", - (long) get_frame_register_unsigned (frame, 0), - (long) get_frame_register_unsigned (frame, 1), - (long) get_frame_register_unsigned (frame, 2), - (long) get_frame_register_unsigned (frame, 3), - (long) get_frame_register_unsigned (frame, 4), - (long) get_frame_register_unsigned (frame, 5), - (long) get_frame_register_unsigned (frame, 6), - (long) get_frame_register_unsigned (frame, 7)); - printf_filtered - ("R8-R15 %08lx %08lx %08lx %08lx %08lx %08lx %08lx %08lx\n", - (long) get_frame_register_unsigned (frame, 8), - (long) get_frame_register_unsigned (frame, 9), - (long) get_frame_register_unsigned (frame, 10), - (long) get_frame_register_unsigned (frame, 11), - (long) get_frame_register_unsigned (frame, 12), - (long) get_frame_register_unsigned (frame, 13), - (long) get_frame_register_unsigned (frame, 14), - (long) get_frame_register_unsigned (frame, 15)); - - printf_filtered - ("A0G=%02lx A0=%08lx M0=%08lx X0=%08lx Y0=%08lx RS=%08lx MOD=%08lx\n", - (long) get_frame_register_unsigned (frame, A0G_REGNUM) & 0xff, - (long) get_frame_register_unsigned (frame, A0_REGNUM), - (long) get_frame_register_unsigned (frame, M0_REGNUM), - (long) get_frame_register_unsigned (frame, X0_REGNUM), - (long) get_frame_register_unsigned (frame, Y0_REGNUM), - (long) get_frame_register_unsigned (frame, RS_REGNUM), - (long) get_frame_register_unsigned (frame, MOD_REGNUM)); - printf_filtered - ("A1G=%02lx A1=%08lx M1=%08lx X1=%08lx Y1=%08lx RE=%08lx\n", - (long) get_frame_register_unsigned (frame, A1G_REGNUM) & 0xff, - (long) get_frame_register_unsigned (frame, A1_REGNUM), - (long) get_frame_register_unsigned (frame, M1_REGNUM), - (long) get_frame_register_unsigned (frame, X1_REGNUM), - (long) get_frame_register_unsigned (frame, Y1_REGNUM), - (long) get_frame_register_unsigned (frame, RE_REGNUM)); -} - -static void -sh4_show_regs (struct frame_info *frame) -{ - struct gdbarch *gdbarch = get_frame_arch (frame); - int pr = get_frame_register_unsigned (frame, FPSCR_REGNUM) & 0x80000; - - printf_filtered - (" PC %s SR %08lx PR %08lx MACH %08lx\n", - phex (get_frame_register_unsigned (frame, - gdbarch_pc_regnum (gdbarch)), 4), - (long) get_frame_register_unsigned (frame, SR_REGNUM), - (long) get_frame_register_unsigned (frame, PR_REGNUM), - (long) get_frame_register_unsigned (frame, MACH_REGNUM)); - - printf_filtered - (" GBR %08lx VBR %08lx MACL %08lx\n", - (long) get_frame_register_unsigned (frame, GBR_REGNUM), - (long) get_frame_register_unsigned (frame, VBR_REGNUM), - (long) get_frame_register_unsigned (frame, MACL_REGNUM)); - printf_filtered - (" SSR %08lx SPC %08lx FPUL %08lx FPSCR %08lx\n", - (long) get_frame_register_unsigned (frame, SSR_REGNUM), - (long) get_frame_register_unsigned (frame, SPC_REGNUM), - (long) get_frame_register_unsigned (frame, FPUL_REGNUM), - (long) get_frame_register_unsigned (frame, FPSCR_REGNUM)); - - printf_filtered - ("R0-R7 %08lx %08lx %08lx %08lx %08lx %08lx %08lx %08lx\n", - (long) get_frame_register_unsigned (frame, 0), - (long) get_frame_register_unsigned (frame, 1), - (long) get_frame_register_unsigned (frame, 2), - (long) get_frame_register_unsigned (frame, 3), - (long) get_frame_register_unsigned (frame, 4), - (long) get_frame_register_unsigned (frame, 5), - (long) get_frame_register_unsigned (frame, 6), - (long) get_frame_register_unsigned (frame, 7)); - printf_filtered - ("R8-R15 %08lx %08lx %08lx %08lx %08lx %08lx %08lx %08lx\n", - (long) get_frame_register_unsigned (frame, 8), - (long) get_frame_register_unsigned (frame, 9), - (long) get_frame_register_unsigned (frame, 10), - (long) get_frame_register_unsigned (frame, 11), - (long) get_frame_register_unsigned (frame, 12), - (long) get_frame_register_unsigned (frame, 13), - (long) get_frame_register_unsigned (frame, 14), - (long) get_frame_register_unsigned (frame, 15)); - - printf_filtered - (pr ? "DR0-DR6 %08lx%08lx %08lx%08lx %08lx%08lx %08lx%08lx\n" - : "FP0-FP7 %08lx %08lx %08lx %08lx %08lx %08lx %08lx %08lx\n", - (long) get_frame_register_unsigned - (frame, gdbarch_fp0_regnum (gdbarch) + 0), - (long) get_frame_register_unsigned - (frame, gdbarch_fp0_regnum (gdbarch) + 1), - (long) get_frame_register_unsigned - (frame, gdbarch_fp0_regnum (gdbarch) + 2), - (long) get_frame_register_unsigned - (frame, gdbarch_fp0_regnum (gdbarch) + 3), - (long) get_frame_register_unsigned - (frame, gdbarch_fp0_regnum (gdbarch) + 4), - (long) get_frame_register_unsigned - (frame, gdbarch_fp0_regnum (gdbarch) + 5), - (long) get_frame_register_unsigned - (frame, gdbarch_fp0_regnum (gdbarch) + 6), - (long) get_frame_register_unsigned - (frame, gdbarch_fp0_regnum (gdbarch) + 7)); - printf_filtered - (pr ? "DR8-DR14 %08lx%08lx %08lx%08lx %08lx%08lx %08lx%08lx\n" - : "FP8-FP15 %08lx %08lx %08lx %08lx %08lx %08lx %08lx %08lx\n", - (long) get_frame_register_unsigned - (frame, gdbarch_fp0_regnum (gdbarch) + 8), - (long) get_frame_register_unsigned - (frame, gdbarch_fp0_regnum (gdbarch) + 9), - (long) get_frame_register_unsigned - (frame, gdbarch_fp0_regnum (gdbarch) + 10), - (long) get_frame_register_unsigned - (frame, gdbarch_fp0_regnum (gdbarch) + 11), - (long) get_frame_register_unsigned - (frame, gdbarch_fp0_regnum (gdbarch) + 12), - (long) get_frame_register_unsigned - (frame, gdbarch_fp0_regnum (gdbarch) + 13), - (long) get_frame_register_unsigned - (frame, gdbarch_fp0_regnum (gdbarch) + 14), - (long) get_frame_register_unsigned - (frame, gdbarch_fp0_regnum (gdbarch) + 15)); -} - -static void -sh4_nofpu_show_regs (struct frame_info *frame) -{ - printf_filtered - (" PC %s SR %08lx PR %08lx MACH %08lx\n", - phex (get_frame_register_unsigned (frame, - gdbarch_pc_regnum - (get_frame_arch (frame))), 4), - (long) get_frame_register_unsigned (frame, SR_REGNUM), - (long) get_frame_register_unsigned (frame, PR_REGNUM), - (long) get_frame_register_unsigned (frame, MACH_REGNUM)); - - printf_filtered - (" GBR %08lx VBR %08lx MACL %08lx\n", - (long) get_frame_register_unsigned (frame, GBR_REGNUM), - (long) get_frame_register_unsigned (frame, VBR_REGNUM), - (long) get_frame_register_unsigned (frame, MACL_REGNUM)); - printf_filtered - (" SSR %08lx SPC %08lx FPUL %08lx FPSCR %08lx\n", - (long) get_frame_register_unsigned (frame, SSR_REGNUM), - (long) get_frame_register_unsigned (frame, SPC_REGNUM), - (long) get_frame_register_unsigned (frame, FPUL_REGNUM), - (long) get_frame_register_unsigned (frame, FPSCR_REGNUM)); - - printf_filtered - ("R0-R7 %08lx %08lx %08lx %08lx %08lx %08lx %08lx %08lx\n", - (long) get_frame_register_unsigned (frame, 0), - (long) get_frame_register_unsigned (frame, 1), - (long) get_frame_register_unsigned (frame, 2), - (long) get_frame_register_unsigned (frame, 3), - (long) get_frame_register_unsigned (frame, 4), - (long) get_frame_register_unsigned (frame, 5), - (long) get_frame_register_unsigned (frame, 6), - (long) get_frame_register_unsigned (frame, 7)); - printf_filtered - ("R8-R15 %08lx %08lx %08lx %08lx %08lx %08lx %08lx %08lx\n", - (long) get_frame_register_unsigned (frame, 8), - (long) get_frame_register_unsigned (frame, 9), - (long) get_frame_register_unsigned (frame, 10), - (long) get_frame_register_unsigned (frame, 11), - (long) get_frame_register_unsigned (frame, 12), - (long) get_frame_register_unsigned (frame, 13), - (long) get_frame_register_unsigned (frame, 14), - (long) get_frame_register_unsigned (frame, 15)); -} - -static void -sh_dsp_show_regs (struct frame_info *frame) -{ - printf_filtered - (" PC %s SR %08lx PR %08lx MACH %08lx\n", - phex (get_frame_register_unsigned (frame, - gdbarch_pc_regnum - (get_frame_arch (frame))), 4), - (long) get_frame_register_unsigned (frame, SR_REGNUM), - (long) get_frame_register_unsigned (frame, PR_REGNUM), - (long) get_frame_register_unsigned (frame, MACH_REGNUM)); - - printf_filtered - (" GBR %08lx VBR %08lx DSR %08lx MACL %08lx\n", - (long) get_frame_register_unsigned (frame, GBR_REGNUM), - (long) get_frame_register_unsigned (frame, VBR_REGNUM), - (long) get_frame_register_unsigned (frame, DSR_REGNUM), - (long) get_frame_register_unsigned (frame, MACL_REGNUM)); - - printf_filtered - ("R0-R7 %08lx %08lx %08lx %08lx %08lx %08lx %08lx %08lx\n", - (long) get_frame_register_unsigned (frame, 0), - (long) get_frame_register_unsigned (frame, 1), - (long) get_frame_register_unsigned (frame, 2), - (long) get_frame_register_unsigned (frame, 3), - (long) get_frame_register_unsigned (frame, 4), - (long) get_frame_register_unsigned (frame, 5), - (long) get_frame_register_unsigned (frame, 6), - (long) get_frame_register_unsigned (frame, 7)); - printf_filtered - ("R8-R15 %08lx %08lx %08lx %08lx %08lx %08lx %08lx %08lx\n", - (long) get_frame_register_unsigned (frame, 8), - (long) get_frame_register_unsigned (frame, 9), - (long) get_frame_register_unsigned (frame, 10), - (long) get_frame_register_unsigned (frame, 11), - (long) get_frame_register_unsigned (frame, 12), - (long) get_frame_register_unsigned (frame, 13), - (long) get_frame_register_unsigned (frame, 14), - (long) get_frame_register_unsigned (frame, 15)); - - printf_filtered - ("A0G=%02lx A0=%08lx M0=%08lx X0=%08lx Y0=%08lx RS=%08lx MOD=%08lx\n", - (long) get_frame_register_unsigned (frame, A0G_REGNUM) & 0xff, - (long) get_frame_register_unsigned (frame, A0_REGNUM), - (long) get_frame_register_unsigned (frame, M0_REGNUM), - (long) get_frame_register_unsigned (frame, X0_REGNUM), - (long) get_frame_register_unsigned (frame, Y0_REGNUM), - (long) get_frame_register_unsigned (frame, RS_REGNUM), - (long) get_frame_register_unsigned (frame, MOD_REGNUM)); - printf_filtered ("A1G=%02lx A1=%08lx M1=%08lx X1=%08lx Y1=%08lx RE=%08lx\n", - (long) get_frame_register_unsigned (frame, A1G_REGNUM) & 0xff, - (long) get_frame_register_unsigned (frame, A1_REGNUM), - (long) get_frame_register_unsigned (frame, M1_REGNUM), - (long) get_frame_register_unsigned (frame, X1_REGNUM), - (long) get_frame_register_unsigned (frame, Y1_REGNUM), - (long) get_frame_register_unsigned (frame, RE_REGNUM)); -} - -static void -sh_show_regs_command (char *args, int from_tty) -{ - if (sh_show_regs) - (*sh_show_regs) (get_current_frame ()); -} - static struct type * sh_sh2a_register_type (struct gdbarch *gdbarch, int reg_nr) { @@ -2923,56 +2213,9 @@ sh_gdbarch_init (struct gdbarch_info inf struct gdbarch *gdbarch; struct gdbarch_tdep *tdep; - sh_show_regs = sh_generic_show_regs; - switch (info.bfd_arch_info->mach) - { - case bfd_mach_sh2e: - sh_show_regs = sh2e_show_regs; - break; - case bfd_mach_sh2a: - sh_show_regs = sh2a_show_regs; - break; - case bfd_mach_sh2a_nofpu: - sh_show_regs = sh2a_nofpu_show_regs; - break; - case bfd_mach_sh_dsp: - sh_show_regs = sh_dsp_show_regs; - break; - - case bfd_mach_sh3: - case bfd_mach_sh3_nommu: - case bfd_mach_sh2a_nofpu_or_sh3_nommu: - sh_show_regs = sh3_show_regs; - break; - - case bfd_mach_sh3e: - case bfd_mach_sh2a_or_sh3e: - sh_show_regs = sh3e_show_regs; - break; - - case bfd_mach_sh3_dsp: - case bfd_mach_sh4al_dsp: - sh_show_regs = sh3_dsp_show_regs; - break; - - case bfd_mach_sh4: - case bfd_mach_sh4a: - case bfd_mach_sh2a_or_sh4: - sh_show_regs = sh4_show_regs; - break; - - case bfd_mach_sh4_nofpu: - case bfd_mach_sh4_nommu_nofpu: - case bfd_mach_sh4a_nofpu: - case bfd_mach_sh2a_nofpu_or_sh4_nommu_nofpu: - sh_show_regs = sh4_nofpu_show_regs; - break; - - case bfd_mach_sh5: - sh_show_regs = sh64_show_regs; - /* SH5 is handled entirely in sh64-tdep.c. */ - return sh64_gdbarch_init (info, arches); - } + /* SH5 is handled entirely in sh64-tdep.c. */ + if (info.bfd_arch_info->mach == bfd_mach_sh5) + return sh64_gdbarch_init (info, arches); /* If there is already a candidate, use it. */ arches = gdbarch_list_lookup_by_info (arches, &info); @@ -3159,11 +2402,14 @@ void _initialize_sh_tdep (void) { struct cmd_list_element *c; + extern void all_registers_info (char *, int); gdbarch_register (bfd_arch_sh, sh_gdbarch_init, NULL); - add_com ("regs", class_vars, sh_show_regs_command, _("Print all registers")); - + c = add_com ("regs", class_vars, all_registers_info, + _("Print all registers")); + deprecate_cmd (c, "info all-registers"); + add_prefix_cmd ("sh", no_class, set_sh_command, "SH specific commands.", &setshcmdlist, "set sh ", 0, &setlist); add_prefix_cmd ("sh", no_class, show_sh_command, "SH specific commands.", Index: gdb/sh64-tdep.c =================================================================== RCS file: /cvs/src/src/gdb/sh64-tdep.c,v retrieving revision 1.82 diff -u -p -r1.82 sh64-tdep.c --- gdb/sh64-tdep.c 1 Mar 2012 23:55:40 -0000 1.82 +++ gdb/sh64-tdep.c 16 May 2012 16:16:42 -0000 @@ -1341,125 +1341,6 @@ sh64_return_value (struct gdbarch *gdbar return RETURN_VALUE_REGISTER_CONVENTION; } -static void -sh64_show_media_regs (struct frame_info *frame) -{ - struct gdbarch *gdbarch = get_frame_arch (frame); - int i; - - printf_filtered - ("PC=%s SR=%s\n", - phex (get_frame_register_unsigned (frame, - gdbarch_pc_regnum (gdbarch)), 8), - phex (get_frame_register_unsigned (frame, SR_REGNUM), 8)); - - printf_filtered - ("SSR=%s SPC=%s\n", - phex (get_frame_register_unsigned (frame, SSR_REGNUM), 8), - phex (get_frame_register_unsigned (frame, SPC_REGNUM), 8)); - printf_filtered - ("FPSCR=%s\n ", - phex (get_frame_register_unsigned (frame, FPSCR_REGNUM), 8)); - - for (i = 0; i < 64; i = i + 4) - printf_filtered - ("\nR%d-R%d %s %s %s %s\n", - i, i + 3, - phex (get_frame_register_unsigned (frame, i + 0), 8), - phex (get_frame_register_unsigned (frame, i + 1), 8), - phex (get_frame_register_unsigned (frame, i + 2), 8), - phex (get_frame_register_unsigned (frame, i + 3), 8)); - - printf_filtered ("\n"); - - for (i = 0; i < 64; i = i + 8) - printf_filtered - ("FR%d-FR%d %08lx %08lx %08lx %08lx %08lx %08lx %08lx %08lx\n", - i, i + 7, - (long) get_frame_register_unsigned - (frame, gdbarch_fp0_regnum (gdbarch) + i + 0), - (long) get_frame_register_unsigned - (frame, gdbarch_fp0_regnum (gdbarch) + i + 1), - (long) get_frame_register_unsigned - (frame, gdbarch_fp0_regnum (gdbarch) + i + 2), - (long) get_frame_register_unsigned - (frame, gdbarch_fp0_regnum (gdbarch) + i + 3), - (long) get_frame_register_unsigned - (frame, gdbarch_fp0_regnum (gdbarch) + i + 4), - (long) get_frame_register_unsigned - (frame, gdbarch_fp0_regnum (gdbarch) + i + 5), - (long) get_frame_register_unsigned - (frame, gdbarch_fp0_regnum (gdbarch) + i + 6), - (long) get_frame_register_unsigned - (frame, gdbarch_fp0_regnum (gdbarch) + i + 7)); -} - -static void -sh64_show_compact_regs (struct frame_info *frame) -{ - struct gdbarch *gdbarch = get_frame_arch (frame); - int i; - - printf_filtered - ("PC=%s\n", - phex (get_frame_register_unsigned (frame, PC_C_REGNUM), 8)); - - printf_filtered - ("GBR=%08lx MACH=%08lx MACL=%08lx PR=%08lx T=%08lx\n", - (long) get_frame_register_unsigned (frame, GBR_C_REGNUM), - (long) get_frame_register_unsigned (frame, MACH_C_REGNUM), - (long) get_frame_register_unsigned (frame, MACL_C_REGNUM), - (long) get_frame_register_unsigned (frame, PR_C_REGNUM), - (long) get_frame_register_unsigned (frame, T_C_REGNUM)); - printf_filtered - ("FPSCR=%08lx FPUL=%08lx\n", - (long) get_frame_register_unsigned (frame, FPSCR_C_REGNUM), - (long) get_frame_register_unsigned (frame, FPUL_C_REGNUM)); - - for (i = 0; i < 16; i = i + 4) - printf_filtered - ("\nR%d-R%d %08lx %08lx %08lx %08lx\n", - i, i + 3, - (long) get_frame_register_unsigned (frame, i + 0), - (long) get_frame_register_unsigned (frame, i + 1), - (long) get_frame_register_unsigned (frame, i + 2), - (long) get_frame_register_unsigned (frame, i + 3)); - - printf_filtered ("\n"); - - for (i = 0; i < 16; i = i + 8) - printf_filtered - ("FR%d-FR%d %08lx %08lx %08lx %08lx %08lx %08lx %08lx %08lx\n", - i, i + 7, - (long) get_frame_register_unsigned - (frame, gdbarch_fp0_regnum (gdbarch) + i + 0), - (long) get_frame_register_unsigned - (frame, gdbarch_fp0_regnum (gdbarch) + i + 1), - (long) get_frame_register_unsigned - (frame, gdbarch_fp0_regnum (gdbarch) + i + 2), - (long) get_frame_register_unsigned - (frame, gdbarch_fp0_regnum (gdbarch) + i + 3), - (long) get_frame_register_unsigned - (frame, gdbarch_fp0_regnum (gdbarch) + i + 4), - (long) get_frame_register_unsigned - (frame, gdbarch_fp0_regnum (gdbarch) + i + 5), - (long) get_frame_register_unsigned - (frame, gdbarch_fp0_regnum (gdbarch) + i + 6), - (long) get_frame_register_unsigned - (frame, gdbarch_fp0_regnum (gdbarch) + i + 7)); -} - -/* FIXME!!! This only shows the registers for shmedia, excluding the - pseudo registers. */ -void -sh64_show_regs (struct frame_info *frame) -{ - if (pc_is_isa32 (get_frame_pc (frame))) - sh64_show_media_regs (frame); - else - sh64_show_compact_regs (frame); -} - /* *INDENT-OFF* */ /* SH MEDIA MODE (ISA 32) Index: gdb/sh64-tdep.h =================================================================== RCS file: /cvs/src/src/gdb/sh64-tdep.h,v retrieving revision 1.1 diff -u -p -r1.1 sh64-tdep.h --- gdb/sh64-tdep.h 1 Mar 2012 23:55:40 -0000 1.1 +++ gdb/sh64-tdep.h 16 May 2012 16:16:42 -0000 @@ -20,6 +20,5 @@ #define SH64_TDEP_H extern gdbarch_init_ftype sh64_gdbarch_init; -extern void sh64_show_regs (struct frame_info *frame); #endif /* SH64_TDEP_H */ Index: gdb/doc/gdb.texinfo =================================================================== RCS file: /cvs/src/src/gdb/doc/gdb.texinfo,v retrieving revision 1.940 diff -u -p -r1.940 gdb.texinfo --- gdb/doc/gdb.texinfo 11 Apr 2012 05:50:43 -0000 1.940 +++ gdb/doc/gdb.texinfo 16 May 2012 16:16:42 -0000 @@ -20099,6 +20099,9 @@ commands: @table @code @item regs @kindex regs@r{, Super-H} +This command is deprecated, and @code{info all-registers} should be +used instead. + Show the values of all Super-H registers. @item set sh calling-convention @var{convention} Grüße, Thomas [-- Attachment #2: Type: application/pgp-signature, Size: 489 bytes --] ^ permalink raw reply [flat|nested] 30+ messages in thread
* Re: [SH] regs command 2012-05-16 16:32 ` Thomas Schwinge @ 2012-05-16 16:58 ` Joel Brobecker 2012-05-16 17:21 ` Thomas Schwinge 2012-05-16 18:36 ` Tom Tromey 2012-05-16 18:36 ` Pedro Alves ` (2 subsequent siblings) 3 siblings, 2 replies; 30+ messages in thread From: Joel Brobecker @ 2012-05-16 16:58 UTC (permalink / raw) To: Thomas Schwinge; +Cc: gdb-patches, Kevin Buettner, Maciej W. Rozycki > Sounds good, and thusly implemented, OK to commit? I have only skimmed the patch for now. Perhaps Kevin would like to look at the purely sh-related changes. They look good to me, but I don't know if you might have missed something. > gdb/ > * sh-tdep.c (sh_show_regs): Remove variable. > (sh_generic_show_regs, sh3_show_regs, sh2e_show_regs, sh2a_show_regs) > (sh2a_nofpu_show_regs, sh3e_show_regs, sh3_dsp_show_regs) > (sh4_show_regs, sh4_nofpu_show_regs, sh_dsp_show_regs) > (sh_show_regs_command): Remove functions. > (sh_gdbarch_init): Don't set sh_show_regs. > (_initialize_sh_tdep): Make the `regs' command an deprecated alias to > `info all-registers'. > * sh64-tdep.c (sh64_show_media_regs, sh64_show_compact_regs) > (sh64_show_regs): Remove functions. > * sh64-tdep.h (sh64_show_regs): Remove function declaration. > * NEWS: Document the deprecation. > gdb/doc/ > * gdb.texinfo: Document the deprecation. In the meantime, I have noticed something: > _initialize_sh_tdep (void) > { > struct cmd_list_element *c; > + extern void all_registers_info (char *, int); > > gdbarch_register (bfd_arch_sh, sh_gdbarch_init, NULL); > > - add_com ("regs", class_vars, sh_show_regs_command, _("Print all registers")); > - > + c = add_com ("regs", class_vars, all_registers_info, > + _("Print all registers")); > + deprecate_cmd (c, "info all-registers"); > + Can you use add_alias_cmd instead of add_com? The only think I am not sure about is whether it is going to work with the deprecation mechanism. The command system is kind of obscure to me (in the fact that it has so many attributes), but a look at the code seems to indicate that it will. And as a bonus, you'll inherit all the attributes of the "info all-reg" command... -- Joel ^ permalink raw reply [flat|nested] 30+ messages in thread
* Re: [SH] regs command 2012-05-16 16:58 ` Joel Brobecker @ 2012-05-16 17:21 ` Thomas Schwinge 2012-05-16 18:47 ` Tom Tromey 2012-05-17 19:32 ` Kevin Buettner 2012-05-16 18:36 ` Tom Tromey 1 sibling, 2 replies; 30+ messages in thread From: Thomas Schwinge @ 2012-05-16 17:21 UTC (permalink / raw) To: Joel Brobecker; +Cc: gdb-patches, Kevin Buettner, Maciej W. Rozycki [-- Attachment #1: Type: text/plain, Size: 1575 bytes --] Hi! On Wed, 16 May 2012 09:57:30 -0700, Joel Brobecker <brobecker@adacore.com> wrote: > > Sounds good, and thusly implemented, OK to commit? > > I have only skimmed the patch for now. Perhaps Kevin would like > to look at the purely sh-related changes. They look good to me, > but I don't know if you might have missed something. Sure, we can wait. > In the meantime, I have noticed something: > > > _initialize_sh_tdep (void) > > { > > struct cmd_list_element *c; > > + extern void all_registers_info (char *, int); > > > > gdbarch_register (bfd_arch_sh, sh_gdbarch_init, NULL); > > > > - add_com ("regs", class_vars, sh_show_regs_command, _("Print all registers")); > > - > > + c = add_com ("regs", class_vars, all_registers_info, > > + _("Print all registers")); > > + deprecate_cmd (c, "info all-registers"); > > + > > Can you use add_alias_cmd instead of add_com? The only think I am not > sure about is whether it is going to work with the deprecation mechanism. > The command system is kind of obscure to me (in the fact that it has so > many attributes), but a look at the code seems to indicate that it will. > And as a bonus, you'll inherit all the attributes of the "info all-reg" > command... That's actually what I have tried first, but failed: due to add_alias_cmd returning a NULL pointer (in c), deprecated_cmd obviously failed. And as we'd remove this code in a few weeks anyway, I decided not to spend more time on this, and instead go the easy route. Grüße, Thomas [-- Attachment #2: Type: application/pgp-signature, Size: 489 bytes --] ^ permalink raw reply [flat|nested] 30+ messages in thread
* Re: [SH] regs command 2012-05-16 17:21 ` Thomas Schwinge @ 2012-05-16 18:47 ` Tom Tromey 2012-05-16 19:06 ` Joel Brobecker 2012-05-17 19:32 ` Kevin Buettner 1 sibling, 1 reply; 30+ messages in thread From: Tom Tromey @ 2012-05-16 18:47 UTC (permalink / raw) To: Thomas Schwinge Cc: Joel Brobecker, gdb-patches, Kevin Buettner, Maciej W. Rozycki >>>>> "Thomas" == Thomas Schwinge <thomas@codesourcery.com> writes: Thomas> That's actually what I have tried first, but failed: due to Thomas> add_alias_cmd returning a NULL pointer (in c), deprecated_cmd Thomas> obviously failed. And as we'd remove this code in a few weeks Thomas> anyway, I decided not to spend more time on this, and instead go Thomas> the easy route. This means you registered "regs" before the thing it aliases was registered. This can happen because _initialize_xxx order is not defined. There's no easy fix :(. You could move "regs" initialization to a better spot but then it will be visible in all builds of gdb, not just those with this target compiled in. Tom ^ permalink raw reply [flat|nested] 30+ messages in thread
* Re: [SH] regs command 2012-05-16 18:47 ` Tom Tromey @ 2012-05-16 19:06 ` Joel Brobecker 2012-05-16 19:38 ` Maciej W. Rozycki 0 siblings, 1 reply; 30+ messages in thread From: Joel Brobecker @ 2012-05-16 19:06 UTC (permalink / raw) To: Tom Tromey Cc: Thomas Schwinge, gdb-patches, Kevin Buettner, Maciej W. Rozycki > This means you registered "regs" before the thing it aliases was > registered. This can happen because _initialize_xxx order is not > defined. > > There's no easy fix :(. You could move "regs" initialization to a > better spot but then it will be visible in all builds of gdb, not just > those with this target compiled in. It seems better in that case to just go with what Thomas had initially, maybe just adding a comment why we don't use an alias? It's only for a few weeks... -- Joel ^ permalink raw reply [flat|nested] 30+ messages in thread
* Re: [SH] regs command 2012-05-16 19:06 ` Joel Brobecker @ 2012-05-16 19:38 ` Maciej W. Rozycki 2012-05-17 0:59 ` Maciej W. Rozycki 0 siblings, 1 reply; 30+ messages in thread From: Maciej W. Rozycki @ 2012-05-16 19:38 UTC (permalink / raw) To: Joel Brobecker; +Cc: Tom Tromey, Thomas Schwinge, gdb-patches, Kevin Buettner On Wed, 16 May 2012, Joel Brobecker wrote: > > This means you registered "regs" before the thing it aliases was > > registered. This can happen because _initialize_xxx order is not > > defined. > > > > There's no easy fix :(. You could move "regs" initialization to a > > better spot but then it will be visible in all builds of gdb, not just > > those with this target compiled in. > > It seems better in that case to just go with what Thomas had initially, > maybe just adding a comment why we don't use an alias? It's only for > a few weeks... I think a fix is actually very easy. All that has to be done is to tweak the init.c scriptery such that *_tdep initialisers are run last. And actually I think it is worth the while regardless of this particular issue as this way all the target-dependent bits can rely on generic stuff to have been initialised. Of course tweaking the scriptery can be horribly boring, but there you go. I'll see if I can give it a shot -- unless anyone beats me to it. Maciej ^ permalink raw reply [flat|nested] 30+ messages in thread
* Re: [SH] regs command 2012-05-16 19:38 ` Maciej W. Rozycki @ 2012-05-17 0:59 ` Maciej W. Rozycki 2012-05-17 11:10 ` Mark Kettenis 0 siblings, 1 reply; 30+ messages in thread From: Maciej W. Rozycki @ 2012-05-17 0:59 UTC (permalink / raw) To: Joel Brobecker, Thomas Schwinge; +Cc: Tom Tromey, gdb-patches, Kevin Buettner On Wed, 16 May 2012, Maciej W. Rozycki wrote: > > > This means you registered "regs" before the thing it aliases was > > > registered. This can happen because _initialize_xxx order is not > > > defined. > > > > > > There's no easy fix :(. You could move "regs" initialization to a > > > better spot but then it will be visible in all builds of gdb, not just > > > those with this target compiled in. > > > > It seems better in that case to just go with what Thomas had initially, > > maybe just adding a comment why we don't use an alias? It's only for > > a few weeks... > > I think a fix is actually very easy. All that has to be done is to tweak > the init.c scriptery such that *_tdep initialisers are run last. And > actually I think it is worth the while regardless of this particular issue > as this way all the target-dependent bits can rely on generic stuff to > have been initialised. > > Of course tweaking the scriptery can be horribly boring, but there you > go. I'll see if I can give it a shot -- unless anyone beats me to it. So here it is, this change moves *_tdep initialisers to the end while otherwise keeping the order the same (IOW within the two groups the order remains the same as before). I've checked it against autoconf's tool portability list and also verified it with Solaris sed to make sure there are no surprises. Thomas, can you give it a shot and see if this fixes your alias issue? I'll add some commentary if this works for you and gets a go-ahead. 2012-05-17 Maciej W. Rozycki <macro@codesourcery.com> gdb/ * Makefile.in (init.c): Reorder *_tdep initialisers to the end. Maciej gdb-init-tdep.diff Index: gdb-fsf-trunk-quilt/gdb/Makefile.in =================================================================== --- gdb-fsf-trunk-quilt.orig/gdb/Makefile.in 2012-05-17 01:08:19.000000000 +0100 +++ gdb-fsf-trunk-quilt/gdb/Makefile.in 2012-05-17 01:43:27.325562969 +0100 @@ -1121,6 +1121,12 @@ init.c: $(INIT_FILES) while read f; do \ sed -n -e 's/^_initialize_\([a-z_0-9A-Z]*\).*/\1/p' $$f 2>/dev/null; \ done | \ + sed -n \ + -e '/_tdep$$/H' \ + -e '//!p' \ + -e '$$x' \ + -e '$$s/\n//' \ + -e '$$p' | \ while read f; do \ case " $$fs " in \ *" $$f "* ) ;; \ ^ permalink raw reply [flat|nested] 30+ messages in thread
* Re: [SH] regs command 2012-05-17 0:59 ` Maciej W. Rozycki @ 2012-05-17 11:10 ` Mark Kettenis 2012-05-17 11:23 ` Maciej W. Rozycki 0 siblings, 1 reply; 30+ messages in thread From: Mark Kettenis @ 2012-05-17 11:10 UTC (permalink / raw) To: macro; +Cc: brobecker, thomas, tromey, gdb-patches, kevinb > Date: Thu, 17 May 2012 01:59:29 +0100 > From: "Maciej W. Rozycki" <macro@codesourcery.com> > > On Wed, 16 May 2012, Maciej W. Rozycki wrote: > > > > > This means you registered "regs" before the thing it aliases was > > > > registered. This can happen because _initialize_xxx order is not > > > > defined. > > > > > > > > There's no easy fix :(. You could move "regs" initialization to a > > > > better spot but then it will be visible in all builds of gdb, not just > > > > those with this target compiled in. > > > > > > It seems better in that case to just go with what Thomas had initially, > > > maybe just adding a comment why we don't use an alias? It's only for > > > a few weeks... > > > > I think a fix is actually very easy. All that has to be done is to tweak > > the init.c scriptery such that *_tdep initialisers are run last. And > > actually I think it is worth the while regardless of this particular issue > > as this way all the target-dependent bits can rely on generic stuff to > > have been initialised. > > > > Of course tweaking the scriptery can be horribly boring, but there you > > go. I'll see if I can give it a shot -- unless anyone beats me to it. > > So here it is, this change moves *_tdep initialisers to the end while > otherwise keeping the order the same (IOW within the two groups the order > remains the same as before). I've checked it against autoconf's tool > portability list and also verified it with Solaris sed to make sure > there are no surprises. Sorry, but we've always considered it a mistake to rely on a specific order of running the initialization functions. Implicit dependencies between modules like that really are a bad idea. ^ permalink raw reply [flat|nested] 30+ messages in thread
* Re: [SH] regs command 2012-05-17 11:10 ` Mark Kettenis @ 2012-05-17 11:23 ` Maciej W. Rozycki 2012-05-17 12:38 ` Joel Brobecker 0 siblings, 1 reply; 30+ messages in thread From: Maciej W. Rozycki @ 2012-05-17 11:23 UTC (permalink / raw) To: Mark Kettenis; +Cc: brobecker, thomas, tromey, gdb-patches, kevinb On Thu, 17 May 2012, Mark Kettenis wrote: > > So here it is, this change moves *_tdep initialisers to the end while > > otherwise keeping the order the same (IOW within the two groups the order > > remains the same as before). I've checked it against autoconf's tool > > portability list and also verified it with Solaris sed to make sure > > there are no surprises. > > Sorry, but we've always considered it a mistake to rely on a specific > order of running the initialization functions. Implicit dependencies > between modules like that really are a bad idea. What's the technical reason and what do you propose as the alternative? Personally I see no problems with a hierarchical structure of initialisers as long as the hierarchy is well-defined so that people can rely on that. I can give you a name of a complex project that works very well with such an arrangement, and they actually have as many as eight levels. Maciej ^ permalink raw reply [flat|nested] 30+ messages in thread
* Re: [SH] regs command 2012-05-17 11:23 ` Maciej W. Rozycki @ 2012-05-17 12:38 ` Joel Brobecker 2012-05-17 15:23 ` Mark Kettenis 0 siblings, 1 reply; 30+ messages in thread From: Joel Brobecker @ 2012-05-17 12:38 UTC (permalink / raw) To: Maciej W. Rozycki; +Cc: Mark Kettenis, thomas, tromey, gdb-patches, kevinb > What's the technical reason and what do you propose as the alternative? > Personally I see no problems with a hierarchical structure of initialisers > as long as the hierarchy is well-defined so that people can rely on that. > I can give you a name of a complex project that works very well with such > an arrangement, and they actually have as many as eight levels. I would tend to agree with that, I don't see what we would have to lose by doing so. I even thought that we could also include -nat files as well in the mix. For instance: - all files except the files to follow, in undefined order; - all -nat files, in undefined order; - all -tdep files, in undefined order. -- Joel ^ permalink raw reply [flat|nested] 30+ messages in thread
* Re: [SH] regs command 2012-05-17 12:38 ` Joel Brobecker @ 2012-05-17 15:23 ` Mark Kettenis 2012-05-17 15:45 ` Joel Brobecker 0 siblings, 1 reply; 30+ messages in thread From: Mark Kettenis @ 2012-05-17 15:23 UTC (permalink / raw) To: brobecker; +Cc: macro, mark.kettenis, thomas, tromey, gdb-patches, kevinb > Date: Thu, 17 May 2012 05:38:27 -0700 > From: Joel Brobecker <brobecker@adacore.com> > > > What's the technical reason and what do you propose as the alternative? > > Personally I see no problems with a hierarchical structure of initialisers > > as long as the hierarchy is well-defined so that people can rely on that. > > I can give you a name of a complex project that works very well with such > > an arrangement, and they actually have as many as eight levels. > > I would tend to agree with that, I don't see what we would have to lose > by doing so. I even thought that we could also include -nat files as > well in the mix. For instance: > - all files except the files to follow, in undefined order; > - all -nat files, in undefined order; > - all -tdep files, in undefined order. It's not obvious that such a hierarchy is the right one. I'd put the -tdep files before the -nat file for example. And I can imagine a scenario where you'd actually wanted the generic ones to come *after* the -tdep ones. I guess what I'm saying that I'm not convinced that the current case, the desire to deprecate a command that should never have been there in the first place, is necessarily a good case to base this decision on. Frankly, I would just remove the command in question, since it should never have been there in the first place. ^ permalink raw reply [flat|nested] 30+ messages in thread
* Re: [SH] regs command 2012-05-17 15:23 ` Mark Kettenis @ 2012-05-17 15:45 ` Joel Brobecker 2012-05-17 19:52 ` Tom Tromey 0 siblings, 1 reply; 30+ messages in thread From: Joel Brobecker @ 2012-05-17 15:45 UTC (permalink / raw) To: Mark Kettenis; +Cc: macro, thomas, tromey, gdb-patches, kevinb > It's not obvious that such a hierarchy is the right one. I'd put the > -tdep files before the -nat file for example. And I can imagine a > scenario where you'd actually wanted the generic ones to come *after* > the -tdep ones. OK. I think the point is not to try to find the best order, but to provide some specified order. > Frankly, I would just remove the command in question, since it should > never have been there in the first place. It's not much trouble going through the deprecation phase, and it is much friendlier to the users who might have been using this command. But I wouldn't oppose deleting the command outright, on the basis that it should be relatively trivial for the users to find the correct command. -- Joel ^ permalink raw reply [flat|nested] 30+ messages in thread
* Re: [SH] regs command 2012-05-17 15:45 ` Joel Brobecker @ 2012-05-17 19:52 ` Tom Tromey 2012-05-17 20:38 ` Joel Brobecker 0 siblings, 1 reply; 30+ messages in thread From: Tom Tromey @ 2012-05-17 19:52 UTC (permalink / raw) To: Joel Brobecker; +Cc: Mark Kettenis, macro, thomas, gdb-patches, kevinb >>>>> "Joel" == Joel Brobecker <brobecker@adacore.com> writes: Joel> It's not much trouble going through the deprecation phase, and it is Joel> much friendlier to the users who might have been using this command. Joel> But I wouldn't oppose deleting the command outright, on the basis Joel> that it should be relatively trivial for the users to find the correct Joel> command. I think the first deprecation/alias patch should go in. I tend to agree with Mark that changing the init order in response to this problem is perhaps not wise. Tom ^ permalink raw reply [flat|nested] 30+ messages in thread
* Re: [SH] regs command 2012-05-17 19:52 ` Tom Tromey @ 2012-05-17 20:38 ` Joel Brobecker 2012-05-18 12:23 ` Maciej W. Rozycki 0 siblings, 1 reply; 30+ messages in thread From: Joel Brobecker @ 2012-05-17 20:38 UTC (permalink / raw) To: Tom Tromey; +Cc: Mark Kettenis, macro, thomas, gdb-patches, kevinb > I think the first deprecation/alias patch should go in. Same here. > I tend to agree with Mark that changing the init order in response to > this problem is perhaps not wise. OK, I think that settles it. -- Joel ^ permalink raw reply [flat|nested] 30+ messages in thread
* Re: [SH] regs command 2012-05-17 20:38 ` Joel Brobecker @ 2012-05-18 12:23 ` Maciej W. Rozycki 2012-05-18 12:39 ` Pedro Alves 2012-05-18 13:47 ` Tom Tromey 0 siblings, 2 replies; 30+ messages in thread From: Maciej W. Rozycki @ 2012-05-18 12:23 UTC (permalink / raw) To: Joel Brobecker; +Cc: Tom Tromey, Mark Kettenis, thomas, gdb-patches, kevinb On Thu, 17 May 2012, Joel Brobecker wrote: > > I tend to agree with Mark that changing the init order in response to > > this problem is perhaps not wise. > > OK, I think that settles it. While I agree that this command deprecation case may not be important enough to make a decision on an internal API change weeks before a release, that does not mean the problem is not there. For example as recently as yesterday I came across this piece (in mips-linux-tdep.c): static struct target_so_ops mips_svr4_so_ops; [...] /* Initialize this lazily, to avoid an initialization order dependency on solib-svr4.c's _initialize routine. */ if (mips_svr4_so_ops.in_dynsym_resolve_code == NULL) { mips_svr4_so_ops = svr4_so_ops; mips_svr4_so_ops.in_dynsym_resolve_code = mips_linux_in_dynsym_resolve_code; } set_solib_ops (gdbarch, &mips_svr4_so_ops); that I find all but clean -- I can't even tell straight away, without studying all the code involved and perhaps experimenting, if this indeed is going to work correctly regardless of whether this is run before or after the other piece referred. And of course, this being an internal API that we can change arbitrarily at any time, including to reverse an earlier decision that turned out not to work as well as expected, I am not thoroughly convinced this moment is any worse than any other. Maciej ^ permalink raw reply [flat|nested] 30+ messages in thread
* Re: [SH] regs command 2012-05-18 12:23 ` Maciej W. Rozycki @ 2012-05-18 12:39 ` Pedro Alves 2012-05-18 12:49 ` Joel Brobecker 2012-05-18 13:47 ` Tom Tromey 1 sibling, 1 reply; 30+ messages in thread From: Pedro Alves @ 2012-05-18 12:39 UTC (permalink / raw) To: Maciej W. Rozycki Cc: Joel Brobecker, Tom Tromey, Mark Kettenis, thomas, gdb-patches, kevinb On 05/18/2012 01:22 PM, Maciej W. Rozycki wrote: > static struct target_so_ops mips_svr4_so_ops; > [...] > > /* Initialize this lazily, to avoid an initialization order > dependency on solib-svr4.c's _initialize routine. */ > if (mips_svr4_so_ops.in_dynsym_resolve_code == NULL) > { > mips_svr4_so_ops = svr4_so_ops; > mips_svr4_so_ops.in_dynsym_resolve_code > = mips_linux_in_dynsym_resolve_code; > } > set_solib_ops (gdbarch, &mips_svr4_so_ops); > > that I find all but clean -- I can't even tell straight away, without > studying all the code involved and perhaps experimenting, if this indeed > is going to work correctly regardless of whether this is run before or > after the other piece referred. solib-svr4.c is as much target dependent as mips-linux-tdep.c though. The split on file name is a bit arbitrary. It'd make a bit more sense to split around something like COMMON_OBS and TARGET_OBJS, but you'd still bump into such issues. A "don't depend on order" rule appears simpler to understand and maintain than having to worry about hierarchies. -- Pedro Alves ^ permalink raw reply [flat|nested] 30+ messages in thread
* Re: [SH] regs command 2012-05-18 12:39 ` Pedro Alves @ 2012-05-18 12:49 ` Joel Brobecker 2012-05-18 13:33 ` Pedro Alves 0 siblings, 1 reply; 30+ messages in thread From: Joel Brobecker @ 2012-05-18 12:49 UTC (permalink / raw) To: Pedro Alves Cc: Maciej W. Rozycki, Tom Tromey, Mark Kettenis, thomas, gdb-patches, kevinb > > /* Initialize this lazily, to avoid an initialization order > > dependency on solib-svr4.c's _initialize routine. */ > > if (mips_svr4_so_ops.in_dynsym_resolve_code == NULL) > > { > > mips_svr4_so_ops = svr4_so_ops; > > mips_svr4_so_ops.in_dynsym_resolve_code > > = mips_linux_in_dynsym_resolve_code; > > } > > set_solib_ops (gdbarch, &mips_svr4_so_ops); > solib-svr4.c is as much target dependent as mips-linux-tdep.c though. > The split on file name is a bit arbitrary. It'd make a bit more sense > to split around something like COMMON_OBS and TARGET_OBJS, but you'd > still bump into such issues. A "don't depend on order" rule appears > simpler to understand and maintain than having to worry about > hierarchies. And I *think* we solved that problem elsewhere, right? Basically, we call functions to get the ops vector. That way, no matter the init order, we always access initialized data... See the inf-* files IIRC. -- Joel ^ permalink raw reply [flat|nested] 30+ messages in thread
* Re: [SH] regs command 2012-05-18 12:49 ` Joel Brobecker @ 2012-05-18 13:33 ` Pedro Alves 0 siblings, 0 replies; 30+ messages in thread From: Pedro Alves @ 2012-05-18 13:33 UTC (permalink / raw) To: Joel Brobecker Cc: Maciej W. Rozycki, Tom Tromey, Mark Kettenis, thomas, gdb-patches, kevinb On 05/18/2012 01:48 PM, Joel Brobecker wrote: >>> /* Initialize this lazily, to avoid an initialization order >>> > > dependency on solib-svr4.c's _initialize routine. */ >>> > > if (mips_svr4_so_ops.in_dynsym_resolve_code == NULL) >>> > > { >>> > > mips_svr4_so_ops = svr4_so_ops; >>> > > mips_svr4_so_ops.in_dynsym_resolve_code >>> > > = mips_linux_in_dynsym_resolve_code; >>> > > } >>> > > set_solib_ops (gdbarch, &mips_svr4_so_ops); >> > solib-svr4.c is as much target dependent as mips-linux-tdep.c though. >> > The split on file name is a bit arbitrary. It'd make a bit more sense >> > to split around something like COMMON_OBS and TARGET_OBJS, but you'd >> > still bump into such issues. A "don't depend on order" rule appears >> > simpler to understand and maintain than having to worry about >> > hierarchies. > And I *think* we solved that problem elsewhere, right? Basically, > we call functions to get the ops vector. That way, no matter the > init order, we always access initialized data... See the inf-* > files IIRC. Yeah, I think you're talking about inf_ptrace_target, etc. In those cases, the target_ops vector is heap allocated. For statically allocated cases, we have, e.g., ada-lang.c: static void initialize_ada_catchpoint_ops (void) { struct breakpoint_ops *ops; initialize_breakpoint_ops (); ... With initialize_breakpoint_ops itself bothering with init order (by being idempotent). Some core things that are dependent on initialization order are handled by "initialize_foo" (no _ prefix) calls crafted in a specific order in gdb_init. -- Pedro Alves ^ permalink raw reply [flat|nested] 30+ messages in thread
* Re: [SH] regs command 2012-05-18 12:23 ` Maciej W. Rozycki 2012-05-18 12:39 ` Pedro Alves @ 2012-05-18 13:47 ` Tom Tromey 2012-05-21 23:36 ` Maciej W. Rozycki 1 sibling, 1 reply; 30+ messages in thread From: Tom Tromey @ 2012-05-18 13:47 UTC (permalink / raw) To: Maciej W. Rozycki Cc: Joel Brobecker, Mark Kettenis, thomas, gdb-patches, kevinb >>>>> "Maciej" == Maciej W Rozycki <macro@codesourcery.com> writes: Maciej> While I agree that this command deprecation case may not be important Maciej> enough to make a decision on an internal API change weeks before a Maciej> release, that does not mean the problem is not there. Yeah, I agree, there is a problem -- it is encountered infrequently enough that we can usually pretend it isn't there. There's also some places that were designed to avoid dependency problems, like the way command list roots are statically allocated. Basing the dependencies on file names doesn't seem robust. It works in this case; but I don't think there is a reason to believe it will always be a workable approach. I think one way to fix it would be to have the code express the dependencies. This might be tricky to maintain, though I suppose with enough assertions it could be robust. Tom ^ permalink raw reply [flat|nested] 30+ messages in thread
* Re: [SH] regs command 2012-05-18 13:47 ` Tom Tromey @ 2012-05-21 23:36 ` Maciej W. Rozycki 2012-05-24 18:05 ` Tom Tromey 0 siblings, 1 reply; 30+ messages in thread From: Maciej W. Rozycki @ 2012-05-21 23:36 UTC (permalink / raw) To: Tom Tromey; +Cc: Joel Brobecker, Mark Kettenis, thomas, gdb-patches, kevinb On Fri, 18 May 2012, Tom Tromey wrote: > Maciej> While I agree that this command deprecation case may not be important > Maciej> enough to make a decision on an internal API change weeks before a > Maciej> release, that does not mean the problem is not there. > > Yeah, I agree, there is a problem -- it is encountered infrequently > enough that we can usually pretend it isn't there. There's also some > places that were designed to avoid dependency problems, like the way > command list roots are statically allocated. Yeah, let's pretend it isn't there. ;) > Basing the dependencies on file names doesn't seem robust. It works in > this case; but I don't think there is a reason to believe it will always > be a workable approach. Yes, this is fragile to say at least, I agree. > I think one way to fix it would be to have the code express the > dependencies. This might be tricky to maintain, though I suppose with > enough assertions it could be robust. Hmm, I gave it some thinking and it looks to me like a functional programming problem to solve (e.g. AC_REQUIRE in autoconf-speak; I didn't really do any functional programming beyond that). This may not be possible to express in C in a very elegant way, but I can imagine retaining the current init.c arrangement/scriptery, but in addition to that letting initialisers call one another. Then in each initialiser we could have: void _initialize_foo (void) { static int initialized; if (initialized > 0) return; else if (initialized < 0) internal_error (__FILE__, __LINE__, _("initialization loop")); else initialized = -1; [...] initialized = 1; } We might be able to hide this stuff in some macros so as to avoid repeating it across all files (and risking mistakes). This could avoid the need to copy these annoying prototypes to shut up GCC for each initialiser as well (but then the scripts could simply make init.h instead). Maciej ^ permalink raw reply [flat|nested] 30+ messages in thread
* Re: [SH] regs command 2012-05-21 23:36 ` Maciej W. Rozycki @ 2012-05-24 18:05 ` Tom Tromey 0 siblings, 0 replies; 30+ messages in thread From: Tom Tromey @ 2012-05-24 18:05 UTC (permalink / raw) To: Maciej W. Rozycki Cc: Joel Brobecker, Mark Kettenis, thomas, gdb-patches, kevinb >>>>> "Maciej" == Maciej W Rozycki <macro@codesourcery.com> writes: Maciej> Hmm, I gave it some thinking and it looks to me like a Maciej> functional programming problem to solve (e.g. AC_REQUIRE in Maciej> autoconf-speak; I didn't really do any functional programming Maciej> beyond that). :) Maciej> This may not be possible to express in C in a very elegant way, Maciej> but I can imagine retaining the current init.c Maciej> arrangement/scriptery, but in addition to that letting Maciej> initialisers call one another. Another way would be to just directly express it, say in comments that are extracted by the script used to create init.c. /* Requires: something_else */ void _initialize_something (void) { ... } Then dependency loops could be caught at init.c-generation time. The problem with anything like this is maintenance of the dependencies. That is, how do you know if one is stale? Or what do you do if you actually hit a cycle? For example, in the case in question -- when we eventually remove the "regs" command, would we remember to delete the "Requires"? Tom ^ permalink raw reply [flat|nested] 30+ messages in thread
* Re: [SH] regs command 2012-05-16 17:21 ` Thomas Schwinge 2012-05-16 18:47 ` Tom Tromey @ 2012-05-17 19:32 ` Kevin Buettner 1 sibling, 0 replies; 30+ messages in thread From: Kevin Buettner @ 2012-05-17 19:32 UTC (permalink / raw) To: gdb-patches On Wed, 16 May 2012 19:20:10 +0200 Thomas Schwinge <thomas@codesourcery.com> wrote: > On Wed, 16 May 2012 09:57:30 -0700, Joel Brobecker <brobecker@adacore.com> wrote: > > > Sounds good, and thusly implemented, OK to commit? > > > > I have only skimmed the patch for now. Perhaps Kevin would like > > to look at the purely sh-related changes. They look good to me, > > but I don't know if you might have missed something. > > Sure, we can wait. The sh specific changes are okay with me. In particular, I'm comfortable with the idea of deprecating the sh-specific "regs" command. Make sure that you've addressed all of the concerns raised by others in this thread though. Kevin ^ permalink raw reply [flat|nested] 30+ messages in thread
* Re: [SH] regs command 2012-05-16 16:58 ` Joel Brobecker 2012-05-16 17:21 ` Thomas Schwinge @ 2012-05-16 18:36 ` Tom Tromey 1 sibling, 0 replies; 30+ messages in thread From: Tom Tromey @ 2012-05-16 18:36 UTC (permalink / raw) To: Joel Brobecker Cc: Thomas Schwinge, gdb-patches, Kevin Buettner, Maciej W. Rozycki >>>>> "Joel" == Joel Brobecker <brobecker@adacore.com> writes: Joel> Can you use add_alias_cmd instead of add_com? I was going to make the same comment :) Joel> The only think I am not Joel> sure about is whether it is going to work with the deprecation mechanism. It should. Tom ^ permalink raw reply [flat|nested] 30+ messages in thread
* Re: [SH] regs command 2012-05-16 16:32 ` Thomas Schwinge 2012-05-16 16:58 ` Joel Brobecker @ 2012-05-16 18:36 ` Pedro Alves 2012-05-16 19:36 ` Eli Zaretskii 2012-06-06 18:10 ` Thomas Schwinge 3 siblings, 0 replies; 30+ messages in thread From: Pedro Alves @ 2012-05-16 18:36 UTC (permalink / raw) To: Thomas Schwinge Cc: Joel Brobecker, gdb-patches, Kevin Buettner, Maciej W. Rozycki On 05/16/2012 05:31 PM, Thomas Schwinge wrote: > _initialize_sh_tdep (void) > { > struct cmd_list_element *c; > + extern void all_registers_info (char *, int); Please put this in a header. AFAICS, infcmd.c extern functions are declared in inferior.h. -- Pedro Alves ^ permalink raw reply [flat|nested] 30+ messages in thread
* Re: [SH] regs command 2012-05-16 16:32 ` Thomas Schwinge 2012-05-16 16:58 ` Joel Brobecker 2012-05-16 18:36 ` Pedro Alves @ 2012-05-16 19:36 ` Eli Zaretskii 2012-06-06 18:10 ` Thomas Schwinge 3 siblings, 0 replies; 30+ messages in thread From: Eli Zaretskii @ 2012-05-16 19:36 UTC (permalink / raw) To: Thomas Schwinge; +Cc: brobecker, gdb-patches, kevinb, macro > From: Thomas Schwinge <thomas@codesourcery.com> > Cc: gdb-patches@sourceware.org, Kevin Buettner <kevinb@redhat.com>, "Maciej W. Rozycki" <macro@codesourcery.com> > Date: Wed, 16 May 2012 18:31:30 +0200 > > On Wed, 16 May 2012 07:26:33 -0700, Joel Brobecker <brobecker@adacore.com> wrote: > > > I therefore propose to remove sh_show_regs_command et al. from sh-tdep.c. > > > If nobody objects, can it just go silently, or should invoking it then > > > cause an error message, like »Please use the »info all-registers« command > > > instead of »regs«.«? > > > > Make it an alias of "info reg" or "info all-registers", and make > > the alias deprecated, so that users get a warning when they use it? > > We can make that command deprecated for 7.5, and then remove it > > from HEAD after 7.5 is branched, in a few weeks. > > Sounds good, and thusly implemented, OK to commit? The documentation parts are okay. Thanks. ^ permalink raw reply [flat|nested] 30+ messages in thread
* Re: [SH] regs command 2012-05-16 16:32 ` Thomas Schwinge ` (2 preceding siblings ...) 2012-05-16 19:36 ` Eli Zaretskii @ 2012-06-06 18:10 ` Thomas Schwinge 2012-08-10 9:22 ` Thomas Schwinge 3 siblings, 1 reply; 30+ messages in thread From: Thomas Schwinge @ 2012-06-06 18:10 UTC (permalink / raw) To: gdb-patches [-- Attachment #1: Type: text/plain, Size: 46098 bytes --] Hi! On Wed, 16 May 2012 18:31:30 +0200, I wrote: > On Wed, 16 May 2012 07:26:33 -0700, Joel Brobecker <brobecker@adacore.com> wrote: > > > I therefore propose to remove sh_show_regs_command et al. from sh-tdep.c. > > > If nobody objects, can it just go silently, or should invoking it then > > > cause an error message, like »Please use the »info all-registers« command > > > instead of »regs«.«? > > > > Make it an alias of "info reg" or "info all-registers", and make > > the alias deprecated, so that users get a warning when they use it? Below is the patch that I finally committed. > > We can make that command deprecated for 7.5, and then remove it > > from HEAD after 7.5 is branched, in a few weeks. I'll prepare a patch for that. gdb/ * NEWS: Document the deprecation of SH's 'regs' command. * inferior.h (all_registers_info): Add function declaration. * sh-tdep.c (sh_show_regs): Remove variable. (sh_generic_show_regs, sh3_show_regs, sh2e_show_regs, sh2a_show_regs) (sh2a_nofpu_show_regs, sh3e_show_regs, sh3_dsp_show_regs) (sh4_show_regs, sh4_nofpu_show_regs, sh_dsp_show_regs) (sh_show_regs_command): Remove functions. (sh_gdbarch_init): Don't set sh_show_regs. (_initialize_sh_tdep): Make the 'regs' command an deprecated alias to 'info all-registers'. * sh64-tdep.c (sh64_show_media_regs, sh64_show_compact_regs) (sh64_show_regs): Remove functions. * sh64-tdep.h (sh64_show_regs): Remove function declaration. gdb/doc/ * gdb.texinfo: Document the deprecation of SH's 'regs' command. Index: gdb/NEWS =================================================================== RCS file: /cvs/src/src/gdb/NEWS,v retrieving revision 1.526 retrieving revision 1.527 diff -u -p -r1.526 -r1.527 --- gdb/NEWS 24 May 2012 00:33:45 -0000 1.526 +++ gdb/NEWS 6 Jun 2012 18:03:53 -0000 1.527 @@ -161,6 +161,11 @@ corresponding to addresses it prints. This defaults to "on", but you can set it to "off" to restore GDB's previous behavior. +* Deprecated commands + + ** For the Renesas Super-H architecture, the "regs" command has been + deprecated, and "info all-registers" should be used instead. + * New targets Renesas RL78 rl78-*-elf Index: gdb/inferior.h =================================================================== RCS file: /cvs/src/src/gdb/inferior.h,v retrieving revision 1.175 retrieving revision 1.176 diff -u -p -r1.175 -r1.176 --- gdb/inferior.h 24 May 2012 16:39:09 -0000 1.175 +++ gdb/inferior.h 6 Jun 2012 18:03:53 -0000 1.176 @@ -246,6 +246,8 @@ extern void set_inferior_args (char *); extern void set_inferior_args_vector (int, char **); +extern void all_registers_info (char *, int); + extern void registers_info (char *, int); extern void nexti_command (char *, int); Index: gdb/sh-tdep.c =================================================================== RCS file: /cvs/src/src/gdb/sh-tdep.c,v retrieving revision 1.243 retrieving revision 1.244 diff -u -p -r1.243 -r1.244 --- gdb/sh-tdep.c 16 May 2012 14:35:07 -0000 1.243 +++ gdb/sh-tdep.c 6 Jun 2012 18:03:53 -0000 1.244 @@ -69,8 +69,6 @@ static const char *const sh_cc_enum[] = static const char *sh_active_calling_convention = sh_cc_gcc; -static void (*sh_show_regs) (struct frame_info *); - #define SH_NUM_REGS 67 struct sh_frame_cache @@ -1431,714 +1429,6 @@ sh_return_value_fpu (struct gdbarch *gdb return RETURN_VALUE_REGISTER_CONVENTION; } -/* Print the registers in a form similar to the E7000. */ - -static void -sh_generic_show_regs (struct frame_info *frame) -{ - printf_filtered - (" PC %s SR %08lx PR %08lx MACH %08lx\n", - phex (get_frame_register_unsigned (frame, - gdbarch_pc_regnum - (get_frame_arch (frame))), 4), - (long) get_frame_register_unsigned (frame, SR_REGNUM), - (long) get_frame_register_unsigned (frame, PR_REGNUM), - (long) get_frame_register_unsigned (frame, MACH_REGNUM)); - - printf_filtered - (" GBR %08lx VBR %08lx MACL %08lx\n", - (long) get_frame_register_unsigned (frame, GBR_REGNUM), - (long) get_frame_register_unsigned (frame, VBR_REGNUM), - (long) get_frame_register_unsigned (frame, MACL_REGNUM)); - - printf_filtered - ("R0-R7 %08lx %08lx %08lx %08lx %08lx %08lx %08lx %08lx\n", - (long) get_frame_register_unsigned (frame, 0), - (long) get_frame_register_unsigned (frame, 1), - (long) get_frame_register_unsigned (frame, 2), - (long) get_frame_register_unsigned (frame, 3), - (long) get_frame_register_unsigned (frame, 4), - (long) get_frame_register_unsigned (frame, 5), - (long) get_frame_register_unsigned (frame, 6), - (long) get_frame_register_unsigned (frame, 7)); - printf_filtered - ("R8-R15 %08lx %08lx %08lx %08lx %08lx %08lx %08lx %08lx\n", - (long) get_frame_register_unsigned (frame, 8), - (long) get_frame_register_unsigned (frame, 9), - (long) get_frame_register_unsigned (frame, 10), - (long) get_frame_register_unsigned (frame, 11), - (long) get_frame_register_unsigned (frame, 12), - (long) get_frame_register_unsigned (frame, 13), - (long) get_frame_register_unsigned (frame, 14), - (long) get_frame_register_unsigned (frame, 15)); -} - -static void -sh3_show_regs (struct frame_info *frame) -{ - printf_filtered - (" PC %s SR %08lx PR %08lx MACH %08lx\n", - phex (get_frame_register_unsigned (frame, - gdbarch_pc_regnum - (get_frame_arch (frame))), 4), - (long) get_frame_register_unsigned (frame, SR_REGNUM), - (long) get_frame_register_unsigned (frame, PR_REGNUM), - (long) get_frame_register_unsigned (frame, MACH_REGNUM)); - - printf_filtered - (" GBR %08lx VBR %08lx MACL %08lx\n", - (long) get_frame_register_unsigned (frame, GBR_REGNUM), - (long) get_frame_register_unsigned (frame, VBR_REGNUM), - (long) get_frame_register_unsigned (frame, MACL_REGNUM)); - printf_filtered - (" SSR %08lx SPC %08lx\n", - (long) get_frame_register_unsigned (frame, SSR_REGNUM), - (long) get_frame_register_unsigned (frame, SPC_REGNUM)); - - printf_filtered - ("R0-R7 %08lx %08lx %08lx %08lx %08lx %08lx %08lx %08lx\n", - (long) get_frame_register_unsigned (frame, 0), - (long) get_frame_register_unsigned (frame, 1), - (long) get_frame_register_unsigned (frame, 2), - (long) get_frame_register_unsigned (frame, 3), - (long) get_frame_register_unsigned (frame, 4), - (long) get_frame_register_unsigned (frame, 5), - (long) get_frame_register_unsigned (frame, 6), - (long) get_frame_register_unsigned (frame, 7)); - printf_filtered - ("R8-R15 %08lx %08lx %08lx %08lx %08lx %08lx %08lx %08lx\n", - (long) get_frame_register_unsigned (frame, 8), - (long) get_frame_register_unsigned (frame, 9), - (long) get_frame_register_unsigned (frame, 10), - (long) get_frame_register_unsigned (frame, 11), - (long) get_frame_register_unsigned (frame, 12), - (long) get_frame_register_unsigned (frame, 13), - (long) get_frame_register_unsigned (frame, 14), - (long) get_frame_register_unsigned (frame, 15)); -} - -static void -sh2e_show_regs (struct frame_info *frame) -{ - struct gdbarch *gdbarch = get_frame_arch (frame); - printf_filtered - (" PC %s SR %08lx PR %08lx MACH %08lx\n", - phex (get_frame_register_unsigned (frame, - gdbarch_pc_regnum (gdbarch)), 4), - (long) get_frame_register_unsigned (frame, SR_REGNUM), - (long) get_frame_register_unsigned (frame, PR_REGNUM), - (long) get_frame_register_unsigned (frame, MACH_REGNUM)); - - printf_filtered - (" GBR %08lx VBR %08lx MACL %08lx\n", - (long) get_frame_register_unsigned (frame, GBR_REGNUM), - (long) get_frame_register_unsigned (frame, VBR_REGNUM), - (long) get_frame_register_unsigned (frame, MACL_REGNUM)); - printf_filtered - (" SSR %08lx SPC %08lx FPUL %08lx FPSCR %08lx\n", - (long) get_frame_register_unsigned (frame, SSR_REGNUM), - (long) get_frame_register_unsigned (frame, SPC_REGNUM), - (long) get_frame_register_unsigned (frame, FPUL_REGNUM), - (long) get_frame_register_unsigned (frame, FPSCR_REGNUM)); - - printf_filtered - ("R0-R7 %08lx %08lx %08lx %08lx %08lx %08lx %08lx %08lx\n", - (long) get_frame_register_unsigned (frame, 0), - (long) get_frame_register_unsigned (frame, 1), - (long) get_frame_register_unsigned (frame, 2), - (long) get_frame_register_unsigned (frame, 3), - (long) get_frame_register_unsigned (frame, 4), - (long) get_frame_register_unsigned (frame, 5), - (long) get_frame_register_unsigned (frame, 6), - (long) get_frame_register_unsigned (frame, 7)); - printf_filtered - ("R8-R15 %08lx %08lx %08lx %08lx %08lx %08lx %08lx %08lx\n", - (long) get_frame_register_unsigned (frame, 8), - (long) get_frame_register_unsigned (frame, 9), - (long) get_frame_register_unsigned (frame, 10), - (long) get_frame_register_unsigned (frame, 11), - (long) get_frame_register_unsigned (frame, 12), - (long) get_frame_register_unsigned (frame, 13), - (long) get_frame_register_unsigned (frame, 14), - (long) get_frame_register_unsigned (frame, 15)); - - printf_filtered - ("FP0-FP7 %08lx %08lx %08lx %08lx %08lx %08lx %08lx %08lx\n", - (long) get_frame_register_unsigned - (frame, gdbarch_fp0_regnum (gdbarch) + 0), - (long) get_frame_register_unsigned - (frame, gdbarch_fp0_regnum (gdbarch) + 1), - (long) get_frame_register_unsigned - (frame, gdbarch_fp0_regnum (gdbarch) + 2), - (long) get_frame_register_unsigned - (frame, gdbarch_fp0_regnum (gdbarch) + 3), - (long) get_frame_register_unsigned - (frame, gdbarch_fp0_regnum (gdbarch) + 4), - (long) get_frame_register_unsigned - (frame, gdbarch_fp0_regnum (gdbarch) + 5), - (long) get_frame_register_unsigned - (frame, gdbarch_fp0_regnum (gdbarch) + 6), - (long) get_frame_register_unsigned - (frame, gdbarch_fp0_regnum (gdbarch) + 7)); - printf_filtered - ("FP8-FP15 %08lx %08lx %08lx %08lx %08lx %08lx %08lx %08lx\n", - (long) get_frame_register_unsigned - (frame, gdbarch_fp0_regnum (gdbarch) + 8), - (long) get_frame_register_unsigned - (frame, gdbarch_fp0_regnum (gdbarch) + 9), - (long) get_frame_register_unsigned - (frame, gdbarch_fp0_regnum (gdbarch) + 10), - (long) get_frame_register_unsigned - (frame, gdbarch_fp0_regnum (gdbarch) + 11), - (long) get_frame_register_unsigned - (frame, gdbarch_fp0_regnum (gdbarch) + 12), - (long) get_frame_register_unsigned - (frame, gdbarch_fp0_regnum (gdbarch) + 13), - (long) get_frame_register_unsigned - (frame, gdbarch_fp0_regnum (gdbarch) + 14), - (long) get_frame_register_unsigned - (frame, gdbarch_fp0_regnum (gdbarch) + 15)); -} - -static void -sh2a_show_regs (struct frame_info *frame) -{ - struct gdbarch *gdbarch = get_frame_arch (frame); - int pr = get_frame_register_unsigned (frame, FPSCR_REGNUM) & 0x80000; - - printf_filtered - (" PC %s SR %08lx PR %08lx MACH %08lx\n", - phex (get_frame_register_unsigned (frame, - gdbarch_pc_regnum (gdbarch)), 4), - (long) get_frame_register_unsigned (frame, SR_REGNUM), - (long) get_frame_register_unsigned (frame, PR_REGNUM), - (long) get_frame_register_unsigned (frame, MACH_REGNUM)); - - printf_filtered - (" GBR %08lx VBR %08lx TBR %08lx MACL %08lx\n", - (long) get_frame_register_unsigned (frame, GBR_REGNUM), - (long) get_frame_register_unsigned (frame, VBR_REGNUM), - (long) get_frame_register_unsigned (frame, TBR_REGNUM), - (long) get_frame_register_unsigned (frame, MACL_REGNUM)); - printf_filtered - (" SSR %08lx SPC %08lx FPUL %08lx FPSCR %08lx\n", - (long) get_frame_register_unsigned (frame, SSR_REGNUM), - (long) get_frame_register_unsigned (frame, SPC_REGNUM), - (long) get_frame_register_unsigned (frame, FPUL_REGNUM), - (long) get_frame_register_unsigned (frame, FPSCR_REGNUM)); - - printf_filtered - ("R0-R7 %08lx %08lx %08lx %08lx %08lx %08lx %08lx %08lx\n", - (long) get_frame_register_unsigned (frame, 0), - (long) get_frame_register_unsigned (frame, 1), - (long) get_frame_register_unsigned (frame, 2), - (long) get_frame_register_unsigned (frame, 3), - (long) get_frame_register_unsigned (frame, 4), - (long) get_frame_register_unsigned (frame, 5), - (long) get_frame_register_unsigned (frame, 6), - (long) get_frame_register_unsigned (frame, 7)); - printf_filtered - ("R8-R15 %08lx %08lx %08lx %08lx %08lx %08lx %08lx %08lx\n", - (long) get_frame_register_unsigned (frame, 8), - (long) get_frame_register_unsigned (frame, 9), - (long) get_frame_register_unsigned (frame, 10), - (long) get_frame_register_unsigned (frame, 11), - (long) get_frame_register_unsigned (frame, 12), - (long) get_frame_register_unsigned (frame, 13), - (long) get_frame_register_unsigned (frame, 14), - (long) get_frame_register_unsigned (frame, 15)); - - printf_filtered - (pr ? "DR0-DR6 %08lx%08lx %08lx%08lx %08lx%08lx %08lx%08lx\n" - : "FP0-FP7 %08lx %08lx %08lx %08lx %08lx %08lx %08lx %08lx\n", - (long) get_frame_register_unsigned - (frame, gdbarch_fp0_regnum (gdbarch) + 0), - (long) get_frame_register_unsigned - (frame, gdbarch_fp0_regnum (gdbarch) + 1), - (long) get_frame_register_unsigned - (frame, gdbarch_fp0_regnum (gdbarch) + 2), - (long) get_frame_register_unsigned - (frame, gdbarch_fp0_regnum (gdbarch) + 3), - (long) get_frame_register_unsigned - (frame, gdbarch_fp0_regnum (gdbarch) + 4), - (long) get_frame_register_unsigned - (frame, gdbarch_fp0_regnum (gdbarch) + 5), - (long) get_frame_register_unsigned - (frame, gdbarch_fp0_regnum (gdbarch) + 6), - (long) get_frame_register_unsigned - (frame, gdbarch_fp0_regnum (gdbarch) + 7)); - printf_filtered - (pr ? "DR8-DR14 %08lx%08lx %08lx%08lx %08lx%08lx %08lx%08lx\n" - : "FP8-FP15 %08lx %08lx %08lx %08lx %08lx %08lx %08lx %08lx\n", - (long) get_frame_register_unsigned - (frame, gdbarch_fp0_regnum (gdbarch) + 8), - (long) get_frame_register_unsigned - (frame, gdbarch_fp0_regnum (gdbarch) + 9), - (long) get_frame_register_unsigned - (frame, gdbarch_fp0_regnum (gdbarch) + 10), - (long) get_frame_register_unsigned - (frame, gdbarch_fp0_regnum (gdbarch) + 11), - (long) get_frame_register_unsigned - (frame, gdbarch_fp0_regnum (gdbarch) + 12), - (long) get_frame_register_unsigned - (frame, gdbarch_fp0_regnum (gdbarch) + 13), - (long) get_frame_register_unsigned - (frame, gdbarch_fp0_regnum (gdbarch) + 14), - (long) get_frame_register_unsigned - (frame, gdbarch_fp0_regnum (gdbarch) + 15)); - printf_filtered - ("BANK=%-3d\n", (int) get_frame_register_unsigned (frame, BANK_REGNUM)); - printf_filtered - ("R0b-R7b %08lx %08lx %08lx %08lx %08lx %08lx %08lx %08lx\n", - (long) get_frame_register_unsigned (frame, R0_BANK0_REGNUM + 0), - (long) get_frame_register_unsigned (frame, R0_BANK0_REGNUM + 1), - (long) get_frame_register_unsigned (frame, R0_BANK0_REGNUM + 2), - (long) get_frame_register_unsigned (frame, R0_BANK0_REGNUM + 3), - (long) get_frame_register_unsigned (frame, R0_BANK0_REGNUM + 4), - (long) get_frame_register_unsigned (frame, R0_BANK0_REGNUM + 5), - (long) get_frame_register_unsigned (frame, R0_BANK0_REGNUM + 6), - (long) get_frame_register_unsigned (frame, R0_BANK0_REGNUM + 7)); - printf_filtered - ("R8b-R14b %08lx %08lx %08lx %08lx %08lx %08lx %08lx\n", - (long) get_frame_register_unsigned (frame, R0_BANK0_REGNUM + 8), - (long) get_frame_register_unsigned (frame, R0_BANK0_REGNUM + 9), - (long) get_frame_register_unsigned (frame, R0_BANK0_REGNUM + 10), - (long) get_frame_register_unsigned (frame, R0_BANK0_REGNUM + 11), - (long) get_frame_register_unsigned (frame, R0_BANK0_REGNUM + 12), - (long) get_frame_register_unsigned (frame, R0_BANK0_REGNUM + 13), - (long) get_frame_register_unsigned (frame, R0_BANK0_REGNUM + 14)); - printf_filtered - ("MACHb=%08lx IVNb=%08lx PRb=%08lx GBRb=%08lx MACLb=%08lx\n", - (long) get_frame_register_unsigned (frame, R0_BANK0_REGNUM + 15), - (long) get_frame_register_unsigned (frame, R0_BANK0_REGNUM + 16), - (long) get_frame_register_unsigned (frame, R0_BANK0_REGNUM + 17), - (long) get_frame_register_unsigned (frame, R0_BANK0_REGNUM + 18), - (long) get_frame_register_unsigned (frame, R0_BANK0_REGNUM + 19)); -} - -static void -sh2a_nofpu_show_regs (struct frame_info *frame) -{ - int pr = get_frame_register_unsigned (frame, FPSCR_REGNUM) & 0x80000; - - printf_filtered - (" PC %s SR %08lx PR %08lx MACH %08lx\n", - phex (get_frame_register_unsigned (frame, - gdbarch_pc_regnum - (get_frame_arch (frame))), 4), - (long) get_frame_register_unsigned (frame, SR_REGNUM), - (long) get_frame_register_unsigned (frame, PR_REGNUM), - (long) get_frame_register_unsigned (frame, MACH_REGNUM)); - - printf_filtered - (" GBR %08lx VBR %08lx TBR %08lx MACL %08lx\n", - (long) get_frame_register_unsigned (frame, GBR_REGNUM), - (long) get_frame_register_unsigned (frame, VBR_REGNUM), - (long) get_frame_register_unsigned (frame, TBR_REGNUM), - (long) get_frame_register_unsigned (frame, MACL_REGNUM)); - printf_filtered - (" SSR %08lx SPC %08lx FPUL %08lx FPSCR %08lx\n", - (long) get_frame_register_unsigned (frame, SSR_REGNUM), - (long) get_frame_register_unsigned (frame, SPC_REGNUM), - (long) get_frame_register_unsigned (frame, FPUL_REGNUM), - (long) get_frame_register_unsigned (frame, FPSCR_REGNUM)); - - printf_filtered - ("R0-R7 %08lx %08lx %08lx %08lx %08lx %08lx %08lx %08lx\n", - (long) get_frame_register_unsigned (frame, 0), - (long) get_frame_register_unsigned (frame, 1), - (long) get_frame_register_unsigned (frame, 2), - (long) get_frame_register_unsigned (frame, 3), - (long) get_frame_register_unsigned (frame, 4), - (long) get_frame_register_unsigned (frame, 5), - (long) get_frame_register_unsigned (frame, 6), - (long) get_frame_register_unsigned (frame, 7)); - printf_filtered - ("R8-R15 %08lx %08lx %08lx %08lx %08lx %08lx %08lx %08lx\n", - (long) get_frame_register_unsigned (frame, 8), - (long) get_frame_register_unsigned (frame, 9), - (long) get_frame_register_unsigned (frame, 10), - (long) get_frame_register_unsigned (frame, 11), - (long) get_frame_register_unsigned (frame, 12), - (long) get_frame_register_unsigned (frame, 13), - (long) get_frame_register_unsigned (frame, 14), - (long) get_frame_register_unsigned (frame, 15)); - - printf_filtered - ("BANK=%-3d\n", (int) get_frame_register_unsigned (frame, BANK_REGNUM)); - printf_filtered - ("R0b-R7b %08lx %08lx %08lx %08lx %08lx %08lx %08lx %08lx\n", - (long) get_frame_register_unsigned (frame, R0_BANK0_REGNUM + 0), - (long) get_frame_register_unsigned (frame, R0_BANK0_REGNUM + 1), - (long) get_frame_register_unsigned (frame, R0_BANK0_REGNUM + 2), - (long) get_frame_register_unsigned (frame, R0_BANK0_REGNUM + 3), - (long) get_frame_register_unsigned (frame, R0_BANK0_REGNUM + 4), - (long) get_frame_register_unsigned (frame, R0_BANK0_REGNUM + 5), - (long) get_frame_register_unsigned (frame, R0_BANK0_REGNUM + 6), - (long) get_frame_register_unsigned (frame, R0_BANK0_REGNUM + 7)); - printf_filtered - ("R8b-R14b %08lx %08lx %08lx %08lx %08lx %08lx %08lx\n", - (long) get_frame_register_unsigned (frame, R0_BANK0_REGNUM + 8), - (long) get_frame_register_unsigned (frame, R0_BANK0_REGNUM + 9), - (long) get_frame_register_unsigned (frame, R0_BANK0_REGNUM + 10), - (long) get_frame_register_unsigned (frame, R0_BANK0_REGNUM + 11), - (long) get_frame_register_unsigned (frame, R0_BANK0_REGNUM + 12), - (long) get_frame_register_unsigned (frame, R0_BANK0_REGNUM + 13), - (long) get_frame_register_unsigned (frame, R0_BANK0_REGNUM + 14)); - printf_filtered - ("MACHb=%08lx IVNb=%08lx PRb=%08lx GBRb=%08lx MACLb=%08lx\n", - (long) get_frame_register_unsigned (frame, R0_BANK0_REGNUM + 15), - (long) get_frame_register_unsigned (frame, R0_BANK0_REGNUM + 16), - (long) get_frame_register_unsigned (frame, R0_BANK0_REGNUM + 17), - (long) get_frame_register_unsigned (frame, R0_BANK0_REGNUM + 18), - (long) get_frame_register_unsigned (frame, R0_BANK0_REGNUM + 19)); -} - -static void -sh3e_show_regs (struct frame_info *frame) -{ - struct gdbarch *gdbarch = get_frame_arch (frame); - printf_filtered - (" PC %s SR %08lx PR %08lx MACH %08lx\n", - phex (get_frame_register_unsigned (frame, - gdbarch_pc_regnum (gdbarch)), 4), - (long) get_frame_register_unsigned (frame, SR_REGNUM), - (long) get_frame_register_unsigned (frame, PR_REGNUM), - (long) get_frame_register_unsigned (frame, MACH_REGNUM)); - - printf_filtered - (" GBR %08lx VBR %08lx MACL %08lx\n", - (long) get_frame_register_unsigned (frame, GBR_REGNUM), - (long) get_frame_register_unsigned (frame, VBR_REGNUM), - (long) get_frame_register_unsigned (frame, MACL_REGNUM)); - printf_filtered - (" SSR %08lx SPC %08lx FPUL %08lx FPSCR %08lx\n", - (long) get_frame_register_unsigned (frame, SSR_REGNUM), - (long) get_frame_register_unsigned (frame, SPC_REGNUM), - (long) get_frame_register_unsigned (frame, FPUL_REGNUM), - (long) get_frame_register_unsigned (frame, FPSCR_REGNUM)); - - printf_filtered - ("R0-R7 %08lx %08lx %08lx %08lx %08lx %08lx %08lx %08lx\n", - (long) get_frame_register_unsigned (frame, 0), - (long) get_frame_register_unsigned (frame, 1), - (long) get_frame_register_unsigned (frame, 2), - (long) get_frame_register_unsigned (frame, 3), - (long) get_frame_register_unsigned (frame, 4), - (long) get_frame_register_unsigned (frame, 5), - (long) get_frame_register_unsigned (frame, 6), - (long) get_frame_register_unsigned (frame, 7)); - printf_filtered - ("R8-R15 %08lx %08lx %08lx %08lx %08lx %08lx %08lx %08lx\n", - (long) get_frame_register_unsigned (frame, 8), - (long) get_frame_register_unsigned (frame, 9), - (long) get_frame_register_unsigned (frame, 10), - (long) get_frame_register_unsigned (frame, 11), - (long) get_frame_register_unsigned (frame, 12), - (long) get_frame_register_unsigned (frame, 13), - (long) get_frame_register_unsigned (frame, 14), - (long) get_frame_register_unsigned (frame, 15)); - - printf_filtered - ("FP0-FP7 %08lx %08lx %08lx %08lx %08lx %08lx %08lx %08lx\n", - (long) get_frame_register_unsigned - (frame, gdbarch_fp0_regnum (gdbarch) + 0), - (long) get_frame_register_unsigned - (frame, gdbarch_fp0_regnum (gdbarch) + 1), - (long) get_frame_register_unsigned - (frame, gdbarch_fp0_regnum (gdbarch) + 2), - (long) get_frame_register_unsigned - (frame, gdbarch_fp0_regnum (gdbarch) + 3), - (long) get_frame_register_unsigned - (frame, gdbarch_fp0_regnum (gdbarch) + 4), - (long) get_frame_register_unsigned - (frame, gdbarch_fp0_regnum (gdbarch) + 5), - (long) get_frame_register_unsigned - (frame, gdbarch_fp0_regnum (gdbarch) + 6), - (long) get_frame_register_unsigned - (frame, gdbarch_fp0_regnum (gdbarch) + 7)); - printf_filtered - ("FP8-FP15 %08lx %08lx %08lx %08lx %08lx %08lx %08lx %08lx\n", - (long) get_frame_register_unsigned - (frame, gdbarch_fp0_regnum (gdbarch) + 8), - (long) get_frame_register_unsigned - (frame, gdbarch_fp0_regnum (gdbarch) + 9), - (long) get_frame_register_unsigned - (frame, gdbarch_fp0_regnum (gdbarch) + 10), - (long) get_frame_register_unsigned - (frame, gdbarch_fp0_regnum (gdbarch) + 11), - (long) get_frame_register_unsigned - (frame, gdbarch_fp0_regnum (gdbarch) + 12), - (long) get_frame_register_unsigned - (frame, gdbarch_fp0_regnum (gdbarch) + 13), - (long) get_frame_register_unsigned - (frame, gdbarch_fp0_regnum (gdbarch) + 14), - (long) get_frame_register_unsigned - (frame, gdbarch_fp0_regnum (gdbarch) + 15)); -} - -static void -sh3_dsp_show_regs (struct frame_info *frame) -{ - printf_filtered - (" PC %s SR %08lx PR %08lx MACH %08lx\n", - phex (get_frame_register_unsigned (frame, - gdbarch_pc_regnum - (get_frame_arch (frame))), 4), - (long) get_frame_register_unsigned (frame, SR_REGNUM), - (long) get_frame_register_unsigned (frame, PR_REGNUM), - (long) get_frame_register_unsigned (frame, MACH_REGNUM)); - - printf_filtered - (" GBR %08lx VBR %08lx MACL %08lx\n", - (long) get_frame_register_unsigned (frame, GBR_REGNUM), - (long) get_frame_register_unsigned (frame, VBR_REGNUM), - (long) get_frame_register_unsigned (frame, MACL_REGNUM)); - - printf_filtered - (" SSR %08lx SPC %08lx DSR %08lx\n", - (long) get_frame_register_unsigned (frame, SSR_REGNUM), - (long) get_frame_register_unsigned (frame, SPC_REGNUM), - (long) get_frame_register_unsigned (frame, DSR_REGNUM)); - - printf_filtered - ("R0-R7 %08lx %08lx %08lx %08lx %08lx %08lx %08lx %08lx\n", - (long) get_frame_register_unsigned (frame, 0), - (long) get_frame_register_unsigned (frame, 1), - (long) get_frame_register_unsigned (frame, 2), - (long) get_frame_register_unsigned (frame, 3), - (long) get_frame_register_unsigned (frame, 4), - (long) get_frame_register_unsigned (frame, 5), - (long) get_frame_register_unsigned (frame, 6), - (long) get_frame_register_unsigned (frame, 7)); - printf_filtered - ("R8-R15 %08lx %08lx %08lx %08lx %08lx %08lx %08lx %08lx\n", - (long) get_frame_register_unsigned (frame, 8), - (long) get_frame_register_unsigned (frame, 9), - (long) get_frame_register_unsigned (frame, 10), - (long) get_frame_register_unsigned (frame, 11), - (long) get_frame_register_unsigned (frame, 12), - (long) get_frame_register_unsigned (frame, 13), - (long) get_frame_register_unsigned (frame, 14), - (long) get_frame_register_unsigned (frame, 15)); - - printf_filtered - ("A0G=%02lx A0=%08lx M0=%08lx X0=%08lx Y0=%08lx RS=%08lx MOD=%08lx\n", - (long) get_frame_register_unsigned (frame, A0G_REGNUM) & 0xff, - (long) get_frame_register_unsigned (frame, A0_REGNUM), - (long) get_frame_register_unsigned (frame, M0_REGNUM), - (long) get_frame_register_unsigned (frame, X0_REGNUM), - (long) get_frame_register_unsigned (frame, Y0_REGNUM), - (long) get_frame_register_unsigned (frame, RS_REGNUM), - (long) get_frame_register_unsigned (frame, MOD_REGNUM)); - printf_filtered - ("A1G=%02lx A1=%08lx M1=%08lx X1=%08lx Y1=%08lx RE=%08lx\n", - (long) get_frame_register_unsigned (frame, A1G_REGNUM) & 0xff, - (long) get_frame_register_unsigned (frame, A1_REGNUM), - (long) get_frame_register_unsigned (frame, M1_REGNUM), - (long) get_frame_register_unsigned (frame, X1_REGNUM), - (long) get_frame_register_unsigned (frame, Y1_REGNUM), - (long) get_frame_register_unsigned (frame, RE_REGNUM)); -} - -static void -sh4_show_regs (struct frame_info *frame) -{ - struct gdbarch *gdbarch = get_frame_arch (frame); - int pr = get_frame_register_unsigned (frame, FPSCR_REGNUM) & 0x80000; - - printf_filtered - (" PC %s SR %08lx PR %08lx MACH %08lx\n", - phex (get_frame_register_unsigned (frame, - gdbarch_pc_regnum (gdbarch)), 4), - (long) get_frame_register_unsigned (frame, SR_REGNUM), - (long) get_frame_register_unsigned (frame, PR_REGNUM), - (long) get_frame_register_unsigned (frame, MACH_REGNUM)); - - printf_filtered - (" GBR %08lx VBR %08lx MACL %08lx\n", - (long) get_frame_register_unsigned (frame, GBR_REGNUM), - (long) get_frame_register_unsigned (frame, VBR_REGNUM), - (long) get_frame_register_unsigned (frame, MACL_REGNUM)); - printf_filtered - (" SSR %08lx SPC %08lx FPUL %08lx FPSCR %08lx\n", - (long) get_frame_register_unsigned (frame, SSR_REGNUM), - (long) get_frame_register_unsigned (frame, SPC_REGNUM), - (long) get_frame_register_unsigned (frame, FPUL_REGNUM), - (long) get_frame_register_unsigned (frame, FPSCR_REGNUM)); - - printf_filtered - ("R0-R7 %08lx %08lx %08lx %08lx %08lx %08lx %08lx %08lx\n", - (long) get_frame_register_unsigned (frame, 0), - (long) get_frame_register_unsigned (frame, 1), - (long) get_frame_register_unsigned (frame, 2), - (long) get_frame_register_unsigned (frame, 3), - (long) get_frame_register_unsigned (frame, 4), - (long) get_frame_register_unsigned (frame, 5), - (long) get_frame_register_unsigned (frame, 6), - (long) get_frame_register_unsigned (frame, 7)); - printf_filtered - ("R8-R15 %08lx %08lx %08lx %08lx %08lx %08lx %08lx %08lx\n", - (long) get_frame_register_unsigned (frame, 8), - (long) get_frame_register_unsigned (frame, 9), - (long) get_frame_register_unsigned (frame, 10), - (long) get_frame_register_unsigned (frame, 11), - (long) get_frame_register_unsigned (frame, 12), - (long) get_frame_register_unsigned (frame, 13), - (long) get_frame_register_unsigned (frame, 14), - (long) get_frame_register_unsigned (frame, 15)); - - printf_filtered - (pr ? "DR0-DR6 %08lx%08lx %08lx%08lx %08lx%08lx %08lx%08lx\n" - : "FP0-FP7 %08lx %08lx %08lx %08lx %08lx %08lx %08lx %08lx\n", - (long) get_frame_register_unsigned - (frame, gdbarch_fp0_regnum (gdbarch) + 0), - (long) get_frame_register_unsigned - (frame, gdbarch_fp0_regnum (gdbarch) + 1), - (long) get_frame_register_unsigned - (frame, gdbarch_fp0_regnum (gdbarch) + 2), - (long) get_frame_register_unsigned - (frame, gdbarch_fp0_regnum (gdbarch) + 3), - (long) get_frame_register_unsigned - (frame, gdbarch_fp0_regnum (gdbarch) + 4), - (long) get_frame_register_unsigned - (frame, gdbarch_fp0_regnum (gdbarch) + 5), - (long) get_frame_register_unsigned - (frame, gdbarch_fp0_regnum (gdbarch) + 6), - (long) get_frame_register_unsigned - (frame, gdbarch_fp0_regnum (gdbarch) + 7)); - printf_filtered - (pr ? "DR8-DR14 %08lx%08lx %08lx%08lx %08lx%08lx %08lx%08lx\n" - : "FP8-FP15 %08lx %08lx %08lx %08lx %08lx %08lx %08lx %08lx\n", - (long) get_frame_register_unsigned - (frame, gdbarch_fp0_regnum (gdbarch) + 8), - (long) get_frame_register_unsigned - (frame, gdbarch_fp0_regnum (gdbarch) + 9), - (long) get_frame_register_unsigned - (frame, gdbarch_fp0_regnum (gdbarch) + 10), - (long) get_frame_register_unsigned - (frame, gdbarch_fp0_regnum (gdbarch) + 11), - (long) get_frame_register_unsigned - (frame, gdbarch_fp0_regnum (gdbarch) + 12), - (long) get_frame_register_unsigned - (frame, gdbarch_fp0_regnum (gdbarch) + 13), - (long) get_frame_register_unsigned - (frame, gdbarch_fp0_regnum (gdbarch) + 14), - (long) get_frame_register_unsigned - (frame, gdbarch_fp0_regnum (gdbarch) + 15)); -} - -static void -sh4_nofpu_show_regs (struct frame_info *frame) -{ - printf_filtered - (" PC %s SR %08lx PR %08lx MACH %08lx\n", - phex (get_frame_register_unsigned (frame, - gdbarch_pc_regnum - (get_frame_arch (frame))), 4), - (long) get_frame_register_unsigned (frame, SR_REGNUM), - (long) get_frame_register_unsigned (frame, PR_REGNUM), - (long) get_frame_register_unsigned (frame, MACH_REGNUM)); - - printf_filtered - (" GBR %08lx VBR %08lx MACL %08lx\n", - (long) get_frame_register_unsigned (frame, GBR_REGNUM), - (long) get_frame_register_unsigned (frame, VBR_REGNUM), - (long) get_frame_register_unsigned (frame, MACL_REGNUM)); - printf_filtered - (" SSR %08lx SPC %08lx FPUL %08lx FPSCR %08lx\n", - (long) get_frame_register_unsigned (frame, SSR_REGNUM), - (long) get_frame_register_unsigned (frame, SPC_REGNUM), - (long) get_frame_register_unsigned (frame, FPUL_REGNUM), - (long) get_frame_register_unsigned (frame, FPSCR_REGNUM)); - - printf_filtered - ("R0-R7 %08lx %08lx %08lx %08lx %08lx %08lx %08lx %08lx\n", - (long) get_frame_register_unsigned (frame, 0), - (long) get_frame_register_unsigned (frame, 1), - (long) get_frame_register_unsigned (frame, 2), - (long) get_frame_register_unsigned (frame, 3), - (long) get_frame_register_unsigned (frame, 4), - (long) get_frame_register_unsigned (frame, 5), - (long) get_frame_register_unsigned (frame, 6), - (long) get_frame_register_unsigned (frame, 7)); - printf_filtered - ("R8-R15 %08lx %08lx %08lx %08lx %08lx %08lx %08lx %08lx\n", - (long) get_frame_register_unsigned (frame, 8), - (long) get_frame_register_unsigned (frame, 9), - (long) get_frame_register_unsigned (frame, 10), - (long) get_frame_register_unsigned (frame, 11), - (long) get_frame_register_unsigned (frame, 12), - (long) get_frame_register_unsigned (frame, 13), - (long) get_frame_register_unsigned (frame, 14), - (long) get_frame_register_unsigned (frame, 15)); -} - -static void -sh_dsp_show_regs (struct frame_info *frame) -{ - printf_filtered - (" PC %s SR %08lx PR %08lx MACH %08lx\n", - phex (get_frame_register_unsigned (frame, - gdbarch_pc_regnum - (get_frame_arch (frame))), 4), - (long) get_frame_register_unsigned (frame, SR_REGNUM), - (long) get_frame_register_unsigned (frame, PR_REGNUM), - (long) get_frame_register_unsigned (frame, MACH_REGNUM)); - - printf_filtered - (" GBR %08lx VBR %08lx DSR %08lx MACL %08lx\n", - (long) get_frame_register_unsigned (frame, GBR_REGNUM), - (long) get_frame_register_unsigned (frame, VBR_REGNUM), - (long) get_frame_register_unsigned (frame, DSR_REGNUM), - (long) get_frame_register_unsigned (frame, MACL_REGNUM)); - - printf_filtered - ("R0-R7 %08lx %08lx %08lx %08lx %08lx %08lx %08lx %08lx\n", - (long) get_frame_register_unsigned (frame, 0), - (long) get_frame_register_unsigned (frame, 1), - (long) get_frame_register_unsigned (frame, 2), - (long) get_frame_register_unsigned (frame, 3), - (long) get_frame_register_unsigned (frame, 4), - (long) get_frame_register_unsigned (frame, 5), - (long) get_frame_register_unsigned (frame, 6), - (long) get_frame_register_unsigned (frame, 7)); - printf_filtered - ("R8-R15 %08lx %08lx %08lx %08lx %08lx %08lx %08lx %08lx\n", - (long) get_frame_register_unsigned (frame, 8), - (long) get_frame_register_unsigned (frame, 9), - (long) get_frame_register_unsigned (frame, 10), - (long) get_frame_register_unsigned (frame, 11), - (long) get_frame_register_unsigned (frame, 12), - (long) get_frame_register_unsigned (frame, 13), - (long) get_frame_register_unsigned (frame, 14), - (long) get_frame_register_unsigned (frame, 15)); - - printf_filtered - ("A0G=%02lx A0=%08lx M0=%08lx X0=%08lx Y0=%08lx RS=%08lx MOD=%08lx\n", - (long) get_frame_register_unsigned (frame, A0G_REGNUM) & 0xff, - (long) get_frame_register_unsigned (frame, A0_REGNUM), - (long) get_frame_register_unsigned (frame, M0_REGNUM), - (long) get_frame_register_unsigned (frame, X0_REGNUM), - (long) get_frame_register_unsigned (frame, Y0_REGNUM), - (long) get_frame_register_unsigned (frame, RS_REGNUM), - (long) get_frame_register_unsigned (frame, MOD_REGNUM)); - printf_filtered ("A1G=%02lx A1=%08lx M1=%08lx X1=%08lx Y1=%08lx RE=%08lx\n", - (long) get_frame_register_unsigned (frame, A1G_REGNUM) & 0xff, - (long) get_frame_register_unsigned (frame, A1_REGNUM), - (long) get_frame_register_unsigned (frame, M1_REGNUM), - (long) get_frame_register_unsigned (frame, X1_REGNUM), - (long) get_frame_register_unsigned (frame, Y1_REGNUM), - (long) get_frame_register_unsigned (frame, RE_REGNUM)); -} - -static void -sh_show_regs_command (char *args, int from_tty) -{ - if (sh_show_regs) - (*sh_show_regs) (get_current_frame ()); -} - static struct type * sh_sh2a_register_type (struct gdbarch *gdbarch, int reg_nr) { @@ -2927,56 +2217,9 @@ sh_gdbarch_init (struct gdbarch_info inf struct gdbarch *gdbarch; struct gdbarch_tdep *tdep; - sh_show_regs = sh_generic_show_regs; - switch (info.bfd_arch_info->mach) - { - case bfd_mach_sh2e: - sh_show_regs = sh2e_show_regs; - break; - case bfd_mach_sh2a: - sh_show_regs = sh2a_show_regs; - break; - case bfd_mach_sh2a_nofpu: - sh_show_regs = sh2a_nofpu_show_regs; - break; - case bfd_mach_sh_dsp: - sh_show_regs = sh_dsp_show_regs; - break; - - case bfd_mach_sh3: - case bfd_mach_sh3_nommu: - case bfd_mach_sh2a_nofpu_or_sh3_nommu: - sh_show_regs = sh3_show_regs; - break; - - case bfd_mach_sh3e: - case bfd_mach_sh2a_or_sh3e: - sh_show_regs = sh3e_show_regs; - break; - - case bfd_mach_sh3_dsp: - case bfd_mach_sh4al_dsp: - sh_show_regs = sh3_dsp_show_regs; - break; - - case bfd_mach_sh4: - case bfd_mach_sh4a: - case bfd_mach_sh2a_or_sh4: - sh_show_regs = sh4_show_regs; - break; - - case bfd_mach_sh4_nofpu: - case bfd_mach_sh4_nommu_nofpu: - case bfd_mach_sh4a_nofpu: - case bfd_mach_sh2a_nofpu_or_sh4_nommu_nofpu: - sh_show_regs = sh4_nofpu_show_regs; - break; - - case bfd_mach_sh5: - sh_show_regs = sh64_show_regs; - /* SH5 is handled entirely in sh64-tdep.c. */ - return sh64_gdbarch_init (info, arches); - } + /* SH5 is handled entirely in sh64-tdep.c. */ + if (info.bfd_arch_info->mach == bfd_mach_sh5) + return sh64_gdbarch_init (info, arches); /* If there is already a candidate, use it. */ arches = gdbarch_list_lookup_by_info (arches, &info); @@ -3166,8 +2409,12 @@ _initialize_sh_tdep (void) gdbarch_register (bfd_arch_sh, sh_gdbarch_init, NULL); - add_com ("regs", class_vars, sh_show_regs_command, _("Print all registers")); - + /* We can't use an alias here because 'info registers' has not yet been + registered. */ + c = add_com ("regs", class_vars, all_registers_info, + _("Print all registers")); + deprecate_cmd (c, "info all-registers"); + add_prefix_cmd ("sh", no_class, set_sh_command, "SH specific commands.", &setshcmdlist, "set sh ", 0, &setlist); add_prefix_cmd ("sh", no_class, show_sh_command, "SH specific commands.", Index: gdb/sh64-tdep.c =================================================================== RCS file: /cvs/src/src/gdb/sh64-tdep.c,v retrieving revision 1.84 retrieving revision 1.85 diff -u -p -r1.84 -r1.85 --- gdb/sh64-tdep.c 18 May 2012 21:02:50 -0000 1.84 +++ gdb/sh64-tdep.c 6 Jun 2012 18:03:53 -0000 1.85 @@ -1339,125 +1339,6 @@ sh64_return_value (struct gdbarch *gdbar return RETURN_VALUE_REGISTER_CONVENTION; } -static void -sh64_show_media_regs (struct frame_info *frame) -{ - struct gdbarch *gdbarch = get_frame_arch (frame); - int i; - - printf_filtered - ("PC=%s SR=%s\n", - phex (get_frame_register_unsigned (frame, - gdbarch_pc_regnum (gdbarch)), 8), - phex (get_frame_register_unsigned (frame, SR_REGNUM), 8)); - - printf_filtered - ("SSR=%s SPC=%s\n", - phex (get_frame_register_unsigned (frame, SSR_REGNUM), 8), - phex (get_frame_register_unsigned (frame, SPC_REGNUM), 8)); - printf_filtered - ("FPSCR=%s\n ", - phex (get_frame_register_unsigned (frame, FPSCR_REGNUM), 8)); - - for (i = 0; i < 64; i = i + 4) - printf_filtered - ("\nR%d-R%d %s %s %s %s\n", - i, i + 3, - phex (get_frame_register_unsigned (frame, i + 0), 8), - phex (get_frame_register_unsigned (frame, i + 1), 8), - phex (get_frame_register_unsigned (frame, i + 2), 8), - phex (get_frame_register_unsigned (frame, i + 3), 8)); - - printf_filtered ("\n"); - - for (i = 0; i < 64; i = i + 8) - printf_filtered - ("FR%d-FR%d %08lx %08lx %08lx %08lx %08lx %08lx %08lx %08lx\n", - i, i + 7, - (long) get_frame_register_unsigned - (frame, gdbarch_fp0_regnum (gdbarch) + i + 0), - (long) get_frame_register_unsigned - (frame, gdbarch_fp0_regnum (gdbarch) + i + 1), - (long) get_frame_register_unsigned - (frame, gdbarch_fp0_regnum (gdbarch) + i + 2), - (long) get_frame_register_unsigned - (frame, gdbarch_fp0_regnum (gdbarch) + i + 3), - (long) get_frame_register_unsigned - (frame, gdbarch_fp0_regnum (gdbarch) + i + 4), - (long) get_frame_register_unsigned - (frame, gdbarch_fp0_regnum (gdbarch) + i + 5), - (long) get_frame_register_unsigned - (frame, gdbarch_fp0_regnum (gdbarch) + i + 6), - (long) get_frame_register_unsigned - (frame, gdbarch_fp0_regnum (gdbarch) + i + 7)); -} - -static void -sh64_show_compact_regs (struct frame_info *frame) -{ - struct gdbarch *gdbarch = get_frame_arch (frame); - int i; - - printf_filtered - ("PC=%s\n", - phex (get_frame_register_unsigned (frame, PC_C_REGNUM), 8)); - - printf_filtered - ("GBR=%08lx MACH=%08lx MACL=%08lx PR=%08lx T=%08lx\n", - (long) get_frame_register_unsigned (frame, GBR_C_REGNUM), - (long) get_frame_register_unsigned (frame, MACH_C_REGNUM), - (long) get_frame_register_unsigned (frame, MACL_C_REGNUM), - (long) get_frame_register_unsigned (frame, PR_C_REGNUM), - (long) get_frame_register_unsigned (frame, T_C_REGNUM)); - printf_filtered - ("FPSCR=%08lx FPUL=%08lx\n", - (long) get_frame_register_unsigned (frame, FPSCR_C_REGNUM), - (long) get_frame_register_unsigned (frame, FPUL_C_REGNUM)); - - for (i = 0; i < 16; i = i + 4) - printf_filtered - ("\nR%d-R%d %08lx %08lx %08lx %08lx\n", - i, i + 3, - (long) get_frame_register_unsigned (frame, i + 0), - (long) get_frame_register_unsigned (frame, i + 1), - (long) get_frame_register_unsigned (frame, i + 2), - (long) get_frame_register_unsigned (frame, i + 3)); - - printf_filtered ("\n"); - - for (i = 0; i < 16; i = i + 8) - printf_filtered - ("FR%d-FR%d %08lx %08lx %08lx %08lx %08lx %08lx %08lx %08lx\n", - i, i + 7, - (long) get_frame_register_unsigned - (frame, gdbarch_fp0_regnum (gdbarch) + i + 0), - (long) get_frame_register_unsigned - (frame, gdbarch_fp0_regnum (gdbarch) + i + 1), - (long) get_frame_register_unsigned - (frame, gdbarch_fp0_regnum (gdbarch) + i + 2), - (long) get_frame_register_unsigned - (frame, gdbarch_fp0_regnum (gdbarch) + i + 3), - (long) get_frame_register_unsigned - (frame, gdbarch_fp0_regnum (gdbarch) + i + 4), - (long) get_frame_register_unsigned - (frame, gdbarch_fp0_regnum (gdbarch) + i + 5), - (long) get_frame_register_unsigned - (frame, gdbarch_fp0_regnum (gdbarch) + i + 6), - (long) get_frame_register_unsigned - (frame, gdbarch_fp0_regnum (gdbarch) + i + 7)); -} - -/* FIXME!!! This only shows the registers for shmedia, excluding the - pseudo registers. */ -void -sh64_show_regs (struct frame_info *frame) -{ - if (pc_is_isa32 (get_frame_pc (frame))) - sh64_show_media_regs (frame); - else - sh64_show_compact_regs (frame); -} - /* *INDENT-OFF* */ /* SH MEDIA MODE (ISA 32) Index: gdb/sh64-tdep.h =================================================================== RCS file: /cvs/src/src/gdb/sh64-tdep.h,v retrieving revision 1.1 retrieving revision 1.2 diff -u -p -r1.1 -r1.2 --- gdb/sh64-tdep.h 1 Mar 2012 23:55:40 -0000 1.1 +++ gdb/sh64-tdep.h 6 Jun 2012 18:03:53 -0000 1.2 @@ -20,6 +20,5 @@ #define SH64_TDEP_H extern gdbarch_init_ftype sh64_gdbarch_init; -extern void sh64_show_regs (struct frame_info *frame); #endif /* SH64_TDEP_H */ Index: gdb/doc/gdb.texinfo =================================================================== RCS file: /cvs/src/src/gdb/doc/gdb.texinfo,v retrieving revision 1.972 retrieving revision 1.973 diff -u -p -r1.972 -r1.973 --- gdb/doc/gdb.texinfo 6 Jun 2012 08:20:12 -0000 1.972 +++ gdb/doc/gdb.texinfo 6 Jun 2012 18:03:54 -0000 1.973 @@ -20444,6 +20444,9 @@ commands: @table @code @item regs @kindex regs@r{, Super-H} +This command is deprecated, and @code{info all-registers} should be +used instead. + Show the values of all Super-H registers. @item set sh calling-convention @var{convention} Grüße, Thomas [-- Attachment #2: Type: application/pgp-signature, Size: 489 bytes --] ^ permalink raw reply [flat|nested] 30+ messages in thread
* Re: [SH] regs command 2012-06-06 18:10 ` Thomas Schwinge @ 2012-08-10 9:22 ` Thomas Schwinge 2012-08-10 16:20 ` Tom Tromey 0 siblings, 1 reply; 30+ messages in thread From: Thomas Schwinge @ 2012-08-10 9:22 UTC (permalink / raw) To: gdb-patches [-- Attachment #1: Type: text/plain, Size: 3428 bytes --] Hi! On Wed, 06 Jun 2012 20:10:02 +0200, I wrote: > On Wed, 16 May 2012 18:31:30 +0200, I wrote: > > On Wed, 16 May 2012 07:26:33 -0700, Joel Brobecker <brobecker@adacore.com> wrote: > > > > I therefore propose to remove sh_show_regs_command et al. from sh-tdep.c. > > > > If nobody objects, can it just go silently, or should invoking it then > > > > cause an error message, like »Please use the »info all-registers« command > > > > instead of »regs«.«? > > > > > > Make it an alias of "info reg" or "info all-registers", and make > > > the alias deprecated, so that users get a warning when they use it? > > Below is the patch that I finally committed. > > > > We can make that command deprecated for 7.5, and then remove it > > > from HEAD after 7.5 is branched, in a few weeks. > > I'll prepare a patch for that. ... and here it is. OK to commit? gdb/ * NEWS: Document the removal of SH's 'regs' command. * sh-tdep.c (_initialize_sh_tdep): Remove the deprecated 'regs' command. gdb/doc/ * gdb.texinfo: Document the removal of SH's 'regs' command. Index: NEWS =================================================================== RCS file: /cvs/src/src/gdb/NEWS,v retrieving revision 1.538 diff -u -p -r1.538 NEWS --- NEWS 6 Aug 2012 17:13:26 -0000 1.538 +++ NEWS 10 Aug 2012 09:15:04 -0000 @@ -20,6 +20,12 @@ maint info bfds List the BFDs known to GDB. +* Removed commands + + ** For the Renesas Super-H architecture, the "regs" command has been removed + (has been deprecated in GDB 7.5), and "info all-registers" should be used + instead. + *** Changes in GDB 7.5 * GDB now supports x32 ABI. Visit <http://sites.google.com/site/x32abi/> Index: sh-tdep.c =================================================================== RCS file: /cvs/src/src/gdb/sh-tdep.c,v retrieving revision 1.246 diff -u -p -r1.246 sh-tdep.c --- sh-tdep.c 22 Jul 2012 16:52:41 -0000 1.246 +++ sh-tdep.c 10 Aug 2012 09:15:04 -0000 @@ -2416,16 +2418,8 @@ extern initialize_file_ftype _initialize void _initialize_sh_tdep (void) { - struct cmd_list_element *c; - gdbarch_register (bfd_arch_sh, sh_gdbarch_init, NULL); - /* We can't use an alias here because 'info registers' has not yet been - registered. */ - c = add_com ("regs", class_vars, all_registers_info, - _("Print all registers")); - deprecate_cmd (c, "info all-registers"); - add_prefix_cmd ("sh", no_class, set_sh_command, "SH specific commands.", &setshcmdlist, "set sh ", 0, &setlist); add_prefix_cmd ("sh", no_class, show_sh_command, "SH specific commands.", Index: doc/gdb.texinfo =================================================================== RCS file: /cvs/src/src/gdb/doc/gdb.texinfo,v retrieving revision 1.994 diff -u -p -r1.994 gdb.texinfo --- doc/gdb.texinfo 2 Aug 2012 09:27:15 -0000 1.994 +++ doc/gdb.texinfo 10 Aug 2012 09:15:05 -0000 @@ -20471,13 +20471,6 @@ For the Renesas Super-H processor, @valu commands: @table @code -@item regs -@kindex regs@r{, Super-H} -This command is deprecated, and @code{info all-registers} should be -used instead. - -Show the values of all Super-H registers. - @item set sh calling-convention @var{convention} @kindex set sh calling-convention Set the calling-convention used when calling functions from @value{GDBN}. Grüße, Thomas [-- Attachment #2: Type: application/pgp-signature, Size: 489 bytes --] ^ permalink raw reply [flat|nested] 30+ messages in thread
* Re: [SH] regs command 2012-08-10 9:22 ` Thomas Schwinge @ 2012-08-10 16:20 ` Tom Tromey 0 siblings, 0 replies; 30+ messages in thread From: Tom Tromey @ 2012-08-10 16:20 UTC (permalink / raw) To: Thomas Schwinge; +Cc: gdb-patches >>>>> "Thomas" == Thomas Schwinge <thomas@codesourcery.com> writes: Thomas> * sh-tdep.c (_initialize_sh_tdep): Remove the deprecated 'regs' Thomas> command. Code bits are ok. Tom ^ permalink raw reply [flat|nested] 30+ messages in thread
end of thread, other threads:[~2012-08-10 16:20 UTC | newest] Thread overview: 30+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2012-05-16 13:56 [SH] regs command Thomas Schwinge 2012-05-16 14:26 ` Joel Brobecker 2012-05-16 16:32 ` Thomas Schwinge 2012-05-16 16:58 ` Joel Brobecker 2012-05-16 17:21 ` Thomas Schwinge 2012-05-16 18:47 ` Tom Tromey 2012-05-16 19:06 ` Joel Brobecker 2012-05-16 19:38 ` Maciej W. Rozycki 2012-05-17 0:59 ` Maciej W. Rozycki 2012-05-17 11:10 ` Mark Kettenis 2012-05-17 11:23 ` Maciej W. Rozycki 2012-05-17 12:38 ` Joel Brobecker 2012-05-17 15:23 ` Mark Kettenis 2012-05-17 15:45 ` Joel Brobecker 2012-05-17 19:52 ` Tom Tromey 2012-05-17 20:38 ` Joel Brobecker 2012-05-18 12:23 ` Maciej W. Rozycki 2012-05-18 12:39 ` Pedro Alves 2012-05-18 12:49 ` Joel Brobecker 2012-05-18 13:33 ` Pedro Alves 2012-05-18 13:47 ` Tom Tromey 2012-05-21 23:36 ` Maciej W. Rozycki 2012-05-24 18:05 ` Tom Tromey 2012-05-17 19:32 ` Kevin Buettner 2012-05-16 18:36 ` Tom Tromey 2012-05-16 18:36 ` Pedro Alves 2012-05-16 19:36 ` Eli Zaretskii 2012-06-06 18:10 ` Thomas Schwinge 2012-08-10 9:22 ` Thomas Schwinge 2012-08-10 16:20 ` Tom Tromey
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox