This is the mail archive of the gdb-prs@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]

gdb/762: Allow -m 1024k et.al. with the simulator -m option


>Number:         762
>Category:       gdb
>Synopsis:       Allow -m 1024k et.al. with the simulator -m option
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          change-request
>Submitter-Id:   net
>Arrival-Date:   Fri Sep 27 17:08:04 PDT 2002
>Closed-Date:
>Last-Modified:
>Originator:     ac131313@redhat.com
>Release:        unknown-1.0
>Organization:
>Environment:

>Description:
Hi Andrew,


> > I would also suggest that you consider adding support for a
> > megabyte  postfix so that the user could do:
> >         -m 6M

> 
> Good idea, all the sims should do this.  Any pointers for the code?


Nope - it was just an idea that popped into my head whilst reading
your code.  It should be very straightforward though.  Something like
the code attached to the end of this email maybe ?


> >> It also sets the default memory size back to something consistent
> >> with the other simulators.

> > This will stop the java tests from running, so maybe you should also
> > add the new switch to the java test harness so that they do not fail.

> 
> Do you know which file?


Umm, not sure - libjava.exp maybe ?  Anthony ?

Cheers
        Nick

-------------------------------------------------------------------------
  else if (argv[i][0] == '-' && argv[i][1] == 'm')
    {
      char * end_ptr;
      const char * ptr;
      unsigned long size;
	
      if (argv[i][2] != '\0')
	ptr = argv[i] + 2;
      else
	{
	  ptr = argv [++i];

	  if (ptr == NULL)
	    {
	      sim_callback->printf_filtered
		(sim_callback,
		 "Missing argument to -m option\n");
	      return NULL;
	    }
	}

      size = strtoul (ptr, & end_ptr, 0);
      if (end_ptr != ptr)
	{
	  switch (* end_ptr)
	    {
	    case 'k':
	    case 'K':
	      size *= 1024;
	      break;
	    case 'm':
	    case 'M':
	      size *= 1024 * 1024;
	      break;
	    case 'g':
	    case 'G':
	      size *= 1024 * 1024 * 1024;
	      break;
	    case 0:
	      break;
	    default:
	      sim_callback->printf_filtered
		(sim_callback,
		 "Unexpected characters at end of -m option\n");
	      break;
	    }
	}

      sim_size (size);
    }


>How-To-Repeat:

>Fix:

>Release-Note:
>Audit-Trail:
>Unformatted:


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