mirror of
https://sourceware.org/git/binutils-gdb.git
synced 2024-12-27 04:52:05 +08:00
Use "const" more in ax-gdb.c
This changes a few spots in ax-gdb.c to use a "const char *" rather than a non-const one. gdb/ChangeLog 2020-11-10 Tom Tromey <tom@tromey.com> * ax-gdb.c (gen_struct_elt_for_reference, gen_namespace_elt) (gen_maybe_namespace_elt, gen_aggregate_elt_ref, gen_expr): Use const.
This commit is contained in:
parent
8e20b4be65
commit
caaece0e2f
@ -1,3 +1,9 @@
|
|||||||
|
2020-11-10 Tom Tromey <tom@tromey.com>
|
||||||
|
|
||||||
|
* ax-gdb.c (gen_struct_elt_for_reference, gen_namespace_elt)
|
||||||
|
(gen_maybe_namespace_elt, gen_aggregate_elt_ref, gen_expr): Use
|
||||||
|
const.
|
||||||
|
|
||||||
2020-11-10 Tom Tromey <tom@tromey.com>
|
2020-11-10 Tom Tromey <tom@tromey.com>
|
||||||
|
|
||||||
* objc-lang.h (value_nsstring): Update.
|
* objc-lang.h (value_nsstring): Update.
|
||||||
|
20
gdb/ax-gdb.c
20
gdb/ax-gdb.c
@ -1537,10 +1537,10 @@ gen_struct_ref (struct agent_expr *ax, struct axs_value *value,
|
|||||||
|
|
||||||
static int
|
static int
|
||||||
gen_namespace_elt (struct agent_expr *ax, struct axs_value *value,
|
gen_namespace_elt (struct agent_expr *ax, struct axs_value *value,
|
||||||
const struct type *curtype, char *name);
|
const struct type *curtype, const char *name);
|
||||||
static int
|
static int
|
||||||
gen_maybe_namespace_elt (struct agent_expr *ax, struct axs_value *value,
|
gen_maybe_namespace_elt (struct agent_expr *ax, struct axs_value *value,
|
||||||
const struct type *curtype, char *name);
|
const struct type *curtype, const char *name);
|
||||||
|
|
||||||
static void
|
static void
|
||||||
gen_static_field (struct agent_expr *ax, struct axs_value *value,
|
gen_static_field (struct agent_expr *ax, struct axs_value *value,
|
||||||
@ -1577,7 +1577,7 @@ gen_static_field (struct agent_expr *ax, struct axs_value *value,
|
|||||||
|
|
||||||
static int
|
static int
|
||||||
gen_struct_elt_for_reference (struct agent_expr *ax, struct axs_value *value,
|
gen_struct_elt_for_reference (struct agent_expr *ax, struct axs_value *value,
|
||||||
struct type *type, char *fieldname)
|
struct type *type, const char *fieldname)
|
||||||
{
|
{
|
||||||
struct type *t = type;
|
struct type *t = type;
|
||||||
int i;
|
int i;
|
||||||
@ -1622,7 +1622,7 @@ gen_struct_elt_for_reference (struct agent_expr *ax, struct axs_value *value,
|
|||||||
|
|
||||||
static int
|
static int
|
||||||
gen_namespace_elt (struct agent_expr *ax, struct axs_value *value,
|
gen_namespace_elt (struct agent_expr *ax, struct axs_value *value,
|
||||||
const struct type *curtype, char *name)
|
const struct type *curtype, const char *name)
|
||||||
{
|
{
|
||||||
int found = gen_maybe_namespace_elt (ax, value, curtype, name);
|
int found = gen_maybe_namespace_elt (ax, value, curtype, name);
|
||||||
|
|
||||||
@ -1641,7 +1641,7 @@ gen_namespace_elt (struct agent_expr *ax, struct axs_value *value,
|
|||||||
|
|
||||||
static int
|
static int
|
||||||
gen_maybe_namespace_elt (struct agent_expr *ax, struct axs_value *value,
|
gen_maybe_namespace_elt (struct agent_expr *ax, struct axs_value *value,
|
||||||
const struct type *curtype, char *name)
|
const struct type *curtype, const char *name)
|
||||||
{
|
{
|
||||||
const char *namespace_name = curtype->name ();
|
const char *namespace_name = curtype->name ();
|
||||||
struct block_symbol sym;
|
struct block_symbol sym;
|
||||||
@ -1665,7 +1665,7 @@ gen_maybe_namespace_elt (struct agent_expr *ax, struct axs_value *value,
|
|||||||
|
|
||||||
static int
|
static int
|
||||||
gen_aggregate_elt_ref (struct agent_expr *ax, struct axs_value *value,
|
gen_aggregate_elt_ref (struct agent_expr *ax, struct axs_value *value,
|
||||||
struct type *type, char *field)
|
struct type *type, const char *field)
|
||||||
{
|
{
|
||||||
switch (type->code ())
|
switch (type->code ())
|
||||||
{
|
{
|
||||||
@ -1919,7 +1919,7 @@ gen_expr (struct expression *exp, union exp_element **pc,
|
|||||||
(*pc)++;
|
(*pc)++;
|
||||||
if ((*pc)[0].opcode == OP_INTERNALVAR)
|
if ((*pc)[0].opcode == OP_INTERNALVAR)
|
||||||
{
|
{
|
||||||
char *name = internalvar_name ((*pc)[1].internalvar);
|
const char *name = internalvar_name ((*pc)[1].internalvar);
|
||||||
struct trace_state_variable *tsv;
|
struct trace_state_variable *tsv;
|
||||||
|
|
||||||
(*pc) += 3;
|
(*pc) += 3;
|
||||||
@ -1946,7 +1946,7 @@ gen_expr (struct expression *exp, union exp_element **pc,
|
|||||||
(*pc)++;
|
(*pc)++;
|
||||||
if ((*pc)[0].opcode == OP_INTERNALVAR)
|
if ((*pc)[0].opcode == OP_INTERNALVAR)
|
||||||
{
|
{
|
||||||
char *name = internalvar_name ((*pc)[1].internalvar);
|
const char *name = internalvar_name ((*pc)[1].internalvar);
|
||||||
struct trace_state_variable *tsv;
|
struct trace_state_variable *tsv;
|
||||||
|
|
||||||
(*pc) += 3;
|
(*pc) += 3;
|
||||||
@ -2204,7 +2204,7 @@ gen_expr (struct expression *exp, union exp_element **pc,
|
|||||||
case STRUCTOP_PTR:
|
case STRUCTOP_PTR:
|
||||||
{
|
{
|
||||||
int length = (*pc)[1].longconst;
|
int length = (*pc)[1].longconst;
|
||||||
char *name = &(*pc)[2].string;
|
const char *name = &(*pc)[2].string;
|
||||||
|
|
||||||
(*pc) += 4 + BYTES_TO_EXP_ELEM (length + 1);
|
(*pc) += 4 + BYTES_TO_EXP_ELEM (length + 1);
|
||||||
gen_expr (exp, pc, ax, value);
|
gen_expr (exp, pc, ax, value);
|
||||||
@ -2249,7 +2249,7 @@ gen_expr (struct expression *exp, union exp_element **pc,
|
|||||||
{
|
{
|
||||||
struct type *type = (*pc)[1].type;
|
struct type *type = (*pc)[1].type;
|
||||||
int length = longest_to_int ((*pc)[2].longconst);
|
int length = longest_to_int ((*pc)[2].longconst);
|
||||||
char *name = &(*pc)[3].string;
|
const char *name = &(*pc)[3].string;
|
||||||
int found;
|
int found;
|
||||||
|
|
||||||
found = gen_aggregate_elt_ref (ax, value, type, name);
|
found = gen_aggregate_elt_ref (ax, value, type, name);
|
||||||
|
Loading…
Reference in New Issue
Block a user