* GDB build is broken, when HAVE_ZLIB_H is not defined.
@ 2008-04-21 22:16 Maxim Grigoriev
2008-04-21 22:38 ` Craig Silverstein
2008-04-22 1:35 ` Craig Silverstein
0 siblings, 2 replies; 4+ messages in thread
From: Maxim Grigoriev @ 2008-04-21 22:16 UTC (permalink / raw)
To: GDB Patches, csilvers
Hello, everybody,
Am I missing something here ?
My build is broken:
xtensa_dc232b-linux-uclibc-gcc -c -g -O2 -I.
-I/home/maxim/GDB/CVS/src/gdb -I/home/maxim/GDB/CVS/src/gdb/config
-DLOCALEDIR="\"/opt/local/maxim/LINUX_ROOT/maxim/native_gdb/share/locale\""
-DHAVE_CONFIG_H -I/home/maxim/GDB/CVS/src/gdb/../include/opcode
-I/home/maxim/GDB/CVS/src/gdb/../readline/.. -I../bfd
-I/home/maxim/GDB/CVS/src/gdb/../bfd
-I/home/maxim/GDB/CVS/src/gdb/../include -I../libdecnumber
-I/home/maxim/GDB/CVS/src/gdb/../libdecnumber -I./../intl
-I/home/maxim/GDB/CVS/src/gdb/gnulib -Ignulib -DMI_OUT=1 -Wall
-Wdeclaration-after-statement -Wpointer-arith -Wformat-nonliteral
-Wno-pointer-sign -Wno-unused -Wno-switch -Wno-char-subscripts -Werror
/home/maxim/GDB/CVS/src/gdb/dwarf2read.c
/home/maxim/GDB/CVS/src/gdb/dwarf2read.c: In function
'zlib_decompress_section':
/home/maxim/GDB/CVS/src/gdb/dwarf2read.c:5301: error: 'abfd' undeclared
(first use in this function)
/home/maxim/GDB/CVS/src/gdb/dwarf2read.c:5301: error: (Each undeclared
identifier is reported only once
/home/maxim/GDB/CVS/src/gdb/dwarf2read.c:5301: error: for each function
it appears in.)
make[2]: *** [dwarf2read.o] Error 1
* * * * *
in dwarf2read.c, should not it look like this :
static void
zlib_decompress_section (struct objfile *objfile, asection *sectp,
gdb_byte **outbuf, bfd_size_type *outsize)
{
bfd *abfd = objfile->obfd;
#ifndef HAVE_ZLIB_H
error (_("Support for zlib-compressed DWARF data (from '%s') "
"is disabled in this copy of GDB"),
bfd_get_filename (abfd));
#else
bfd_size_type compressed_size = bfd_get_section_size (sectp);
. . . .
-- Maxim
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: GDB build is broken, when HAVE_ZLIB_H is not defined.
2008-04-21 22:16 GDB build is broken, when HAVE_ZLIB_H is not defined Maxim Grigoriev
@ 2008-04-21 22:38 ` Craig Silverstein
2008-04-22 3:24 ` Daniel Jacobowitz
2008-04-22 1:35 ` Craig Silverstein
1 sibling, 1 reply; 4+ messages in thread
From: Craig Silverstein @ 2008-04-21 22:38 UTC (permalink / raw)
To: maxim; +Cc: gdb-patches
} in dwarf2read.c, should not it look like this :
Never mind the approval; I ended up submitting this patch (as
suggested) under the Obvious Fix Rule. GDB folks, please let me know
if I did wrong.
craig
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: GDB build is broken, when HAVE_ZLIB_H is not defined.
2008-04-21 22:16 GDB build is broken, when HAVE_ZLIB_H is not defined Maxim Grigoriev
2008-04-21 22:38 ` Craig Silverstein
@ 2008-04-22 1:35 ` Craig Silverstein
1 sibling, 0 replies; 4+ messages in thread
From: Craig Silverstein @ 2008-04-22 1:35 UTC (permalink / raw)
To: maxim; +Cc: gdb-patches
} Am I missing something here ?
No, you're absolutely right. I tested the no-zlib case, but then
refactored the code after that, and must have neglected to test the
no-zlib case again. I'm sorry for the trouble. :-( I've attached the
suggested patch to fix it, below. gdb-patches folks, look ok?
craig
--cut here--
* dwarf2read.c (zlib_decompress_section): Define abfd in the
!HAVE_ZLIB_H case.
Index: dwarf2read.c
===================================================================
RCS file: /cvs/src/src/gdb/dwarf2read.c,v
retrieving revision 1.255
diff -u -r1.255 dwarf2read.c
--- dwarf2read.c 19 Apr 2008 05:06:54 -0000 1.255
+++ dwarf2read.c 21 Apr 2008 21:49:53 -0000
@@ -5295,12 +5295,12 @@
zlib_decompress_section (struct objfile *objfile, asection *sectp,
gdb_byte **outbuf, bfd_size_type *outsize)
{
+ bfd *abfd = objfile->obfd;
#ifndef HAVE_ZLIB_H
error (_("Support for zlib-compressed DWARF data (from '%s') "
"is disabled in this copy of GDB"),
bfd_get_filename (abfd));
#else
- bfd *abfd = objfile->obfd;
bfd_size_type compressed_size = bfd_get_section_size (sectp);
gdb_byte *compressed_buffer = xmalloc (compressed_size);
bfd_size_type uncompressed_size;
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: GDB build is broken, when HAVE_ZLIB_H is not defined.
2008-04-21 22:38 ` Craig Silverstein
@ 2008-04-22 3:24 ` Daniel Jacobowitz
0 siblings, 0 replies; 4+ messages in thread
From: Daniel Jacobowitz @ 2008-04-22 3:24 UTC (permalink / raw)
To: Craig Silverstein; +Cc: maxim, gdb-patches
On Mon, Apr 21, 2008 at 03:02:05PM -0700, Craig Silverstein wrote:
> } in dwarf2read.c, should not it look like this :
>
> Never mind the approval; I ended up submitting this patch (as
> suggested) under the Obvious Fix Rule. GDB folks, please let me know
> if I did wrong.
You did right. Thanks for the quick fix.
--
Daniel Jacobowitz
CodeSourcery
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2008-04-21 22:36 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-04-21 22:16 GDB build is broken, when HAVE_ZLIB_H is not defined Maxim Grigoriev
2008-04-21 22:38 ` Craig Silverstein
2008-04-22 3:24 ` Daniel Jacobowitz
2008-04-22 1:35 ` Craig Silverstein
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox