This is the mail archive of the gdb-patches@sources.redhat.com mailing list for the GDB project.


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

[PATCH] arguments of 'restore' command



This patch is the result of trying out the dump/restore commands
on a harvard architecture.  I realized that the arguments of the
'restore' command are actually integers, not addresses.

The only time one of these arguments is used as an address
is when you specify the offset at which to restore a binary
file.  And in that case, if you have a harvard architecture, 
you must specify the full "long" form of the address, so that
GDB can know whether to restore the file to instruction 
space or data space.

2002-05-23  Michael Snyder  <msnyder@redhat.com>

	* cli/cli-dump.c (restore_command): Use parse_and_eval_long
	for input, rather than parse_and_eval_address.  

Index: cli-dump.c
===================================================================
RCS file: /cvs/src/src/gdb/cli/cli-dump.c,v
retrieving revision 1.3
diff -p -r1.3 cli-dump.c
*** cli-dump.c	6 Apr 2002 01:52:34 -0000	1.3
--- cli-dump.c	24 May 2002 01:17:20 -0000
*************** restore_command (char *args, int from_tt
*** 623,640 ****
        /* Parse offset (optional). */
        if (args != NULL && *args != '\0')
        data.load_offset = 
! 	parse_and_eval_address (scan_expression_with_cleanup (&args, 
! 							      NULL));
        if (args != NULL && *args != '\0')
  	{
  	  /* Parse start address (optional). */
  	  data.load_start = 
! 	    parse_and_eval_address (scan_expression_with_cleanup (&args, 
! 								  NULL));
  	  if (args != NULL && *args != '\0')
  	    {
  	      /* Parse end address (optional). */
! 	      data.load_end = parse_and_eval_address (args);
  	      if (data.load_end <= data.load_start)
  		error ("Start must be less than end.");
  	    }
--- 623,638 ----
        /* Parse offset (optional). */
        if (args != NULL && *args != '\0')
        data.load_offset = 
! 	parse_and_eval_long (scan_expression_with_cleanup (&args, NULL));
        if (args != NULL && *args != '\0')
  	{
  	  /* Parse start address (optional). */
  	  data.load_start = 
! 	    parse_and_eval_long (scan_expression_with_cleanup (&args, NULL));
  	  if (args != NULL && *args != '\0')
  	    {
  	      /* Parse end address (optional). */
! 	      data.load_end = parse_and_eval_long (args);
  	      if (data.load_end <= data.load_start)
  		error ("Start must be less than end.");
  	    }


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