This is the mail archive of the
mailing list for the GDB project.
[RFC] Entry point update with "run" command
- From: Luis Machado <luisgpm at linux dot vnet dot ibm dot com>
- To: gdb-patches at sourceware dot org
- Date: Thu, 24 Apr 2008 12:58:14 -0300
- Subject: [RFC] Entry point update with "run" command
- Reply-to: luisgpm at linux dot vnet dot ibm dot com
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?
--- 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;
+ init_entry_point_info (objfile);