aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorElena Zannoni <ezannoni@kwikemart.cygnus.com>2001-03-26 02:50:46 +0000
committerElena Zannoni <ezannoni@kwikemart.cygnus.com>2001-03-26 02:50:46 +0000
commit6ec4c4bd0ef272bc731317621ce4482eb801e4ca (patch)
tree021e1046ff935176cd4e277338c50e8848ac8fda
parentb9179dbce95be8ab496758e27909ad5ea2cdd8cd (diff)
downloadgdb-6ec4c4bd0ef272bc731317621ce4482eb801e4ca.zip
gdb-6ec4c4bd0ef272bc731317621ce4482eb801e4ca.tar.gz
gdb-6ec4c4bd0ef272bc731317621ce4482eb801e4ca.tar.bz2
2001-03-25 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
From Andrew Cagney <ac131313@redhat.com> * coffread.c: Include "gdb_assert.h". (coff_symtab_read): Cast the integer s_sclass to a long before casting it to a pointer.
-rw-r--r--gdb/ChangeLog8
-rw-r--r--gdb/coffread.c11
2 files changed, 17 insertions, 2 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 38efd9f..f8538bd 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,6 +1,14 @@
2001-03-25 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
From Andrew Cagney <ac131313@redhat.com>
+
+ * coffread.c: Include "gdb_assert.h".
+ (coff_symtab_read): Cast the integer s_sclass to a long before
+ casting it to a pointer.
+
+2001-03-25 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
+
+ From Andrew Cagney <ac131313@redhat.com>
* coffread.c (coff_symtab_read): Initialize
``fcn_first_line_addr''. Check that the ``.bf'' always preceeds
diff --git a/gdb/coffread.c b/gdb/coffread.c
index 7f775de..a343a68 100644
--- a/gdb/coffread.c
+++ b/gdb/coffread.c
@@ -43,6 +43,7 @@
#include "stabsread.h"
#include "complaints.h"
#include "target.h"
+#include "gdb_assert.h"
extern void _initialize_coffread (void);
@@ -966,9 +967,15 @@ coff_symtab_read (long symtab_offset, unsigned int nsyms,
{
struct minimal_symbol *msym;
+ /* FIXME: cagney/2001-02-01: The nasty (int) -> (long)
+ -> (void*) cast is to ensure that that the value of
+ cs->c_sclass can be correctly stored in a void
+ pointer in MSYMBOL_INFO. Better solutions
+ welcome. */
+ gdb_assert (sizeof (void *) >= sizeof (cs->c_sclass));
msym = prim_record_minimal_symbol_and_info
- (cs->c_name, tmpaddr, ms_type, (char *) cs->c_sclass, sec,
- NULL, objfile);
+ (cs->c_name, tmpaddr, ms_type, (void *) (long) cs->c_sclass,
+ sec, NULL, objfile);
#ifdef COFF_MAKE_MSYMBOL_SPECIAL
if (msym)
COFF_MAKE_MSYMBOL_SPECIAL (cs->c_sclass, msym);