Rename struct lzma_stream to avoid clash with system header
/home/pedro/gdb/mygit/src/gdb/minidebug.c: At global scope: /home/pedro/gdb/mygit/src/gdb/minidebug.c:55:8: error: using typedef-name ‘lzma_stream’ after ‘struct’ struct lzma_stream ^ In file included from /usr/include/lzma.h:281:0, from /home/pedro/gdb/mygit/src/gdb/minidebug.c:28: /usr/include/lzma/base.h:498:3: note: ‘lzma_stream’ has a previous declaration here } lzma_stream; ^ gdb/ChangeLog: 2015-02-27 Tom Tromey <tromey@redhat.com> * minidebug.c (struct lzma_stream): Rename to ... (struct gdb_lzma_stream): ... this. (lzma_open, lzma_pread, lzma_close, lzma_stat): Adjust.
This commit is contained in:
parent
10367c7c94
commit
1424c16eab
2 changed files with 17 additions and 11 deletions
|
@ -1,3 +1,9 @@
|
||||||
|
2015-02-27 Tom Tromey <tromey@redhat.com>
|
||||||
|
|
||||||
|
* minidebug.c (struct lzma_stream): Rename to ...
|
||||||
|
(struct gdb_lzma_stream): ... this.
|
||||||
|
(lzma_open, lzma_pread, lzma_close, lzma_stat): Adjust.
|
||||||
|
|
||||||
2015-02-27 Pedro Alves <palves@redhat.com>
|
2015-02-27 Pedro Alves <palves@redhat.com>
|
||||||
|
|
||||||
* mi/mi-cmd-stack.c (mi_apply_ext_lang_frame_filter): New
|
* mi/mi-cmd-stack.c (mi_apply_ext_lang_frame_filter): New
|
||||||
|
|
|
@ -52,7 +52,7 @@ static lzma_allocator gdb_lzma_allocator = { alloc_lzma, free_lzma, NULL };
|
||||||
a section. This keeps only the last decompressed block in memory
|
a section. This keeps only the last decompressed block in memory
|
||||||
to allow larger data without using to much memory. */
|
to allow larger data without using to much memory. */
|
||||||
|
|
||||||
struct lzma_stream
|
struct gdb_lzma_stream
|
||||||
{
|
{
|
||||||
/* Section of input BFD from which we are decoding data. */
|
/* Section of input BFD from which we are decoding data. */
|
||||||
asection *section;
|
asection *section;
|
||||||
|
@ -70,8 +70,8 @@ struct lzma_stream
|
||||||
find_separate_debug_file_in_section. OPEN_CLOSURE is 'asection *'
|
find_separate_debug_file_in_section. OPEN_CLOSURE is 'asection *'
|
||||||
of the section to decompress.
|
of the section to decompress.
|
||||||
|
|
||||||
Return 'struct lzma_stream *' must be freed by caller by xfree, together
|
Return 'struct gdb_lzma_stream *' must be freed by caller by xfree,
|
||||||
with its INDEX lzma data. */
|
together with its INDEX lzma data. */
|
||||||
|
|
||||||
static void *
|
static void *
|
||||||
lzma_open (struct bfd *nbfd, void *open_closure)
|
lzma_open (struct bfd *nbfd, void *open_closure)
|
||||||
|
@ -84,7 +84,7 @@ lzma_open (struct bfd *nbfd, void *open_closure)
|
||||||
lzma_index *index;
|
lzma_index *index;
|
||||||
int ret;
|
int ret;
|
||||||
uint64_t memlimit = UINT64_MAX;
|
uint64_t memlimit = UINT64_MAX;
|
||||||
struct lzma_stream *lstream;
|
struct gdb_lzma_stream *lstream;
|
||||||
size_t pos;
|
size_t pos;
|
||||||
|
|
||||||
size = bfd_get_section_size (section);
|
size = bfd_get_section_size (section);
|
||||||
|
@ -118,7 +118,7 @@ lzma_open (struct bfd *nbfd, void *open_closure)
|
||||||
}
|
}
|
||||||
xfree (indexdata);
|
xfree (indexdata);
|
||||||
|
|
||||||
lstream = xzalloc (sizeof (struct lzma_stream));
|
lstream = xzalloc (sizeof (struct gdb_lzma_stream));
|
||||||
lstream->section = section;
|
lstream->section = section;
|
||||||
lstream->index = index;
|
lstream->index = index;
|
||||||
|
|
||||||
|
@ -127,13 +127,13 @@ lzma_open (struct bfd *nbfd, void *open_closure)
|
||||||
|
|
||||||
/* bfd_openr_iovec PREAD_P implementation for
|
/* bfd_openr_iovec PREAD_P implementation for
|
||||||
find_separate_debug_file_in_section. Passed STREAM
|
find_separate_debug_file_in_section. Passed STREAM
|
||||||
is 'struct lzma_stream *'. */
|
is 'struct gdb_lzma_stream *'. */
|
||||||
|
|
||||||
static file_ptr
|
static file_ptr
|
||||||
lzma_pread (struct bfd *nbfd, void *stream, void *buf, file_ptr nbytes,
|
lzma_pread (struct bfd *nbfd, void *stream, void *buf, file_ptr nbytes,
|
||||||
file_ptr offset)
|
file_ptr offset)
|
||||||
{
|
{
|
||||||
struct lzma_stream *lstream = stream;
|
struct gdb_lzma_stream *lstream = stream;
|
||||||
bfd_size_type chunk_size;
|
bfd_size_type chunk_size;
|
||||||
lzma_index_iter iter;
|
lzma_index_iter iter;
|
||||||
gdb_byte *compressed, *uncompressed;
|
gdb_byte *compressed, *uncompressed;
|
||||||
|
@ -214,13 +214,13 @@ lzma_pread (struct bfd *nbfd, void *stream, void *buf, file_ptr nbytes,
|
||||||
|
|
||||||
/* bfd_openr_iovec CLOSE_P implementation for
|
/* bfd_openr_iovec CLOSE_P implementation for
|
||||||
find_separate_debug_file_in_section. Passed STREAM
|
find_separate_debug_file_in_section. Passed STREAM
|
||||||
is 'struct lzma_stream *'. */
|
is 'struct gdb_lzma_stream *'. */
|
||||||
|
|
||||||
static int
|
static int
|
||||||
lzma_close (struct bfd *nbfd,
|
lzma_close (struct bfd *nbfd,
|
||||||
void *stream)
|
void *stream)
|
||||||
{
|
{
|
||||||
struct lzma_stream *lstream = stream;
|
struct gdb_lzma_stream *lstream = stream;
|
||||||
|
|
||||||
lzma_index_end (lstream->index, &gdb_lzma_allocator);
|
lzma_index_end (lstream->index, &gdb_lzma_allocator);
|
||||||
xfree (lstream->data);
|
xfree (lstream->data);
|
||||||
|
@ -232,14 +232,14 @@ lzma_close (struct bfd *nbfd,
|
||||||
|
|
||||||
/* bfd_openr_iovec STAT_P implementation for
|
/* bfd_openr_iovec STAT_P implementation for
|
||||||
find_separate_debug_file_in_section. Passed STREAM
|
find_separate_debug_file_in_section. Passed STREAM
|
||||||
is 'struct lzma_stream *'. */
|
is 'struct gdb_lzma_stream *'. */
|
||||||
|
|
||||||
static int
|
static int
|
||||||
lzma_stat (struct bfd *abfd,
|
lzma_stat (struct bfd *abfd,
|
||||||
void *stream,
|
void *stream,
|
||||||
struct stat *sb)
|
struct stat *sb)
|
||||||
{
|
{
|
||||||
struct lzma_stream *lstream = stream;
|
struct gdb_lzma_stream *lstream = stream;
|
||||||
|
|
||||||
sb->st_size = lzma_index_uncompressed_size (lstream->index);
|
sb->st_size = lzma_index_uncompressed_size (lstream->index);
|
||||||
return 0;
|
return 0;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue