public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Jan Kratochvil <jan.kratochvil@redhat.com>
To: gdb-patches@sourceware.org
Subject: [PATCH v4 10/14] make dwarf_expr_frame_base_1 public
Date: Sun, 23 Nov 2014 19:28:00 -0000	[thread overview]
Message-ID: <20141123192832.32193.5561.stgit@host1.jankratochvil.net> (raw)
In-Reply-To: <20141123192713.32193.57150.stgit@host1.jankratochvil.net>

From: Tom Tromey <tromey@redhat.com>

This exports dwarf_expr_frame_base_1 so that other code can use it.

2014-10-07  Tom Tromey  <tromey@redhat.com>
	    Jan Kratochvil  <jan.kratochvil@redhat.com>

	* dwarf2loc.c (dwarf_expr_frame_base_1): Remove declaration.
	(dwarf_expr_frame_base): Update caller.
	(dwarf_expr_frame_base_1): Rename to ...
	(func_get_frame_base_dwarf_block): ... this and make it public.
	(dwarf2_compile_expr_to_ax, locexpr_describe_location_piece): Update
	callers.
	* dwarf2loc.h (func_get_frame_base_dwarf_block): New declaration.
---
 gdb/ChangeLog   |   11 +++++++++++
 gdb/dwarf2loc.c |   23 +++++++++++------------
 gdb/dwarf2loc.h |   12 ++++++++++++
 3 files changed, 34 insertions(+), 12 deletions(-)

diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 922d8c9..bf9daed 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,4 +1,15 @@
 2014-10-07  Tom Tromey  <tromey@redhat.com>
+	    Jan Kratochvil  <jan.kratochvil@redhat.com>
+
+	* dwarf2loc.c (dwarf_expr_frame_base_1): Remove declaration.
+	(dwarf_expr_frame_base): Update caller.
+	(dwarf_expr_frame_base_1): Rename to ...
+	(func_get_frame_base_dwarf_block): ... this and make it public.
+	(dwarf2_compile_expr_to_ax, locexpr_describe_location_piece): Update
+	callers.
+	* dwarf2loc.h (func_get_frame_base_dwarf_block): New declaration.
+
+2014-10-07  Tom Tromey  <tromey@redhat.com>
 
 	* dwarf2loc.c (dwarf2_compile_expr_to_ax) <DW_OP_call_frame_cfa>:
 	Update.
diff --git a/gdb/dwarf2loc.c b/gdb/dwarf2loc.c
index ffae7a5..50c2f24 100644
--- a/gdb/dwarf2loc.c
+++ b/gdb/dwarf2loc.c
@@ -40,9 +40,6 @@
 
 extern int dwarf2_always_disassemble;
 
