Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Hui Zhu <teawater@gmail.com>
To: gdb-patches ml <gdb-patches@sourceware.org>
Subject: [OB] dwarf2loc.c: fix read_sleb128 use ULONGEST
Date: Fri, 04 Jun 2010 02:44:00 -0000	[thread overview]
Message-ID: <AANLkTinTrNP06VoDCEtNtT8UFSUdAGlGnsay_ziavXNz@mail.gmail.com> (raw)

Hi,

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.

Thanks,
Hui

2010-06-04  Hui Zhu  <teawater@gmail.com>

	* 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));
 	  break;
 	case DW_OP_consts:
-	  data = read_sleb128 (data, end, &ul);
+	  data = read_sleb128 (data, end, &l);
 	  fprintf_filtered (stream, " %s", plongest (l));
 	  break;


             reply	other threads:[~2010-06-04  2:44 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-06-04  2:44 Hui Zhu [this message]
2010-06-04 17:34 ` Tom Tromey
2010-06-07  4:52   ` Hui Zhu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=AANLkTinTrNP06VoDCEtNtT8UFSUdAGlGnsay_ziavXNz@mail.gmail.com \
    --to=teawater@gmail.com \
    --cc=gdb-patches@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox