diff options
author | Yao Qi <yao@codesourcery.com> | 2014-12-15 21:40:29 +0800 |
---|---|---|
committer | Yao Qi <yao@codesourcery.com> | 2014-12-16 13:13:17 +0800 |
commit | 2a54636794b71f8248dff12cd7608829ee068571 (patch) | |
tree | 208a114165743fc13f289eb153c33a0b2e961934 | |
parent | 395cf596db32c02f34fa211cf49c3e9231d7c277 (diff) | |
download | gdb-2a54636794b71f8248dff12cd7608829ee068571.zip gdb-2a54636794b71f8248dff12cd7608829ee068571.tar.gz gdb-2a54636794b71f8248dff12cd7608829ee068571.tar.bz2 |
Replace ARG_MAX with ARG_LAST
We define an enum ARG_MAX in linux_infcall_mmap, but it is conflict
with macro ARG_MAX which is defined in /usr/include/linux/limits.h.
This causes a build failure below,
gdb/linux-tdep.c: In function 'linux_infcall_mmap':
gdb/linux-tdep.c:1945:70: error: expected identifier before numeric constant
the enum in the pre-processed source becomes:
enum
{
ARG_ADDR, ARG_LENGTH, ARG_PROT, ARG_FLAGS, ARG_FD, ARG_OFFSET, 131072
};
This patch is to replace ARG_MAX with ARG_LAST.
gdb:
2014-12-16 Yao Qi <yao@codesourcery.com>
* linux-tdep.c (linux_infcall_mmap): Replace ARG_MAX with
ARG_LAST.
-rw-r--r-- | gdb/ChangeLog | 5 | ||||
-rw-r--r-- | gdb/linux-tdep.c | 6 |
2 files changed, 8 insertions, 3 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index b92cfa2..95669d3 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,8 @@ +2014-12-16 Yao Qi <yao@codesourcery.com> + + * linux-tdep.c (linux_infcall_mmap): Replace ARG_MAX with + ARG_LAST. + 2014-12-15 Simon Marchi <simon.marchi@ericsson.com> * inferior.c (find_inferior_ptid): New function. diff --git a/gdb/linux-tdep.c b/gdb/linux-tdep.c index 485f5ca..6b5e475 100644 --- a/gdb/linux-tdep.c +++ b/gdb/linux-tdep.c @@ -1942,9 +1942,9 @@ linux_infcall_mmap (CORE_ADDR size, unsigned prot) CORE_ADDR retval; enum { - ARG_ADDR, ARG_LENGTH, ARG_PROT, ARG_FLAGS, ARG_FD, ARG_OFFSET, ARG_MAX + ARG_ADDR, ARG_LENGTH, ARG_PROT, ARG_FLAGS, ARG_FD, ARG_OFFSET, ARG_LAST }; - struct value *arg[ARG_MAX]; + struct value *arg[ARG_LAST]; arg[ARG_ADDR] = value_from_pointer (builtin_type (gdbarch)->builtin_data_ptr, 0); @@ -1961,7 +1961,7 @@ linux_infcall_mmap (CORE_ADDR size, unsigned prot) arg[ARG_FD] = value_from_longest (builtin_type (gdbarch)->builtin_int, -1); arg[ARG_OFFSET] = value_from_longest (builtin_type (gdbarch)->builtin_int64, 0); - addr_val = call_function_by_hand (mmap_val, ARG_MAX, arg); + addr_val = call_function_by_hand (mmap_val, ARG_LAST, arg); retval = value_as_address (addr_val); if (retval == (CORE_ADDR) -1) error (_("Failed inferior mmap call for %s bytes, errno is changed."), |