Re: thumb_skip_prologue too adventurous

Jonathan Larmour
2000-03-19T12:29:00Z

Fernando Nasser wrote:
> I am not sure if there isn't a better solution for this, but for now I
> would say that you should check your change in as an emergency fix.

I don't have checkin rights to the "src" repository, so I'd be grateful if
you could do this for me.

> I
> am assuming you ran the testsuite and it did not cause any regressions,
> right? (I don't think it will cause any)

Nope - no regressions.

> I may latter add another change to check first if there is information
> about the prologue end in the symbol table. I don't know why this was
> not checked before, I just noticed it now, looking at you patch.

Don't worry - it is checked, but it is done in arm_skip_prologue, before
thumb_skip_prologue is called.

> I wrote this thumb prologue scan code to match the new compiler (gcc)
> prologue generation. As everything is new, both Nick and I used the
> testsuite results to verify our work. The case you mention does not have
> a testsuite case. I wonder if you could add a test case?

I've never done a GDB testcase before, but here goes - I've attached one. It
runs at the end of break.exp. The complication is that we need to start
over, because the problematic programs are the ones compiled with
optimization. So we have to jump through all the same hoops as at the start
of the file. Some of this stuff might be overkill, but it definitely seems
to work.

I agree the addition of this test is A Good Thing as we've had these types
of problems before on other targets with optimized code.

Hope this helps. Obviously let me know if there are any problems with it.

Jifl

2000-03-19 Jonathan Larmour <jlarmour@redhat.co.uk>

* gdb.base/break.exp: Add new test for setting breakpoints on
optimized code so we can test breakpoints work even when function
prologues may be optimized away

--
Red Hat, 35 Cambridge Place, Cambridge, UK. CB2 1NS Tel: +44 (1223) 728762
"Plan to be spontaneous tomorrow." || These opinions are all my own fault
Index: gdb/testsuite/gdb.base/break.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.base/break.exp,v
retrieving revision 1.2
diff -u -5 -p -r1.2 break.exp
--- gdb/testsuite/gdb.base/break.exp 2000/02/16 00:11:07 1.2
+++ gdb/testsuite/gdb.base/break.exp 2000/03/19 20:26:34
@@ -799,10 +799,83 @@ proc test_next_with_recursion {} {
}

test_clear_command
test_next_with_recursion

+
+#********
+
+# build a new file with optimization enabled so that we can try breakpoints
+# on targets with optimized prologues
+
+set binfileo2 ${objdir}/${subdir}/${testfile}o2
+
+if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfileo2}" executable {debug additional_flags="-O2" }] != "" } {
+ gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
+}
+
+if [get_compiler_info ${binfileo2}] {
+ return -1
+}
+
+gdb_exit
+gdb_start
+gdb_reinitialize_dir $srcdir/$subdir
+gdb_load ${binfileo2}
+
+if [target_info exists gdb_stub] {
+ gdb_step_for_stub;
+}
+
+#
+# test break at function
+#
+gdb_test "break main" \
+ "Breakpoint.*at.* file .*$srcfile, line.*" \
+ "breakpoint function, optimized file"
+
+#
+# test break at function
+#
+gdb_test "break marker4" \
+ "Breakpoint.*at.* file .*$srcfile, line.*" \
+ "breakpoint small function, optimized file"
+
+#
+# run until the breakpoint at main is hit. For non-stubs-using targets.
+#
+if ![target_info exists use_gdb_stub] {
+ if [istarget "*-*-vxworks*"] then {
+ send_gdb "run vxmain \"2\"\n"
+ set timeout 120
+ verbose "Timeout is now $timeout seconds" 2
+ } else {
+ send_gdb "run\n"
+ }
+ gdb_expect {
+ -re "The program .* has been started already.*y or n. $" {
+ send_gdb "y\n"
+ exp_continue
+ }
+ -re "Starting program.*Breakpoint \[0-9\]+,.*main .*argc.*argv.* at .*$srcfile:75.*75\[\t \]+if .argc.* \{.*$gdb_prompt $"\
+ { pass "run until function breakpoint, optimized file" }
+ -re ".*$gdb_prompt $" { fail "run until function breakpoint, optimized file" }
+ timeout { fail "run until function breakpoint, optimized file (timeout)" }
+ }
+} else {
+ if ![target_info exists gdb_stub] {
+ gdb_test continue ".*Continuing\\..*Breakpoint \[0-9\]+, main \\(argc=.*, argv=.*, envp=.*\\) at .*$srcfile:75.*75\[\t \]+if .argc.*\{.*" "stub continue, optimized file"
+ }
+}
+
+#
+# run until the breakpoint at a small function
+#
+gdb_test continue "Continuing\\..*Breakpoint \[0-9\]+, marker4 \\(d=177601976\\) at .*$srcfile:51.*51\[\t \]+void.*marker4.*" \
+ "run until breakpoint set at small function, optimized file"
+
+
# Reset the default arguments for VxWorks
if [istarget "*-*-vxworks*"] {
set timeout 10
verbose "Timeout is now $timeout seconds" 2
send_gdb "set args main\n"
From Peter.Schauer@regent.e-technik.tu-muenchen.de Sun Mar 19 13:08:00 2000
From: "Peter.Schauer" <Peter.Schauer@regent.e-technik.tu-muenchen.de>
To: eliz@delorie.com (Eli Zaretskii)
Cc: jimb@zwingli.cygnus.com, gdb-patches@sourceware.cygnus.com
Subject: Re: RFA: minor watchpoint code cleanup
Date: Sun, 19 Mar 2000 13:08:00 -0000
Message-id: <200003192107.WAA12743@reisser.regent.e-technik.tu-muenchen.de>
References: <200003190944.EAA07454@indy.delorie.com>
X-SW-Source: 2000-03/msg00349.html
Content-length: 1635

> While we are talking: someone (H.J. Lu?) suggested to make the
> watchpoint insertion code common to all x86 targets. What's the
> current say-so on this?

With Solaris x86 2.6 and beyond we can get an unlimited amount of watchpoints
with only a few restrictions via page fault handling, procfs and appropriate
Solaris kernel support.

I don't object to common watchpoint insertion code (using x86 debug registers)
for other x86 targets, but we should be able to override it via the tm/nm
config files.

My (currently experimental) version of config/nm-i386sol2.h has this:

#if defined (NEW_PROC_API)

/* Solaris supports procfs watchpoints starting with 2.6. */
#define TARGET_HAS_HARDWARE_WATCHPOINTS

#define TARGET_CAN_USE_HARDWARE_WATCHPOINT(type, cnt, ot) 1

/* When a hardware watchpoint fires off the PC will be left after the
instruction which caused the watchpoint. */

#define STOPPED_BY_WATCHPOINT(W) \
procfs_stopped_by_watchpoint(inferior_pid)
extern int procfs_stopped_by_watchpoint PARAMS ((int));

#define HAVE_CONTINUABLE_WATCHPOINT

#define CANNOT_STEP_HW_WATCHPOINTS

/* Use these macros for watchpoint insertion/deletion. */
/* TYPE is target_hw_bp_type. */
#define target_insert_watchpoint(ADDR, LEN, TYPE) \
procfs_set_watchpoint (inferior_pid, ADDR, LEN, TYPE, 1)
#define target_remove_watchpoint(ADDR, LEN, TYPE) \
procfs_set_watchpoint (inferior_pid, ADDR, 0, 0, 1)
extern int procfs_set_watchpoint PARAMS ((int, CORE_ADDR, int, int, int));

#define TARGET_REGION_SIZE_OK_FOR_HW_WATCHPOINT(SIZE) 1

#endif /* NEW_PROC_API */

--
Peter Schauer pes@regent.e-technik.tu-muenchen.de
From kettenis@wins.uva.nl Sun Mar 19 14:36:00 2000
From: Mark Kettenis <kettenis@wins.uva.nl>
To: jimb@cygnus.com
Cc: msnyder@cygnus.com, ac131313@cygnus.com, gdb-patches@sourceware.cygnus.com
Subject: Re: RFA: Fix arguments passed to W_SETSTOP
Date: Sun, 19 Mar 2000 14:36:00 -0000
Message-id: <200003192236.e2JMaKs00612@delius.kettenis.local>
References: <38A12872.13D194C4@cygnus.com> <200002091429.e19ETk916570@delius.kettenis.local> <npog8d8e85.fsf_-_@zwingli.cygnus.com>
X-SW-Source: 2000-03/msg00350.html
Content-length: 245

From: Jim Blandy <jimb@cygnus.com>
Date: 17 Mar 2000 16:43:22 -0500

Looks like a careless cut and paste. Does this fix look right?

Sure that's what my origional patch did. Looks like Michael fiddled a
bit too much with it :-)

Mark
From kettenis@wins.uva.nl Sun Mar 19 14:48:00 2000
From: Mark Kettenis <kettenis@wins.uva.nl>
To: eliz@is.elta.co.il
Cc: jimb@zwingli.cygnus.com, kevinb@cygnus.com, gdb-patches@sourceware.cygnus.com
Subject: Re: Linux sigtramp detection code moved to its proper place
Date: Sun, 19 Mar 2000 14:48:00 -0000
Message-id: <200003192248.e2JMm1H00626@delius.kettenis.local>
References: <200003162241.RAA19616@zwingli.cygnus.com> <1000316225504.ZM3009@ocotillo.lan> <npsnxp8ix6.fsf@zwingli.cygnus.com> <200003182227.RAA07058@indy.delorie.com>
X-SW-Source: 2000-03/msg00351.html
Content-length: 1038

Date: Sat, 18 Mar 2000 17:27:44 -0500 (EST)
From: Eli Zaretskii <eliz@delorie.com>

> *** gdb/Makefile.in 2000/03/16 10:23:38 1.13
> --- gdb/Makefile.in 2000/03/17 19:59:40
> ***************
> *** 1063,1068 ****
> --- 1063,1069 ----
> i386-tdep.c i386b-nat.c i386mach-nat.c i386v-nat.c i386-linux-nat.c \
> i386aix-nat.c i386m3-nat.c i386v4-nat.c i386ly-tdep.c \
> i387-tdep.c \
> + i386-linux-tdep.c \
> i960-tdep.c \
> infptrace.c inftarg.c irix4-nat.c irix5-nat.c isi-xdep.c \
> lynx-nat.c m3-nat.c \

I see you already added the new file. Sigh... Is it possible to find
a different name for it, one which won't clash with i386-linux-nat.c?
How about i386linux-tdep.c, for example?

Yuck, that's ugly!

Is it really important that these Linux-specific files are correctly
extracted on MS-DOS? I believe your argument was about buggy tar
programs floating around, but I don't think it is too much too ask
people to fix their tar before trying to build GDB.

Mark
From kingdon@redhat.com Sun Mar 19 14:52:00 2000
From: Jim Kingdon <kingdon@redhat.com>
To: gdb-patches@sourceware.cygnus.com
Subject: make_cleanup_func elimination
Date: Sun, 19 Mar 2000 14:52:00 -0000
Message-id: <200003192252.RAA14902@devserv.devel.redhat.com>
X-SW-Source: 2000-03/msg00352.html
Content-length: 60783

This patch takes the advice of the comments in defs.h.

