* Code cleanup - split print_stop_reason / question
[not found] <BANLkTin70pF0swcBvPZ3ftSmbrrccOUzcw@mail.gmail.com>
@ 2011-04-27 11:34 ` Kevin Pouget
2011-04-27 13:01 ` Jan Kratochvil
1 sibling, 0 replies; 3+ messages in thread
From: Kevin Pouget @ 2011-04-27 11:34 UTC (permalink / raw)
To: gdb
Hello,
I had a little question regarding Jan's patch below,
do you remember why you print the `exitstatus' in octal?
it looks like a bug to me when I see
> int main() {
> return 10 ;
> }
> [Inferior 1 (process 4395) exited with code 012]
Thanks,
Kevin
+2010-09-04 Jan Kratochvil <jan.kratochvil@redhat.com>
+
+ Code cleanup - split print_stop_reason.
+ * infrun.c (enum inferior_stop_reason): Remove.
+ (print_stop_reason): Remove by splitting into ...
+ (print_exited_reason, print_signal_exited_reason)
+ (print_no_history_reason, print_signal_received_reason)
+ (print_end_stepping_range_reason): ... these new functions. Update
+ the preceding comment.
+ (handle_inferior_event): Change the calls to print_exited_reason,
+ print_signal_exited_reason, print_no_history_reason,
+ print_signal_received_reason, print_end_stepping_range_reason.
+ (handle_step_into_function, handle_step_into_function_backward):
+ Change the calls to print_end_stepping_range_reason.
ui_out_text (uiout, "[Inferior ");
ui_out_text (uiout, plongest (inf->num));
ui_out_text (uiout, " (");
ui_out_text (uiout, pidstr);
ui_out_text (uiout, ") exited with code ");
ui_out_field_fmt (uiout, "exit-code", "0%o", (unsigned int) exitstatus);
ui_out_text (uiout, "]\n");
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Code cleanup - split print_stop_reason / question
[not found] <BANLkTin70pF0swcBvPZ3ftSmbrrccOUzcw@mail.gmail.com>
2011-04-27 11:34 ` Code cleanup - split print_stop_reason / question Kevin Pouget
@ 2011-04-27 13:01 ` Jan Kratochvil
2011-04-27 13:17 ` Kevin Pouget
1 sibling, 1 reply; 3+ messages in thread
From: Jan Kratochvil @ 2011-04-27 13:01 UTC (permalink / raw)
To: Kevin Pouget; +Cc: gdb
On Wed, 27 Apr 2011 13:27:38 +0200, Kevin Pouget wrote:
> I had a little question regarding Jan's patch below,
> do you remember why you print the `exitstatus' in octal?
This is not from me. When you check the history (I use git annotate file,
git annotate file REVISION^, git annotate file PREVREVISION^ and so on) you
will find that line of code comes from:
commit 14558c99c9b3adcfd7ab7934392a7b958337a015
Author: Jason Molenda <jsm@bugshack.cygnus.com>
Date: Thu Feb 3 04:14:45 2000 +0000
import gdb-2000-02-02 snapshot
So there is no further history and the line's original author is unknown.
AFAIK there was a tradition in UNIX to deal with program exit codes in octal.
I do not know why.
Thanks,
Jan
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Code cleanup - split print_stop_reason / question
2011-04-27 13:01 ` Jan Kratochvil
@ 2011-04-27 13:17 ` Kevin Pouget
0 siblings, 0 replies; 3+ messages in thread
From: Kevin Pouget @ 2011-04-27 13:17 UTC (permalink / raw)
To: Jan Kratochvil; +Cc: gdb
> This is not from me.
oh, sorry
at least, you're the last one who touched this line, right?
git blame gdb/infrun.c
...
8fc36186 (Jan Kratochvil 2010-09-04 14:27:43 +0000 5504)
ui_out_field_fmt (uiout, "exit-code", "0%o", (unsigned int)
exitstatus);
...
> When you check the history (I use git annotate file,
> git annotate file REVISION^, git annotate file PREVREVISION^ and so on) you
> will find that line of code comes from:
ok, thanks
> AFAIK there was a tradition in UNIX to deal with program exit codes in octal.
> I do not know why.
ok, so if it's a tradition, let's perpetuate the tradition :)
--
Kevin
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2011-04-27 13:17 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
[not found] <BANLkTin70pF0swcBvPZ3ftSmbrrccOUzcw@mail.gmail.com>
2011-04-27 11:34 ` Code cleanup - split print_stop_reason / question Kevin Pouget
2011-04-27 13:01 ` Jan Kratochvil
2011-04-27 13:17 ` Kevin Pouget
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox