From: Gary Benson <gbenson@redhat.com>
To: gdb-patches@sourceware.org
Subject: [RFA 2/4 take 2] Improved linker-debugger interface
Date: Thu, 19 Jul 2012 11:05:00 -0000 [thread overview]
Message-ID: <20120719110509.GC16185@redhat.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 202 bytes --]
Hi all,
This patch moves a block of code in solib-svr4.c. There are no
code changes. I couldn't figure out how to write a ChangeLog for
this--does it need one?
Cheers,
Gary
--
http://gbenson.net/
[-- Attachment #2: rtld-stap-4.patch --]
[-- Type: text/plain, Size: 3274 bytes --]
diff --git a/gdb/solib-svr4.c b/gdb/solib-svr4.c
index 307e483..c88b9cb 100644
--- a/gdb/solib-svr4.c
+++ b/gdb/solib-svr4.c
@@ -106,6 +106,59 @@ static const char * const main_name_list[] =
NULL
};
+/* Per pspace SVR4 specific data. */
+
+struct svr4_info
+{
+ CORE_ADDR debug_base; /* Base of dynamic linker structures. */
+
+ /* Validity flag for debug_loader_offset. */
+ int debug_loader_offset_p;
+
+ /* Load address for the dynamic linker, inferred. */
+ CORE_ADDR debug_loader_offset;
+
+ /* Name of the dynamic linker, valid if debug_loader_offset_p. */
+ char *debug_loader_name;
+
+ /* Load map address for the main executable. */
+ CORE_ADDR main_lm_addr;
+
+ CORE_ADDR interp_text_sect_low;
+ CORE_ADDR interp_text_sect_high;
+ CORE_ADDR interp_plt_sect_low;
+ CORE_ADDR interp_plt_sect_high;
+};
+
+/* Per-program-space data key. */
+static const struct program_space_data *solib_svr4_pspace_data;
+
+static void
+svr4_pspace_data_cleanup (struct program_space *pspace, void *arg)
+{
+ struct svr4_info *info;
+
+ info = program_space_data (pspace, solib_svr4_pspace_data);
+ xfree (info);
+}
+
+/* Get the current svr4 data. If none is found yet, add it now. This
+ function always returns a valid object. */
+
+static struct svr4_info *
+get_svr4_info (void)
+{
+ struct svr4_info *info;
+
+ info = program_space_data (current_program_space, solib_svr4_pspace_data);
+ if (info != NULL)
+ return info;
+
+ info = XZALLOC (struct svr4_info);
+ set_program_space_data (current_program_space, solib_svr4_pspace_data, info);
+ return info;
+}
+
/* Return non-zero if GDB_SO_NAME and INFERIOR_SO_NAME represent
the same shared library. */
@@ -291,59 +344,6 @@ lm_addr_check (struct so_list *so, bfd *abfd)
return so->lm_info->l_addr;
}
-/* Per pspace SVR4 specific data. */
-
-struct svr4_info
-{
- CORE_ADDR debug_base; /* Base of dynamic linker structures. */
-
- /* Validity flag for debug_loader_offset. */
- int debug_loader_offset_p;
-
- /* Load address for the dynamic linker, inferred. */
- CORE_ADDR debug_loader_offset;
-
- /* Name of the dynamic linker, valid if debug_loader_offset_p. */
- char *debug_loader_name;
-
- /* Load map address for the main executable. */
- CORE_ADDR main_lm_addr;
-
- CORE_ADDR interp_text_sect_low;
- CORE_ADDR interp_text_sect_high;
- CORE_ADDR interp_plt_sect_low;
- CORE_ADDR interp_plt_sect_high;
-};
-
-/* Per-program-space data key. */
-static const struct program_space_data *solib_svr4_pspace_data;
-
-static void
-svr4_pspace_data_cleanup (struct program_space *pspace, void *arg)
-{
- struct svr4_info *info;
-
- info = program_space_data (pspace, solib_svr4_pspace_data);
- xfree (info);
-}
-
-/* Get the current svr4 data. If none is found yet, add it now. This
- function always returns a valid object. */
-
-static struct svr4_info *
-get_svr4_info (void)
-{
- struct svr4_info *info;
-
- info = program_space_data (current_program_space, solib_svr4_pspace_data);
- if (info != NULL)
- return info;
-
- info = XZALLOC (struct svr4_info);
- set_program_space_data (current_program_space, solib_svr4_pspace_data, info);
- return info;
-}
-
/* Local function prototypes */
static int match_main (const char *);
next reply other threads:[~2012-07-19 11:05 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-07-19 11:05 Gary Benson [this message]
2012-07-19 17:02 ` Tom Tromey
2012-07-19 17:23 ` Gary Benson
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=20120719110509.GC16185@redhat.com \
--to=gbenson@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