sam@sam-desktop:~$ sudo gdb Xorg [sudo] password for sam: GNU gdb 6.8-debian Copyright (C) 2008 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later 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-linux-gnu"... (gdb) break RADEONMapMMIO Function "RADEONMapMMIO" not defined. Make breakpoint pending on future shared library load? (y or [n]) y Breakpoint 1 (RADEONMapMMIO) pending. (gdb) handle SIGUSR1 nostop Signal Stop Print Pass to program Description SIGUSR1 No Yes Yes User defined signal 1 (gdb) run Starting program: /usr/bin/Xorg [Thread debugging using libthread_db enabled] This is a pre-release version of the X server from The X.Org Foundation. It is not supported in any way. Bugs may be filed in the bugzilla at http://bugs.freedesktop.org/. Select the "xorg" product for bugs you find in this release. Before reporting bugs in pre-release versions please check the latest version in the X.Org Foundation git repository. See http://wiki.x.org/wiki/GitPage for git access instructions. X.Org X Server 1.4.99.906 (1.5.0 RC 6) Release Date: X Protocol Version 11, Revision 0 Build Operating System: Linux 2.6.24-15-server x86_64 Ubuntu Current Operating System: Linux sam-desktop 2.6.26-5-generic #1 SMP Sun Aug 3 01:26:00 UTC 2008 x86_64 Build Date: 06 August 2008 11:28:30AM xorg-server 2:1.4.99.906-1ubuntu3 (buildd@crested.buildd) Before reporting problems, check http://wiki.x.org to make sure that you have the latest version. Module Loader present Markers: (--) probed, (**) from config file, (==) default setting, (++) from command line, (!!) notice, (II) informational, (WW) warning, (EE) error, (NI) not implemented, (??) unknown. (==) Log file: "/var/log/Xorg.0.log", Time: Sat Aug 9 16:41:38 2008 (==) Using config file: "/etc/X11/xorg.conf" [New Thread 0x7fd17afd66e0 (LWP 12533)] [tcsetpgrp failed in terminal_inferior: Operation not permitted] [Switching to Thread 0x7fd17afd66e0 (LWP 12533)] Breakpoint 1, RADEONMapMMIO (pScrn=0x1687580) at ../../src/radeon_driver.c:358 358 ../../src/radeon_driver.c: No such file or directory. in ../../src/radeon_driver.c (gdb) break pci_device_map_range Breakpoint 2 at 0x7fd17abcebb3: file ../../src/common_interface.c, line 217. (gdb) cont Continuing. Breakpoint 2, pci_device_map_range (dev=0x16728b8, base=3491758080, size=65536, map_flags=1, addr=0x168a788) at ../../src/common_interface.c:217 217 (struct pci_device_private *) dev; (gdb) full bt Undefined command: "full". Try "help". (gdb) bt full #0 pci_device_map_range (dev=0x16728b8, base=3491758080, size=65536, map_flags=1, addr=0x168a788) at ../../src/common_interface.c:217 devp = (struct pci_device_private * const) 0x168a788 mappings = (struct pci_device_mapping *) 0x16728b8 region = 0 i = 23618224 err = 2130640638 #1 0x00007fd17775df2d in RADEONMapMMIO (pScrn=0x1687580) at ../../src/radeon_driver.c:383 info = (RADEONInfoPtr) 0x168a730 pRADEONEnt = (RADEONEntPtr) 0x1687d10 err = #2 0x00007fd17775fddb in RADEONPreInit (pScrn=0x1687580, flags=0) at ../../src/radeon_driver.c:2739 pInt10 = int10_save = s = crtc_max_X = crtc_max_Y = pRADEONEnt = (RADEONEntPtr) 0x1687d10 pPriv = #3 0x0000000000469ce9 in InitOutput (pScreenInfo=0x7e37c0, argc=1, argv=0x7fff82ff1888) at ../../../../hw/xfree86/common/xf86Init.c:749 ---Type to continue, or q to quit--- configured_device = i = 0 j = k = scr_index = modulelist = optionlist = (pointer *) 0x1678830 layout = (screenLayoutPtr) 0x1666700 screenpix24 = pix24 = pix24From = autoconfig = #4 0x0000000000433116 in main (argc=1, argv=0x7fff82ff1888, envp=0x7fff82ff1898) at ../../dix/main.c:358 i = 0 error = 0 xauthfile = alwaysCheckForInput = {0, 1} (gdb) list 212 pci_device_map_range(struct pci_device *dev, pciaddr_t base, 213 pciaddr_t size, unsigned map_flags, 214 void **addr) 215 { 216 struct pci_device_private *const devp = 217 (struct pci_device_private *) dev; 218 struct pci_device_mapping *mappings; 219 unsigned region; 220 unsigned i; 221 int err = 0; (gdb) next 221 int err = 0; (gdb) next 224 *addr = NULL; (gdb) next 226 if (dev == NULL) { (gdb) next 231 for (region = 0; region < 6; region++) { (gdb) next 232 const struct pci_mem_region const* r = &dev->regions[region]; (gdb) next 234 if (r->size != 0) { (gdb) next 235 if ((r->base_addr <= base) && ((r->base_addr + r->size) > base)) { (gdb) next 231 for (region = 0; region < 6; region++) { (gdb) next 232 const struct pci_mem_region const* r = &dev->regions[region]; (gdb) info locals r = (const struct pci_mem_region *) 0x16728d0 devp = (struct pci_device_private * const) 0x16728b8 mappings = (struct pci_device_mapping *) 0x16728b8 region = 1 i = 23618224 err = 0 (gdb) next 234 if (r->size != 0) { (gdb) next 231 for (region = 0; region < 6; region++) { (gdb) info locals devp = (struct pci_device_private * const) 0x16728b8 mappings = (struct pci_device_mapping *) 0x16728b8 region = 1 i = 23618224 err = 0 (gdb) next 232 const struct pci_mem_region const* r = &dev->regions[region]; (gdb) next 234 if (r->size != 0) { (gdb) next 235 if ((r->base_addr <= base) && ((r->base_addr + r->size) > base)) { (gdb) next 236 if ((base + size) > (r->base_addr + r->size)) { (gdb) next 245 if (region > 5) { (gdb) info locals devp = (struct pci_device_private * const) 0x16728b8 mappings = (struct pci_device_mapping *) 0x16728b8 region = 2 i = 23618224 err = 0 (gdb) next 252 for (i = 0; i < devp->num_mappings; i++) { (gdb) display region 1: region = 2 (gdb) next 260 mappings = realloc(devp->mappings, 1: region = 2 (gdb) next 262 if (mappings == NULL) { 1: region = 2 (gdb) next 266 mappings[devp->num_mappings].base = base; 1: region = 2 (gdb) next 267 mappings[devp->num_mappings].size = size; 1: region = 2 (gdb) next 268 mappings[devp->num_mappings].region = region; 1: region = 2 (gdb) next 269 mappings[devp->num_mappings].flags = map_flags; 1: region = 2 (gdb) next 270 mappings[devp->num_mappings].memory = NULL; 1: region = 2 (gdb) next 272 if (dev->regions[region].memory == NULL) { 1: region = 2 (gdb) next 273 err = (*pci_sys->methods->map_range)(dev, 1: region = 2 (gdb) info locals devp = (struct pci_device_private * const) 0x16728b8 mappings = (struct pci_device_mapping *) 0x168b300 region = 2 i = 0 err = 0 (gdb) list 268 mappings[devp->num_mappings].region = region; 269 mappings[devp->num_mappings].flags = map_flags; 270 mappings[devp->num_mappings].memory = NULL; 271 272 if (dev->regions[region].memory == NULL) { 273 err = (*pci_sys->methods->map_range)(dev, 274 &mappings[devp->num_mappings]); 275 } 276 277 if (err == 0) { (gdb) print *mappings $1 = {base = 3491758080, size = 65536, region = 2, flags = 1, memory = 0x0} (gdb) print devp->num_mappings $2 = 0 (gdb) print pci_sys->methods->map_range $3 = (int (*)(struct pci_device *, struct pci_device_mapping *)) 0x7fd17abd10db (gdb) step pci_device_linux_sysfs_map_range (dev=0x16728b8, map=0x168b300) at ../../src/linux_sysfs.c:507 507 { (gdb) list 502 * \c mmap64 may need to be used. 503 */ 504 static int 505 pci_device_linux_sysfs_map_range(struct pci_device *dev, 506 struct pci_device_mapping *map) 507 { 508 char name[256]; 509 int fd; 510 int err = 0; 511 const int prot = ((map->flags & PCI_DEV_MAP_FLAG_WRITABLE) != 0) (gdb) bt full #0 pci_device_linux_sysfs_map_range (dev=0x16728b8, map=0x168b300) at ../../src/linux_sysfs.c:507 name = "P\025�\202�\177\000\000�bh\001\000\000\000\000f;sw�\177\000\000\210R�x�\177\000\000@\000\000\000\000\000\000\000\001\000\000\000\000\000\000\000\001\000\000\000\000\000\000\000�|h\001\000\000\000\000\020\025�\202�\177\000\000b{O\000\000\000\000\000P\000\000\000\000\000\000\000�\024�\202�\177\000\000�\024�\202�\177\000\000�\024�\202�\177\000\000 ", '\0' , "\003\000\000\000\020\025�\202�\177\000\0006`�x�\177\000\000�|h\001\000\000\000\000{�H\000\000\000\000\000\000\000\000\000\003\000\000\000\000z\ay�\177\000\000p̼z�\177\000\000�\004�z�\177\000\000\000\000\000\000\000\000\000\000�"... fd = 0 err = 23619080 prot = 0 open_flags = 0 offset = 4318442672 sentry = {base = 64, size = 2027418777, type = 32721} #1 0x00007fd17abcee1f in pci_device_map_range (dev=0x16728b8, base=3491758080, size=65536, map_flags=1, addr=0x168a788) at ../../src/common_interface.c:273 devp = (struct pci_device_private * const) 0x16728b8 mappings = (struct pci_device_mapping *) 0x168b300 region = 2 i = 0 ---Type to continue, or q to quit--- err = 0 #2 0x00007fd17775df2d in RADEONMapMMIO (pScrn=0x1687580) at ../../src/radeon_driver.c:383 info = (RADEONInfoPtr) 0x168a730 pRADEONEnt = (RADEONEntPtr) 0x1687d10 err = #3 0x00007fd17775fddb in RADEONPreInit (pScrn=0x1687580, flags=0) at ../../src/radeon_driver.c:2739 pInt10 = int10_save = s = crtc_max_X = crtc_max_Y = pRADEONEnt = (RADEONEntPtr) 0x1687d10 pPriv = #4 0x0000000000469ce9 in InitOutput (pScreenInfo=0x7e37c0, argc=1, argv=0x7fff82ff1888) at ../../../../hw/xfree86/common/xf86Init.c:749 configured_device = i = 0 j = k = scr_index = modulelist = ---Type to continue, or q to quit--- optionlist = (pointer *) 0x1678830 layout = (screenLayoutPtr) 0x1666700 screenpix24 = pix24 = pix24From = autoconfig = #5 0x0000000000433116 in main (argc=1, argv=0x7fff82ff1888, envp=0x7fff82ff1898) at ../../dix/main.c:358 i = 0 error = 0 xauthfile = alwaysCheckForInput = {0, 1} (gdb) info locals name = "P\025�\202�\177\000\000�bh\001\000\000\000\000f;sw�\177\000\000\210R�x�\177\000\000@\000\000\000\000\000\000\000\001\000\000\000\000\000\000\000\001\000\000\000\000\000\000\000�|h\001\000\000\000\000\020\025�\202�\177\000\000b{O\000\000\000\000\000P\000\000\000\000\000\000\000�\024�\202�\177\000\000�\024�\202�\177\000\000�\024�\202�\177\000\000 ", '\0' , "\003\000\000\000\020\025�\202�\177\000\0006`�x�\177\000\000�|h\001\000\000\000\000{�H\000\000\000\000\000\000\000\000\000\003\000\000\000\000z\ay�\177\000\000p̼z�\177\000\000�\004�z�\177\000\000\000\000\000\000\000\000\000\000�"... fd = 0 err = 23619080 prot = 0 open_flags = 0 offset = 4318442672 sentry = {base = 64, size = 2027418777, type = 32721} (gdb) next 510 int err = 0; (gdb) next 512 ? (PROT_READ | PROT_WRITE) : PROT_READ; (gdb) next 514 ? O_RDWR : O_RDONLY; (gdb) next 515 const off_t offset = map->base - dev->regions[map->region].base_addr; (gdb) next 521 }; (gdb) next 524 snprintf(name, 255, "%s/%04x:%02x:%02x.%1u/resource%u", (gdb) 532 fd = open(name, open_flags); (gdb) list 527 dev->bus, 528 dev->dev, 529 dev->func, 530 map->region); 531 532 fd = open(name, open_flags); 533 if (fd == -1) { 534 return errno; 535 } 536 (gdb) print name $4 = "/sys/bus/pci/devices/0000:08:00.0/resource2\000\000\000\000\000\001\000\000\000\000\000\000\000�|h\001\000\000\000\000\020\025�\202�\177\000\000b{O\000\000\000\000\000P\000\000\000\000\000\000\000�\024�\202�\177\000\000�\024�\202�\177\000\000�\024�\202�\177\000\000 ", '\0' , "\003\000\000\000\020\025�\202�\177\000\0006`�x�\177\000\000�|h\001\000\000\000\000{�H\000\000\000\000\000\000\000\000\000\003\000\000\000\000z\ay�\177\000\000p̼z�\177\000\000�\004�z�\177\000\000\000\000\000\000\000\000\000\000�"... (gdb) next 533 if (fd == -1) { (gdb) next 538 map->memory = mmap(NULL, map->size, prot, MAP_SHARED, fd, offset); (gdb) list 533 if (fd == -1) { 534 return errno; 535 } 536 537 538 map->memory = mmap(NULL, map->size, prot, MAP_SHARED, fd, offset); 539 if (map->memory == MAP_FAILED) { 540 map->memory = NULL; 541 close(fd); 542 return errno; (gdb) print *map $5 = {base = 3491758080, size = 65536, region = 2, flags = 1, memory = 0x0} (gdb) info locals name = "/sys/bus/pci/devices/0000:08:00.0/resource2\000\000\000\000\000\001\000\000\000\000\000\000\000�|h\001\000\000\000\000\020\025�\202�\177\000\000b{O\000\000\000\000\000P\000\000\000\000\000\000\000�\024�\202�\177\000\000�\024�\202�\177\000\000�\024�\202�\177\000\000 ", '\0' , "\003\000\000\000\020\025�\202�\177\000\0006`�x�\177\000\000�|h\001\000\000\000\000{�H\000\000\000\000\000\000\000\000\000\003\000\000\000\000z\ay�\177\000\000p̼z�\177\000\000�\004�z�\177\000\000\000\000\000\000\000\000\000\000�"... fd = 11 err = 0 prot = 3 open_flags = 2 offset = 0 sentry = {base = 3491758080, size = 65536, type = 0} (gdb) next