public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
* [Bug sim/9734] New: result of sim_create_sim not checked in remote-sim.c
@ 2009-01-12 14:27 richard dot stuckey at arc dot com
2009-01-12 14:27 ` [Bug sim/9734] result of sim_create_inferior " richard dot stuckey at arc dot com
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: richard dot stuckey at arc dot com @ 2009-01-12 14:27 UTC (permalink / raw)
To: gdb-prs
If sim_create_inferior fails to create the inferior, for whatever reason, gdb
should not mark the target as running.
The code at the end of function gdbsim_create_inferior in remote-sim.c should be
changed to:
if (sim_create_inferior (gdbsim_desc, exec_bfd, argv, env) == SIM_RC_OK)
{
inferior_ptid = pid_to_ptid (42);
target_mark_running (&gdbsim_ops);
insert_breakpoints (); /* Needed to get correct instruction in cache */
clear_proceed_status ();
}
--
Summary: result of sim_create_sim not checked in remote-sim.c
Product: gdb
Version: 6.8
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: sim
AssignedTo: unassigned at sourceware dot org
ReportedBy: richard dot stuckey at arc dot com
CC: gdb-prs at sourceware dot org
http://sourceware.org/bugzilla/show_bug.cgi?id=9734
------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.
^ permalink raw reply [flat|nested] 4+ messages in thread
* [Bug sim/9734] result of sim_create_inferior not checked in remote-sim.c
2009-01-12 14:27 [Bug sim/9734] New: result of sim_create_sim not checked in remote-sim.c richard dot stuckey at arc dot com
@ 2009-01-12 14:27 ` richard dot stuckey at arc dot com
2009-01-12 14:33 ` pedro at codesourcery dot com
2009-01-12 14:48 ` richard dot stuckey at arc dot com
2 siblings, 0 replies; 4+ messages in thread
From: richard dot stuckey at arc dot com @ 2009-01-12 14:27 UTC (permalink / raw)
To: gdb-prs
--
What |Removed |Added
----------------------------------------------------------------------------
Summary|result of sim_create_sim not|result of
|checked in remote-sim.c |sim_create_inferior not
| |checked in remote-sim.c
http://sourceware.org/bugzilla/show_bug.cgi?id=9734
------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.
^ permalink raw reply [flat|nested] 4+ messages in thread
* [Bug sim/9734] result of sim_create_inferior not checked in remote-sim.c
2009-01-12 14:27 [Bug sim/9734] New: result of sim_create_sim not checked in remote-sim.c richard dot stuckey at arc dot com
2009-01-12 14:27 ` [Bug sim/9734] result of sim_create_inferior " richard dot stuckey at arc dot com
@ 2009-01-12 14:33 ` pedro at codesourcery dot com
2009-01-12 14:48 ` richard dot stuckey at arc dot com
2 siblings, 0 replies; 4+ messages in thread
From: pedro at codesourcery dot com @ 2009-01-12 14:33 UTC (permalink / raw)
To: gdb-prs
------- Additional Comments From pedro at codesourcery dot com 2009-01-12 14:33 -------
I see that the result of sim_create_inferior is still not checked on current
mainline. I think that it would be best to throw an error() instead, otherwise
currently core gdb will probably assert, in thinking the inferior was created.
if (sim_create_inferior (gdbsim_desc, exec_bfd, argv, env) != SIM_RC_OK)
error (_("foo failed to create, blah!"));
--
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Ever Confirmed| |1
http://sourceware.org/bugzilla/show_bug.cgi?id=9734
------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.
^ permalink raw reply [flat|nested] 4+ messages in thread
* [Bug sim/9734] result of sim_create_inferior not checked in remote-sim.c
2009-01-12 14:27 [Bug sim/9734] New: result of sim_create_sim not checked in remote-sim.c richard dot stuckey at arc dot com
2009-01-12 14:27 ` [Bug sim/9734] result of sim_create_inferior " richard dot stuckey at arc dot com
2009-01-12 14:33 ` pedro at codesourcery dot com
@ 2009-01-12 14:48 ` richard dot stuckey at arc dot com
2 siblings, 0 replies; 4+ messages in thread
From: richard dot stuckey at arc dot com @ 2009-01-12 14:48 UTC (permalink / raw)
To: gdb-prs
------- Additional Comments From richard dot stuckey at arc dot com 2009-01-12 14:48 -------
I have added a check to the ARC-specific version of sim_create_inferior that the
endianness of the executable file matches the endiannness of the simulator
target, for the situation that the target instance is created before the
executable file has been specified (this check should also probably go into the
gdb core code, in remote-sim.c, but I try to avoid altering the core code where
possible); if the check fails, the function gives a warning and returns
SIM_RC_FAIL.
This, together with the change I suggested to gdbsim_create_inferior, gives the
behaviour:
(gdb) set endian big
The target is assumed to be big endian
(gdb) target sim
Connected to the simulator.
(gdb) file test.little
Reading symbols from test.little...done.
(gdb) load
(gdb) run
Starting program: test.little
Target is big-endian but executable file test.little is little-endian.
The program is not being run.
gdb appears to be left in a stable state at this point, but I have not carried
out extensive testing on this, so am willing to accept that throwing an error
may be better.
--
http://sourceware.org/bugzilla/show_bug.cgi?id=9734
------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2009-01-12 14:48 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-01-12 14:27 [Bug sim/9734] New: result of sim_create_sim not checked in remote-sim.c richard dot stuckey at arc dot com
2009-01-12 14:27 ` [Bug sim/9734] result of sim_create_inferior " richard dot stuckey at arc dot com
2009-01-12 14:33 ` pedro at codesourcery dot com
2009-01-12 14:48 ` richard dot stuckey at arc dot com
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).