I did try a few testsuite runs without obvious disasters, but I needed
to re-do them to get completely good numbers, and I haven't been
getting around to that. So sending the patch in now seemed better
than just letting it sit around without telling anyone.

2000-03-13 Jim Kingdon <kingdon@redhat.com>

Fix dubious assumptions about sizes of host pointers and ints and
such in calling make_cleanup:
* coffread.c, solib.c, dbxread.c, mipsread.c, os9kread.c,
elfread.c, nlmread.c, somread.c, xcoffread.c, ax-gdb.c,
tracepoint.c, dwarf2read.c, command.c, eval.c, top.c, event-top.c,
top.h, breakpoint.h, breakpoint.c, infrun.c, infcmd.c, varobj.c,
parse.c, stack.c, printcmd.c, symfile.c, symtab.c, thread.c,
typeprint.c, valops.c, procfs.c, hp-psymtab-read.c, hppa-tdep.c,
sparcl-tdep.c, remote-udi.c, procfs.c, remote-e7000.c: Don't cast
argument to make_cleanup. Instead give the function we pass the
right argument type one way or another. In various cases change
argument types or add wrapper functions. In the case of bfd_close
(many places), close (procfs.c), closedir (procfs.c), chdir
(top.c), fclose (top.c), add error handling.
* defs.h (make_cleanup_func): Remove.

Index: ax-gdb.c
===================================================================
RCS file: /cvs/src/src/gdb/ax-gdb.c,v
retrieving revision 1.1.1.7
diff -u -r1.1.1.7 ax-gdb.c
--- ax-gdb.c 2000/02/02 00:21:04 1.1.1.7
+++ ax-gdb.c 2000/03/19 21:58:04
@@ -1798,7 +1798,7 @@
struct agent_expr *ax = new_agent_expr (0);
union exp_element *pc;

- old_chain = make_cleanup ((make_cleanup_func) free_agent_expr, ax);
+ old_chain = make_cleanup (cleanup_agent_expr, ax);

pc = expr->elts;
trace_kludge = 0;
@@ -1854,7 +1854,7 @@
union exp_element *pc;
struct axs_value value;

- old_chain = make_cleanup ((make_cleanup_func) free_agent_expr, ax);
+ old_chain = make_cleanup (cleanup_agent_expr, ax);

pc = expr->elts;
trace_kludge = 1;
@@ -1923,9 +1923,9 @@
error_no_arg ("expression to translate");

expr = parse_expression (exp);
- old_chain = make_cleanup ((make_cleanup_func) free_current_contents, &expr);
+ old_chain = make_cleanup (free_current_contents, &expr);
agent = gen_trace_for_expr (fi->pc, expr);
- make_cleanup ((make_cleanup_func) free_agent_expr, agent);
+ make_cleanup (cleanup_agent_expr, agent);
ax_print (gdb_stdout, agent);

/* It would be nice to call ax_reqs here to gather some general info
Index: ax-general.c
===================================================================
RCS file: /cvs/src/src/gdb/ax-general.c,v
retrieving revision 1.1.1.5
diff -u -r1.1.1.5 ax-general.c
--- ax-general.c 2000/02/02 00:21:04 1.1.1.5
+++ ax-general.c 2000/03/19 21:58:05
@@ -62,6 +62,12 @@
free (x);
}

+/* Like free_agent_expr but callable through make_cleanup. */
+void
+cleanup_agent_expr (void *arg)
+{
+ free_agent_expr ((struct agent_expr *) arg);
+}

/* Make sure that X has room for at least N more bytes. This doesn't
affect the length, just the allocated size. */
Index: ax.h
===================================================================
RCS file: /cvs/src/src/gdb/ax.h,v
retrieving revision 1.1.1.4
diff -u -r1.1.1.4 ax.h
--- ax.h 2000/02/02 00:21:04 1.1.1.4
+++ ax.h 2000/03/19 21:58:05
@@ -144,6 +144,9 @@
/* Free a agent expression. */
extern void free_agent_expr PARAMS ((struct agent_expr *));

+/* Like free_agent_expr but callable through make_cleanup. */
+extern void cleanup_agent_expr (void *arg);
+
/* Append a simple operator OP to EXPR. */
extern void ax_simple PARAMS ((struct agent_expr * EXPR, enum agent_op OP));

Index: breakpoint.c
===================================================================
RCS file: /cvs/src/src/gdb/breakpoint.c,v
retrieving revision 1.2
diff -u -r1.2 breakpoint.c
--- breakpoint.c 2000/02/23 00:25:42 1.2
+++ breakpoint.c 2000/03/19 21:58:11
@@ -1895,7 +1895,7 @@
struct cleanup *old_chain;
struct ui_stream *stb;
stb = ui_out_stream_new (uiout);
- old_chain = make_cleanup ((make_cleanup_func) ui_out_stream_delete, stb);
+ old_chain = make_cleanup_ui_out_stream_delete (stb);
#endif /* UI_OUT */
/* bs->breakpoint_at can be NULL if it was a momentary breakpoint
which has since been deleted. */
@@ -3932,7 +3932,7 @@
}

void
-disable_longjmp_breakpoint ()
+disable_longjmp_breakpoint (void *ignore)
{
register struct breakpoint *b;

@@ -4396,7 +4396,7 @@
struct ui_stream *stb;

stb = ui_out_stream_new (uiout);
- old_chain = make_cleanup ((make_cleanup_func) ui_out_stream_delete, stb);
+ old_chain = make_cleanup_ui_out_stream_delete, stb);
#endif /* UI_OUT */

/* FIXME: This is misplaced; mention() is called by things (like hitting a
@@ -5679,10 +5679,9 @@
breakpoint = set_momentary_breakpoint (sal, selected_frame, bp_until);

if (!event_loop_p || !target_can_async_p ())
- old_chain = make_cleanup ((make_cleanup_func) delete_breakpoint,
- breakpoint);
+ old_chain = make_cleanup (cleanup_breakpoint, breakpoint);
else
- old_chain = make_exec_cleanup ((make_cleanup_func) delete_breakpoint, breakpoint);
+ old_chain = make_exec_cleanup (cleanup_breakpoint, breakpoint);

/* If we are running asynchronously, and the target supports async
execution, we are not waiting for the target to stop, in the call
@@ -5713,9 +5712,9 @@
sal.pc = prev_frame->pc;
breakpoint = set_momentary_breakpoint (sal, prev_frame, bp_until);
if (!event_loop_p || !target_can_async_p ())
- make_cleanup ((make_cleanup_func) delete_breakpoint, breakpoint);
+ make_cleanup (cleanup_breakpoint, breakpoint);
else
- make_exec_cleanup ((make_cleanup_func) delete_breakpoint, breakpoint);
+ make_exec_cleanup (cleanup_breakpoint, breakpoint);
}

proceed (-1, TARGET_SIGNAL_DEFAULT, 0);
@@ -6993,6 +6992,12 @@
bpt->type = bp_none;

free ((PTR) bpt);
+}
+
+void
+cleanup_breakpoint (void *arg)
+{
+ delete_breakpoint (arg);
}

void
Index: breakpoint.h
===================================================================
RCS file: /cvs/src/src/gdb/breakpoint.h,v
retrieving revision 1.1.1.11
diff -u -r1.1.1.11 breakpoint.h
--- breakpoint.h 2000/02/03 04:14:27 1.1.1.11
+++ breakpoint.h 2000/03/19 21:58:11
@@ -545,6 +545,8 @@

extern void delete_breakpoint PARAMS ((struct breakpoint *));

+extern void cleanup_breakpoint (void *);
+
extern void breakpoint_auto_delete PARAMS ((bpstat));

extern void breakpoint_clear_ignore_counts PARAMS ((void));
@@ -600,7 +602,7 @@

extern void enable_longjmp_breakpoint PARAMS ((void));

-extern void disable_longjmp_breakpoint PARAMS ((void));
+extern void disable_longjmp_breakpoint (void *);

extern void set_longjmp_resume_breakpoint PARAMS ((CORE_ADDR,
struct frame_info *));
Index: coffread.c
===================================================================
RCS file: /cvs/src/src/gdb/coffread.c,v
retrieving revision 1.2
diff -u -r1.2 coffread.c
--- coffread.c 2000/02/08 04:39:01 1.2
+++ coffread.c 2000/03/19 21:58:13
@@ -203,7 +203,7 @@

static void enter_linenos PARAMS ((long, int, int, struct objfile *));

-static void free_linetab PARAMS ((void));
+static void free_linetab (void *);

static int init_lineno PARAMS ((bfd *, long, int));

@@ -211,7 +211,7 @@

static char *coff_getfilename PARAMS ((union internal_auxent *));

-static void free_stringtab PARAMS ((void));
+static void free_stringtab (void *);

static int init_stringtab PARAMS ((bfd *, long));

@@ -638,7 +638,7 @@
temp_sym = (char *) xmalloc
(cdata->local_symesz + cdata->local_auxesz);
temp_aux = temp_sym + cdata->local_symesz;
- back_to = make_cleanup ((make_cleanup_func) free_current_contents, &temp_sym);
+ back_to = make_cleanup (free_current_contents, &temp_sym);

/* We need to know whether this is a PE file, because in PE files,
unlike standard COFF files, symbol values are stored as offsets
@@ -656,7 +656,7 @@
info->max_lineno_offset = 0;
bfd_map_over_sections (abfd, find_linenos, (PTR) info);

- make_cleanup ((make_cleanup_func) free_linetab, 0);
+ make_cleanup (free_linetab, NULL);
val = init_lineno (abfd, info->min_lineno_offset,
info->max_lineno_offset - info->min_lineno_offset);
if (val < 0)
@@ -664,13 +664,13 @@

/* Now read the string table, all at once. */

- make_cleanup ((make_cleanup_func) free_stringtab, 0);
+ make_cleanup (free_stringtab, NULL);
val = init_stringtab (abfd, stringtab_offset);
if (val < 0)
error ("\"%s\": can't get string table", name);

init_minimal_symbol_collection ();
- make_cleanup ((make_cleanup_func) discard_minimal_symbols, 0);
+ make_cleanup (discard_minimal_symbols, 0);

/* Now that the executable file is positioned at symbol table,
process it and define symbols accordingly. */
@@ -1247,7 +1247,7 @@
int val;
unsigned char lengthbuf[4];

- free_stringtab ();
+ free_stringtab (NULL);

/* If the file is stripped, the offset might be zero, indicating no
string table. Just return with `stringtab' set to null. */
@@ -1280,7 +1280,7 @@
}

static void
-free_stringtab ()
+free_stringtab (void *ignore)
{
if (stringtab)
free (stringtab);
@@ -1359,7 +1359,7 @@
linetab_offset = offset;
linetab_size = size;

- free_linetab ();
+ free_linetab (NULL);

if (size == 0)
return 0;
@@ -1381,7 +1381,7 @@
}

