diff options
author | Simon Marchi <simon.marchi@polymtl.ca> | 2015-10-27 09:33:29 -0400 |
---|---|---|
committer | Simon Marchi <simon.marchi@polymtl.ca> | 2015-10-27 09:33:29 -0400 |
commit | 70b8286a9749deb6639c2fd5b39c7e4a26195738 (patch) | |
tree | b309a136d583646c6017b54e7c4d926c1d854303 /gdb | |
parent | a480de357b17b1b2057b8375284079ccafae39db (diff) | |
download | gdb-70b8286a9749deb6639c2fd5b39c7e4a26195738.zip gdb-70b8286a9749deb6639c2fd5b39c7e4a26195738.tar.gz gdb-70b8286a9749deb6639c2fd5b39c7e4a26195738.tar.bz2 |
Introduce ax_raw_byte and use it
This patch was taken directly from Pedro's branch.
ax_simple is used to append an agent expression operator to an agent
expression string. Therefore, it takes an enum agent_op as input.
There is an instance where it's called to append a raw byte, unrelated
to the enum. It makes the build fail in C++ mode.
This patch introduces ax_raw_byte for that purpose and uses it.
gdb/ChangeLog:
* ax.h (ax_raw_byte): New declaration.
* ax-general.c (ax_raw_byte): New function.
(ax_simple): Use ax_raw_byte.
* ax-gdb.c (gen_printf): Likewise.
Diffstat (limited to 'gdb')
-rw-r--r-- | gdb/ChangeLog | 7 | ||||
-rw-r--r-- | gdb/ax-gdb.c | 2 | ||||
-rw-r--r-- | gdb/ax-general.c | 11 | ||||
-rw-r--r-- | gdb/ax.h | 3 |
4 files changed, 20 insertions, 3 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 7b78890..768de09 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,5 +1,12 @@ 2015-10-27 Simon Marchi <simon.marchi@polymtl.ca> + * ax.h (ax_raw_byte): New declaration. + * ax-general.c (ax_raw_byte): New function. + (ax_simple): Use ax_raw_byte. + * ax-gdb.c (gen_printf): Likewise. + +2015-10-27 Simon Marchi <simon.marchi@polymtl.ca> + * ada-lang.h (GROW_VECT): Add cast. 2015-10-26 Doug Evans <xdje42@gmail.com> diff --git a/gdb/ax-gdb.c b/gdb/ax-gdb.c index 817fa53..7091a4a 100644 --- a/gdb/ax-gdb.c +++ b/gdb/ax-gdb.c @@ -2564,7 +2564,7 @@ gen_printf (CORE_ADDR scope, struct gdbarch *gdbarch, /* Issue the printf bytecode proper. */ ax_simple (ax, aop_printf); - ax_simple (ax, nargs); + ax_raw_byte (ax, nargs); ax_string (ax, format, fmtlen); /* And terminate. */ diff --git a/gdb/ax-general.c b/gdb/ax-general.c index e5dc240..5c8a25b 100644 --- a/gdb/ax-general.c +++ b/gdb/ax-general.c @@ -133,13 +133,20 @@ read_const (struct agent_expr *x, int o, int n) return accum; } +/* See ax.h. */ + +void +ax_raw_byte (struct agent_expr *x, gdb_byte byte) +{ + grow_expr (x, 1); + x->buf[x->len++] = byte; +} /* Append a simple operator OP to EXPR. */ void ax_simple (struct agent_expr *x, enum agent_op op) { - grow_expr (x, 1); - x->buf[x->len++] = op; + ax_raw_byte (x, op); } /* Append a pick operator to EXPR. DEPTH is the stack item to pick, @@ -190,6 +190,9 @@ extern struct agent_expr *new_agent_expr (struct gdbarch *, CORE_ADDR); extern void free_agent_expr (struct agent_expr *); extern struct cleanup *make_cleanup_free_agent_expr (struct agent_expr *); +/* Append a raw byte to EXPR. */ +extern void ax_raw_byte (struct agent_expr *expr, gdb_byte byte); + /* Append a simple operator OP to EXPR. */ extern void ax_simple (struct agent_expr *EXPR, enum agent_op OP); |