This is the mail archive of the mailing list for the GDB project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[OB] dwarf2loc.c: fix read_sleb128 use ULONGEST


Got some error with this file:

gcc -g -O2   -I. -I../../src/gdb -I../../src/gdb/common
-I../../src/gdb/config -DLOCALEDIR="\"/usr/local/share/locale\""
-DHAVE_CONFIG_H -I../../src/gdb/../include/opcode
-I../../src/gdb/../opcodes/.. -I../../src/gdb/../readline/.. -I../bfd
-I../../src/gdb/../bfd -I../../src/gdb/../include -I../libdecnumber
-I../../src/gdb/../libdecnumber  -I../../src/gdb/gnulib -Ignulib
-DMI_OUT=1 -DTUI=1  -DGDBTK -I/usr/include -I/usr/include  -Wall
-Wdeclaration-after-statement -Wpointer-arith -Wformat-nonliteral
-Wno-pointer-sign -Wno-unused -Wunused-value -Wunused-function
-Wno-switch -Wno-char-subscripts -Werror -c -o dwarf2loc.o -MT
dwarf2loc.o -MMD -MP -MF .deps/dwarf2loc.Tpo ../../src/gdb/dwarf2loc.c
cc1: warnings being treated as errors
../../src/gdb/dwarf2loc.c: In function 'locexpr_describe_location_1':
../../src/gdb/dwarf2loc.c:1476: warning: 'l' may be used uninitialized
in this function
../../src/gdb/dwarf2loc.c:1476: note: 'l' was declared here
make[2]: *** [dwarf2loc.o] Error 1

This because:
data = read_sleb128 (data, end, &ul);           //use ul
fprintf_filtered (stream, " %s", plongest (l)); //use l

read_sleb128 (const gdb_byte *buf, const gdb_byte *buf_end, LONGEST * r)

So change first line to l.


2010-06-04  Hui Zhu  <>

	* dwarf2loc.c (disassemble_dwarf_expression): Change ul to l.

RCS file: /cvs/src/src/gdb/dwarf2loc.c,v
retrieving revision 1.85
retrieving revision 1.86
diff -u -r1.85 -r1.86
--- src/gdb/dwarf2loc.c	2010/06/02 19:37:55	1.85
+++ src/gdb/dwarf2loc.c	2010/06/04 02:39:16	1.86
@@ -1536,7 +1536,7 @@
 	  fprintf_filtered (stream, " %s", pulongest (ul));
 	case DW_OP_consts:
-	  data = read_sleb128 (data, end, &ul);
+	  data = read_sleb128 (data, end, &l);
 	  fprintf_filtered (stream, " %s", plongest (l));

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]