diff options
author | Doug Evans <dje@google.com> | 2008-12-14 20:51:04 +0000 |
---|---|---|
committer | Doug Evans <dje@google.com> | 2008-12-14 20:51:04 +0000 |
commit | bca929d3a66489b6b2aff2a9a81bc17853dff79e (patch) | |
tree | 01fb0fc214848cab8a2629b58956f92238f7edf5 /gdb/gdbserver/server.h | |
parent | 023eb17ca2bc152be687b0b5676bdb6fda6cd9d1 (diff) | |
download | gdb-bca929d3a66489b6b2aff2a9a81bc17853dff79e.zip gdb-bca929d3a66489b6b2aff2a9a81bc17853dff79e.tar.gz gdb-bca929d3a66489b6b2aff2a9a81bc17853dff79e.tar.bz2 |
* utils.c (xmalloc,xcalloc,xstrdup): New fns.
* server.h (ATTR_MALLOC): New macro.
(xmalloc,xcalloc,xstrdup): Declare.
* hostio.c: Replace malloc,calloc,strdup with xmalloc,xcalloc,xstrdup.
* inferiors.c: Ditto.
* linux-low.c: Ditto.
* mem-break.c: Ditto.
* regcache.c: Ditto.
* remote-utils.c: Ditto.
* server.c: Ditto.
* target.c: Ditto.
* win32-low.c: Ditto.
Diffstat (limited to 'gdb/gdbserver/server.h')
-rw-r--r-- | gdb/gdbserver/server.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/gdb/gdbserver/server.h b/gdb/gdbserver/server.h index ca5530d..8c24c9d 100644 --- a/gdb/gdbserver/server.h +++ b/gdb/gdbserver/server.h @@ -70,6 +70,14 @@ extern void *memmem (const void *, size_t , const void *, size_t); #endif #endif +#ifndef ATTR_MALLOC +#if defined(__GNUC__) && (__GNUC__ >= 3) +#define ATTR_MALLOC __attribute__ ((__malloc__)) +#else +#define ATTR_MALLOC /* nothing */ +#endif +#endif + /* A type used for binary buffers. */ typedef unsigned char gdb_byte; @@ -265,6 +273,9 @@ char *target_signal_to_name (enum target_signal); /* Functions from utils.c */ +void *xmalloc (size_t) ATTR_MALLOC; +void *xcalloc (size_t, size_t) ATTR_MALLOC; +char *xstrdup (const char *) ATTR_MALLOC; void perror_with_name (char *string); void error (const char *string,...) ATTR_NORETURN ATTR_FORMAT (printf, 1, 2); void fatal (const char *string,...) ATTR_NORETURN ATTR_FORMAT (printf, 1, 2); |