Репозиторий Sisyphus
Последнее обновление: 1 октября 2023 | Пакетов: 18631 | Посещений: 37665412
en ru br
Репозитории ALT
S:13.2.0.43.854f46b6377-alt2
5.1: 6.6-alt3
4.1: 6.6-alt3
4.0: 6.6-alt2
3.0: 6.3-alt2
www.altlinux.org/Changes

Группа :: Разработка/Отладчики
Пакет: gdb

 Главная   Изменения   Спек   Патчи   Sources   Загрузить   Gear   Bugs and FR  Repocop 

Патч: gdb-6.5-bz205551-printf-p.patch
Скачать


https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=205551
2006-09-10  Jan Kratochvil  <jan.kratochvil@redhat.com>
	* printcmd.c (printf_command): Handle forgotten "%p".
2006-09-10  Jan Kratochvil  <jan.kratochvil@redhat.com>
	* gdb.base/display.exp: New test of `printf' "%p" formatting.
diff -u -r sources-clean/gdb/printcmd.c sources-custom/gdb/printcmd.c
--- sources-clean/gdb/printcmd.c	2006-07-29 20:29:26.000000000 +0200
+++ sources-custom/gdb/printcmd.c	2006-09-12 16:18:55.000000000 +0200
@@ -43,6 +43,9 @@
 #include "gdb_assert.h"
 #include "block.h"
 #include "disasm.h"
+#ifdef HAVE_STDINT_H
+#include <stdint.h>
+#endif
 
 #ifdef TUI
 #include "tui/tui.h"		/* For tui_active et.al.   */
@@ -2065,6 +2068,16 @@
 #else
 	    error (_("long long not supported in printf"));
 #endif
+	  case ptr_arg:
+#ifdef HAVE_UINTPTR_T
+	    {
+	      void *val = (void *) (uintptr_t) value_as_address (val_args[i]);
+	      printf_filtered (current_substring, val);
+	      break;
+	    }
+#else
+	    error (_("pointer not supported in printf"));
+#endif
 	  case int_arg:
 	    {
 	      int val = value_as_long (val_args[i]);
diff -u -r sources-clean/gdb/testsuite/gdb.base/display.exp sources-custom/gdb/testsuite/gdb.base/display.exp
--- sources-clean/gdb/testsuite/gdb.base/display.exp	2006-08-13 02:53:36.000000000 +0200
+++ sources-custom/gdb/testsuite/gdb.base/display.exp	2006-09-12 16:17:24.000000000 +0200
@@ -179,6 +179,8 @@
 gdb_test "printf \"\"" ".*" "re-set term"
 gdb_test "printf \"\\w\"" ".*Unrecognized escape character.*"
 gdb_test "printf \"%d\" j" ".*Invalid argument syntax.*"
+# 0 or hex vs. dec printing may be platform dependent:
+gdb_test "printf \"<%p>\\n\", (void *)7" ".*7>.*"
 
 # play with "print", too
 #
 
дизайн и разработка: Vladimir Lettiev aka crux © 2004-2005, Andrew Avramenko aka liks © 2007-2008
текущий майнтейнер: Michael Shigorin