Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [RFA] Fix decode_indirect to use parse_to_comma_and_eval
@ 2011-02-23 20:47 Thiago Jung Bauermann
  2011-03-01 17:08 ` Tom Tromey
  0 siblings, 1 reply; 3+ messages in thread
From: Thiago Jung Bauermann @ 2011-02-23 20:47 UTC (permalink / raw)
  To: gdb-patches ml

Hi,

This came up in the discussion about the ranged breakpoints patch. I
needed the break-range command to accept locations of the form *PC in a
string of the form "*PC_START, *PC_END" but couldn't call
parse_breakpoint_sals because decode_indirect (called by decode_line_1)
tried to read past the comma and got confused. Ulrich mentioned that it
should stop at the comma. This patch implements that.

I removed parse_and_eval_address_1 because it is not called by anybody
after the change in this patch (I checked Insight too).

No regressions on ppc-linux and ppc64-linux. Ok?
-- 
[]'s
Thiago Jung Bauermann
IBM Linux Technology Center


2011-02-23  Thiago Jung Bauermann  <bauerman@br.ibm.com>

	* eval.c (parse_and_eval_address_1): Remove function.
	* linespec.c (decode_indirect): Call parse_to_comma_and_eval
	instead of parse_and_eval_address_1.
	* value.h (parse_and_eval_address_1): Remove prototype.

diff --git a/gdb/eval.c b/gdb/eval.c
index de25b39..c737058 100644
--- a/gdb/eval.c
+++ b/gdb/eval.c
@@ -93,22 +93,6 @@ parse_and_eval_address (char *exp)
   return addr;
 }
 
-/* Like parse_and_eval_address but takes a pointer to a char * variable
-   and advanced that variable across the characters parsed.  */
-
-CORE_ADDR
-parse_and_eval_address_1 (char **expptr)
-{
-  struct expression *expr = parse_exp_1 (expptr, (struct block *) 0, 0);
-  CORE_ADDR addr;
-  struct cleanup *old_chain =
-    make_cleanup (free_current_contents, &expr);
-
-  addr = value_as_address (evaluate_expression (expr));
-  do_cleanups (old_chain);
-  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
diff --git a/gdb/linespec.c b/gdb/linespec.c
index e801381..a539c9a 100644
--- a/gdb/linespec.c
+++ b/gdb/linespec.c
@@ -980,7 +980,7 @@ decode_indirect (char **argptr)
   CORE_ADDR pc;
   
   (*argptr)++;
-  pc = parse_and_eval_address_1 (argptr);
+  pc = value_as_address (parse_to_comma_and_eval (argptr));
 
   values.sals = (struct symtab_and_line *)
     xmalloc (sizeof (struct symtab_and_line));
diff --git a/gdb/value.h b/gdb/value.h
index e019e56..1a9df49 100644
--- a/gdb/value.h
+++ b/gdb/value.h
@@ -661,8 +661,6 @@ extern struct type *parse_and_eval_type (char *p, int length);
 
 extern CORE_ADDR parse_and_eval_address (char *exp);
 
-extern CORE_ADDR parse_and_eval_address_1 (char **expptr);
-
 extern LONGEST parse_and_eval_long (char *exp);
 
 extern void unop_promote (const struct language_defn *language,



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [RFA] Fix decode_indirect to use parse_to_comma_and_eval
  2011-02-23 20:47 [RFA] Fix decode_indirect to use parse_to_comma_and_eval Thiago Jung Bauermann
@ 2011-03-01 17:08 ` Tom Tromey
  2011-03-04 20:16   ` Thiago Jung Bauermann
  0 siblings, 1 reply; 3+ messages in thread
From: Tom Tromey @ 2011-03-01 17:08 UTC (permalink / raw)
  To: Thiago Jung Bauermann; +Cc: gdb-patches ml

>>>>> "Thiago" == Thiago Jung Bauermann <bauerman@br.ibm.com> writes:

Thiago> This came up in the discussion about the ranged breakpoints patch. I
Thiago> needed the break-range command to accept locations of the form *PC in a
Thiago> string of the form "*PC_START, *PC_END" but couldn't call
Thiago> parse_breakpoint_sals because decode_indirect (called by decode_line_1)
Thiago> tried to read past the comma and got confused. Ulrich mentioned that it
Thiago> should stop at the comma. This patch implements that.

Usually I am opposed to incompatible changes, but this one seems fairly
harmless to me.  It seems unlikely that anybody ever uses a "," in an
expression in a linespec.

Thiago> No regressions on ppc-linux and ppc64-linux. Ok?

If there are no objections by Friday, please go ahead.

Tom


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [RFA] Fix decode_indirect to use parse_to_comma_and_eval
  2011-03-01 17:08 ` Tom Tromey
@ 2011-03-04 20:16   ` Thiago Jung Bauermann
  0 siblings, 0 replies; 3+ messages in thread
From: Thiago Jung Bauermann @ 2011-03-04 20:16 UTC (permalink / raw)
  To: Tom Tromey; +Cc: gdb-patches ml

On Tue, 2011-03-01 at 10:07 -0700, Tom Tromey wrote:
> >>>>> "Thiago" == Thiago Jung Bauermann <bauerman@br.ibm.com> writes:
> 
> Thiago> This came up in the discussion about the ranged breakpoints patch. I
> Thiago> needed the break-range command to accept locations of the form *PC in a
> Thiago> string of the form "*PC_START, *PC_END" but couldn't call
> Thiago> parse_breakpoint_sals because decode_indirect (called by decode_line_1)
> Thiago> tried to read past the comma and got confused. Ulrich mentioned that it
> Thiago> should stop at the comma. This patch implements that.
> 
> Usually I am opposed to incompatible changes, but this one seems fairly
> harmless to me.  It seems unlikely that anybody ever uses a "," in an
> expression in a linespec.
> 
> Thiago> No regressions on ppc-linux and ppc64-linux. Ok?
> 
> If there are no objections by Friday, please go ahead.

Since there were no objections, I've just committed it. Thanks!

-- 
[]'s
Thiago Jung Bauermann
IBM Linux Technology Center


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2011-03-04 20:16 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-02-23 20:47 [RFA] Fix decode_indirect to use parse_to_comma_and_eval Thiago Jung Bauermann
2011-03-01 17:08 ` Tom Tromey
2011-03-04 20:16   ` Thiago Jung Bauermann

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox