Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Randolph Chung <randolph@tausq.org>
To: Daniel Jacobowitz <drow@false.org>
Cc: Jim Blandy <jimb@red-bean.com>,  gdb-patches@sources.redhat.com
Subject: Re: [RFA/RFC] Support DW_OP_breg for tracepoints
Date: Sat, 19 Nov 2005 19:41:00 -0000	[thread overview]
Message-ID: <437F2C4D.5060801@tausq.org> (raw)
In-Reply-To: <20051114022745.GA10422@nevyn.them.org>

[-- Attachment #1: Type: text/plain, Size: 195 bytes --]

> I assumed it was right by analogy to the existing frame base code. 
> Presumably I was just wrong the first time.  Please fix both places.

this is what i finally checked in.

thanks
randolph


[-- Attachment #2: d.diff --]
[-- Type: text/x-patch, Size: 1553 bytes --]

2005-11-19  Randolph Chung  <tausq@debian.org>

	* dwarf2loc.c (dwarf2_tracepoint_var_ref): Remove extra add for
	DW_OP_fbreg.  Handle DW_OP_breg0 through DW_OP_breg31.  Print 
	DWARF opcode for unsupported case.

Index: dwarf2loc.c
===================================================================
RCS file: /cvs/src/src/gdb/dwarf2loc.c,v
retrieving revision 1.31
diff -u -p -r1.31 dwarf2loc.c
--- dwarf2loc.c	14 Nov 2005 22:25:16 -0000	1.31
+++ dwarf2loc.c	19 Nov 2005 13:41:37 -0000
@@ -477,13 +477,30 @@ dwarf2_tracepoint_var_ref (struct symbol
       ax_const_l (ax, frame_offset);
       ax_simple (ax, aop_add);
 
-      ax_const_l (ax, frame_offset);
+      value->kind = axs_lvalue_memory;
+    }
+  else if (data[0] >= DW_OP_breg0
+	   && data[0] <= DW_OP_breg31)
+    {
+      unsigned int reg;
+      LONGEST offset;
+      gdb_byte *buf_end;
+
+      reg = data[0] - DW_OP_breg0;
+      buf_end = read_sleb128 (data + 1, data + size, &offset);
+      if (buf_end != data + size)
+	error (_("Unexpected opcode after DW_OP_breg%u for symbol \"%s\"."),
+	       reg, SYMBOL_PRINT_NAME (symbol));
+
+      ax_reg (ax, reg);
+      ax_const_l (ax, offset);
       ax_simple (ax, aop_add);
+
       value->kind = axs_lvalue_memory;
     }
   else
-    error (_("Unsupported DWARF opcode in the location of \"%s\"."),
-	   SYMBOL_PRINT_NAME (symbol));
+    error (_("Unsupported DWARF opcode 0x%x in the location of \"%s\"."),
+	   data[0], SYMBOL_PRINT_NAME (symbol));
 }
 \f
 /* Return the value of SYMBOL in FRAME using the DWARF-2 expression

      parent reply	other threads:[~2005-11-19 13:45 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-11-13 18:10 Randolph Chung
2005-11-13 18:11 ` Daniel Jacobowitz
2005-11-14  2:27 ` Jim Blandy
2005-11-14  3:41   ` Randolph Chung
2005-11-14  3:56     ` Daniel Jacobowitz
2005-11-14 15:57       ` Jim Blandy
2005-11-19 19:41       ` Randolph Chung [this message]

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=437F2C4D.5060801@tausq.org \
    --to=randolph@tausq.org \
    --cc=drow@false.org \
    --cc=gdb-patches@sources.redhat.com \
    --cc=jimb@red-bean.com \
    /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