[m-dev.] For review: Stacks dump in the external debugger

Fergus Henderson fjh at cs.mu.OZ.AU
Fri Feb 12 03:12:06 AEDT 1999


On 11-Feb-1999, Erwan Jahier <Erwan.Jahier at irisa.fr> wrote:
> Estimated hours taken: 1
> 
> This change implement stack dump commands for the external debugger.
> 
> browser/debugger_interface.m:
> 	Add three new kinds of requests: stack, nondet_stack and stack_regs.
> 
> trace/mercury_trace_external.c:
> 	Implement the ancestors, non det and registers stack dump.

Is there much point in implementing the `nondet_stack' and `stack_regs'
commands in the external debugger? 
These commands are intended for developers of the Mercury implementation only,
to debug the low-level execution mechanism.

I suppose it can't do much harm...

> +			case MR_REQUEST_STACK:
> +				if (MR_debug_socket) {
> +					fprintf(stderr, "\nMercury runtime: "
> +						"REQUEST_STACK\n");
> +				}
> +				include_trace_data = TRUE;
> +				do_init_modules();
> +				message = MR_dump_stack_from_layout(stdout,

I think stdout is not a good place to send such things.
That might interfere with the output of the program being debugged.
Shouldn't they be sent down the socket?

> +			case MR_REQUEST_NONDET_STACK:
> +				if (MR_debug_socket) {
> +					fprintf(stderr, "\nMercury runtime: "
> +						"REQUEST_NONDET_STACK\n");
> +				}
> +				do_init_modules();
> +				MR_dump_nondet_stack_from_layout(stdout,
> +					MR_saved_maxfr(saved_regs));
> +				MR_send_message_to_socket("ok");
> +				break;

Likewise.

-- 
Fergus Henderson <fjh at cs.mu.oz.au>  |  "Binaries may die
WWW: <http://www.cs.mu.oz.au/~fjh>  |   but source code lives forever"
PGP: finger fjh at 128.250.37.3        |     -- leaked Microsoft memo.



More information about the developers mailing list