static void
-free_linetab ()
+free_linetab (void *ignore)
{
if (linetab)
free (linetab);
Index: command.c
===================================================================
RCS file: /cvs/src/src/gdb/command.c,v
retrieving revision 1.2
diff -u -r1.2 command.c
--- command.c 2000/02/09 08:52:45 1.2
+++ command.c 2000/03/19 21:58:14
@@ -1370,7 +1370,7 @@
int quote;

stb = ui_out_stream_new (uiout);
- old_chain = make_cleanup ((make_cleanup_func) ui_out_stream_delete, stb);
+ old_chain = make_cleanup_ui_out_stream_delete (stb);
#endif /* UI_OUT */

/* Print doc minus "show" at start. */
Index: corelow.c
===================================================================
RCS file: /cvs/src/src/gdb/corelow.c,v
retrieving revision 1.1.1.6
diff -u -r1.1.1.6 corelow.c
--- corelow.c 1999/12/08 02:50:37 1.1.1.6
+++ corelow.c 2000/03/19 21:58:15
@@ -32,6 +32,7 @@
#include "target.h"
#include "gdbcore.h"
#include "gdbthread.h"
+#include "symfile.h" /* cleanup_bfd_close */

/* List of all available core_fns. On gdb startup, each core file register
reader calls add_core_fns() to register information on each core format it
@@ -207,6 +208,12 @@
core_vec = NULL;
}

+static void
+cleanup_core_close (void *arg)
+{
+ core_close (0);
+}
+
#ifdef SOLIB_ADD
/* Stub function for catch_errors around shared library hacking. FROM_TTYP
is really an int * which points to from_tty. */
@@ -292,10 +299,7 @@
!gdb_check_format (temp_bfd))
{
/* Do it after the err msg */
- /* FIXME: should be checking for errors from bfd_close (for one thing,
- on error it does not free all the storage associated with the
- bfd). */
- make_cleanup ((make_cleanup_func) bfd_close, temp_bfd);
+ make_cleanup (cleanup_bfd_close, temp_bfd);
error ("\"%s\" is not a core dump: %s",
filename, bfd_errmsg (bfd_get_error ()));
}
@@ -305,7 +309,7 @@
discard_cleanups (old_chain); /* Don't free filename any more */
unpush_target (&core_ops);
core_bfd = temp_bfd;
- old_chain = make_cleanup ((make_cleanup_func) core_close, core_bfd);
+ old_chain = make_cleanup (cleanup_core_close, NULL);

/* Find a suitable core file handler to munch on core_bfd */
core_vec = sniff_core_bfd (core_bfd);
@@ -488,10 +492,7 @@
if (!bfd_check_format (temp_bfd, bfd_core))
{
/* Do it after the err msg */
- /* FIXME: should be checking for errors from bfd_close (for one thing,
- on error it does not free all the storage associated with the
- bfd). */
- make_cleanup ((make_cleanup_func) bfd_close, temp_bfd);
+ make_cleanup (cleanup_bfd_close, temp_bfd);
error ("\"%s\" is not a core dump: %s",
core, bfd_errmsg (bfd_get_error ()));
}
Index: dbxread.c
===================================================================
RCS file: /cvs/src/src/gdb/dbxread.c,v
retrieving revision 1.1.1.10
diff -u -r1.1.1.10 dbxread.c
--- dbxread.c 2000/01/06 03:06:36 1.1.1.10
+++ dbxread.c 2000/03/19 21:58:17
@@ -624,7 +624,7 @@
back_to = make_cleanup (really_free_pendings, 0);

init_minimal_symbol_collection ();
- make_cleanup ((make_cleanup_func) discard_minimal_symbols, 0);
+ make_cleanup (discard_minimal_symbols, 0);

/* Read stabs data from executable file and define symbols. */

@@ -1094,6 +1094,12 @@
bincls_allocated = 0;
}

+static void
+cleanup_bincl_list (void *arg)
+{
+ free_bincl_list (arg);
+}
+
/* Scan a SunOs dynamic symbol table for symbols of interest and
add them to the minimal symbol table. */

@@ -1295,7 +1301,7 @@

/* Init bincl list */
init_bincl_list (20, objfile);
- back_to = make_cleanup ((make_cleanup_func) free_bincl_list, objfile);
+ back_to = make_cleanup (cleanup_bincl_list, objfile);

last_source_file = NULL;

Index: defs.h
===================================================================
RCS file: /cvs/src/src/gdb/defs.h,v
retrieving revision 1.11
diff -u -r1.11 defs.h
--- defs.h 2000/03/13 07:30:00 1.11
+++ defs.h 2000/03/19 21:58:18
@@ -293,13 +293,6 @@
extern void discard_exec_error_cleanups (struct cleanup *);
extern void discard_my_cleanups (struct cleanup **, struct cleanup *);

-/* DEPRECATED: cagney/2000-03-04: Do not use this typedef to cast
- function pointers so that they match the argument to the various
- cleanup functions. Post GDB 5.0, this typedef will be
- deleted. [Editors note: cagney was the person that added most of
- those type casts] */
-typedef void (*make_cleanup_func) (void *);
-
/* NOTE: cagney/2000-03-04: This typedef is strictly for the
make_cleanup function declarations below. Do not use this typedef
as a cast when passing functions into the make_cleanup() code.
@@ -332,7 +325,7 @@
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 *);

@@ -618,6 +611,7 @@
extern struct command_line *read_command_lines (char *, int);

extern void free_command_lines (struct command_line **);
+extern void cleanup_command_lines (void *);

/* To continue the execution commands when running gdb asynchronously.
A continuation structure contains a pointer to a function to be called
Index: dwarf2read.c
===================================================================
RCS file: /cvs/src/src/gdb/dwarf2read.c,v
retrieving revision 1.3
diff -u -r1.3 dwarf2read.c
--- dwarf2read.c 2000/02/29 05:10:04 1.3
+++ dwarf2read.c 2000/03/19 21:58:22
@@ -717,6 +717,7 @@
struct die_info *read_comp_unit PARAMS ((char *, bfd *));

static void free_die_list PARAMS ((struct die_info *));
+static void cleanup_die_list (void *);

static void process_die PARAMS ((struct die_info *, struct objfile *));

@@ -1342,7 +1343,7 @@

dies = read_comp_unit (info_ptr, abfd);

- make_cleanup ((make_cleanup_func) free_die_list, dies);
+ make_cleanup (cleanup_die_list, dies);

/* Do line number decoding in read_file_scope () */
process_die (dies, objfile);
@@ -2018,7 +2019,7 @@
(fip->nfnfields + DW_FIELD_ALLOC_CHUNK)
* sizeof (struct fnfieldlist));
if (fip->nfnfields == 0)
- make_cleanup ((make_cleanup_func) free_current_contents,
+ make_cleanup (free_current_contents,
&fip->fnfieldlists);
}
flp = &fip->fnfieldlists[fip->nfnfields];
@@ -2526,7 +2527,7 @@
xrealloc (range_types, (ndim + DW_FIELD_ALLOC_CHUNK)
* sizeof (struct type *));
if (ndim == 0)
- make_cleanup ((make_cleanup_func) free_current_contents,
+ make_cleanup (free_current_contents,
&range_types);
}
range_types[ndim++] = create_range_type (NULL, index_type, low, high);
@@ -2978,6 +2979,13 @@
}
}

+static void
+cleanup_die_list (arg)
+ void *arg;
+{
+ free_die_list (arg);
+}
+
/* Read the contents of the section at OFFSET and of size SIZE from the
object file specified by OBJFILE into the psymbol_obstack and return it. */

@@ -3789,7 +3797,7 @@
line_ptr += 1;
lh.standard_opcode_lengths = (unsigned char *)
xmalloc (lh.opcode_base * sizeof (unsigned char));
- back_to = make_cleanup ((make_cleanup_func) free_current_contents,
+ back_to = make_cleanup (free_current_contents,
&lh.standard_opcode_lengths);

lh.standard_opcode_lengths[0] = 1;
@@ -3809,7 +3817,7 @@
xrealloc (dirs.dirs,
(dirs.num_dirs + DIR_ALLOC_CHUNK) * sizeof (char *));
if (dirs.num_dirs == 0)
- make_cleanup ((make_cleanup_func) free_current_contents, &dirs.dirs);
+ make_cleanup (free_current_contents, &dirs.dirs);
}
dirs.dirs[dirs.num_dirs++] = cur_dir;
}
@@ -3826,7 +3834,7 @@
(files.num_files + FILE_ALLOC_CHUNK)
* sizeof (struct fileinfo));
if (files.num_files == 0)
- make_cleanup ((make_cleanup_func) free_current_contents,
+ make_cleanup (free_current_contents,
&files.files);
}
files.files[files.num_files].name = cur_file;
@@ -3902,7 +3910,7 @@
(files.num_files + FILE_ALLOC_CHUNK)
* sizeof (struct fileinfo));
if (files.num_files == 0)
- make_cleanup ((make_cleanup_func) free_current_contents,
+ make_cleanup (free_current_contents,
&files.files);
}
files.files[files.num_files].name = cur_file;
Index: elfread.c
===================================================================
RCS file: /cvs/src/src/gdb/elfread.c,v
retrieving revision 1.4
diff -u -r1.4 elfread.c
--- elfread.c 2000/02/15 04:48:23 1.4
+++ elfread.c 2000/03/19 21:58:22
@@ -593,7 +593,7 @@
CORE_ADDR offset;

init_minimal_symbol_collection ();
- back_to = make_cleanup ((make_cleanup_func) discard_minimal_symbols, 0);
+ back_to = make_cleanup (discard_minimal_symbols, 0);

memset ((char *) &ei, 0, sizeof (ei));

Index: eval.c
===================================================================
RCS file: /cvs/src/src/gdb/eval.c,v
retrieving revision 1.1.1.7
diff -u -r1.1.1.7 eval.c
--- eval.c 1999/12/14 01:05:30 1.1.1.7
+++ eval.c 2000/03/19 21:58:24
@@ -82,7 +82,7 @@
struct expression *expr = parse_expression (exp);
register CORE_ADDR addr;
register struct cleanup *old_chain =
- make_cleanup ((make_cleanup_func) free_current_contents, &expr);
+ make_cleanup (free_current_contents, &expr);

addr = value_as_pointer (evaluate_expression (expr));
do_cleanups (old_chain);
@@ -99,7 +99,7 @@
struct expression *expr = parse_exp_1 (expptr, (struct block *) 0, 0);
register CORE_ADDR addr;
register struct cleanup *old_chain =
- make_cleanup ((make_cleanup_func) free_current_contents, &expr);
+ make_cleanup (free_current_contents, &expr);

addr = value_as_pointer (evaluate_expression (expr));
do_cleanups (old_chain);
@@ -113,7 +113,7 @@
struct expression *expr = parse_expression (exp);
register value_ptr val;
register struct cleanup *old_chain
- = make_cleanup ((make_cleanup_func) free_current_contents, &expr);
+ = make_cleanup (free_current_contents, &expr);

val = evaluate_expression (expr);
do_cleanups (old_chain);
@@ -131,7 +131,7 @@
struct expression *expr = parse_exp_1 (expp, (struct block *) 0, 1);
register value_ptr val;
register struct cleanup *old_chain
- = make_cleanup ((make_cleanup_func) free_current_contents, &expr);
+ = make_cleanup (free_current_contents, &expr);

