mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-06-24 12:23:31 +08:00
* 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:
@ -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>
|
Mon Jul 31 18:19:26 1995 steve chamberlain <sac@slash.cygnus.com>
|
||||||
|
|
||||||
* gasp.c (change_base): Don't modify numbers in strings. (pr7583)
|
* gasp.c (main): Parse -I option.
|
||||||
* testsuite/gas/gasp/*: New.
|
(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>
|
Mon Jul 31 12:16:21 1995 Ian Lance Taylor <ian@cygnus.com>
|
||||||
|
|
||||||
|
50
gas/gasp.c
50
gas/gasp.c
@ -37,6 +37,7 @@ suitable for gas to consume.
|
|||||||
-a use alternate syntax
|
-a use alternate syntax
|
||||||
Pseudo ops can start with or without a .
|
Pseudo ops can start with or without a .
|
||||||
Labels have to be in first column.
|
Labels have to be in first column.
|
||||||
|
-I specify include dir
|
||||||
Macro arg parameters subsituted by name, don't need the &.
|
Macro arg parameters subsituted by name, don't need the &.
|
||||||
String can start with ' too.
|
String can start with ' too.
|
||||||
Strings can be surrounded by <..>
|
Strings can be surrounded by <..>
|
||||||
@ -311,6 +312,19 @@ struct include_stack *sp;
|
|||||||
#define dsize 5
|
#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 ();
|
void include_print_where_line ();
|
||||||
|
|
||||||
|
|
||||||
@ -3316,14 +3330,30 @@ do_include (idx, in)
|
|||||||
sb *in;
|
sb *in;
|
||||||
{
|
{
|
||||||
sb t;
|
sb t;
|
||||||
|
sb cat;
|
||||||
char *text;
|
char *text;
|
||||||
|
include_path *includes;
|
||||||
sb_new (&t);
|
sb_new (&t);
|
||||||
|
sb_new (&cat);
|
||||||
|
|
||||||
idx = getstring (idx, in, &t);
|
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));
|
FATAL ((stderr, "Can't open include file `%s'.\n", text));
|
||||||
}
|
}
|
||||||
|
sb_kill (&cat);
|
||||||
sb_kill (&t);
|
sb_kill (&t);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -3827,6 +3857,7 @@ char *program_name;
|
|||||||
static struct option long_options[] =
|
static struct option long_options[] =
|
||||||
{
|
{
|
||||||
{ "alternate", no_argument, 0, 'a' },
|
{ "alternate", no_argument, 0, 'a' },
|
||||||
|
{ "include", required_argument, 0, 'I' },
|
||||||
{ "commentchar", required_argument, 0, 'c' },
|
{ "commentchar", required_argument, 0, 'c' },
|
||||||
{ "copysource", no_argument, 0, 's' },
|
{ "copysource", no_argument, 0, 's' },
|
||||||
{ "debug", no_argument, 0, 'd' },
|
{ "debug", no_argument, 0, 'd' },
|
||||||
@ -3857,6 +3888,7 @@ Usage: %s \n\
|
|||||||
[-u] [--unreasonable] allow unreasonable nesting\n\
|
[-u] [--unreasonable] allow unreasonable nesting\n\
|
||||||
[-v] [--version] print the program version\n\
|
[-v] [--version] print the program version\n\
|
||||||
[-Dname=value] create preprocessor variable called name, with value\n\
|
[-Dname=value] create preprocessor variable called name, with value\n\
|
||||||
|
[-Ipath] add to include path list\n\
|
||||||
[in-file]\n", program_name);
|
[in-file]\n", program_name);
|
||||||
exit (status);
|
exit (status);
|
||||||
}
|
}
|
||||||
@ -3895,7 +3927,7 @@ main (argc, argv)
|
|||||||
sb_new (&label);
|
sb_new (&label);
|
||||||
process_init ();
|
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))
|
(int *) NULL))
|
||||||
!= EOF)
|
!= EOF)
|
||||||
{
|
{
|
||||||
@ -3907,6 +3939,18 @@ main (argc, argv)
|
|||||||
case 'u':
|
case 'u':
|
||||||
unreasonable = 1;
|
unreasonable = 1;
|
||||||
break;
|
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':
|
case 'p':
|
||||||
print_line_number = 1;
|
print_line_number = 1;
|
||||||
break;
|
break;
|
||||||
|
Reference in New Issue
Block a user