Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Pedro Alves <palves@redhat.com>
To: gdb-patches@sourceware.org
Subject: [PATCH 4/7] gdbserver: btrace enums
Date: Wed, 28 Oct 2015 17:20:00 -0000	[thread overview]
Message-ID: <1446044362-8655-5-git-send-email-palves@redhat.com> (raw)
In-Reply-To: <1446044362-8655-1-git-send-email-palves@redhat.com>

Fixes:

 ../../../src/gdb/gdbserver/linux-low.c: In function ‘int linux_low_read_btrace(btrace_target_info*, buffer*, int)’:
 ../../../src/gdb/gdbserver/linux-low.c:6827:48: error: invalid conversion from ‘int’ to ‘btrace_read_type’ [-fpermissive]
    err = linux_read_btrace (&btrace, tinfo, type);
						 ^
 In file included from ../../../src/gdb/gdbserver/linux-low.c:98:0:
 ../../../src/gdb/gdbserver/../nat/linux-btrace.h:116:26: error:   initializing argument 3 of ‘btrace_error linux_read_btrace(btrace_data*, btrace_target_info*, btrace_read_type)’ [-fpermissive]
  extern enum btrace_error linux_read_btrace (struct btrace_data *btrace,
			   ^

I didn't spot the cyclic dependency the comment talks about.

gdb/ChangeLog:
2015-10-28  Pedro Alves  <palves@redhat.com>

	* linux-low.c (linux_low_read_btrace): Change type of 'type'
	parameter.
	* server.c (handle_qxfer_btrace): Change type of 'type'
	local.
	* target.h (struct target_ops) <read_btrace>: Change type of
	'type' parameter.  Update comment.
---
 gdb/gdbserver/linux-low.c | 2 +-
 gdb/gdbserver/server.c    | 3 ++-
 gdb/gdbserver/target.h    | 6 +++---
 3 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/gdb/gdbserver/linux-low.c b/gdb/gdbserver/linux-low.c
index e778c4c..41ab510 100644
--- a/gdb/gdbserver/linux-low.c
+++ b/gdb/gdbserver/linux-low.c
@@ -6815,7 +6815,7 @@ linux_low_encode_raw (struct buffer *buffer, const gdb_byte *data,
 
 static int
 linux_low_read_btrace (struct btrace_target_info *tinfo, struct buffer *buffer,
-		       int type)
+		       enum btrace_read_type type)
 {
   struct btrace_data btrace;
   struct btrace_block *block;
diff --git a/gdb/gdbserver/server.c b/gdb/gdbserver/server.c
index ad6626e..024399d 100644
--- a/gdb/gdbserver/server.c
+++ b/gdb/gdbserver/server.c
@@ -1608,7 +1608,8 @@ handle_qxfer_btrace (const char *annex,
 {
   static struct buffer cache;
   struct thread_info *thread;
-  int type, result;
+  enum btrace_read_type type;
+  int result;
 
   if (the_target->read_btrace == NULL || writebuf != NULL)
     return -2;
diff --git a/gdb/gdbserver/target.h b/gdb/gdbserver/target.h
index a14c6ff..769c876 100644
--- a/gdb/gdbserver/target.h
+++ b/gdb/gdbserver/target.h
@@ -399,11 +399,11 @@ struct target_ops
      Returns zero on success, non-zero otherwise.  */
   int (*disable_btrace) (struct btrace_target_info *tinfo);
 
-  /* Read branch trace data into buffer.  We use an int to specify the type
-     to break a cyclic dependency.
+  /* Read branch trace data into buffer.
      Return 0 on success; print an error message into BUFFER and return -1,
      otherwise.  */
-  int (*read_btrace) (struct btrace_target_info *, struct buffer *, int type);
+  int (*read_btrace) (struct btrace_target_info *, struct buffer *,
+		      enum btrace_read_type type);
 
   /* Read the branch trace configuration into BUFFER.
      Return 0 on success; print an error message into BUFFER and return -1
-- 
1.9.3


  parent reply	other threads:[~2015-10-28 14:59 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-28 16:48 [PATCH 0/7] C++ patches Pedro Alves
2015-10-28 16:55 ` [PATCH 1/7] compile: Rename struct type_map_instance::gcc_type field Pedro Alves
2015-10-28 17:05 ` [PATCH 6/7] gdbserver/tracepoint: Add casts out of tpoint->handle Pedro Alves
2015-10-28 17:10 ` [PATCH 3/7] gdbserver/Linux: Introduce NULL_REGSET Pedro Alves
2015-10-28 17:20 ` Pedro Alves [this message]
2015-10-28 18:46   ` [PATCH 4/7] gdbserver: btrace enums Metzger, Markus T
2015-10-29 14:42     ` Pedro Alves
2015-10-28 17:44 ` [PATCH 5/7] gdbserver: enum gdb_signal casts Pedro Alves
2015-10-28 17:57 ` [PATCH 2/7] Add cast to exception_none Pedro Alves
2015-10-28 18:24 ` [PATCH 7/7] gdbserver/mem-break.c: Add cast Pedro Alves
2015-10-29 15:32 ` [PATCH 0/7] C++ patches Pedro Alves

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=1446044362-8655-5-git-send-email-palves@redhat.com \
    --to=palves@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