aboutsummaryrefslogtreecommitdiff
path: root/gas/as.h
diff options
context:
space:
mode:
authorJan Beulich <jbeulich@suse.com>2022-12-13 09:11:53 +0100
committerJan Beulich <jbeulich@suse.com>2022-12-13 09:11:53 +0100
commit969b9a36506bfb386f8ce30f88f1a6a6ebbaca6e (patch)
tree7cc916e6db68595bb894cd1675fb0112038ab218 /gas/as.h
parentf2e469cb476a8fff9841914af6f8b5dead5c553a (diff)
downloadgdb-969b9a36506bfb386f8ce30f88f1a6a6ebbaca6e.zip
gdb-969b9a36506bfb386f8ce30f88f1a6a6ebbaca6e.tar.gz
gdb-969b9a36506bfb386f8ce30f88f1a6a6ebbaca6e.tar.bz2
gas: re-work line number tracking for macros and their expansions
The PR gas/16908 workaround aimed at uniformly reporting line numbers to reference macro invocation sites. As mentioned in a comment this may be desirable for small macros, but often isn't for larger ones. As a first step improve diagnostics to report both locations, while aiming at leaving generated debug info unaltered. Note that macro invocation context is lost for any diagnostics issued only after all input was processed (or more generally for any use of as_*_where(), as the functions can't know whether the passed in location is related to [part of] the present stack of locations). To maintain the intended workaround behavior for PR gas/16908, a new as_where() is introduced to "look through" macro invocations, while the existing as_where() is renamed (and used in only very few places for now). Down the road as_where() will likely want to return a list of (file,line) pairs.
Diffstat (limited to 'gas/as.h')
-rw-r--r--gas/as.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/gas/as.h b/gas/as.h
index 61f259f..65affeb 100644
--- a/gas/as.h
+++ b/gas/as.h
@@ -437,6 +437,10 @@ typedef struct _pseudo_type pseudo_typeS;
#define PRINTF_WHERE_LIKE(FCN) \
void FCN (const char *file, unsigned int line, const char *format, ...) \
__attribute__ ((__format__ (__printf__, 3, 4)))
+#define PRINTF_INDENT_LIKE(FCN) \
+ void FCN (const char *file, unsigned int line, unsigned int indent, \
+ const char *format, ...) \
+ __attribute__ ((__format__ (__printf__, 4, 5)))
#else /* __GNUC__ < 2 || defined(VMS) */
@@ -444,6 +448,10 @@ typedef struct _pseudo_type pseudo_typeS;
#define PRINTF_WHERE_LIKE(FCN) void FCN (const char *file, \
unsigned int line, \
const char *format, ...)
+#define PRINTF_INDENT_LIKE(FCN) void FCN (const char *file, \
+ unsigned int line, \
+ unsigned int indent, \
+ const char *format, ...)
#endif /* __GNUC__ < 2 || defined(VMS) */
@@ -453,6 +461,7 @@ PRINTF_LIKE (as_tsktsk);
PRINTF_LIKE (as_warn);
PRINTF_WHERE_LIKE (as_bad_where);
PRINTF_WHERE_LIKE (as_warn_where);
+PRINTF_INDENT_LIKE (as_info_where);
void as_abort (const char *, int, const char *) ATTRIBUTE_NORETURN;
void signal_init (void);
@@ -487,7 +496,9 @@ void cond_finish_check (int);
void cond_exit_macro (int);
int seen_at_least_1_file (void);
void app_pop (char *);
+void as_report_context (void);
const char * as_where (unsigned int *);
+const char * as_where_top (unsigned int *);
const char * as_where_physical (unsigned int *);
void bump_line_counters (void);
void do_scrub_begin (int);