This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[commit] "info threads" and quit
- From: Daniel Jacobowitz <drow at false dot org>
- To: gdb-patches at sourceware dot org
- Date: Mon, 17 Mar 2008 11:09:29 -0400
- Subject: [commit] "info threads" and quit
MontaVista reported that saying "quit" at the pagination prompt during
a long info threads had no effect. That's because we swallow the
quit. The hierarchy of exceptions we use for this sort of thing does
not make a ton of sense for quitting, in my opinion: we want to abort
the last user-requested operation, but we don't necessarily want to
abort e.g. connecting to the target if a single long argument list
requires pagination. Maybe someone will get energetic and design
a more theoretically robust solution... but for now, I've checked
this patch in to catch only errors when printing stack frames, not
user interrupts.
Tested on x86_64-linux.
--
Daniel Jacobowitz
CodeSourcery
2008-03-17 Daniel Jacobowitz <dan@codesourcery.com>
* stack.c (print_stack_frame, print_frame): Use RETURN_MASK_ERROR.
* symmisc.c (dump_symtab_1): Likewise.
* wrapper.c (gdb_value_struct_elt): Likewise.
Index: stack.c
===================================================================
RCS file: /cvs/src/src/gdb/stack.c,v
retrieving revision 1.163
diff -u -p -r1.163 stack.c
--- stack.c 11 Jan 2008 13:34:14 -0000 1.163
+++ stack.c 17 Mar 2008 14:30:57 -0000
@@ -115,7 +115,7 @@ print_stack_frame (struct frame_info *fr
args.print_what = ui_out_is_mi_like_p (uiout) ? LOC_AND_ADDRESS : print_what;
args.print_args = 1;
- catch_errors (print_stack_frame_stub, &args, "", RETURN_MASK_ALL);
+ catch_errors (print_stack_frame_stub, &args, "", RETURN_MASK_ERROR);
}
struct print_args_args
@@ -688,7 +688,7 @@ print_frame (struct frame_info *frame, i
args.func = func;
args.stream = gdb_stdout;
args_list_chain = make_cleanup_ui_out_list_begin_end (uiout, "args");
- catch_errors (print_args_stub, &args, "", RETURN_MASK_ALL);
+ catch_errors (print_args_stub, &args, "", RETURN_MASK_ERROR);
/* FIXME: ARGS must be a list. If one argument is a string it
will have " that will not be properly escaped. */
/* Invoke ui_out_tuple_end. */
Index: symmisc.c
===================================================================
RCS file: /cvs/src/src/gdb/symmisc.c,v
retrieving revision 1.47
diff -u -p -r1.47 symmisc.c
--- symmisc.c 11 Jan 2008 13:34:15 -0000 1.47
+++ symmisc.c 17 Mar 2008 14:30:57 -0000
@@ -515,7 +515,7 @@ dump_symtab_1 (struct objfile *objfile,
s.depth = depth + 1;
s.outfile = outfile;
catch_errors (print_symbol, &s, "Error printing symbol:\n",
- RETURN_MASK_ALL);
+ RETURN_MASK_ERROR);
}
}
fprintf_filtered (outfile, "\n");
Index: wrapper.c
===================================================================
RCS file: /cvs/src/src/gdb/wrapper.c,v
retrieving revision 1.22
diff -u -p -r1.22 wrapper.c
--- wrapper.c 1 Jan 2008 22:53:13 -0000 1.22
+++ wrapper.c 17 Mar 2008 14:30:57 -0000
@@ -151,7 +151,7 @@ gdb_value_struct_elt (struct ui_out *uio
{
volatile struct gdb_exception except;
- TRY_CATCH (except, RETURN_MASK_ALL)
+ TRY_CATCH (except, RETURN_MASK_ERROR)
{
*result = value_struct_elt (argp, args, name, static_memfuncp, err);
}