This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
FYI: minor code movement in jit.c
- From: Tom Tromey <tromey at redhat dot com>
- To: gdb-patches at sourceware dot org
- Date: Wed, 01 Feb 2012 13:16:01 -0700
- Subject: FYI: minor code movement in jit.c
I'm checking this in.
While looking into a jit.c bug, I noticed that some code had slipped
between bfd_open_from_target_memory and the functions it refers to.
I think this was just in error; this patch moves
bfd_open_from_target_memory higher in the file to keep the
target-memory-BFD code all in one place.
Tom
2012-02-01 Tom Tromey <tromey@redhat.com>
* jit.c (bfd_open_from_target_memory): Move higher in file.
Index: jit.c
===================================================================
RCS file: /cvs/src/src/gdb/jit.c,v
retrieving revision 1.25
diff -u -r1.25 jit.c
--- jit.c 4 Jan 2012 08:17:05 -0000 1.25
+++ jit.c 1 Feb 2012 20:14:29 -0000
@@ -127,6 +127,24 @@
return 0;
}
+/* Open a BFD from the target's memory. */
+
+static struct bfd *
+bfd_open_from_target_memory (CORE_ADDR addr, ULONGEST size, char *target)
+{
+ const char *filename = xstrdup ("<in-memory>");
+ struct target_buffer *buffer = xmalloc (sizeof (struct target_buffer));
+
+ buffer->base = addr;
+ buffer->size = size;
+ return bfd_openr_iovec (filename, target,
+ mem_bfd_iovec_open,
+ buffer,
+ mem_bfd_iovec_pread,
+ mem_bfd_iovec_close,
+ mem_bfd_iovec_stat);
+}
+
/* One reader that has been loaded successfully, and can potentially be used to
parse debug info. */
@@ -213,24 +231,6 @@
loaded_jit_reader = NULL;
}
-/* Open a BFD from the target's memory. */
-
-static struct bfd *
-bfd_open_from_target_memory (CORE_ADDR addr, ULONGEST size, char *target)
-{
- const char *filename = xstrdup ("<in-memory>");
- struct target_buffer *buffer = xmalloc (sizeof (struct target_buffer));
-
- buffer->base = addr;
- buffer->size = size;
- return bfd_openr_iovec (filename, target,
- mem_bfd_iovec_open,
- buffer,
- mem_bfd_iovec_pread,
- mem_bfd_iovec_close,
- mem_bfd_iovec_stat);
-}
-
/* Per-inferior structure recording the addresses in the inferior. */
struct jit_inferior_data