val = evaluate_expression (expr);
do_cleanups (old_chain);
Index: event-top.c
===================================================================
RCS file: /cvs/src/src/gdb/event-top.c,v
retrieving revision 1.3
diff -u -r1.3 event-top.c
--- event-top.c 2000/03/03 15:37:09 1.3
+++ event-top.c 2000/03/19 21:58:25
@@ -487,7 +487,7 @@
quit_flag = 0;
if (instream == stdin && stdin_is_tty)
reinitialize_more_filter ();
- old_chain = make_cleanup ((make_cleanup_func) command_loop_marker, 0);
+ old_chain = make_cleanup (command_loop_marker, 0);

#if defined(TUI)
insert_mode = 0;
Index: hp-psymtab-read.c
===================================================================
RCS file: /cvs/src/src/gdb/hp-psymtab-read.c,v
retrieving revision 1.1.1.6
diff -u -r1.1.1.6 hp-psymtab-read.c
--- hp-psymtab-read.c 1999/12/22 21:45:06 1.1.1.6
+++ hp-psymtab-read.c 2000/03/19 21:58:27
@@ -1628,7 +1628,7 @@
(struct partial_symtab **) alloca (dependencies_allocated *
sizeof (struct partial_symtab *));

- old_chain = make_cleanup ((make_cleanup_func) free_objfile, objfile);
+ old_chain = make_cleanup (cleanup_objfile, objfile);

last_source_file = 0;

Index: hppa-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/hppa-tdep.c,v
retrieving revision 1.2
diff -u -r1.2 hppa-tdep.c
--- hppa-tdep.c 2000/02/09 08:52:45 1.2
+++ hppa-tdep.c 2000/03/19 21:58:31
@@ -1618,7 +1618,7 @@
breakpoint->silent = 1;

/* So we can clean things up. */
- old_chain = make_cleanup ((make_cleanup_func) delete_breakpoint, breakpoint);
+ old_chain = make_cleanup (cleanup_breakpoint, breakpoint);

/* Start up the inferior. */
clear_proceed_status ();
Index: infcmd.c
===================================================================
RCS file: /cvs/src/src/gdb/infcmd.c,v
retrieving revision 1.2
diff -u -r1.2 infcmd.c
--- infcmd.c 2000/02/23 15:53:33 1.2
+++ infcmd.c 2000/03/19 21:58:32
@@ -489,10 +489,9 @@
{
enable_longjmp_breakpoint ();
if (!event_loop_p || !target_can_async_p ())
- cleanups = make_cleanup ((make_cleanup_func) disable_longjmp_breakpoint,
- 0);
+ cleanups = make_cleanup (disable_longjmp_breakpoint, NULL);
else
- make_exec_cleanup ((make_cleanup_func) disable_longjmp_breakpoint, 0);
+ make_exec_cleanup (disable_longjmp_breakpoint, NULL);
}

/* In synchronous case, all is well, just use the regular for loop. */
@@ -1194,9 +1193,9 @@
breakpoint = set_momentary_breakpoint (sal, frame, bp_finish);

if (!event_loop_p || !target_can_async_p ())
- old_chain = make_cleanup ((make_cleanup_func) delete_breakpoint, breakpoint);
+ old_chain = make_cleanup (cleanup_breakpoint, breakpoint);
else
- old_chain = make_exec_cleanup ((make_cleanup_func) delete_breakpoint, breakpoint);
+ old_chain = make_exec_cleanup (cleanup_breakpoint, breakpoint);

/* Find the function we will return from. */

Index: inferior.h
===================================================================
RCS file: /cvs/src/src/gdb/inferior.h,v
retrieving revision 1.2
diff -u -r1.2 inferior.h
--- inferior.h 2000/02/29 13:53:59 1.2
+++ inferior.h 2000/03/19 21:58:32
@@ -40,7 +40,7 @@

extern struct inferior_status *save_inferior_status PARAMS ((int));

-extern void restore_inferior_status PARAMS ((struct inferior_status *));
+extern void restore_inferior_status (void *);

extern void discard_inferior_status PARAMS ((struct inferior_status *));

Index: infrun.c
===================================================================
RCS file: /cvs/src/src/gdb/infrun.c,v
retrieving revision 1.4
diff -u -r1.4 infrun.c
--- infrun.c 2000/02/29 07:17:15 1.4
+++ infrun.c 2000/03/19 21:58:36
@@ -46,7 +46,7 @@

static void sig_print_header (void);

-static void resume_cleanups (int);
+static void resume_cleanups (void *);

static int hook_stop_stub (void *);

@@ -745,7 +745,7 @@
/* Things to clean up if we QUIT out of resume (). */
/* ARGSUSED */
static void
-resume_cleanups (int arg)
+resume_cleanups (void *arg)
{
normal_stop ();
}
@@ -784,8 +784,7 @@
resume (int step, enum target_signal sig)
{
int should_resume = 1;
- struct cleanup *old_cleanups = make_cleanup ((make_cleanup_func)
- resume_cleanups, 0);
+ struct cleanup *old_cleanups = make_cleanup (resume_cleanups, NULL);
QUIT;

#ifdef CANNOT_STEP_BREAKPOINT
@@ -2271,7 +2270,7 @@
/* If we hit the breakpoint at longjmp, disable it for the
duration of this command. Then, install a temporary
breakpoint at the target of the jmp_buf. */
- disable_longjmp_breakpoint ();
+ disable_longjmp_breakpoint (NULL);
remove_breakpoints ();
breakpoints_inserted = 0;
if (!GET_LONGJMP_TARGET (&jmp_buf_pc))
@@ -2322,7 +2321,7 @@
return;
}
#endif /* 0 */
- disable_longjmp_breakpoint ();
+ disable_longjmp_breakpoint (NULL);
ecs->handling_longjmp = 0; /* FIXME */
if (what.main_action == BPSTAT_WHAT_CLEAR_LONGJMP_RESUME)
break;
@@ -4014,8 +4013,10 @@
}

void
-restore_inferior_status (struct inferior_status *inf_status)
+restore_inferior_status (void *arg)
{
+ struct inferior_status *inf_status = (struct inferior_status *) arg;
+
stop_signal = inf_status->stop_signal;
stop_pc = inf_status->stop_pc;
stop_step = inf_status->stop_step;
Index: minsyms.c
===================================================================
RCS file: /cvs/src/src/gdb/minsyms.c,v
retrieving revision 1.3
diff -u -r1.3 minsyms.c
--- minsyms.c 2000/03/09 22:58:49 1.3
+++ minsyms.c 2000/03/19 21:58:37
@@ -728,8 +728,7 @@

/* ARGSUSED */
void
-discard_minimal_symbols (foo)
- int foo;
+discard_minimal_symbols (void *arg)
{
register struct msym_bunch *next;

Index: mipsread.c
===================================================================
RCS file: /cvs/src/src/gdb/mipsread.c,v
retrieving revision 1.1.1.5
diff -u -r1.1.1.5 mipsread.c
--- mipsread.c 1999/09/08 23:59:22 1.1.1.5
+++ mipsread.c 2000/03/19 21:58:37
@@ -94,7 +94,7 @@
struct cleanup *back_to;

init_minimal_symbol_collection ();
- back_to = make_cleanup ((make_cleanup_func) discard_minimal_symbols, 0);
+ back_to = make_cleanup (discard_minimal_symbols, 0);

/* Now that the executable file is positioned at symbol table,
process it and define symbols accordingly. */
Index: nlmread.c
===================================================================
RCS file: /cvs/src/src/gdb/nlmread.c,v
retrieving revision 1.1.1.4
diff -u -r1.1.1.4 nlmread.c
--- nlmread.c 1999/08/09 21:33:43 1.1.1.4
+++ nlmread.c 2000/03/19 21:58:37
@@ -192,7 +192,7 @@
struct symbol *mainsym;

init_minimal_symbol_collection ();
- back_to = make_cleanup ((make_cleanup_func) discard_minimal_symbols, 0);
+ back_to = make_cleanup (discard_minimal_symbols, 0);

/* FIXME, should take a section_offsets param, not just an offset. */

Index: objfiles.c
===================================================================
RCS file: /cvs/src/src/gdb/objfiles.c,v
retrieving revision 1.2
diff -u -r1.2 objfiles.c
--- objfiles.c 2000/02/29 12:58:51 1.2
+++ objfiles.c 2000/03/19 21:58:38
@@ -495,6 +495,12 @@
}
}

+void
+cleanup_objfile (void *arg)
+{
+ free_objfile (arg);
+}
+

/* Free all the object files at once and clean up their users. */

Index: objfiles.h
===================================================================
RCS file: /cvs/src/src/gdb/objfiles.h,v
retrieving revision 1.2
diff -u -r1.2 objfiles.h
--- objfiles.h 2000/03/07 04:33:52 1.2
+++ objfiles.h 2000/03/19 21:58:39
@@ -496,6 +496,9 @@
free_objfile PARAMS ((struct objfile *));

extern void
+cleanup_objfile (void *);
+
+extern void
free_all_objfiles PARAMS ((void));

extern void
Index: os9kread.c
===================================================================
RCS file: /cvs/src/src/gdb/os9kread.c,v
retrieving revision 1.1.1.6
diff -u -r1.1.1.6 os9kread.c
--- os9kread.c 1999/09/08 23:59:23 1.1.1.6
+++ os9kread.c 2000/03/19 21:58:40
@@ -342,7 +342,7 @@
free_pending_blocks ();
back_to = make_cleanup (really_free_pendings, 0);

- make_cleanup ((make_cleanup_func) discard_minimal_symbols, 0);
+ make_cleanup (discard_minimal_symbols, 0);
read_minimal_symbols (objfile);

/* Now that the symbol table data of the executable file are all in core,
Index: parse.c
===================================================================
RCS file: /cvs/src/src/gdb/parse.c,v
retrieving revision 1.1.1.11
diff -u -r1.1.1.11 parse.c
--- parse.c 1999/10/12 04:37:23 1.1.1.11
+++ parse.c 2000/03/19 21:58:41
@@ -78,7 +78,7 @@
extern int hp_som_som_object_present;

static void
-free_funcalls PARAMS ((void));
+free_funcalls (void *);

static void
prefixify_expression PARAMS ((struct expression *));
@@ -177,7 +177,7 @@
Used when there is an error inside parsing. */

