public inbox for archer-commits@sourceware.org help / color / mirror / Atom feed
From: jkratoch@sourceware.org To: archer-commits@sourceware.org Subject: [SCM] archer-jankratochvil-python: Merge commit 'origin/archer-tromey-python' into archer-jankratochvil-python Date: Wed, 25 Mar 2009 19:00:00 -0000 [thread overview] Message-ID: <20090325190027.15423.qmail@sourceware.org> (raw) The branch, archer-jankratochvil-python has been updated via 2e4985cad1fc3d054eaceac9aef5fed7dfa2fd37 (commit) via ffcb73fcb226abe0bb6d6f6855f479f0c5456527 (commit) from 57ef0cba8a93024e781a32a323884f8a7ff1d557 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email. - Log ----------------------------------------------------------------- ----------------------------------------------------------------------- Summary of changes: gdb/stack.c | 53 ++++++++--------------------------------------------- gdb/valprint.c | 35 +++++++++++++++++++++++++++++++++++ 2 files changed, 43 insertions(+), 45 deletions(-) First 500 lines of diff: diff --git a/gdb/stack.c b/gdb/stack.c index d6ef5a3..88b672d 100644 --- a/gdb/stack.c +++ b/gdb/stack.c @@ -58,7 +58,7 @@ void (*deprecated_selected_frame_level_changed_hook) (int); static const char *print_frame_arguments_choices[] = {"all", "scalars", "none", NULL}; -static const char *print_frame_arguments = "all"; +static const char *print_frame_arguments = "scalars"; /* Prototypes for local functions. */ @@ -158,46 +158,6 @@ print_frame_nameless_args (struct frame_info *frame, long start, int num, } } -/* Return non-zero if the debugger should print the value of the provided - symbol parameter (SYM). */ - -static int -print_this_frame_argument_p (struct symbol *sym) -{ - struct type *type; - - /* If the user asked to print no argument at all, then obviously - do not print this argument. */ - - if (strcmp (print_frame_arguments, "none") == 0) - return 0; - - /* If the user asked to print all arguments, then we should print - that one. */ - - if (strcmp (print_frame_arguments, "all") == 0) - return 1; - - /* The user asked to print only the scalar arguments, so do not - print the non-scalar ones. */ - - type = CHECK_TYPEDEF (SYMBOL_TYPE (sym)); - while (TYPE_CODE (type) == TYPE_CODE_REF) - type = CHECK_TYPEDEF (TYPE_TARGET_TYPE (type)); - switch (TYPE_CODE (type)) - { - case TYPE_CODE_ARRAY: - case TYPE_CODE_STRUCT: - case TYPE_CODE_UNION: - case TYPE_CODE_SET: - case TYPE_CODE_STRING: - case TYPE_CODE_BITSTRING: - return 0; - default: - return 1; - } -} - /* Print the arguments of frame FRAME on STREAM, given the function FUNC running in that frame (as a symbol), where NUM is the number of arguments according to the stack frame (or -1 if the number of @@ -220,6 +180,10 @@ print_frame_args (struct symbol *func, struct frame_info *frame, int args_printed = 0; struct cleanup *old_chain, *list_chain; struct ui_stream *stb; + /* True if we should print arguments, false otherwise. */ + int print_args = strcmp (print_frame_arguments, "none"); + /* True in "summary" mode, false otherwise. */ + int summary = !strcmp (print_frame_arguments, "scalars"); stb = ui_out_stream_new (uiout); old_chain = make_cleanup_ui_out_stream_delete (stb); @@ -354,7 +318,7 @@ print_frame_args (struct symbol *func, struct frame_info *frame, annotate_arg_name_end (); ui_out_text (uiout, "="); - if (print_this_frame_argument_p (sym)) + if (print_args) { /* Avoid value_print because it will deref ref parameters. We just want to print their addresses. Print ??? for @@ -381,9 +345,8 @@ print_frame_args (struct symbol *func, struct frame_info *frame, get_raw_print_options (&opts); opts.deref_ref = 0; - opts.summary = 1; - common_val_print (val, stb->stream, 2, - &opts, language); + opts.summary = summary; + common_val_print (val, stb->stream, 2, &opts, language); ui_out_field_stream (uiout, "value", stb); } else diff --git a/gdb/valprint.c b/gdb/valprint.c index 1eb7088..4f2ddbe 100644 --- a/gdb/valprint.c +++ b/gdb/valprint.c @@ -217,6 +217,33 @@ show_addressprint (struct ui_file *file, int from_tty, } \f +/* A helper function for val_print. When printing in "summary" mode, + we want to print scalar arguments, but not aggregate arguments. + This function distinguishes between the two. */ + +static int +scalar_type_p (struct type *type) +{ + CHECK_TYPEDEF (type); + while (TYPE_CODE (type) == TYPE_CODE_REF) + { + type = TYPE_TARGET_TYPE (type); + CHECK_TYPEDEF (type); + } + switch (TYPE_CODE (type)) + { + case TYPE_CODE_ARRAY: + case TYPE_CODE_STRUCT: + case TYPE_CODE_UNION: + case TYPE_CODE_SET: + case TYPE_CODE_STRING: + case TYPE_CODE_BITSTRING: + return 0; + default: + return 1; + } +} + /* Print using the given LANGUAGE the data of type TYPE located at VALADDR (within GDB), which came from the inferior at address ADDRESS, onto stdio stream STREAM according to OPTIONS. @@ -269,6 +296,14 @@ val_print (struct type *type, const gdb_byte *valaddr, int embedded_offset, return ret; } + /* Handle summary mode. If the value is a scalar, print it; + otherwise, print an ellipsis. */ + if (options->summary && !scalar_type_p (type)) + { + fprintf_filtered (stream, "..."); + return 0; + } + TRY_CATCH (except, RETURN_MASK_ERROR) { ret = language->la_val_print (type, valaddr, embedded_offset, address, hooks/post-receive -- Repository for Project Archer.
next reply other threads:[~2009-03-25 19:00 UTC|newest] Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top 2009-03-25 19:00 jkratoch [this message] -- strict thread matches above, loose matches on Subject: below -- 2009-06-26 13:51 jkratoch 2009-03-30 17:22 jkratoch 2009-03-29 22:42 jkratoch 2009-03-27 0:35 jkratoch 2009-03-24 17:33 jkratoch 2009-03-09 17:05 jkratoch 2009-03-06 16:59 jkratoch 2009-03-06 14:26 jkratoch 2009-03-05 21:53 jkratoch 2009-03-05 21:15 jkratoch 2009-03-04 23:54 jkratoch 2009-03-04 22:34 jkratoch 2009-03-04 15:02 jkratoch 2009-03-03 21:46 jkratoch 2009-03-03 21:45 jkratoch 2009-03-02 20:46 jkratoch 2009-03-01 14:38 jkratoch 2009-02-28 19:26 jkratoch 2009-02-26 23:01 jkratoch
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=20090325190027.15423.qmail@sourceware.org \ --to=jkratoch@sourceware.org \ --cc=archer-commits@sourceware.org \ /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: linkBe 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).