This is the mail archive of the crossgcc@sourceware.org mailing list for the crossgcc project.

See crosstool-NG for lots more information.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH 1 of 1] scripts: add option to start an interactive debug shell


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]