public inbox for archer-commits@sourceware.org
help / color / mirror / Atom feed
* [SCM]  archer-sergiodj-stap: Fixing problem with expout initializer/reallocation.
@ 2012-01-25 19:00 sergiodj
  0 siblings, 0 replies; only message in thread
From: sergiodj @ 2012-01-25 19:00 UTC (permalink / raw)
  To: archer-commits

The branch, archer-sergiodj-stap has been updated
       via  1314192a3c7d31c64c17becfc9a43c4a6d0f2f4a (commit)
      from  8c800dbe17ff4b5bbc5ace4be82b1a5f2ac453cf (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email.

- Log -----------------------------------------------------------------
commit 1314192a3c7d31c64c17becfc9a43c4a6d0f2f4a
Author: Sergio Durigan Junior <sergiodj@redhat.com>
Date:   Wed Jan 25 16:59:56 2012 -0200

    Fixing problem with expout initializer/reallocation.

-----------------------------------------------------------------------

Summary of changes:
 gdb/parse.c       |   39 ++++-----------------------------------
 gdb/parser-defs.h |   17 ++++++++---------
 2 files changed, 12 insertions(+), 44 deletions(-)

First 500 lines of diff:
diff --git a/gdb/parse.c b/gdb/parse.c
index 9a531b5..1ebfd2e 100644
--- a/gdb/parse.c
+++ b/gdb/parse.c
@@ -180,13 +180,9 @@ free_funcalls (void *ignore)
 /* This page contains the functions for adding data to the struct expression
    being constructed.  */
 
-/* Helper function to initialize the expout, expout_size, expout_ptr
-   trio before it is used to store expression elements created during
-   the parsing of an expression.  INITIAL_SIZE is the initial size of
-   the expout array.  LANG is the language used to parse the expression.
-   And GDBARCH is the gdbarch to use during parsing.  */
+/* See definition in parser-defs.h.  */
 
-static void
+void
 initialize_expout (int initial_size, const struct language_defn *lang,
 		   struct gdbarch *gdbarch)
 {
@@ -198,11 +194,9 @@ initialize_expout (int initial_size, const struct language_defn *lang,
   expout->gdbarch = gdbarch;
 }
 
-/* Helper function that frees any unsed space in the expout array.
-   It is generally used when the parser has just been parsed and
-   created.  */
+/* See definition in parser-defs.h.  */
 
-static void
+void
 reallocate_expout (void)
 {
   /* Record the actual number of expression elements, and then
@@ -1112,31 +1106,6 @@ parse_exp_1 (char **stringptr, struct block *block, int comma)
   return parse_exp_in_context (stringptr, block, comma, 0, NULL);
 }
 
-void
-initialize_expout (int initial_size, const struct language_defn *lang,
-		   struct gdbarch *gdbarch)
-{
-  expout_size = initial_size;
-  expout_ptr = 0;
-  expout = (struct expression *)
-    xmalloc (sizeof (struct expression) + EXP_ELEM_TO_BYTES (expout_size));
-  expout->language_defn = lang;
-  expout->gdbarch = gdbarch;
-}
-
-void
-reallocate_expout (void)
-{
-  /* Record the actual number of expression elements, and then
-     reallocate the expression memory so that we free up any
-     excess elements.  */
-
-  expout->nelts = expout_ptr;
-  expout = (struct expression *)
-    xrealloc ((char *) expout,
-	      sizeof (struct expression) + EXP_ELEM_TO_BYTES (expout_ptr));
-}
-
 /* As for parse_exp_1, except that if VOID_CONTEXT_P, then
    no value is expected from the expression.
    OUT_SUBEXP is set when attempting to complete a field name; in this
diff --git a/gdb/parser-defs.h b/gdb/parser-defs.h
index 6a06ad1..442ca03 100644
--- a/gdb/parser-defs.h
+++ b/gdb/parser-defs.h
@@ -130,19 +130,18 @@ union type_stack_elt
 extern union type_stack_elt *type_stack;
 extern int type_stack_depth, type_stack_size;
 
-/* Allocate and initialize `expout' and its related variables `expout_size'
-   and `expout_ptr'.
-
-   The first argument is the initial size to be used for xmalloc.  The second
-   argument is the language related to the expression.  The third argument is
-   corresponding gdbarch.  */
+/* Helper function to initialize the expout, expout_size, expout_ptr
+   trio before it is used to store expression elements created during
+   the parsing of an expression.  INITIAL_SIZE is the initial size of
+   the expout array.  LANG is the language used to parse the expression.
+   And GDBARCH is the gdbarch to use during parsing.  */
 
 extern void initialize_expout (int, const struct language_defn *,
 			       struct gdbarch *);
 
-/* Reallocate `expout' in order to free excessive elements that might have
-   been created during the parsing.  Set the number of elements
-   accordingly.  */
+/* Helper function that frees any unsed space in the expout array.
+   It is generally used when the parser has just been parsed and
+   created.  */
 
 extern void reallocate_expout (void);
 


hooks/post-receive
--
Repository for Project Archer.


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2012-01-25 19:00 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-01-25 19:00 [SCM] archer-sergiodj-stap: Fixing problem with expout initializer/reallocation sergiodj

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).