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]

Re: patch approval request


David Taylor wrote:
> 
>     Date: Wed, 25 Oct 2000 10:47:15 -0700
>     From: Michael Snyder <msnyder@redhat.com>
> 
>     I'll approve the eval.c changes on JimB's behalf.
> 
>     Michael
> 
> Ummm, eval.c didn't need approval (I'm the maintainer of eval.c, not
> JimB) -- it's stack.c that still needs approval (I've gotten approval
> either publicly or privately for the rest).

Doh!  I meant to say the stack.c changes.
Really!   ;-)

> 
>     David Taylor wrote:
>     >     To: gdb-patches@sourceware.cygnus.com
>     >     Subject: [RFA] addresses/pointers vs numbers and expression evaluation
>     >     Date: Thu, 12 Oct 2000 10:06:20 -0400
>     >     From: David Taylor <taylor@texas.cygnus.com>
>     >
>     >     The following patch concerns bugs brought to light during a port of
>     >     gdb to a target with separate instruction and data.
>     >
>     >     The bugs will potentially impact any port which defines
>     >     POINTER_TO_ADDRESS to have any value other than the default value.
>     >
>     >     There are undoubtably additional bugs still lurking in the expression
>     >     evaluation code.
>     >
>     >     Several places in gdb it calls
>     >
>     >         parse_and_eval_address
>     >
>     >     when the expression is *NOT* an address, but rather is just a number!
>     >     For example, it calls parse_and_eval_address when you type:
>     >
>     >         set height 24
>     >
>     >     For this processor, treating 24 as a pointer resulted in an address of
>     >     0x01000018 -- 16 meg plus 24!  Similarly, it does this for the count
>     >     given to the continue and step commands as well as a few other places.
>     >
>     >     To fix this, I have create a new function called parse_and_eval_long
>     >     and changed 17 of the calls to parse_and_eval_address.
>     >
>     >     I have tested this on solaris native and on solaris x d10v (using the
>     >     simulator).  There were no regressions.
>     >
>     > Here's the ChangeLog message, the changes to eval.c (for reference),
>     > and the changes to stack.c.  All of the changes other than stack.c
>     > have been approved.
>     >
>     >         * eval.c (parse_and_eval_long): New function.
>     >         (value.h): Declare it.
>     >
>     >         * breakpoint.c (breakpoints_info, maintenance_info_breakpoints):
>     >         Call parse_and_eval_long, not parse_and_eval_address.
>     >         * command.c (do_setshow_command): Ditto.
>     >         * infcmd.c (step_1, signal_command, continue_command): Ditto.
>     >         * infrun.c (signals_info): Ditto.
>     >         * stack.c (set_backtrace_limit_command, backtrace_command_1,
>     >         up_silently_base, down_silently_base): Ditto.
>     >         * tracepoints.c (tracepoints_info, trace_find_command,
>     >         trace_find_tracepoint_command): Ditto.
>     >         * valprint.c (set_radix): Ditto.
>     >         * values (show_values): Ditto.
>     >
>     > Index: eval.c
>     > ===================================================================
>     > RCS file: /cvs/src/src/gdb/eval.c,v
>     > retrieving revision 1.8
>     > diff -c -r1.8 eval.c
>     > *** eval.c      2000/09/01 23:50:17     1.8
>     > --- eval.c      2000/10/12 13:57:09
>     > ***************
>     > *** 103,108 ****
>     > --- 103,123 ----
>     >     return addr;
>     >   }
>     >
>     > + /* Like parse_and_eval_address, but treats the value of the expression
>     > +    as an integer, not an address, returns a LONGEST, not a CORE_ADDR */
>     > + LONGEST
>     > + parse_and_eval_long (char *exp)
>     > + {
>     > +   struct expression *expr = parse_expression (exp);
>     > +   register LONGEST retval;
>     > +   register struct cleanup *old_chain =
>     > +     make_cleanup (free_current_contents, &expr);
>     > +
>     > +   retval = value_as_long (evaluate_expression (expr));
>     > +   do_cleanups (old_chain);
>     > +   return (retval);
>     > + }
>     > +
>     >   value_ptr
>     >   parse_and_eval (char *exp)
>     >   {
>     > Index: stack.c
>     > ===================================================================
>     > RCS file: /cvs/src/src/gdb/stack.c,v
>     > retrieving revision 1.7
>     > diff -c -r1.7 stack.c
>     > *** stack.c     2000/07/30 01:48:27     1.7
>     > --- stack.c     2000/10/12 13:57:17
>     > ***************
>     > *** 1038,1044 ****
>     >   static void
>     >   set_backtrace_limit_command (char *count_exp, int from_tty)
>     >   {
>     > !   int count = parse_and_eval_address (count_exp);
>     >
>     >     if (count < 0)
>     >       error ("Negative argument not meaningful as backtrace limit.");
>     > --- 1038,1044 ----
>     >   static void
>     >   set_backtrace_limit_command (char *count_exp, int from_tty)
>     >   {
>     > !   int count = parse_and_eval_long (count_exp);
>     >
>     >     if (count < 0)
>     >       error ("Negative argument not meaningful as backtrace limit.");
>     > ***************
>     > *** 1086,1092 ****
>     >     trailing_level = 0;
>     >     if (count_exp)
>     >       {
>     > !       count = parse_and_eval_address (count_exp);
>     >         if (count < 0)
>     >         {
>     >           struct frame_info *current;
>     > --- 1086,1092 ----
>     >     trailing_level = 0;
>     >     if (count_exp)
>     >       {
>     > !       count = parse_and_eval_long (count_exp);
>     >         if (count < 0)
>     >         {
>     >           struct frame_info *current;
>     > ***************
>     > *** 1740,1746 ****
>     >     register struct frame_info *fi;
>     >     int count = 1, count1;
>     >     if (count_exp)
>     > !     count = parse_and_eval_address (count_exp);
>     >     count1 = count;
>     >
>     >     if (target_has_stack == 0 || selected_frame == 0)
>     > --- 1740,1746 ----
>     >     register struct frame_info *fi;
>     >     int count = 1, count1;
>     >     if (count_exp)
>     > !     count = parse_and_eval_long (count_exp);
>     >     count1 = count;
>     >
>     >     if (target_has_stack == 0 || selected_frame == 0)
>     > ***************
>     > *** 1777,1783 ****
>     >     register struct frame_info *frame;
>     >     int count = -1, count1;
>     >     if (count_exp)
>     > !     count = -parse_and_eval_address (count_exp);
>     >     count1 = count;
>     >
>     >     if (target_has_stack == 0 || selected_frame == 0)
>     > --- 1777,1783 ----
>     >     register struct frame_info *frame;
>     >     int count = -1, count1;
>     >     if (count_exp)
>     > !     count = -parse_and_eval_long (count_exp);
>     >     count1 = count;
>     >
>     >     if (target_has_stack == 0 || selected_frame == 0)

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