This is the mail archive of the gdb-patches@sources.redhat.com mailing list for the GDB project.


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/rfc] Rewrite return_command


Hello,

The attached patch changes the return_command so that it reports the fact that it can't handle the specified return value before, rather than after, is asked to confirm that the function should return. This way the user can make a better informed decision. The three outputs below illustrate the old vs new behavior:

YESTERDAY:

(gdb) return foo1
Make fun1 return now? (y or n) y
This architecture does not support specifying a struct or union return-value.
(gdb)

TODAY:

(gdb) return foo1
Make fun1 return now? (y or n) y
This architecture does not support specifying a struct or union return-value.
#0  0x018011a4 in main () at .../structs.c:231
231       L1  = fun1();
(gdb)

TOMORROW:

(gdb) return foo1
The location at which to store the function's return value is unknown.
Make fun1 return now? (y or n) y
#0  0x018011a4 in main () at .../structs.c:231
231       L1  = fun1();
(gdb)

The rewrite also eliminates deprecated frame references and the no-longer-called function set_return_value function.

Baring comment, I'll commit this in a day or so.

I've checked this in.


Andrew


2003-10-20 Andrew Cagney <cagney@redhat.com>

* Makefile.in (stack.o): Add $(regcache_h).
* stack.c: Include "regcache.h"
(return_command): Rewrite. Use get_frame_id and
get_selected_frame. Eliminate "deprecated_selected_frame". Warn
about unhandled return-values.
* value.h (set_return_value): Delete declaration.
* values.c (set_return_value): Delete function.



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