J'ai compilé GDB 7 sur un système Mac OS X Leopard. Lors de l'exécution d'un programme C, GDB ne parvient pas à parcourir les instructions 'printf()', qui n'ont probablement pas d'informations de débogage associées, et commence à imprimer "Impossible de trouver les limites de la fonction en cours."GDB ne saute pas de fonctions sans débogage Info
Voici quelques sorties:
$ /usr/local/bin/gdb try1
GNU gdb (GDB) 7.1
Copyright (C) 2010 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-apple-darwin10".
(gdb) list
1 #include <stdio.h>
2 static void display(int i, int *ptr);
3
4 int main(void) {
5 int x = 5;
6 int *xptr = &x;
7 printf("In main():\n");
8 printf(" x is %d and is stored at %p.\n", x, &x);
9 printf(" xptr holds %p and points to %d.\n", xptr, *xptr);
10 display(x, xptr);
(gdb) b 6
Breakpoint 1 at 0x1e8e: file try1.c, line 6.
(gdb) r
Starting program: /tmp/try1
Breakpoint 1, main() at try1.c:6
6 int *xptr = &x;
(gdb) n
7 printf("In main():\n");
(gdb) n
0x0000300a in ??()
(gdb) n
Cannot find bounds of current function
(gdb) n
Cannot find bounds of current function
Toute idée de ce qui se passe?
Alan
Oui, le programme a été compilé avec l'option -g; sinon, aucune de ces bonnes informations de débogage n'aurait été affichée. Le GDB 6.3.50 standard fourni avec mon Mac fonctionne aussi bien que votre sortie, mais j'ai un problème avec le GDB 7 que j'ai compilé à partir de la source. Si vous avez besoin d'aide, j'ai téléchargé les sources GDB 7.1 à partir de http://ftp.gnu.org/gnu/gdb/ et j'ai compilé en suivant ces instructions: http://chenkaie.blogspot.com/2009/11/macsnow -leopard-build-gdb-v70-from.html. – aparkerlue