public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* [pushed/ob] Constify value_cstring
@ 2015-11-18 16:01 Pedro Alves
  2015-11-18 16:21 ` Simon Marchi
  0 siblings, 1 reply; 3+ messages in thread
From: Pedro Alves @ 2015-11-18 16:01 UTC (permalink / raw)
  To: gdb-patches

From: Simon Marchi <simon.marchi@ericsson.com>

gdb/ChangeLog:
2015-11-18  Simon Marchi  <simon.marchi@ericsson.com>

	* valops.c (value_cstring): Constify 'ptr' parameter.
	* value.h (value_cstring): Constify 'ptr' parameter.
---
 gdb/ChangeLog | 5 +++++
 gdb/valops.c  | 2 +-
 gdb/value.h   | 2 +-
 3 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index a7b44fe..32f8134 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,8 @@
+2015-11-18  Simon Marchi  <simon.marchi@ericsson.com>
+
+	* valops.c (value_cstring): Constify 'ptr' parameter.
+	* value.h (value_cstring): Constify 'ptr' parameter.
+
 2015-11-18  Yao Qi  <yao.qi@linaro.org>
 
 	* aarch64-tdep.c (pass_in_v): Add argument len.  Add local array
diff --git a/gdb/valops.c b/gdb/valops.c
index 1e372ef..67e6afe 100644
--- a/gdb/valops.c
+++ b/gdb/valops.c
@@ -1626,7 +1626,7 @@ value_array (int lowbound, int highbound, struct value **elemvec)
 }
 
 struct value *
-value_cstring (char *ptr, ssize_t len, struct type *char_type)
+value_cstring (const char *ptr, ssize_t len, struct type *char_type)
 {
   struct value *val;
   int lowbound = current_language->string_lower_bound;
diff --git a/gdb/value.h b/gdb/value.h
index 0a4bc47..94a2234 100644
--- a/gdb/value.h
+++ b/gdb/value.h
@@ -696,7 +696,7 @@ extern struct value *value_mark (void);
 
 extern void value_free_to_mark (struct value *mark);
 
-extern struct value *value_cstring (char *ptr, ssize_t len,
+extern struct value *value_cstring (const char *ptr, ssize_t len,
 				    struct type *char_type);
 extern struct value *value_string (char *ptr, ssize_t len,
 				   struct type *char_type);
-- 
1.9.3

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

* Re: [pushed/ob] Constify value_cstring
  2015-11-18 16:01 [pushed/ob] Constify value_cstring Pedro Alves
@ 2015-11-18 16:21 ` Simon Marchi
  2015-11-18 16:41   ` Pedro Alves
  0 siblings, 1 reply; 3+ messages in thread
From: Simon Marchi @ 2015-11-18 16:21 UTC (permalink / raw)
  To: Pedro Alves, gdb-patches

On 15-11-18 11:01 AM, Pedro Alves wrote:
> From: Simon Marchi <simon.marchi@ericsson.com>
> 
> gdb/ChangeLog:
> 2015-11-18  Simon Marchi  <simon.marchi@ericsson.com>
> 
> 	* valops.c (value_cstring): Constify 'ptr' parameter.
> 	* value.h (value_cstring): Constify 'ptr' parameter.
> ---
>  gdb/ChangeLog | 5 +++++
>  gdb/valops.c  | 2 +-
>  gdb/value.h   | 2 +-
>  3 files changed, 7 insertions(+), 2 deletions(-)
> 
> diff --git a/gdb/ChangeLog b/gdb/ChangeLog
> index a7b44fe..32f8134 100644
> --- a/gdb/ChangeLog
> +++ b/gdb/ChangeLog
> @@ -1,3 +1,8 @@
> +2015-11-18  Simon Marchi  <simon.marchi@ericsson.com>
> +
> +	* valops.c (value_cstring): Constify 'ptr' parameter.
> +	* value.h (value_cstring): Constify 'ptr' parameter.
> +
>  2015-11-18  Yao Qi  <yao.qi@linaro.org>
>  
>  	* aarch64-tdep.c (pass_in_v): Add argument len.  Add local array
> diff --git a/gdb/valops.c b/gdb/valops.c
> index 1e372ef..67e6afe 100644
> --- a/gdb/valops.c
> +++ b/gdb/valops.c
> @@ -1626,7 +1626,7 @@ value_array (int lowbound, int highbound, struct value **elemvec)
>  }
>  
>  struct value *
> -value_cstring (char *ptr, ssize_t len, struct type *char_type)
> +value_cstring (const char *ptr, ssize_t len, struct type *char_type)
>  {
>    struct value *val;
>    int lowbound = current_language->string_lower_bound;
> diff --git a/gdb/value.h b/gdb/value.h
> index 0a4bc47..94a2234 100644
> --- a/gdb/value.h
> +++ b/gdb/value.h
> @@ -696,7 +696,7 @@ extern struct value *value_mark (void);
>  
>  extern void value_free_to_mark (struct value *mark);
>  
> -extern struct value *value_cstring (char *ptr, ssize_t len,
> +extern struct value *value_cstring (const char *ptr, ssize_t len,
>  				    struct type *char_type);
>  extern struct value *value_string (char *ptr, ssize_t len,
>  				   struct type *char_type);
> 


I pushed this one as well...


From 7cc3f8e23b5c19a50722adefce986230b191e9cd Mon Sep 17 00:00:00 2001
From: Simon Marchi <simon.marchi@ericsson.com>
Date: Wed, 18 Nov 2015 11:20:22 -0500
Subject: [PATCH] Constify value_string

If we constify value_cstring, we might as well constify this one.

gdb/ChangeLog:

	* valops.c (value_string): Constify 'ptr' parameter.
	* value.h (value_string): Constify 'ptr' parameter.
---
 gdb/ChangeLog | 5 +++++
 gdb/valops.c  | 2 +-
 gdb/value.h   | 2 +-
 3 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index d92ba43..d1b40b8 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,4 +1,9 @@
 2015-11-18  Simon Marchi  <simon.marchi@ericsson.com>
+
+	* valops.c (value_string): Constify 'ptr' parameter.
+	* value.h (value_string): Constify 'ptr' parameter.
+
+2015-11-18  Simon Marchi  <simon.marchi@ericsson.com>
 	    Pedro Alves  <palves@redhat.com>

 	* break-catch-sig.c (signal_catchpoint_print_one): Add cast.
diff --git a/gdb/valops.c b/gdb/valops.c
index 67e6afe..5e5f685 100644
--- a/gdb/valops.c
+++ b/gdb/valops.c
@@ -1649,7 +1649,7 @@ value_cstring (const char *ptr, ssize_t len, struct type *char_type)
    string may contain embedded null bytes.  */

 struct value *
-value_string (char *ptr, ssize_t len, struct type *char_type)
+value_string (const char *ptr, ssize_t len, struct type *char_type)
 {
   struct value *val;
   int lowbound = current_language->string_lower_bound;
diff --git a/gdb/value.h b/gdb/value.h
index 94a2234..eea0e59 100644
--- a/gdb/value.h
+++ b/gdb/value.h
@@ -698,7 +698,7 @@ extern void value_free_to_mark (struct value *mark);

 extern struct value *value_cstring (const char *ptr, ssize_t len,
 				    struct type *char_type);
-extern struct value *value_string (char *ptr, ssize_t len,
+extern struct value *value_string (const char *ptr, ssize_t len,
 				   struct type *char_type);

 extern struct value *value_array (int lowbound, int highbound,
-- 
2.5.1


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

* Re: [pushed/ob] Constify value_cstring
  2015-11-18 16:21 ` Simon Marchi
@ 2015-11-18 16:41   ` Pedro Alves
  0 siblings, 0 replies; 3+ messages in thread
From: Pedro Alves @ 2015-11-18 16:41 UTC (permalink / raw)
  To: Simon Marchi, gdb-patches

On 11/18/2015 04:21 PM, Simon Marchi wrote:

> I pushed this one as well...

Nice, thanks!

> 
> 
> From 7cc3f8e23b5c19a50722adefce986230b191e9cd Mon Sep 17 00:00:00 2001
> From: Simon Marchi <simon.marchi@ericsson.com>
> Date: Wed, 18 Nov 2015 11:20:22 -0500
> Subject: [PATCH] Constify value_string
> 
> If we constify value_cstring, we might as well constify this one.
> 
> gdb/ChangeLog:
> 
> 	* valops.c (value_string): Constify 'ptr' parameter.
> 	* value.h (value_string): Constify 'ptr' parameter.

Thanks,
Pedro Alves

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

end of thread, other threads:[~2015-11-18 16:41 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-11-18 16:01 [pushed/ob] Constify value_cstring Pedro Alves
2015-11-18 16:21 ` Simon Marchi
2015-11-18 16:41   ` Pedro Alves

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).