-static void dwarf_expr_frame_base_1 (struct symbol *framefunc, CORE_ADDR pc,
-				     const gdb_byte **start, size_t *length);
-
 static const struct dwarf_expr_context_funcs dwarf_expr_ctx_funcs;
 
 static struct value *dwarf2_evaluate_loc_desc_full (struct type *type,
@@ -365,9 +362,9 @@ dwarf_expr_frame_base (void *baton, const gdb_byte **start, size_t * length)
      something has gone wrong.  */
   gdb_assert (framefunc != NULL);
 
-  dwarf_expr_frame_base_1 (framefunc,
-			   get_frame_address_in_block (debaton->frame),
-			   start, length);
+  func_get_frame_base_dwarf_block (framefunc,
+				   get_frame_address_in_block (debaton->frame),
+				   start, length);
 }
 
 /* Implement find_frame_base_location method for LOC_BLOCK functions using
@@ -411,9 +408,11 @@ const struct symbol_block_ops dwarf2_block_frame_base_loclist_funcs =
   loclist_find_frame_base_location
 };
 
-static void
-dwarf_expr_frame_base_1 (struct symbol *framefunc, CORE_ADDR pc,
-			 const gdb_byte **start, size_t *length)
+/* See dwarf2loc.h.  */
+
+void
+func_get_frame_base_dwarf_block (struct symbol *framefunc, CORE_ADDR pc,
+				 const gdb_byte **start, size_t *length)
 {
   if (SYMBOL_BLOCK_OPS (framefunc) != NULL)
     {
@@ -3074,8 +3073,8 @@ dwarf2_compile_expr_to_ax (struct agent_expr *expr, struct axs_value *loc,
 	    if (!framefunc)
 	      error (_("No function found for block"));
 
-	    dwarf_expr_frame_base_1 (framefunc, expr->scope,
-				     &datastart, &datalen);
+	    func_get_frame_base_dwarf_block (framefunc, expr->scope,
+					     &datastart, &datalen);
 
 	    op_ptr = safe_read_sleb128 (op_ptr, op_end, &offset);
 	    dwarf2_compile_expr_to_ax (expr, loc, arch, addr_size, datastart,
@@ -3571,7 +3570,7 @@ locexpr_describe_location_piece (struct symbol *symbol, struct ui_file *stream,
 	error (_("No function found for block for symbol \"%s\"."),
 	       SYMBOL_PRINT_NAME (symbol));
 
-      dwarf_expr_frame_base_1 (framefunc, addr, &base_data, &base_size);
+      func_get_frame_base_dwarf_block (framefunc, addr, &base_data, &base_size);
 
       if (base_data[0] >= DW_OP_breg0 && base_data[0] <= DW_OP_breg31)
 	{
diff --git a/gdb/dwarf2loc.h b/gdb/dwarf2loc.h
index 96925e4..082ccfa 100644
--- a/gdb/dwarf2loc.h
+++ b/gdb/dwarf2loc.h
@@ -80,6 +80,18 @@ extern const gdb_byte *dwarf2_fetch_constant_bytes (sect_offset,
 struct type *dwarf2_get_die_type (cu_offset die_offset,
 				  struct dwarf2_per_cu_data *per_cu);
 
+/* Find the frame base information for FRAMEFUNC at PC.  START is an
+   out parameter which is set to point to the DWARF expression to
+   compute.  LENGTH is an out parameter which is set to the length of
+   the DWARF expression.  This throws an exception on error or if an
+   expression is not found; the returned length will never be
+   zero.  */
+
+extern void func_get_frame_base_dwarf_block (struct symbol *framefunc,
+					     CORE_ADDR pc,
+					     const gdb_byte **start,
+					     size_t *length);
+
 /* Evaluate a location description, starting at DATA and with length
    SIZE, to find the current location of variable of TYPE in the context
    of FRAME.  */

  parent reply	other threads:[~2014-11-23 19:28 UTC|newest]

Thread overview: 93+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-11-23 19:27 [PATCH v4 00/14] let gdb reuse gcc's C compiler Jan Kratochvil
2014-11-23 19:27 ` [PATCH v4 04/14] add make_unqualified_type Jan Kratochvil
2014-11-23 19:27 ` [PATCH v4 01/14] introduce ui_file_write_for_put Jan Kratochvil
2014-11-23 19:27 ` [PATCH v4 03/14] add some missing ops to DWARF assembler Jan Kratochvil
2014-11-23 19:27 ` [PATCH v4 02/14] add gcc/gdb interface files Jan Kratochvil
2014-11-23 19:28 ` [PATCH v4 07/14] add gnu_triplet_regexp gdbarch method Jan Kratochvil
2014-11-23 19:28 ` Jan Kratochvil [this message]
2014-11-23 19:28 ` [PATCH v4 08/14] introduce call_function_by_hand_dummy Jan Kratochvil
2014-11-23 19:28 ` [PATCH v4 05/14] add dummy frame destructor Jan Kratochvil
2014-11-23 19:28 ` [PATCH v4 12/14] add linux_infcall_mmap Jan Kratochvil
2014-12-15 12:41   ` Ulrich Weigand
2014-12-15 13:49     ` Yao Qi
2014-12-15 16:48       ` Jan Kratochvil
2014-12-16  5:27         ` Yao Qi
2014-11-23 19:28 ` [PATCH v4 11/14] export dwarf2_reg_to_regnum_or_error Jan Kratochvil
2014-11-23 19:28 ` [PATCH v4 13/14] add s390_gcc_target_options Jan Kratochvil
2014-11-23 19:28 ` [PATCH v4 06/14] add infcall_mmap and gcc_target_options gdbarch methods Jan Kratochvil
2014-11-23 19:28 ` [PATCH v4 09/14] split dwarf2_fetch_cfa_info from dwarf2_compile_expr_to_ax Jan Kratochvil
2014-11-23 19:29 ` [PATCH v4 14/14] the "compile" command Jan Kratochvil
2014-12-14  6:05   ` Yao Qi
2014-12-14  7:53     ` Jan Kratochvil
2014-12-14  8:54       ` Yao Qi
2014-12-14 18:24         ` [mingw rfc] Add mkdtemp to gdb/gnulib/ [Re: [PATCH v4 14/14] the "compile" command] Jan Kratochvil
2014-12-15  3:16           ` Yao Qi
2014-12-15 12:44             ` Joel Brobecker
2014-12-15 13:11               ` Kai Tietz
2014-12-15 13:24               ` Yao Qi
2014-12-15 17:12               ` Jan Kratochvil
2014-12-15 17:48                 ` Eli Zaretskii
2014-12-15 18:14                 ` Joel Brobecker
2014-12-15 18:21                   ` Jan Kratochvil
2014-12-15 18:35                     ` Joel Brobecker
2014-12-15 18:40                       ` Jan Kratochvil
2014-12-15 18:57                         ` Eli Zaretskii
2014-12-15 22:28                           ` [patch] compile: Fix MinGW build [Re: [mingw rfc] Add mkdtemp to gdb/gnulib/] Jan Kratochvil
2014-12-15 22:56                             ` Jan Kratochvil
2014-12-16  3:40                               ` Eli Zaretskii
2014-12-16  9:04                                 ` Kai Tietz
2014-12-17 21:02                                   ` [patch] compile: rm -rf -> ftw()+rmdir()+unlink() [Re: [patch] compile: Fix MinGW build] Jan Kratochvil
2014-12-17 22:07                                     ` Steve Ellcey
2014-12-17 22:42                                     ` Pedro Alves
2014-12-18 18:14                                       ` Jan Kratochvil
2014-12-18 18:24                                         ` Pedro Alves
2014-12-18 18:41                                           ` Jan Kratochvil
2014-12-18 19:07                                             ` Pedro Alves
2014-12-18 21:05                                               ` Jan Kratochvil
2014-12-18 21:11                                                 ` Eli Zaretskii
2014-12-18 21:24                                                   ` Jan Kratochvil
2014-12-18 22:18                                                     ` Sergio Durigan Junior
2014-12-18 23:06                                                     ` Pedro Alves
2014-12-19  0:12                                                       ` Jan Kratochvil
2014-12-19 10:48                                                         ` Pedro Alves
2014-12-19  8:24                                                     ` Eli Zaretskii
2014-12-19 12:59                                             ` Joel Brobecker
2014-12-18 20:26                                         ` Eli Zaretskii
2014-12-18  5:38                                     ` Yao Qi
2014-12-18 17:23                                     ` Eli Zaretskii
2014-12-18 17:31                                       ` Jan Kratochvil
2014-12-18 17:40                                         ` Eli Zaretskii
2014-12-18 20:15                                           ` Kai Tietz
2014-12-18 20:47                                             ` Eli Zaretskii
2014-12-18 20:55                                               ` Kai Tietz
2014-12-18 23:47                                             ` Pedro Alves
2014-12-19  9:28                                               ` Kai Tietz
2014-12-19 19:25                                               ` Jan Kratochvil
2014-12-19 20:55                                                 ` Jan Kratochvil
2014-12-20 12:26                                                 ` Joel Brobecker
2014-12-18 20:56                                     ` Sergio Durigan Junior
2014-12-17 17:30                                 ` [patch] compile: Fix MinGW build [Re: [mingw rfc] Add mkdtemp to gdb/gnulib/] Steve Ellcey
2014-12-16  3:37                             ` Eli Zaretskii
2014-12-16  9:06                               ` Kai Tietz
2014-12-17 19:18                               ` Jan Kratochvil
2014-12-17 19:31                                 ` Eli Zaretskii
2014-12-17 19:37                                   ` Jan Kratochvil
2014-12-17 20:34                                   ` Pedro Alves
2014-12-18 17:22                                     ` Eli Zaretskii
2014-12-18 18:00                                       ` Pedro Alves
2014-12-16 12:40                             ` Pierre Muller
2014-12-17 18:21                               ` Jan Kratochvil
2014-12-17  1:22                             ` Yao Qi
2014-12-17 10:57                               ` Pedro Alves
2014-12-17 11:40                                 ` Yao Qi
2014-12-17 11:43                                   ` Pedro Alves
2014-12-17 11:56                                     ` Yao Qi
2014-12-17 19:15                                     ` Jan Kratochvil
2014-12-17 11:16                             ` Pedro Alves
2014-12-17 18:17                               ` [patchv2] " Jan Kratochvil
2014-12-17 18:33                                 ` Pedro Alves
2014-12-17 19:12                                   ` [commit] " Jan Kratochvil
2014-12-05 18:29 ` [patch 15/14] GDB/GCC compile function pointers [Re: [PATCH v4 00/14] let gdb reuse gcc's C compiler] Jan Kratochvil
2014-12-12 21:51   ` obsolete: " Jan Kratochvil
2014-12-12 14:40 ` [PATCH v4 00/14] let gdb reuse gcc's C compiler Pedro Alves
2014-12-12 21:46   ` [commit all 14 parts] " Jan Kratochvil

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=20141123192832.32193.5561.stgit@host1.jankratochvil.net \
    --to=jan.kratochvil@redhat.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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).