RFA: Make --memory-info work for MIPS simulators
Nick Clifton
nickc@redhat.com
Fri Aug 10 10:38:00 GMT 2007
Hi Thiemo,
The --memory-info command line switch (and its alias --info-memory)
do not work for the MIPS simulator because the memory regions are
not set up until after the command line has been parsed. The
attached patch fixes this by delaying the processing of
--memory-info until after the regions have been initialized.
The patch does have one slightly dubious component - it removes the
mips specific command line options table from the linked list of
options tables once the command line has been processed. It does
this so that the real handler for --memory-info can be called via
the sim_do_commandf() function. I think that this is safe, since
there is no longer any need to process mips specific command line
switches.
Before the patch:
% mips64vrel-elf-run --memory-info a.out
Memory maps:
After the patch:
% mips64vrel-elf-run --memory-info a.out
Memory maps:
memory region 0x7fff8000,0x8000
memory alias 0xa0000000@0x1,0x20000000%0x800000,0x80000000@0x1
May I apply this patch please ?
Cheers
Nick
PS. The sim/MAINTAINERS file has your email address as
<ths@networkno.de>, judging from the ChangeLog though, I guessed that
this was incorrect.
sim/mips/ChangeLog
2007-08-10 Nick Clifton <nickc@redhat.com>
* interp.c (options enum): Add OPTION_INFO_MEMORY.
(display_mem_info): New static variable.
(mips_option_handler): Handle OPTION_INFO_MEMORY.
(mips_options): Add info-memory and memory-info.
(sim_open): After processing the command line and board
specification, check display_mem_info. If it is set then
call the real handler for the --memory-info command line
switch.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: interp.c.patch
Type: text/x-patch
Size: 2902 bytes
Desc: not available
URL: <http://sourceware.org/pipermail/gdb-patches/attachments/20070810/41985cf8/attachment.bin>
More information about the Gdb-patches
mailing list