From: Luis Machado <luisgpm@linux.vnet.ibm.com>
To: gdb-patches@sourceware.org
Subject: [RFC] Entry point update with "run" command
Date: Thu, 24 Apr 2008 16:45:00 -0000 [thread overview]
Message-ID: <1209052694.18229.6.camel@gargoyle.br.ibm.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 825 bytes --]
Hi folks,
It seems GDB doesn't really update the entry point of an object file if
we "reload" the modified binary through the "run" command.
This can be clearly seen with the reread.exp testcase:
1 - Run reread until "foo" breakpoint
2 - Move reread2 on top of reread
3 - "Run" and expect GDB to notice that the binary has changed
4 - GDB says it will re-read the symbols
5 - The entry point of the second binary is just the same as the first
one. This causes problems with the displaced stepping since the entry
point is used to store the instructions.
The problem is that "init_entry_point_info" is never called with the
"run" command. If we do a "file", then we get the right entry point.
The attached patch does this on "reread_symbols", though it seems a
brute-force method. Is this OK?
Regards
--
Luis Machado
[-- Attachment #2: entry_point.diff --]
[-- Type: text/x-patch, Size: 405 bytes --]
Index: hg/gdb/symfile.c
===================================================================
--- hg.orig/gdb/symfile.c 2008-04-24 08:09:30.000000000 -0700
+++ hg/gdb/symfile.c 2008-04-24 08:45:50.000000000 -0700
@@ -2467,6 +2467,7 @@
objfile->mtime = new_modtime;
reread_one = 1;
reread_separate_symbols (objfile);
+ init_entry_point_info (objfile);
}
}
}
next reply other threads:[~2008-04-24 15:59 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-04-24 16:45 Luis Machado [this message]
2008-04-26 13:42 ` Jan Kratochvil
2008-05-01 16:19 ` Luis Machado
2008-05-02 15:46 ` Daniel Jacobowitz
2008-05-04 15:23 ` Jan Kratochvil
2008-05-02 15:45 ` Daniel Jacobowitz
2008-05-05 19:17 ` Luis Machado
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=1209052694.18229.6.camel@gargoyle.br.ibm.com \
--to=luisgpm@linux.vnet.ibm.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