[RFA/commit] fix problem when debugging a core file on Tru64
Joel Brobecker
brobecker@adacore.com
Mon Jun 2 17:14:00 GMT 2008
Hello,
Core file debugging on Tru64 is slightly broken:
(gdb) core core
Reading symbols from /sbin/loader...done.
Loaded symbols for /sbin/loader
Reading symbols from /usr/shlib/libc.so...done.
Loaded symbols for /usr/shlib/libc.so
You can't do that without a process to debug.
The problem comes again from the solib create_inferior_hook which tries
to resume the execution of the inferior. In the case of debugging
a core file, this cannot (and doesn't need to) be done.
I fixed it by checking whether the target_can_run or not. It seemed
logical to check that target feature before trying to resume the inferior.
However, it introduces another use of the global current_target. I can't
remember if we are trying to eliminate this global or not...
2008-06-02 Joel Brobecker <brobecker@adacore.com>
* solib-osf.c (osf_solib_create_inferior_hook): Do nothing if
the target cannot run.
Tested on alpha-tru64. Will commit in a week if no comment.
--
Joel
-------------- next part --------------
Modified: solib-osf.c
===================================================================
--- solib-osf.c 2008-06-02 16:51:00 UTC (rev 132042)
+++ solib-osf.c 2008-06-02 17:00:22 UTC (rev 132043)
@@ -321,7 +321,14 @@
/* Now run the target. It will eventually get a SIGTRAP, at
which point all of the libraries will have been mapped in and we
can go groveling around in the rld structures to find
- out what we need to know about them. */
+ out what we need to know about them.
+
+ If debugging from a core file, we cannot resume the execution
+ of the inferior. But this is actually not an issue, because
+ shared libraries have already been mapped anyways, which means
+ we have nothing more to do. */
+ if (!target_can_run (¤t_target))
+ return;
clear_proceed_status ();
stop_soon = STOP_QUIETLY;
More information about the Gdb-patches
mailing list