Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [RFC] Entry point update with "run" command
@ 2008-04-24 16:45 Luis Machado
  2008-04-26 13:42 ` Jan Kratochvil
  2008-05-02 15:45 ` Daniel Jacobowitz
  0 siblings, 2 replies; 7+ messages in thread
From: Luis Machado @ 2008-04-24 16:45 UTC (permalink / raw)
  To: gdb-patches

[-- 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);
 	    }
 	}
     }

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2008-05-05 16:15 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-04-24 16:45 [RFC] Entry point update with "run" command Luis Machado
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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox