mirror of
https://github.com/netwide-assembler/nasm.git
synced 2025-02-23 17:29:23 +08:00
debug: don't call dfmt->linenum without a filename
With -Lb, it is possible that we don't have a filename for the current code expansion. In that case, suppress calling dfmt->linenum as some debug backends *really* aren't equipped to handle that case. Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
This commit is contained in:
parent
2f171ddeec
commit
0d4ce8d739
@ -1,6 +1,6 @@
|
||||
/* ----------------------------------------------------------------------- *
|
||||
*
|
||||
* Copyright 1996-2019 The NASM Authors - All Rights Reserved
|
||||
* Copyright 1996-2020 The NASM Authors - All Rights Reserved
|
||||
* See the file AUTHORS included with the NASM distribution for
|
||||
* the specific copyright holders.
|
||||
*
|
||||
@ -401,11 +401,14 @@ static void out(struct out_data *data)
|
||||
|
||||
/*
|
||||
* If the source location or output segment has changed,
|
||||
* let the debug backend know.
|
||||
* let the debug backend know. Some backends really don't
|
||||
* like being given a NULL filename as can happen if we
|
||||
* use -Lb and expand a macro, so filter out that case.
|
||||
*/
|
||||
data->where = src_where();
|
||||
if (!src_location_same(data->where, dbg.where) |
|
||||
(data->segment != dbg.segment)) {
|
||||
if (data->where.filename &&
|
||||
(!src_location_same(data->where, dbg.where) |
|
||||
(data->segment != dbg.segment))) {
|
||||
dbg.where = data->where;
|
||||
dbg.segment = data->segment;
|
||||
dfmt->linenum(dbg.where.filename, dbg.where.lineno, data->segment);
|
||||
|
Loading…
Reference in New Issue
Block a user