Peter Johnson [Mon, 29 Oct 2001 00:01:31 +0000 (00:01 -0000)]
Add option for malloc debugging using dmalloc library (http://dmalloc.com/).
Remove unnecessary stdlib includes (because we use xmalloc instead of malloc).
Peter Johnson [Sun, 28 Oct 2001 09:22:13 +0000 (09:22 -0000)]
*COMPLETELY* rewrite most of expression handling.
Features:
- More complex memory expressions like [bx-(bx-di)] are now calculated through
as valid.
- Much better simplification.
Internal changes:
- More flexible n-way tree (rather than old binary-only).
- Many new functions to simplify and deal with very complex expressions.
Peter Johnson [Mon, 15 Oct 2001 04:32:16 +0000 (04:32 -0000)]
Allow both signed and unsigned interpretations for get_int and check_size.
Change argument order on get_int and check_size to better match other
functions (intnum * first arg).
Peter Johnson [Fri, 12 Oct 2001 03:36:10 +0000 (03:36 -0000)]
Add parsing of memory expressions. Currently adds a lot of duplication for
the expressions in the yacc code, but I don't see an easier way right now.
Also, no validity checking is done.
Peter Johnson [Fri, 12 Oct 2001 02:34:30 +0000 (02:34 -0000)]
Add expr_contains_float() and symrec_get_equ() functions. These are the first
of many functions like this which will be needed for advanced validity checking
in the finalization of the parser stage.
Fix yacc grammar to not use the (incorrect) expr_no_fltstr, and change memexp
to memexpr and its handling to prepare for memory expressions.
Peter Johnson [Fri, 12 Oct 2001 02:29:31 +0000 (02:29 -0000)]
Clarify and fix some usages of valid/need flags for modrm and sib bytes.
In bytecode_print(), check for NULL ea displacement and print out modrm and
sib bytes in octal (because it's easier to read the 2/3/3 format in octal).
Peter Johnson [Thu, 11 Oct 2001 05:34:50 +0000 (05:34 -0000)]
Fix LOTS of little nits. Primary changes:
- New intnum module to replace using just unsigned long (for >32 bit values).
Read values using BitVector instead of strtoul().
- Brought both floatnum and intnum into expr (still need to integrate calc for
floatnum).
- Add traversal function to ternary tree (for use by symrec_foreach).
- Change floatnum output interface from single/double/extended to byte size.
- Try to make floatnum/intnum interfaces very similar. Still needs work.
- Add/fix *_print functions, including interating ones for sections/bytecodes.
- Fix handling of $ and $$. Both now are properly parsed and bytecode'd.
- Print out all sections and symbol table in main() in preparation for work
on "cleanup" functionality between parser and optimizer stages (really part
of the parser stage).
Peter Johnson [Wed, 3 Oct 2001 20:42:17 +0000 (20:42 -0000)]
Make most data structures opaque, keeping internals truly internal and making the
overall structure much more modular.
The test files, which need access to the internals of the structures being
tested, now include the source file instead of the header file to gain access
to all internal formats and functions.
Peter Johnson [Wed, 3 Oct 2001 07:14:48 +0000 (07:14 -0000)]
Completely revamp format and extensiveness of testing.
Currently two tests fail (the approx 1.e-38 in single and double precision).
Need still to add tests for ASCII->internal conversion.
Peter Johnson [Wed, 3 Oct 2001 02:27:41 +0000 (02:27 -0000)]
malloc->xmalloc, strdup->xstrdup, and calloc->xcalloc. The x* family performs
error checking. Remove check for strdup() from configure, as we don't need it.
Peter Johnson [Wed, 3 Oct 2001 01:44:47 +0000 (01:44 -0000)]
Add some (optional through configure) additional warning flags. Add options
to configure to enable profiling and enable -Werror. Make changes to ensure
everything builds with all additional warnings and -Werror enabled. Most of
these changes consist of adding "const" modifiers for functions that get
constant literal strings.
Peter Johnson [Tue, 2 Oct 2001 23:24:15 +0000 (23:24 -0000)]
Finish ASCII->internal FP conversion and clean up single/double/extended
conversion functions. For accuracy, change from 64-bit to 80-bit internal
mantissa. Modify tests to match new internal format.
TODO: Denormalized numbers, and write more tests!
Peter Johnson [Thu, 27 Sep 2001 07:55:36 +0000 (07:55 -0000)]
Implement floating point size conversions (with help from BitVector).
Interface changed slightly (only affects symrec.c right now). Tests committed
to check a single case (pi) with all three size conversion functions.
Still need to write to/from ASCII string functions (the hard part).
Peter Johnson [Wed, 26 Sep 2001 00:57:55 +0000 (00:57 -0000)]
Fix large parts of expression and symbol handling. Actually link in labels
properly (bug #8). Framework added for portable floating point support (bug
#7). Lots of functions still not finished in this commit.
Peter Johnson [Mon, 24 Sep 2001 21:39:45 +0000 (21:39 -0000)]
Change error/warning framework to store a list of errors and warnings instead
of just one at a time. This is the groundwork for printing undefined symbol
messages, which can't be determined until after parsing has been completed
(and should be in the same line order with the other errors).
Peter Johnson [Mon, 24 Sep 2001 06:40:27 +0000 (06:40 -0000)]
Used ternary search tree instead of linked list to store symbol table.
Cleaned up function naming too.
Removed locallabel_base from global.h, moving it into the parser-specific code.
Made sym_table private to symrec.c.
Peter Johnson [Sun, 23 Sep 2001 19:22:04 +0000 (19:22 -0000)]
Get initial bits setting from object format. Change the initial section name
from a function to a constant string. Make mode_bits uniformily an unsigned
char instead of an int.
Peter Johnson [Thu, 20 Sep 2001 06:25:05 +0000 (06:25 -0000)]
Try to fix configure and automake files so everything builds a bit cleaner.
Also try to fix the warnings on the GNU C Library.
Still a lot of work and testing to be done here, but making progress.
Peter Johnson [Thu, 20 Sep 2001 03:21:26 +0000 (03:21 -0000)]
Cleaned up bytecode data structure, some effaddr functions. Made ea an
effaddr * instead of an effaddr to decrease size of bytecode. Changed parser
to use effaddr * as well. Finally fixed issue with ONE by adding flag to
bytecode.data.insn and utilizing spare bytes of the opcode. Hackish, but
works.
Peter Johnson [Wed, 19 Sep 2001 07:20:02 +0000 (07:20 -0000)]
Build section linked list, and support the section directive, including
asking the objfmt module. Add some utility functions for both bytecode
and section to better modularize their data structure usage and common
code. Rename doparse to do_parse to be consistent in naming.