static void
-free_funcalls ()
+free_funcalls (void *ignore)
{
register struct funcall *call, *next;

@@ -1165,7 +1165,7 @@
if (lexptr == 0 || *lexptr == 0)
error_no_arg ("expression to compute");

- old_chain = make_cleanup ((make_cleanup_func) free_funcalls, 0);
+ old_chain = make_cleanup (free_funcalls, NULL);
funcall_chain = 0;

expression_context_block = block ? block : get_selected_block ();
@@ -1176,7 +1176,7 @@
expout = (struct expression *)
xmalloc (sizeof (struct expression) + EXP_ELEM_TO_BYTES (expout_size));
expout->language_defn = current_language;
- make_cleanup ((make_cleanup_func) free_current_contents, &expout);
+ make_cleanup (free_current_contents, &expout);

if (current_language->la_parser ())
current_language->la_error (NULL);
Index: printcmd.c
===================================================================
RCS file: /cvs/src/src/gdb/printcmd.c,v
retrieving revision 1.1.1.8
diff -u -r1.1.1.8 printcmd.c
--- printcmd.c 2000/02/05 07:29:47 1.1.1.8
+++ printcmd.c 2000/03/19 21:58:43
@@ -922,7 +922,7 @@
{
struct type *type;
expr = parse_expression (exp);
- old_chain = make_cleanup ((make_cleanup_func) free_current_contents,
+ old_chain = make_cleanup (free_current_contents,
&expr);
cleanup = 1;
val = evaluate_expression (expr);
@@ -1036,7 +1036,7 @@
}

expr = parse_expression (exp);
- old_chain = make_cleanup ((make_cleanup_func) free_current_contents, &expr);
+ old_chain = make_cleanup (free_current_contents, &expr);

val = evaluate_expression (expr);

@@ -1060,7 +1060,7 @@
{
struct expression *expr = parse_expression (exp);
register struct cleanup *old_chain
- = make_cleanup ((make_cleanup_func) free_current_contents, &expr);
+ = make_cleanup (free_current_contents, &expr);
evaluate_expression (expr);
do_cleanups (old_chain);
}
@@ -1357,7 +1357,7 @@
But don't clobber a user-defined command's definition. */
if (from_tty)
*exp = 0;
- old_chain = make_cleanup ((make_cleanup_func) free_current_contents,
+ old_chain = make_cleanup (free_current_contents,
&expr);
val = evaluate_expression (expr);
if (TYPE_CODE (VALUE_TYPE (val)) == TYPE_CODE_REF)
@@ -1840,7 +1840,7 @@
struct ui_stream *stb;

stb = ui_out_stream_new (uiout);
- old_chain = make_cleanup ((make_cleanup_func) ui_out_stream_delete, stb);
+ old_chain = make_cleanup_ui_out_stream_delete (stb);
#endif /* UI_OUT */

if (func)
@@ -2096,8 +2096,7 @@
struct cleanup *old_cleanups;

val_args = (value_ptr *) xmalloc (allocated_args * sizeof (value_ptr));
- old_cleanups = make_cleanup ((make_cleanup_func) free_current_contents,
- &val_args);
+ old_cleanups = make_cleanup (free_current_contents, &val_args);

if (s == 0)
error_no_arg ("format-control string and values to print");
Index: procfs.c
===================================================================
RCS file: /cvs/src/src/gdb/procfs.c,v
retrieving revision 1.3
diff -u -r1.3 procfs.c
--- procfs.c 2000/02/29 13:53:59 1.3
+++ procfs.c 2000/03/19 21:58:46
@@ -707,6 +707,12 @@
}
}

+static void
+cleanup_procinfo (void *arg)
+{
+ destroy_procinfo (arg);
+}
+
enum { NOKILL, KILL };

/*
@@ -2615,6 +2621,20 @@
#endif
}

+static void
+cleanup_close (void *arg)
+{
+ if (close ((int) arg) < 0)
+ perror ("cleanup_close");
+}
+
+static void
+cleanup_closedir (void *arg)
+{
+ if (closedir ((DIR *) arg) < 0)
+ perror ("cleanup_closedir");
+}
+
/*
* Function: proc_iterate_over_mappings
*
@@ -2657,7 +2677,7 @@
proc_error (pi, "proc_iterate_over_mappings (open)", __LINE__);

/* Make sure it gets closed again. */
- make_cleanup ((make_cleanup_func) close, (void *) map_fd);
+ make_cleanup (cleanup_close, (void *) map_fd);

/* Allocate space for mapping (lifetime only for this function). */
map = alloca (sizeof (struct prmap));
@@ -2768,7 +2788,7 @@
return NULL;
}
/* Make sure it gets closed again! */
- old_chain = make_cleanup ((make_cleanup_func) close, (void *) fd);
+ old_chain = make_cleanup (cleanup_close, (void *) fd);

/* Now 'read' thru the table, find a match and return it. */
while (read (fd, ldt_entry, sizeof (struct ssd)) == sizeof (struct ssd))
@@ -3075,7 +3095,7 @@
if ((dirp = opendir (pathname)) == NULL)
proc_error (pi, "update_threads, opendir", __LINE__);

- old_chain = make_cleanup ((make_cleanup_func) closedir, dirp);
+ old_chain = make_cleanup (cleanup_closedir, dirp);
while ((direntry = readdir (dirp)) != NULL)
if (direntry->d_name[0] != '.') /* skip '.' and '..' */
{
@@ -5047,7 +5067,7 @@
if ((argv = buildargv (args)) == NULL)
nomem (0);
else
- make_cleanup ((make_cleanup_func) freeargv, argv);
+ make_cleanup_freeargv (argv);
}
while (argv != NULL && *argv != NULL)
{
@@ -5081,7 +5101,7 @@
/* No. So open a procinfo for it, but
remember to close it again when finished. */
process = create_procinfo (pid, 0);
- make_cleanup ((make_cleanup_func) destroy_procinfo, process);
+ make_cleanup (cleanup_procinfo, process);
if (!open_procinfo_files (process, FD_CTL))
proc_error (process, "info proc, open_procinfo_files", __LINE__);
}
Index: remote-e7000.c
===================================================================
RCS file: /cvs/src/src/gdb/remote-e7000.c,v
retrieving revision 1.2
diff -u -r1.2 remote-e7000.c
--- remote-e7000.c 2000/02/09 08:52:46 1.2
+++ remote-e7000.c 2000/03/19 21:58:48
@@ -1580,7 +1580,7 @@
perror_with_name (filename);
return;
}
- old_chain = make_cleanup ((make_cleanup_func) bfd_close, pbfd);
+ old_chain = make_cleanup (cleanup_bfd_close, pbfd);

