diff options
author | Stephane Carrez <stcarrez@nerim.fr> | 2002-08-25 19:39:45 +0000 |
---|---|---|
committer | Stephane Carrez <stcarrez@nerim.fr> | 2002-08-25 19:39:45 +0000 |
commit | 0510ab860e77735fe7dd64a9542f29916c2484ef (patch) | |
tree | 92f4a160e223339fedff7f8a94a7e7b8ebfceaf9 /gdb | |
parent | 1f393769d4d0ac2ccf84cd57bef7c8f9bc7a08d7 (diff) | |
download | gdb-0510ab860e77735fe7dd64a9542f29916c2484ef.zip gdb-0510ab860e77735fe7dd64a9542f29916c2484ef.tar.gz gdb-0510ab860e77735fe7dd64a9542f29916c2484ef.tar.bz2 |
* tuiDisassem.c (tuiGetBeginAsmAddress): Use lookup_minimal_symbol
to find symbol address.
Diffstat (limited to 'gdb')
-rw-r--r-- | gdb/tui/ChangeLog | 5 | ||||
-rw-r--r-- | gdb/tui/tuiDisassem.c | 22 |
2 files changed, 19 insertions, 8 deletions
diff --git a/gdb/tui/ChangeLog b/gdb/tui/ChangeLog index dc04b1f..ac71eee 100644 --- a/gdb/tui/ChangeLog +++ b/gdb/tui/ChangeLog @@ -1,5 +1,10 @@ 2002-08-25 Stephane Carrez <stcarrez@nerim.fr> + * tuiDisassem.c (tuiGetBeginAsmAddress): Use lookup_minimal_symbol + to find symbol address. + +2002-08-25 Stephane Carrez <stcarrez@nerim.fr> + * tuiSourceWin.c (tui_display_main): Rename from tuiDisplayMainFunction and use tuiGetBeginAsmAddress. * tuiSourceWin.h (tui_display_main): Declare. diff --git a/gdb/tui/tuiDisassem.c b/gdb/tui/tuiDisassem.c index 8e59e68..e3a19b3 100644 --- a/gdb/tui/tuiDisassem.c +++ b/gdb/tui/tuiDisassem.c @@ -231,19 +231,25 @@ tuiGetBeginAsmAddress (void) if (element->addr == 0) { - /*the target is not executing, because the pc is 0 */ - - addr = parse_and_eval_address ("main"); - - if (addr == 0) - addr = parse_and_eval_address ("MAIN"); - + struct minimal_symbol *main_symbol; + + /* Find address of the start of program. + Note: this should be language specific. */ + main_symbol = lookup_minimal_symbol ("main", NULL, NULL); + if (main_symbol == 0) + main_symbol = lookup_minimal_symbol ("MAIN", NULL, NULL); + if (main_symbol == 0) + main_symbol = lookup_minimal_symbol ("_start", NULL, NULL); + if (main_symbol) + addr = SYMBOL_VALUE_ADDRESS (main_symbol); + else + addr = 0; } else /* the target is executing */ addr = element->addr; return addr; -} /* tuiGetBeginAsmAddress */ +} /* |