public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* [patch] Fix `info addr' for complex DWARF
@ 2011-01-25 17:26 Jan Kratochvil
  2011-02-25 10:26 ` Jan Kratochvil
  0 siblings, 1 reply; 2+ messages in thread
From: Jan Kratochvil @ 2011-01-25 17:26 UTC (permalink / raw)
  To: gdb-patches

Hi,

readelf says:
    <68>   DW_AT_name        : _s
    <70>   DW_AT_location    : 2 byte block: 91 4c      (DW_OP_fbreg: -52)

GDB HEAD says:
(gdb) info addr _s
Symbol "_s" is a complex DWARF expression:
     1: DW_OP_fbreg 18446744073709551564
.

patched GDB HEAD sasys:
->
Symbol "_s" is a complex DWARF expression:
     1: DW_OP_fbreg -52
.

No regressions on {x86_64,x86_64-m32,i686}-fedora14-linux-gnu.

I made only a brief overlook and fixed those sleb128 I found.  I will check it
in in some time.


Thanks,
Jan


gdb/
2011-01-25  Jan Kratochvil  <jan.kratochvil@redhat.com>

	* dwarf2loc.c (disassemble_dwarf_expression) <DW_OP_breg[0-9]+>: Use
	L and plongest.
	(disassemble_dwarf_expression) <DW_OP_bregx>: Drop variable offset,
	use L and plongest.
	(disassemble_dwarf_expression) <DW_OP_fbreg>: Use L and plongest.

--- a/gdb/dwarf2loc.c
+++ b/gdb/dwarf2loc.c
@@ -2440,27 +2440,23 @@ disassemble_dwarf_expression (struct ui_file *stream,
 	case DW_OP_breg29:
 	case DW_OP_breg30:
 	case DW_OP_breg31:
-	  data = read_sleb128 (data, end, &ul);
-	  fprintf_filtered (stream, " %s [$%s]", pulongest (ul),
+	  data = read_sleb128 (data, end, &l);
+	  fprintf_filtered (stream, " %s [$%s]", plongest (l),
 			    gdbarch_register_name (arch, op - DW_OP_breg0));
 	  break;
 
 	case DW_OP_bregx:
-	  {
-	    ULONGEST offset;
-
-	    data = read_uleb128 (data, end, &ul);
-	    data = read_sleb128 (data, end, &offset);
-	    fprintf_filtered (stream, " register %s [$%s] offset %s",
-			      pulongest (ul),
-			      gdbarch_register_name (arch, (int) ul),
-			      pulongest (offset));
-	  }
+	  data = read_uleb128 (data, end, &ul);
+	  data = read_sleb128 (data, end, &l);
+	  fprintf_filtered (stream, " register %s [$%s] offset %s",
+			    pulongest (ul),
+			    gdbarch_register_name (arch, (int) ul),
+			    plongest (l));
 	  break;
 
 	case DW_OP_fbreg:
-	  data = read_sleb128 (data, end, &ul);
-	  fprintf_filtered (stream, " %s", pulongest (ul));
+	  data = read_sleb128 (data, end, &l);
+	  fprintf_filtered (stream, " %s", plongest (l));
 	  break;
 
 	case DW_OP_xderef_size:

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [patch] Fix `info addr' for complex DWARF
  2011-01-25 17:26 [patch] Fix `info addr' for complex DWARF Jan Kratochvil
@ 2011-02-25 10:26 ` Jan Kratochvil
  0 siblings, 0 replies; 2+ messages in thread
From: Jan Kratochvil @ 2011-02-25 10:26 UTC (permalink / raw)
  To: gdb-patches

On Tue, 25 Jan 2011 18:06:02 +0100, Jan Kratochvil wrote:
> gdb/
> 2011-01-25  Jan Kratochvil  <jan.kratochvil@redhat.com>
> 
> 	* dwarf2loc.c (disassemble_dwarf_expression) <DW_OP_breg[0-9]+>: Use
> 	L and plongest.
> 	(disassemble_dwarf_expression) <DW_OP_bregx>: Drop variable offset,
> 	use L and plongest.
> 	(disassemble_dwarf_expression) <DW_OP_fbreg>: Use L and plongest.

Checked in:
	http://sourceware.org/ml/gdb-cvs/2011-02/msg00191.html


Thanks,
Jan

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2011-02-25  8:36 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-01-25 17:26 [patch] Fix `info addr' for complex DWARF Jan Kratochvil
2011-02-25 10:26 ` Jan Kratochvil

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).