if (!bfd_check_format (pbfd, bfd_object))
error ("\"%s\" is not an object file: %s", filename,
Index: remote-udi.c
===================================================================
RCS file: /cvs/src/src/gdb/remote-udi.c,v
retrieving revision 1.2
diff -u -r1.2 remote-udi.c
--- remote-udi.c 2000/02/09 08:52:47 1.2
+++ remote-udi.c 2000/03/19 21:58:49
@@ -1108,7 +1108,7 @@
error ("Must specify at least a file name with the load command");

filename = tilde_expand (filename);
- make_cleanup ((make_cleanup_func) free, filename);
+ make_cleanup (free, filename);

while (token = strtok (NULL, " \t"))
{
@@ -1162,7 +1162,7 @@
/* FIXME: should be checking for errors from bfd_close (for one thing,
on error it does not free all the storage associated with the
bfd). */
- make_cleanup ((make_cleanup_func) bfd_close, pbfd);
+ make_cleanup (cleanup_bfd_close, pbfd);

QUIT;
immediate_quit++;
Index: solib.c
===================================================================
RCS file: /cvs/src/src/gdb/solib.c,v
retrieving revision 1.2
diff -u -r1.2 solib.c
--- solib.c 2000/03/06 18:04:56 1.2
+++ solib.c 2000/03/19 21:58:50
@@ -417,7 +417,7 @@
}

init_minimal_symbol_collection ();
- make_cleanup ((make_cleanup_func) discard_minimal_symbols, 0);
+ make_cleanup (discard_minimal_symbols, 0);

while (rtc_symp)
{
@@ -943,7 +943,7 @@
return 0;
}

- make_cleanup ((make_cleanup_func) free, (void *) filename);
+ make_cleanup (free, filename);
/* Have a pathname: read the symbol file. */
symbol_file_command (filename, from_tty);

Index: somread.c
===================================================================
RCS file: /cvs/src/src/gdb/somread.c,v
retrieving revision 1.1.1.7
diff -u -r1.1.1.7 somread.c
--- somread.c 1999/10/05 23:08:49 1.1.1.7
+++ somread.c 2000/03/19 21:58:51
@@ -366,7 +366,7 @@
do_pxdb (symfile_bfd_open (objfile->name));

init_minimal_symbol_collection ();
- back_to = make_cleanup ((make_cleanup_func) discard_minimal_symbols, 0);
+ back_to = make_cleanup (discard_minimal_symbols, 0);

/* Read in the import list and the export list. Currently
the export list isn't used; the import list is used in
Index: sparcl-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/sparcl-tdep.c,v
retrieving revision 1.1.1.6
diff -u -r1.1.1.6 sparcl-tdep.c
--- sparcl-tdep.c 1999/08/31 01:06:04 1.1.1.6
+++ sparcl-tdep.c 2000/03/19 21:58:51
@@ -44,7 +44,7 @@

static serial_t open_tty PARAMS ((char *name));
static int send_resp PARAMS ((serial_t desc, char c));
-static void close_tty PARAMS ((int ignore));
+static void close_tty (void *);
#ifdef HAVE_SOCKETS
static int recv_udp_buf PARAMS ((int fd, unsigned char *buf, int len, int timeout));
static int send_udp_buf PARAMS ((int fd, unsigned char *buf, int len));
@@ -358,8 +358,7 @@
}

static void
-close_tty (ignore)
- int ignore;
+close_tty (void *arg)
{
if (!remote_desc)
return;
@@ -480,7 +479,7 @@
{
remote_desc = open_tty (p);

- old_chain = make_cleanup ((make_cleanup_func) close_tty, 0);
+ old_chain = make_cleanup (close_tty, 0);

c = send_resp (remote_desc, 0x00);

@@ -614,7 +613,7 @@
perror_with_name (filename);
return;
}
- old_chain = make_cleanup ((make_cleanup_func) bfd_close, pbfd);
+ old_chain = make_cleanup (cleanup_bfd_close, pbfd);

if (!bfd_check_format (pbfd, bfd_object))
error ("\"%s\" is not an object file: %s", filename,
Index: stack.c
===================================================================
RCS file: /cvs/src/src/gdb/stack.c,v
retrieving revision 1.3
diff -u -r1.3 stack.c
--- stack.c 2000/02/29 07:17:15 1.3
+++ stack.c 2000/03/19 21:58:53
@@ -471,7 +471,7 @@
struct cleanup *old_chain;

stb = ui_out_stream_new (uiout);
- old_chain = make_cleanup ((make_cleanup_func) ui_out_stream_delete, stb);
+ old_chain = make_cleanup_ui_out_stream_delete, stb);
#endif /* UI_OUT */

func = find_pc_function (fi->pc);
Index: symfile.c
===================================================================
RCS file: /cvs/src/src/gdb/symfile.c,v
retrieving revision 1.1.1.17
diff -u -r1.1.1.17 symfile.c
--- symfile.c 2000/02/03 04:14:35 1.1.1.17
+++ symfile.c 2000/03/19 21:58:56
@@ -554,13 +554,13 @@

/* Make sure that partially constructed symbol tables will be cleaned up
if an error occurs during symbol reading. */
- old_chain = make_cleanup ((make_cleanup_func) free_objfile, objfile);
+ old_chain = make_cleanup (cleanup_objfile, objfile);

if (mainline)
{
/* We will modify the main symbol table, make sure that all its users
will be cleaned up if an error occurs during symbol reading. */
- make_cleanup ((make_cleanup_func) clear_symtab_users, 0);
+ make_cleanup (cleanup_symtab_users, NULL);

/* Since no error yet, throw away the old symbol table. */

@@ -1145,6 +1145,19 @@
return (sym_bfd);
}

+/* Verison of bfd_close suitable for passing to make_cleanup. */
+void
+cleanup_bfd_close (void *arg)
+{
+ bfd *abfd = (bfd *)arg;
+ char *name = bfd_get_filename (abfd);
+
+ if (!bfd_close (abfd))
+ /* Question: does bfd_close free all the resources associated with
+ the bfd? Should we do it here? */
+ warning ("cannot close \"%s\": %s", name, bfd_errmsg (bfd_get_error ()));
+}
+
/* Link a new symtab_fns into the global symtab_fns list. Called on gdb
startup by the _initialize routine in each object file format reader,
to register information about each format the the reader is prepared
@@ -1257,10 +1270,7 @@
return;
}

- /* FIXME: should be checking for errors from bfd_close (for one thing,
- on error it does not free all the storage associated with the
- bfd). */
- make_cleanup ((make_cleanup_func) bfd_close, loadfile_bfd);
+ make_cleanup (cleanup_bfd_close, loadfile_bfd);

if (!bfd_check_format (loadfile_bfd, bfd_object))
{
@@ -1723,10 +1733,9 @@
/* If we get an error, blow away this objfile (not sure if
that is the correct response for things like shared
libraries). */
- old_cleanups = make_cleanup ((make_cleanup_func) free_objfile,
- objfile);
+ old_cleanups = make_cleanup (cleanup_objfile, objfile);
/* We need to do this whenever any symbols go away. */
- make_cleanup ((make_cleanup_func) clear_symtab_users, 0);
+ make_cleanup (cleanup_symtab_users, NULL);

/* Clean up any state BFD has sitting around. We don't need
to close the descriptor but BFD lacks a way of closing the
@@ -2150,6 +2159,12 @@
target_new_objfile_hook (NULL);
}

+void
+cleanup_symtab_users (void *arg)
+{
+ clear_symtab_users ();
+}
+
/* clear_symtab_users_once:

This function is run after symbol reading, or from a cleanup.
@@ -2331,6 +2346,7 @@

clear_symtab_users_queued++;
make_cleanup (clear_symtab_users_once, 0);
+#error bitrot - clear_symtab_users_once mismatches make_cleanup
blewit = 1;
}
else
Index: symfile.h
===================================================================
RCS file: /cvs/src/src/gdb/symfile.h,v
retrieving revision 1.1.1.6
diff -u -r1.1.1.6 symfile.h
--- symfile.h 1999/10/19 02:46:39 1.1.1.6
+++ symfile.h 2000/03/19 21:58:56
@@ -221,6 +221,8 @@

extern bfd *symfile_bfd_open PARAMS ((char *));

+extern void cleanup_bfd_close (void *);
+
/* Utility functions for overlay sections: */
extern int overlay_debugging;
extern int overlay_cache_invalid;
Index: symtab.c
===================================================================
RCS file: /cvs/src/src/gdb/symtab.c,v
retrieving revision 1.2
diff -u -r1.2 symtab.c
--- symtab.c 2000/02/08 04:39:02 1.2
+++ symtab.c 2000/03/19 21:58:59
@@ -3556,9 +3556,10 @@

/* Free any memory associated with a search. */
void
-free_search_symbols (symbols)
- struct symbol_search *symbols;
+free_search_symbols (void *arg)
{
+ struct symbol_search *symbols = (struct symbol_search *) arg;
+
struct symbol_search *p;
struct symbol_search *next;

@@ -3801,8 +3802,7 @@
if (tail == NULL)
{
sr = psr;
- old_chain = make_cleanup ((make_cleanup_func)
- free_search_symbols, sr);
+ old_chain = make_cleanup (free_search_symbols, sr);
}
else
tail->next = psr;
@@ -3846,8 +3846,8 @@
if (tail == NULL)
{
sr = psr;
- old_chain = make_cleanup ((make_cleanup_func)
- free_search_symbols, &sr);
+ old_chain = make_cleanup (free_search_symbols,
+ &sr);
}
else
tail->next = psr;
@@ -3962,7 +3962,7 @@

/* must make sure that if we're interrupted, symbols gets freed */
search_symbols (regexp, kind, 0, (char **) NULL, &symbols);
- old_chain = make_cleanup ((make_cleanup_func) free_search_symbols, symbols);
+ old_chain = make_cleanup (free_search_symbols, symbols);

printf_filtered (regexp
? "All %ss matching regular expression \"%s\":\n"
@@ -4050,7 +4050,7 @@
struct cleanup *old_chain;

search_symbols (regexp, FUNCTIONS_NAMESPACE, 0, (char **) NULL, &ss);
- old_chain = make_cleanup ((make_cleanup_func) free_search_symbols, ss);
+ old_chain = make_cleanup (free_search_symbols, ss);

for (p = ss; p != NULL; p = p->next)
{
Index: symtab.h
===================================================================
RCS file: /cvs/src/src/gdb/symtab.h,v
retrieving revision 1.2
diff -u -r1.2 symtab.h
--- symtab.h 2000/03/07 04:33:52 1.2
+++ symtab.h 2000/03/19 21:59:00
@@ -1291,7 +1291,7 @@
init_minimal_symbol_collection PARAMS ((void));

extern void
-discard_minimal_symbols PARAMS ((int));
+discard_minimal_symbols (void *);

extern void
install_minimal_symbols PARAMS ((struct objfile *));
@@ -1480,6 +1480,8 @@
extern void
clear_symtab_users PARAMS ((void));

+extern void cleanup_symtab_users (void *);
+
extern enum language
deduce_language_from_filename PARAMS ((char *));

@@ -1517,6 +1519,6 @@
};

extern void search_symbols PARAMS ((char *, namespace_enum, int, char **, struct symbol_search **));
-extern void free_search_symbols PARAMS ((struct symbol_search *));
+extern void free_search_symbols (void *);

#endif /* !defined(SYMTAB_H) */
Index: thread.c
===================================================================
RCS file: /cvs/src/src/gdb/thread.c,v
retrieving revision 1.1.1.11
diff -u -r1.1.1.11 thread.c
--- thread.c 2000/02/03 04:14:36 1.1.1.11
+++ thread.c 2000/03/19 21:59:01
@@ -59,7 +59,7 @@
static int thread_alive PARAMS ((struct thread_info *));
static void info_threads_command PARAMS ((char *, int));
static void thread_apply_command PARAMS ((char *, int));
-static void restore_current_thread PARAMS ((int));
+static void restore_current_thread (void *);
static void switch_to_thread PARAMS ((int pid));
static void prune_threads PARAMS ((void));

@@ -508,10 +508,16 @@
select_frame (get_current_frame (), 0);
}

+struct thread_number {
+ int pid;
+};
+
static void
-restore_current_thread (pid)
- int pid;
+restore_current_thread (void *arg)
{
+ int pid = ((struct thread_number *)arg)->pid;
+ free (arg);
+
if (pid != inferior_pid)
{
switch_to_thread (pid);
@@ -519,6 +525,14 @@
}
}

+static struct cleanup *
+make_cleanup_restore_current_thread (int pid)
+{
+ struct thread_number *tn = xmalloc (sizeof (struct thread_number));
+ tn->pid = pid;
+ return make_cleanup (restore_current_thread, tn);
+}
+
/* Apply a GDB command to a list of threads. List syntax is a whitespace
seperated list of numbers, or ranges, or the keyword `all'. Ranges consist
of two numbers seperated by a hyphen. Examples:
@@ -539,8 +553,7 @@
if (cmd == NULL || *cmd == '\000')
error ("Please specify a command following the thread ID list");

- old_chain = make_cleanup ((make_cleanup_func) restore_current_thread,
- (void *) inferior_pid);
+ old_chain = make_cleanup_restore_current_thread (inferior_pid);

for (tp = thread_list; tp; tp = tp->next)
if (thread_alive (tp))
@@ -575,8 +588,7 @@
if (*cmd == '\000')
error ("Please specify a command following the thread ID list");

- old_chain = make_cleanup ((make_cleanup_func) restore_current_thread,
- (void *) inferior_pid);
+ old_chain = make_cleanup_restore_current_thread (inferior_pid);

while (tidlist < cmd)
{
Index: top.c
===================================================================
RCS file: /cvs/src/src/gdb/top.c,v
retrieving revision 1.4
diff -u -r1.4 top.c
--- top.c 2000/02/24 00:04:03 1.4
+++ top.c 2000/03/19 21:59:04
@@ -76,7 +76,7 @@
/* NOTE 1999-04-29: this function will be static again, after we make the
event loop be the default command loop for gdb, and we merge
event-top.c into this file, top.c */
-/* static */ void command_loop_marker PARAMS ((int));
+/* static */ void command_loop_marker (void *);

static void while_command PARAMS ((char *, int));

@@ -101,7 +101,7 @@

static char *insert_args PARAMS ((char *));

-static void arg_cleanup PARAMS ((void));
+static void arg_cleanup (void *);

static void init_main PARAMS ((void));

@@ -153,7 +153,7 @@
static void disconnect PARAMS ((int));
#endif

-static void source_cleanup PARAMS ((FILE *));
+static void source_cleanup (void *);

/* Default command line prompt. This is overriden in some configs. */

@@ -753,9 +753,10 @@
user-defined command). */

static void
-source_cleanup (stream)
- FILE *stream;
+source_cleanup (void *arg)
{
+ FILE *stream = (void *)arg;
+
/* Restore the previous input stream. */
instream = stream;
}
@@ -767,7 +768,7 @@
{
struct cleanup *cleanups;

- cleanups = make_cleanup ((make_cleanup_func) source_cleanup, instream);
+ cleanups = make_cleanup (source_cleanup, instream);
instream = stream;
command_loop ();
do_cleanups (cleanups);
@@ -777,6 +778,13 @@

void (*pre_init_ui_hook) PARAMS ((void));

+static void
+cleanup_chdir (void *arg)
+{
+ if (chdir (arg) < 0)
+ perror_with_name (arg);
+}
+
void
gdb_init (argv0)
char *argv0;
@@ -792,7 +800,7 @@
#ifdef __MSDOS__
/* Make sure we return to the original directory upon exit, come
what may, since the OS doesn't do that for us. */
- make_final_cleanup ((make_cleanup_func) chdir, strsave (current_directory));
+ make_final_cleanup (cleanup_chdir, strsave (current_directory));
#endif

init_cmd_lists (); /* This needs to be done first */
@@ -877,7 +885,7 @@
/* Allocate and build a new command line structure. */
cmd = build_command_line (type, arg);

- old_chain = make_cleanup ((make_cleanup_func) free_command_lines, &cmd);
+ old_chain = make_cleanup (cleanup_command_lines, &cmd);

/* Read in the body of this command. */
if (recurse_read_control_structure (cmd) == invalid_control)
@@ -1087,7 +1095,7 @@
new_line = insert_args (cmd->line);
if (!new_line)
return invalid_control;
- old_chain = make_cleanup ((make_cleanup_func) free_current_contents,
+ old_chain = make_cleanup (free_current_contents,
&new_line);
execute_command (new_line, 0);
ret = cmd->control_type;
@@ -1106,10 +1114,10 @@
new_line = insert_args (cmd->line);
if (!new_line)
return invalid_control;
- old_chain = make_cleanup ((make_cleanup_func) free_current_contents,
+ old_chain = make_cleanup (free_current_contents,
&new_line);
expr = parse_expression (new_line);
- make_cleanup ((make_cleanup_func) free_current_contents, &expr);
+ make_cleanup (free_current_contents, &expr);

ret = simple_control;
loop = 1;
@@ -1167,11 +1175,11 @@
new_line = insert_args (cmd->line);
if (!new_line)
return invalid_control;
- old_chain = make_cleanup ((make_cleanup_func) free_current_contents,
+ old_chain = make_cleanup (free_current_contents,
&new_line);
/* Parse the conditional for the if statement. */
expr = parse_expression (new_line);
- make_cleanup ((make_cleanup_func) free_current_contents, &expr);
+ make_cleanup (free_current_contents, &expr);

current = NULL;
ret = simple_control;
@@ -1257,7 +1265,7 @@

/* Cleanup */
static void
-arg_cleanup ()
+arg_cleanup (void *arg)
{
struct user_args *oargs = user_args;
if (!user_args)
@@ -1284,7 +1292,7 @@
args->next = user_args;
user_args = args;

- old_chain = make_cleanup ((make_cleanup_func) arg_cleanup, 0);
+ old_chain = make_cleanup (arg_cleanup, NULL);

if (p == NULL)
return old_chain;
@@ -1448,7 +1456,7 @@

/* Set the instream to 0, indicating execution of a
user-defined function. */
- old_chain = make_cleanup ((make_cleanup_func) source_cleanup, instream);
+ old_chain = make_cleanup (source_cleanup, instream);
instream = (FILE *) 0;
while (cmdlines)
{
@@ -1568,8 +1576,7 @@
gdb to use the event loop as the default command loop and we merge
event-top.c into this file, top.c */
/* static */ void
-command_loop_marker (foo)
- int foo;
+command_loop_marker (void *arg)
{
}

@@ -1600,7 +1607,7 @@
quit_flag = 0;
if (instream == stdin && stdin_is_tty)
reinitialize_more_filter ();
- old_chain = make_cleanup ((make_cleanup_func) command_loop_marker, 0);
+ old_chain = make_cleanup (command_loop_marker, 0);

#if defined(TUI)
/* A bit of paranoia: I want to make sure the "insert_mode" global
@@ -1681,7 +1688,7 @@
quit_flag = 0;
if (instream == stdin && stdin_is_tty)
reinitialize_more_filter ();
- old_chain = make_cleanup ((make_cleanup_func) command_loop_marker, 0);
+ old_chain = make_cleanup (command_loop_marker, 0);

/* Get a command-line. */
command = (*read_input_func) (instream == stdin ?
@@ -2839,7 +2846,7 @@
else
{
head = next;
- old_chain = make_cleanup ((make_cleanup_func) free_command_lines,
+ old_chain = make_cleanup (cleanup_command_lines,
&head);
}
tail = next;
@@ -2889,6 +2896,12 @@
l = next;
}
}
+
+void
+cleanup_command_lines (void *arg)
+{
+ free_command_lines (arg);
+}
\f
/* Add an element to the list of info subcommands. */

@@ -3722,6 +3735,14 @@
error_pre_print = p->old_error_pre_print;
}

+static void
+cleanup_fclose (void *arg)
+{
+ FILE *fp = (FILE *) arg;
+ if (fclose (fp) < 0)
+ perror_with_name ("cleanup_fclose");
+}
+
/* ARGSUSED */
void
source_command (args, from_tty)
@@ -3751,7 +3772,7 @@
return;
}

- make_cleanup ((make_cleanup_func) fclose, stream);
+ make_cleanup (cleanup_fclose, stream);

old_lines.old_line = source_line_number;
old_lines.old_file = source_file_name;
Index: top.h
===================================================================
RCS file: /cvs/src/src/gdb/top.h,v
retrieving revision 1.1.1.11
diff -u -r1.1.1.11 top.h
--- top.h 2000/02/03 04:14:30 1.1.1.11
+++ top.h 2000/03/19 21:59:04
@@ -39,7 +39,7 @@
extern int quit_confirm PARAMS ((void));
extern void quit_force PARAMS ((char *, int));
extern void quit_command PARAMS ((char *, int));
-extern void command_loop_marker PARAMS ((int));
+extern void command_loop_marker (void *);
extern int quit_cover PARAMS ((PTR));
extern void execute_command PARAMS ((char *, int));

Index: tracepoint.c
===================================================================
RCS file: /cvs/src/src/gdb/tracepoint.c,v
retrieving revision 1.1.1.11
diff -u -r1.1.1.11 tracepoint.c
--- tracepoint.c 1999/12/14 01:05:38 1.1.1.11
+++ tracepoint.c 2000/03/19 21:59:06
@@ -854,7 +854,7 @@
signal (STOP_SIGNAL, stop_sig);
}
#endif
- old_chain = make_cleanup ((make_cleanup_func) free_actions, (void *) t);
+ old_chain = make_cleanup (cleanup_actions, t);
while (1)
{
/* Make sure that all output has been output. Some machines may let
@@ -977,7 +977,7 @@
/* else fall thru, treat p as an expression and parse it! */
}
exp = parse_exp_1 (&p, block_for_pc (t->address), 1);
- old_chain = make_cleanup ((make_cleanup_func) free_current_contents,
+ old_chain = make_cleanup (free_current_contents,
&exp);

if (exp->elts[0].opcode == OP_VAR_VALUE)
@@ -1000,7 +1000,7 @@
/* we have something to collect, make sure that the expr to
bytecode translator can handle it and that it's not too long */
aexpr = gen_trace_for_expr (t->address, exp);
- (void) make_cleanup ((make_cleanup_func) free_agent_expr, aexpr);
+ (void) make_cleanup (cleanup_agent_expr, aexpr);

if (aexpr->len > MAX_AGENT_EXPR_LEN)
error ("expression too complicated, try simplifying");
@@ -1064,6 +1064,12 @@
t->actions = NULL;
}

+void
+cleanup_actions (void *arg)
+{
+ free_actions (arg);
+}
+
struct memrange
{
int type; /* 0 for absolute memory range, else basereg number */
@@ -1588,8 +1594,7 @@
struct agent_reqs areqs;

exp = parse_exp_1 (&action_exp, block_for_pc (t->address), 1);
- old_chain = make_cleanup ((make_cleanup_func)
- free_current_contents, &exp);
+ old_chain = make_cleanup (free_current_contents, &exp);

switch (exp->elts[0].opcode)
{
@@ -1618,8 +1623,7 @@
default: /* full-fledged expression */
aexpr = gen_trace_for_expr (t->address, exp);

- old_chain1 = make_cleanup ((make_cleanup_func)
- free_agent_expr, aexpr);
+ old_chain1 = make_cleanup (cleanup_agent_expr, aexpr);

ax_reqs (aexpr, &areqs);
if (areqs.flaw != agent_flaw_none)
Index: tracepoint.h
===================================================================
RCS file: /cvs/src/src/gdb/tracepoint.h,v
retrieving revision 1.1.1.4
diff -u -r1.1.1.4 tracepoint.h
--- tracepoint.h 1999/12/07 03:56:07 1.1.1.4
+++ tracepoint.h 2000/03/19 21:59:06
@@ -124,6 +124,7 @@
struct tracepoint *get_tracepoint_by_number PARAMS ((char **, int, int));
int get_traceframe_number PARAMS ((void));
void free_actions PARAMS ((struct tracepoint *));
+void cleanup_actions (void *);
enum actionline_type validate_actionline PARAMS ((char **,
struct tracepoint *));

Index: typeprint.c
===================================================================
RCS file: /cvs/src/src/gdb/typeprint.c,v
retrieving revision 1.1.1.5
diff -u -r1.1.1.5 typeprint.c
--- typeprint.c 2000/02/02 00:21:11 1.1.1.5
+++ typeprint.c 2000/03/19 21:59:06
@@ -89,7 +89,7 @@
if (exp)
{
expr = parse_expression (exp);
- old_chain = make_cleanup ((make_cleanup_func) free_current_contents,
+ old_chain = make_cleanup (free_current_contents,
&expr);
val = evaluate_type (expr);
}
@@ -161,7 +161,7 @@
else
{
expr = parse_expression (typename);
- old_chain = make_cleanup ((make_cleanup_func) free_current_contents,
+ old_chain = make_cleanup (free_current_contents,
&expr);
type = ptype_eval (expr);
if (type != NULL)
@@ -282,7 +282,7 @@
if (typename != NULL)
{
expr = parse_expression (typename);
- old_chain = make_cleanup ((make_cleanup_func) free_current_contents, &expr);
+ old_chain = make_cleanup (free_current_contents, &expr);
if (expr->elts[0].opcode == OP_TYPE)
{
/* The user expression names a type directly, just use that type. */
Index: utils.c
===================================================================
RCS file: /cvs/src/src/gdb/utils.c,v
retrieving revision 1.4
diff -u -r1.4 utils.c
--- utils.c 2000/03/04 02:23:06 1.4
+++ utils.c 2000/03/19 21:59:08
@@ -375,10 +375,9 @@
to arrange to free the object thus allocated. */

void
-free_current_contents (location)
- char **location;
+free_current_contents (void *arg)
{
- free (*location);
+ free (*(void **)arg);
}

/* Provide a known function that does nothing, to use as a base for
Index: valops.c
===================================================================
RCS file: /cvs/src/src/gdb/valops.c,v
retrieving revision 1.6
diff -u -r1.6 valops.c
--- valops.c 2000/03/13 10:01:23 1.6
+++ valops.c 2000/03/19 21:59:11
@@ -1370,7 +1370,7 @@
noprocess ();

inf_status = save_inferior_status (1);
- old_chain = make_cleanup ((make_cleanup_func) restore_inferior_status,
+ old_chain = make_cleanup (restore_inferior_status,
inf_status);

/* PUSH_DUMMY_FRAME is responsible for saving the inferior registers
Index: varobj.c
===================================================================
RCS file: /cvs/src/src/gdb/varobj.c,v
retrieving revision 1.1.1.1
diff -u -r1.1.1.1 varobj.c
--- varobj.c 2000/02/03 04:14:36 1.1.1.1
+++ varobj.c 2000/03/19 21:59:13
@@ -174,7 +174,7 @@

static struct varobj *new_root_variable PARAMS ((void));

-static void free_variable PARAMS ((struct varobj * var));
+static void free_variable (void *);

static struct type *get_type PARAMS ((struct varobj * var));

@@ -410,7 +410,7 @@

/* Fill out a varobj structure for the (root) variable being constructed. */
var = new_root_variable ();
- old_chain = make_cleanup ((make_cleanup_func) free_variable, var);
+ old_chain = make_cleanup (free_variable, var);

if (expression != NULL)
{
@@ -1322,9 +1322,10 @@

/* Free any allocated memory associated with VAR. */
static void
-free_variable (var)
- struct varobj *var;
+free_variable (void *arg)
{
+ struct varobj *var = (struct varobj *) arg;
+
/* Free the expression if this is a root variable. */
if (var->root->rootvar == var)
{
Index: xcoffread.c
===================================================================
RCS file: /cvs/src/src/gdb/xcoffread.c,v
retrieving revision 1.1.1.9
diff -u -r1.1.1.9 xcoffread.c
--- xcoffread.c 1999/12/07 03:56:07 1.1.1.9
+++ xcoffread.c 2000/03/19 21:59:15
@@ -2743,7 +2743,7 @@
back_to = make_cleanup (really_free_pendings, 0);

init_minimal_symbol_collection ();
- make_cleanup ((make_cleanup_func) discard_minimal_symbols, 0);
+ make_cleanup (discard_minimal_symbols, 0);

/* Now that the symbol table data of the executable file are all in core,
process them and define symbols accordingly. */
From kettenis@wins.uva.nl Sun Mar 19 14:55:00 2000
From: Mark Kettenis <kettenis@wins.uva.nl>
To: eliz@is.elta.co.il
Cc: jimb@zwingli.cygnus.com, gdb-patches@sourceware.cygnus.com
Subject: Re: RFA: minor watchpoint code cleanup
Date: Sun, 19 Mar 2000 14:55:00 -0000
Message-id: <200003192255.e2JMtcs00643@delius.kettenis.local>
References: <200003180006.TAA26919@zwingli.cygnus.com> <200003190944.EAA07454@indy.delorie.com>
X-SW-Source: 2000-03/msg00353.html
Content-length: 808

Date: Sun, 19 Mar 2000 04:44:56 -0500 (EST)
From: Eli Zaretskii <eliz@delorie.com>

> This is just a cosmetic change. Let me know.
>
> 2000-03-17 Jim Blandy <jimb@redhat.com>
>
> * i386v-nat.c (i386_insert_nonaligned_watchpoint): Use a
> two-dimensional array, instead of faking it with explicit index
> arithmetic.

While we are talking: someone (H.J. Lu?) suggested to make the
watchpoint insertion code common to all x86 targets. What's the
current say-so on this?

I haven't yet looked into the HW watchpoints yet. We probably could
use the same logic for choosing the appropriate debug registers, but
the way the registers are accessed wil differ considerably among the
various i386 targets. When fiddling the code we should keep
multi-arch in mind.

Mark
From kettenis@wins.uva.nl Sun Mar 19 15:11:00 2000
From: Mark Kettenis <kettenis@wins.uva.nl>
To: jimb@zwingli.cygnus.com
Cc: gdb-patches@sourceware.cygnus.com
Subject: Re: Linux sigtramp detection code moved to its proper place
Date: Sun, 19 Mar 2000 15:11:00 -0000
Message-id: <200003192311.e2JNBI900709@delius.kettenis.local>
References: <200003162241.RAA19616@zwingli.cygnus.com> <1000316225504.ZM3009@ocotillo.lan> <npsnxp8ix6.fsf@zwingli.cygnus.com>
X-SW-Source: 2000-03/msg00354.html
Content-length: 255

From: Jim Blandy <jimb@zwingli.cygnus.com>
Date: 17 Mar 2000 15:01:57 -0500

I'm sorry --- this is obviously a tdep issue. Does the following
change look better?

Sure! But could you please add i386-linux-tdep.c to the CVS
repository?

Mark
From ac131313@cygnus.com Sun Mar 19 18:00:00 2000
From: Andrew Cagney <ac131313@cygnus.com>
To: Eli Zaretskii <eliz@is.elta.co.il>
Cc: gdb-patches@sourceware.cygnus.com
Subject: Re: [PATCH] Support for building with DJGPP
Date: Sun, 19 Mar 2000 18:00:00 -0000
Message-id: <38D58623.3FBFFE30@cygnus.com>
References: <200003191224.HAA08367@indy.delorie.com>
X-SW-Source: 2000-03/msg00355.html
Content-length: 455

Eli Zaretskii wrote:
>
> I committed today the following patches which allow to build GDB with
> DJGPP tools.
>
> 2000-03-17 Eli Zaretskii <eliz@is.elta.co.il>
>
> * config/djgpp/djconfig.sh: New file.
> * config/djgpp/config.sed: New file.
> * config/djgpp/README: New file.
> * config/djgpp/fnchange.lst: New file.
> * config/djgpp/djcheck.sh: New file.
>

I'd also add an entry to gdb/NEWS. (Yaa)

Andrew
From ac131313@cygnus.com Sun Mar 19 20:56:00 2000
From: Andrew Cagney <ac131313@cygnus.com>
To: Eli Zaretskii <eliz@is.elta.co.il>
Cc: gdb-patches@sourceware.cygnus.com
Subject: Re: [PATCH] Add change-log variables to more MI files
Date: Sun, 19 Mar 2000 20:56:00 -0000
Message-id: <38D5AF42.748BB2F5@cygnus.com>
References: <38CDC788.D9C8FE12@cygnus.com> <200003140932.EAA28159@indy.delorie.com>
X-SW-Source: 2000-03/msg00356.html
Content-length: 614

Eli Zaretskii wrote:
>
> > I've checked in the attatched. It should help keep ChangeLog entries
> > local.
> [snip]
> > +
> > + # Local variables:
> > + # change-log-default-name: "ChangeLog-mi"
> > + # End:
>
> You _are_ aware that ChangeLog and ChangeLog-mi both map to the same
> name "changelo" when truncated to 8+3 limits, right?

Yes, along with ChangeLog-99, ChangeLog-gdbtk et.al. I copied an
existing convention.

> Is it conceivable to rename ChangeLog-mi to ChangeLog.mi or
> mi-ChangeLog?

If we're going to do that then we should rename all the ChangeLog files
to be:
ChangeLog.<suffix>

Andrew
From ac131313@cygnus.com Sun Mar 19 21:29:00 2000
From: Andrew Cagney <ac131313@cygnus.com>
To: Stephane Carrez <Stephane.Carrez@worldnet.fr>
Cc: gdb-patches@sourceware.cygnus.com
Subject: Re: path for gdb/dwarf2read.c, support 16-bit targets in dwarf-2
Date: Sun, 19 Mar 2000 21:29:00 -0000
Message-id: <38D5B6E0.50FF6A5E@cygnus.com>
References: <38D4DCB0.88313CB2@worldnet.fr>
X-SW-Source: 2000-03/msg00357.html
Content-length: 461

Stephane Carrez wrote:
>
> Hi!
>
> One part of the patch for dwarf2 correction with 16-bit target has
> been lost. If you are still not convinced by the fix, have a look
> at gas/dwarf2dbg.c in out_set_addr() where we obtain the address
> size in a good way.
>
> Can you integrate it?

FYI,

My reading of the thread from when this patch was last posted is that it
wasn't clear that this was a bug and the change was the correct thing to
do.

Enjoy,
Andrew
From ac131313@cygnus.com Sun Mar 19 21:31:00 2000
From: Andrew Cagney <ac131313@cygnus.com>
To: Eli Zaretskii <eliz@is.elta.co.il>
Cc: gdb-patches@sourceware.cygnus.com
Subject: Re: [PATCH] "make install" in mmalloc to work on MS-DOS
Date: Sun, 19 Mar 2000 21:31:00 -0000
Message-id: <38D5B78B.9D272F09@cygnus.com>
References: <200003191215.HAA08359@indy.delorie.com>
X-SW-Source: 2000-03/msg00358.html
Content-length: 989

Eli Zaretskii wrote:
>
> The following patch is required so that "make install" would work on
> filesystems where libmmalloc.a.n is not a valid file name.
>
> Okay to commit?
>
> 2000-03-17 Eli Zaretskii <eliz@is.elta.co.il>
>
> * Makefile.in (install): Append "n", not ".n" to libmmalloc.a,
> since the latter loses on DOS 8+3 filesystems.
>
> --- mmalloc/Makefile.i~0 Fri Apr 16 03:55:28 1999
> +++ mmalloc/Makefile.in Fri Mar 17 14:32:50 2000
> @@ -121,9 +121,9 @@
> # ./a.out
>
> install: all
> - $(INSTALL_DATA) $(TARGETLIB) $(libdir)/$(TARGETLIB).n
> - $(RANLIB) $(libdir)/$(TARGETLIB).n
> - mv -f $(libdir)/$(TARGETLIB).n $(libdir)/$(TARGETLIB)
> + $(INSTALL_DATA) $(TARGETLIB) $(libdir)/$(TARGETLIB)n
> + $(RANLIB) $(libdir)/$(TARGETLIB)n
> + mv -f $(libdir)/$(TARGETLIB)n $(libdir)/$(TARGETLIB)

Fine with me. I suspect no one will notice :-)

Andrew
From ac131313@cygnus.com Sun Mar 19 22:01:00 2000
From: Andrew Cagney <ac131313@cygnus.com>
To: Philippe De Muyter <phdm@macqel.be>, Elena Zannoni <ezannoni@cygnus.com>
Cc: gdb-patches@sourceware.cygnus.com
Subject: Re: HAVE_POLL is not enough - RFA
Date: Sun, 19 Mar 2000 22:01:00 -0000
Message-id: <38D5BE1D.7BB02C99@cygnus.com>
References: <200003181028.LAA30913@mail.macqel.be>
X-SW-Source: 2000-03/msg00359.html
Content-length: 718

Philippe De Muyter wrote:
>
> I implemented the runtime poll/select selection. The patch seems huge because
> of the indentation changes caused by replacing
> #if HAVE_POLL
> some_code
> #else
> some_other_code
> #endif
>
> by
>
> #if HAVE_POLL
> if (!use_select)
> {
> some_code
> }
> else
> #endif
> {
> some_other_code
> }

Um, to wear the hat of the style police (... :-) I'd suggest instead
codeing it as:

if (use_poll)
{
#if HAVE_POLL
...
#else
internal_error (...);
#endif
}
else
{
}

or even as a psuedo object with a bunch of methods:

some_struct.what_are_we_doing (args);

Andrew
From Philippe.Giacinti@sxb.bsf.alcatel.fr Sun Mar 19 22:19:00 2000
From: Philippe GIACINTI <Philippe.Giacinti@sxb.bsf.alcatel.fr>
To: gdb-patches@sourceware.cygnus.com
Subject: [PATCH] minor fixes in remote.c
Date: Sun, 19 Mar 2000 22:19:00 -0000
Message-id: <14549.49859.878539.158465@gargle.gargle.HOWL>
X-SW-Source: 2000-03/msg00360.html
Content-length: 641

Hi,

Here is a patch including minor fixes in file gdb/remote.c:

* remote.c (record_currthread): must call `set_thread' to change
general thread, in order to let stub know we have changed it.
* remote.c (remote_read_bytes): when we need to read more memory
than max buffer size, we have to reserve space for leading $ and
trailing # + checksum (i.e.: 4 char)

Best regards.
--
Philippe Giacinti - Alcatel Business Systems - PCD/SMB/SWPCC - CC S0645
1, route du Dr Albert Schweitzer - 67408 Illkirch Cedex - FRANCE
Tel: +33 (0)3.90.67.62.10 - Fax: +33 (0)3.90.67.77.93
mailto:Philippe.Giacinti@sxb.bsf.alcatel.fr