* debugger/mcs51/break.c,
[fw/sdcc] / debugger / mcs51 / symtab.c
index b35e2d150a36e33d578132a22e620958f686c4bb..7c14aa89fcde8af797696d8b9bc567266c948223 100644 (file)
@@ -261,7 +261,7 @@ symbol *parseSymbol (char *s, char **rs, int doadd)
         if ( applyToSetFTrue(symbols,symWithRName,s,&nsym))
         {
             if ( nsym->rname != nsym->name )
-                return;
+                return NULL;
             doadd = 0;
         }
     }
@@ -712,7 +712,7 @@ static void lnkCSrc (char *s)
     module *mod ;
 
     /* input will be of format
-       filename.ext$<level>$<block>$<line>:<address> */
+       filename.ext$<line>$<level>$<block>:<address> */
     /* get the module name */
     while (*s != '$' )
   *bp++ = *s++;
@@ -734,14 +734,28 @@ static void lnkCSrc (char *s)
 
     line--;
     /* one line can have more than one address : (for loops !)*/
-    if (line < mod->ncLines && line > 0 &&
+    if (line < mod->ncLines && line > 0 /*&&
         ( !mod->cLines[line]->addr ||
-           mod->cLines[line]->level > level )) {
-  mod->cLines[line]->addr = addr;
-  mod->cLines[line]->block = block;
-  mod->cLines[line]->level = level;
-  Dprintf(D_symtab, ("symtab: ccc %s(%d:0x%x) %s",mod->c_name,
-         line+1,addr,mod->cLines[line]->src));
+        mod->cLines[line]->level > level )*/ ) 
+    {
+        if ( mod->cLines[line]->addr != INT_MAX )
+        {
+            /* save double line information for exepoints */
+            exePoint *ep ;
+            ep = Safe_calloc(1,sizeof(exePoint));
+            ep->addr =  mod->cLines[line]->addr ;
+            ep->line = line;
+            ep->block= mod->cLines[line]->block;
+            ep->level= mod->cLines[line]->level;
+            addSet(&mod->cfpoints,ep);
+            Dprintf(D_symtab, ("symtab: exe %s(%d:0x%x) %s",mod->c_name,
+                           line+1,addr,mod->cLines[line]->src));
+        }
+        mod->cLines[line]->addr = addr;
+        mod->cLines[line]->block = block;
+        mod->cLines[line]->level = level;
+        Dprintf(D_symtab, ("symtab: ccc %s(%d:0x%x) %s",mod->c_name,
+                           line+1,addr,mod->cLines[line]->src));
     }
     return;