* gasp.c (main): Parse -I option.

(do_include): Look through include list.
	* gasp.c (change_base): Don't modify numbers in strings.
	(pr7583)

 	* testsuite/gasp/*: New.
	* testsuite/Makefile.in: Use gasp tests.
	* testsuite/config/default.exp: Add gasp stuff.
This commit is contained in:
Steve Chamberlain 1995-08-01 03:35:23 +00:00
parent 2994850346
commit 4f2f30116b
2 changed files with 55 additions and 5 deletions

View File

@ -9,8 +9,14 @@ Mon Jul 31 21:40:47 1995 Ken Raeburn <raeburn@cygnus.com>
Mon Jul 31 18:19:26 1995 steve chamberlain <sac@slash.cygnus.com>
* gasp.c (change_base): Don't modify numbers in strings. (pr7583)
* testsuite/gas/gasp/*: New.
* gasp.c (main): Parse -I option.
(do_include): Look through include list.
* gasp.c (change_base): Don't modify numbers in strings.
(pr7583)
* testsuite/gasp/*: New.
* testsuite/Makefile.in: Use gasp tests.
* testsuite/config/default.exp: Add gasp stuff.
Mon Jul 31 12:16:21 1995 Ian Lance Taylor <ian@cygnus.com>

View File

@ -37,6 +37,7 @@ suitable for gas to consume.
-a use alternate syntax
Pseudo ops can start with or without a .
Labels have to be in first column.
-I specify include dir
Macro arg parameters subsituted by name, don't need the &.
String can start with ' too.
Strings can be surrounded by <..>
@ -311,6 +312,19 @@ struct include_stack *sp;
#define dsize 5
/* Include file list */
typedef struct include_path
{
struct include_path *next;
sb path;
} include_path;
include_path *paths_head;
include_path *paths_tail;
void include_print_where_line ();
@ -3316,14 +3330,30 @@ do_include (idx, in)
sb *in;
{
sb t;
sb cat;
char *text;
include_path *includes;
sb_new (&t);
sb_new (&cat);
idx = getstring (idx, in, &t);
text = sb_name (&t);
if (!new_file (text))
for (includes = paths_head; includes; includes = includes->next)
{
sb_reset (&cat);
sb_add_sb (&cat, &includes->path);
sb_add_char (&cat, '/');
sb_add_sb (&cat, &t);
if (new_file (sb_name (&cat)))
{
break;
}
}
if (!includes)
{
FATAL ((stderr, "Can't open include file `%s'.\n", text));
}
sb_kill (&cat);
sb_kill (&t);
}
@ -3827,6 +3857,7 @@ char *program_name;
static struct option long_options[] =
{
{ "alternate", no_argument, 0, 'a' },
{ "include", required_argument, 0, 'I' },
{ "commentchar", required_argument, 0, 'c' },
{ "copysource", no_argument, 0, 's' },
{ "debug", no_argument, 0, 'd' },
@ -3857,6 +3888,7 @@ Usage: %s \n\
[-u] [--unreasonable] allow unreasonable nesting\n\
[-v] [--version] print the program version\n\
[-Dname=value] create preprocessor variable called name, with value\n\
[-Ipath] add to include path list\n\
[in-file]\n", program_name);
exit (status);
}
@ -3895,7 +3927,7 @@ main (argc, argv)
sb_new (&label);
process_init ();
while ((opt = getopt_long (argc, argv, "sdhavc:upo:D:", long_options,
while ((opt = getopt_long (argc, argv, "I:sdhavc:upo:D:", long_options,
(int *) NULL))
!= EOF)
{
@ -3907,6 +3939,18 @@ main (argc, argv)
case 'u':
unreasonable = 1;
break;
case 'I':
{
include_path *p = (include_path *) xmalloc (sizeof (include_path));
sb_new (&p->path);
sb_add_string (&p->path, optarg);
if (paths_tail)
paths_tail->next = p;
else
paths_head = p;
paths_tail = p;
}
break;
case 'p':
print_line_number = 1;
break;