* defs.h, utils.c (free_current_contents): Change parameter to
void*. From Philippe De Muyter <phdm@macqel.be>: * printcmd.c (print_address_symbolic): Call `make_cleanup' with `(free_current_contents, &x)', not `(free, x)'. * utils.c (free_current_contents): Do not `free (NULL)'. * printcmd.c (print_address_symbolic): Cleanup after a failed call to build_address_symbolic.
This commit is contained in:
parent
61c37cee5d
commit
2f9429aea3
4 changed files with 25 additions and 8 deletions
|
@ -1,3 +1,16 @@
|
|||
Thu Apr 20 17:39:11 2000 Andrew Cagney <cagney@b1.cygnus.com>
|
||||
|
||||
* defs.h, utils.c (free_current_contents): Change parameter to
|
||||
void*.
|
||||
|
||||
From Philippe De Muyter <phdm@macqel.be>:
|
||||
* printcmd.c (print_address_symbolic): Call `make_cleanup' with
|
||||
`(free_current_contents, &x)', not `(free, x)'.
|
||||
* utils.c (free_current_contents): Do not `free (NULL)'.
|
||||
|
||||
* printcmd.c (print_address_symbolic): Cleanup after a failed
|
||||
call to build_address_symbolic.
|
||||
|
||||
2000-04-20 Christopher Faylor <cgf@cygnus.com>
|
||||
|
||||
* wince-stub.c (FREE): New macro.
|
||||
|
|
|
@ -354,7 +354,7 @@ extern void restore_cleanups (struct cleanup *);
|
|||
extern void restore_final_cleanups (struct cleanup *);
|
||||
extern void restore_my_cleanups (struct cleanup **, struct cleanup *);
|
||||
|
||||
extern void free_current_contents (char **);
|
||||
extern void free_current_contents (void *);
|
||||
|
||||
extern void null_cleanup (void *);
|
||||
|
||||
|
|
|
@ -562,12 +562,15 @@ print_address_symbolic (addr, stream, do_demangle, leadin)
|
|||
int offset = 0;
|
||||
int line = 0;
|
||||
|
||||
struct cleanup *cleanup_chain = make_cleanup (free, name);
|
||||
if (print_symbol_filename)
|
||||
make_cleanup (free, filename);
|
||||
/* throw away both name and filename */
|
||||
struct cleanup *cleanup_chain = make_cleanup (free_current_contents, &name);
|
||||
make_cleanup (free_current_contents, &filename);
|
||||
|
||||
if (build_address_symbolic (addr, do_demangle, &name, &offset, &filename, &line, &unmapped))
|
||||
{
|
||||
do_cleanups (cleanup_chain);
|
||||
return;
|
||||
}
|
||||
|
||||
fputs_filtered (leadin, stream);
|
||||
if (unmapped)
|
||||
|
|
|
@ -375,9 +375,10 @@ restore_my_cleanups (pmy_chain, chain)
|
|||
to arrange to free the object thus allocated. */
|
||||
|
||||
void
|
||||
free_current_contents (location)
|
||||
char **location;
|
||||
free_current_contents (void *ptr)
|
||||
{
|
||||
void **location = ptr;
|
||||
if (*location != NULL)
|
||||
free (*location);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue