fix resolution of symbol references like: symbolgen.tcl(buf), when descending into symbol correctly recognize generator and descend into generated symbol

This commit is contained in:
stefan schippers 2025-01-10 17:14:13 +01:00
parent 1d5ff21130
commit a0da5c7b51
1 changed files with 6 additions and 2 deletions

View File

@ -3446,7 +3446,7 @@ int load_schematic(int load_symbols, const char *fname, int reset_undo, int aler
int generator = 0; int generator = 0;
if(is_generator(fname)) generator = 1; if(is_generator(fname)) generator = 1;
my_strncpy(name, fname, S(name)); my_strncpy(name, fname, S(name));
dbg(1, "load_schematic(): fname=%s\n", fname); dbg(0, "load_schematic(): fname=%s\n", fname);
/* remote web object specified */ /* remote web object specified */
if(is_from_web(fname) && xschem_web_dirname[0]) { if(is_from_web(fname) && xschem_web_dirname[0]) {
/* download into ${XSCHEM_TMP_DIR}/xschem_web */ /* download into ${XSCHEM_TMP_DIR}/xschem_web */
@ -5152,7 +5152,11 @@ void descend_symbol(void)
} }
if(!sympath || stat(sympath, &buf)) { /* not found */ if(!sympath || stat(sympath, &buf)) { /* not found */
dbg(1, "descend_symbol: not found: %s\n", sympath); dbg(1, "descend_symbol: not found: %s\n", sympath);
my_strdup2(_ALLOC_ID_, &sympath, abs_sym_path(tcl_hook2(name), "")); if(is_generator(name)) {
my_strdup2(_ALLOC_ID_, &sympath, tcl_hook2(name));
} else {
my_strdup2(_ALLOC_ID_, &sympath, abs_sym_path(tcl_hook2(name), ""));
}
} }
dbg(1, "descend_symbol(): name=%s, sympath=%s, dirname=%s\n", name, sympath, xctx->current_dirname); dbg(1, "descend_symbol(): name=%s, sympath=%s, dirname=%s\n", name, sympath, xctx->current_dirname);
++xctx->currsch; /* increment level counter */ ++xctx->currsch; /* increment level counter */