* [PATCH] Include <stdlib.h> to cp1.c for abort() declaration
@ 2020-12-12 12:45 Pavel Kryukov
2020-12-13 14:10 ` Joel Brobecker
0 siblings, 1 reply; 4+ messages in thread
From: Pavel Kryukov @ 2020-12-12 12:45 UTC (permalink / raw)
To: gdb-patches; +Cc: Pavel I. Kryukov
From: "Pavel I. Kryukov" <kryukov@frtk.ru>
sim/mips/ChangeLog:
* cp1.c: Include <stdlib.h>
---
sim/mips/ChangeLog | 4 ++++
sim/mips/cp1.c | 2 ++
2 files changed, 6 insertions(+)
diff --git a/sim/mips/ChangeLog b/sim/mips/ChangeLog
index 7ced3edd1b..f9a1eb96c6 100644
--- a/sim/mips/ChangeLog
+++ b/sim/mips/ChangeLog
@@ -1,3 +1,7 @@
+2020-12-12 Pavel I. Kryukov <kryukov@frtk.ru>
+
+ * cp1.c: Include <stdlib.h>.
+
2020-07-29 Simon Marchi <simon.marchi@efficios.com>
* configure: Re-generate.
diff --git a/sim/mips/cp1.c b/sim/mips/cp1.c
index 82fdea2bcb..d81b07a20c 100644
--- a/sim/mips/cp1.c
+++ b/sim/mips/cp1.c
@@ -42,6 +42,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "sim-main.h"
+#include <stdlib.h>
+
/* Within cp1.c we refer to sim_cpu directly. */
#define CPU cpu
#define SD CPU_STATE(cpu)
--
2.17.1
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] Include <stdlib.h> to cp1.c for abort() declaration
2020-12-12 12:45 [PATCH] Include <stdlib.h> to cp1.c for abort() declaration Pavel Kryukov
@ 2020-12-13 14:10 ` Joel Brobecker
2020-12-13 16:27 ` Pavel I. Kryukov
0 siblings, 1 reply; 4+ messages in thread
From: Joel Brobecker @ 2020-12-13 14:10 UTC (permalink / raw)
To: Pavel Kryukov; +Cc: gdb-patches
> sim/mips/ChangeLog:
>
> * cp1.c: Include <stdlib.h>
:-/. Using "abort" in the sim is not a good idea, because the sim
can be built into GDB. So imagine the scenario where a user uses
an invalid switch as the sim calls "abort", instead of just reporting
the error to the user and letting him try again, the debugging session
just abort...
However, in this particular case, the use of aborts is not your fault,
and it's probably not new either, so it makes sense to include
the corresponding system header.
The patch is OK for me. Please feel free to push (do you have push
permissions?).
> ---
> sim/mips/ChangeLog | 4 ++++
> sim/mips/cp1.c | 2 ++
> 2 files changed, 6 insertions(+)
>
> diff --git a/sim/mips/ChangeLog b/sim/mips/ChangeLog
> index 7ced3edd1b..f9a1eb96c6 100644
> --- a/sim/mips/ChangeLog
> +++ b/sim/mips/ChangeLog
> @@ -1,3 +1,7 @@
> +2020-12-12 Pavel I. Kryukov <kryukov@frtk.ru>
> +
> + * cp1.c: Include <stdlib.h>.
> +
> 2020-07-29 Simon Marchi <simon.marchi@efficios.com>
>
> * configure: Re-generate.
> diff --git a/sim/mips/cp1.c b/sim/mips/cp1.c
> index 82fdea2bcb..d81b07a20c 100644
> --- a/sim/mips/cp1.c
> +++ b/sim/mips/cp1.c
> @@ -42,6 +42,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. */
>
> #include "sim-main.h"
>
> +#include <stdlib.h>
> +
> /* Within cp1.c we refer to sim_cpu directly. */
> #define CPU cpu
> #define SD CPU_STATE(cpu)
> --
> 2.17.1
--
Joel
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] Include <stdlib.h> to cp1.c for abort() declaration
2020-12-13 14:10 ` Joel Brobecker
@ 2020-12-13 16:27 ` Pavel I. Kryukov
2020-12-14 3:03 ` Joel Brobecker
0 siblings, 1 reply; 4+ messages in thread
From: Pavel I. Kryukov @ 2020-12-13 16:27 UTC (permalink / raw)
To: Joel Brobecker; +Cc: gdb-patches
I don't have push permissions.
Thanks,
--
Pavel
вс, 13 дек. 2020 г. в 17:10, Joel Brobecker <brobecker@adacore.com>:
>
> > sim/mips/ChangeLog:
> >
> > * cp1.c: Include <stdlib.h>
>
> :-/. Using "abort" in the sim is not a good idea, because the sim
> can be built into GDB. So imagine the scenario where a user uses
> an invalid switch as the sim calls "abort", instead of just reporting
> the error to the user and letting him try again, the debugging session
> just abort...
>
> However, in this particular case, the use of aborts is not your fault,
> and it's probably not new either, so it makes sense to include
> the corresponding system header.
>
> The patch is OK for me. Please feel free to push (do you have push
> permissions?).
>
> > ---
> > sim/mips/ChangeLog | 4 ++++
> > sim/mips/cp1.c | 2 ++
> > 2 files changed, 6 insertions(+)
> >
> > diff --git a/sim/mips/ChangeLog b/sim/mips/ChangeLog
> > index 7ced3edd1b..f9a1eb96c6 100644
> > --- a/sim/mips/ChangeLog
> > +++ b/sim/mips/ChangeLog
> > @@ -1,3 +1,7 @@
> > +2020-12-12 Pavel I. Kryukov <kryukov@frtk.ru>
> > +
> > + * cp1.c: Include <stdlib.h>.
> > +
> > 2020-07-29 Simon Marchi <simon.marchi@efficios.com>
> >
> > * configure: Re-generate.
> > diff --git a/sim/mips/cp1.c b/sim/mips/cp1.c
> > index 82fdea2bcb..d81b07a20c 100644
> > --- a/sim/mips/cp1.c
> > +++ b/sim/mips/cp1.c
> > @@ -42,6 +42,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. */
> >
> > #include "sim-main.h"
> >
> > +#include <stdlib.h>
> > +
> > /* Within cp1.c we refer to sim_cpu directly. */
> > #define CPU cpu
> > #define SD CPU_STATE(cpu)
> > --
> > 2.17.1
>
> --
> Joel
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] Include <stdlib.h> to cp1.c for abort() declaration
2020-12-13 16:27 ` Pavel I. Kryukov
@ 2020-12-14 3:03 ` Joel Brobecker
0 siblings, 0 replies; 4+ messages in thread
From: Joel Brobecker @ 2020-12-14 3:03 UTC (permalink / raw)
To: Pavel I. Kryukov; +Cc: gdb-patches
> I don't have push permissions.
OK, no problem. I pushed the patch for you.
--
Joel
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2020-12-14 3:03 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-12 12:45 [PATCH] Include <stdlib.h> to cp1.c for abort() declaration Pavel Kryukov
2020-12-13 14:10 ` Joel Brobecker
2020-12-13 16:27 ` Pavel I. Kryukov
2020-12-14 3:03 ` Joel Brobecker
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox