public inbox for crossgcc@sourceware.org
 help / color / mirror / Atom feed
From: "Yann E. MORIN" <yann.morin.1998@free.fr>
To: crossgcc@sourceware.org
Cc: Johannes Stezenbach <js@sig21.net>
Subject: Re: [PATCH 1 of 1] scripts: add option to start an interactive debug shell
Date: Mon, 15 Oct 2012 20:05:00 -0000	[thread overview]
Message-ID: <201210152204.56409.yann.morin.1998@free.fr> (raw)
In-Reply-To: <82c19a72f25a7b399f6b.1350330836@treguer.bzh.lan>

Johannes, All,

[Replying on my own patch. Yikes! ;-) ]

On Monday 15 October 2012 Yann E. MORIN wrote:
> # HG changeset patch
> # User "Yann E. MORIN" <yann.morin.1998@free.fr>
> # Date 1349560087 -7200
> # Node ID 82c19a72f25a7b399f6be4e2c8c1cecc45d8c171
> # Parent  2a616dab6531ad82876c3252cd2e1cb873375c3f
> scripts: add option to start an interactive debug shell
[--SNIP--]
> diff --git a/scripts/functions b/scripts/functions
> --- a/scripts/functions
> +++ b/scripts/functions
> @@ -5,10 +5,45 @@
>  # Prepare the fault handler
>  CT_OnError() {
>      local ret=$?
> +    local old_trap result
>      local intro
>      local file line func
>      local step step_depth
>  
> +    # If the user asked for interactive debugging, dump him/her to a shell
> +    if [ "${CT_DEBUG_INTERACTIVE}" = "y" ]; then

The debug-shell should not be spawned for commands that were not run via
CT_DoExecLog, otherwise it is impossible to properly resume, although it
would be possible to just 'continue' or 'abort', not 'repeat'.

So, what do you think for non-CT_DoExecLog commands:
  - don't run debug-shell at all, or
  - run debug-shell, but only allow 'continue' or 'abort' ?

Note: use [ -n "${cur_cmd}" ] to check if we're in CT_DoExecLog.

> +        # We do not want this sub-shell exit status to be caught
> +        old_trap="$(trap -p ERR)"

No need to save the old trap, it's not used.
Or, what was I thinking in the first place to do that?... O_o

> @@ -157,10 +192,11 @@
>  # Usage: CT_DoExecLog <level> [VAR=val...] <command> [parameters...]
>  CT_DoExecLog() {
>      local level="$1"
> +    local cur_cmd
>      shift
>      (
>      for i in "$@"; do
> -        tmp_log+="'${i}' "
> +        cur_cmd+="'${i}' "
>      done
>      while true; do
>          case "${1}" in

The hunk above could well be a separate cset.

Regards,
Yann E. MORIN.

-- 
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'

--
For unsubscribe information see http://sourceware.org/lists.html#faq

  reply	other threads:[~2012-10-15 20:05 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-15 15:31 [PATCH] ct-ng build " Johannes Stezenbach
2012-10-15 19:56 ` [PATCH 0 of 1] Alternative debug-shell implementation Yann E. MORIN
2012-10-15 19:56   ` [PATCH 1 of 1] scripts: add option to start an interactive debug shell Yann E. MORIN
2012-10-15 20:05     ` Yann E. MORIN [this message]
2012-10-16 10:25   ` [PATCH 0 of 1] Alternative debug-shell implementation Johannes Stezenbach
2012-10-16 18:53     ` Yann E. MORIN
2012-10-17 10:15       ` Johannes Stezenbach
2012-10-17 11:13         ` Johannes Stezenbach
2012-10-17 11:20           ` Yann E. MORIN
2012-10-17 11:38         ` Yann E. MORIN
2012-10-17 13:54           ` Johannes Stezenbach
2012-10-26 12:42           ` Johannes Stezenbach
2012-10-26 17:43             ` Yann E. MORIN
2012-10-30 10:22               ` [PATCH] fix endless loop in debug-shell with IO redirection Johannes Stezenbach
2012-10-31  0:09                 ` scripts/functions: " Yann E. MORIN
2012-10-30 10:36               ` [PATCH] use patch -i instead of " Johannes Stezenbach
2012-10-31  0:09                 ` scripts/functions: " Yann E. MORIN
2012-10-30 10:55               ` [PATCH 0 of 1] Alternative debug-shell implementation Johannes Stezenbach
2012-10-15 21:45 ` [PATCH 0 of 1] Alternate debug-shell implementation, v2 Yann E. MORIN
2012-10-15 21:45   ` [PATCH 1 of 1] scripts: add option to start an interactive debug shell Yann E. MORIN

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=201210152204.56409.yann.morin.1998@free.fr \
    --to=yann.morin.1998@free.fr \
    --cc=crossgcc@sourceware.org \
    --cc=js@sig21.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).