20:10:28 #startmeeting 20:10:28 Meeting started Sat Dec 5 20:10:28 2009 UTC. The chair is boeckb. Information about MeetBot at http://wiki.debian.org/MeetBot. 20:10:28 Useful Commands: #action #agreed #halp #info #idea #link #topic. 20:10:51 #meetingtopic gdb features 20:10:57 thanks boeckb! 20:11:13 #topic threaded programs 20:11:38 20:11:53 turning on the thread debugging 20:11:59 set non-stop on 20:12:06 set target-async on 20:12:25 these can be added to the gdb config file to be set by default 20:12:45 set breakpoints at main and each of the threads 20:13:01 the "info threads" command gives information about all of the threads that are running 20:14:26 by stepping through the program, "next" steps through the current thread 20:14:41 the other threads do not execute 20:14:55 but only if they hit breakpoints 20:15:11 if there were not breakpoints, they would run because only the main thread is being debugged 20:15:33 the "thread 2" command switchs the thread that is being debugged 20:16:18 to the scond thread (see inf threads for ids) 20:16:39 the "continue &" command backgrounds the current thread 20:17:28 to break a runnign thread, switch to it and use the "interrupt" command 20:18:55 question: with "next &", does the program stop after finishing the backgrounded process of running the next line? 20:20:06 this allows you to do one long-running line and continue doing other commands on other threads 20:21:09 #toppic pretty printing 20:21:13 #topic pretty printing 20:21:26 using a python script to print a cmplex type 20:22:19 20:22:43 it uses a deque on strings, a map from int to strings, and a custom data strucure 20:23:03 (c++) 20:23:22 print/r the_map 20:23:36 20:23:49 (this is without pretty printing) 20:24:04 similar with the_deque 20:24:20 and strings 20:24:36 (data is there, but among other data) 20:24:45 print the_map 20:25:00 { 20:25:07 [23], "hello", 20:25:16 } 20:25:40 these are built-in with gdb now 20:25:46 custom data types 20:26:19 these need pretty printers to display anything other than a dump of member variables 20:26:34 in python: 20:26:45 class with a to_string method 20:27:54 another function which compares the type of the value and uses the class to use the class (returns None otherwise) 20:27:58 then: 20:28:11 gdb.pretty_printers.append() 20:28:24 to use in gdb "source mytype.py" 20:28:39 then "print value" will use the pretty printer 20:29:05 pretty printers can be auto loaded 20:29:31 in the same directory as the executable (assume executable named "demo") 20:29:37 demo-gdb.py 20:29:41 it will be auto-sourced 20:30:05 (searching the same directory) 20:30:21 unsure whether other directories can be searched now (will research) 20:30:36 (question from adam jackson) 20:31:15 also would be nice if -debuginfo came with these pretty printers 20:32:57 #topic C++ expression handling 20:33:07 info func Base::Base 20:33:23 prints out all functions matching 20:34:26 (Base has 3 ctors) 20:34:34 print Base::Base 20:34:39 is ambiguous 20:35:05 print Base::Base(void) 20:35:26 prints out the method data (return value, args, pointer) 20:36:17 #topic template handling 20:37:17 ptype will display the rsolved type of a variable 20:37:55 so "ptype mytype" displays the declaration of a template with a certain type 20:38:07 s/certain type/int/ 20:38:30 typedefs will be handed as well 20:38:40 typedef mytype tchar 20:38:48 ptype tchar::member 20:39:32 will display the type of the member with the template specified 20:40:08 question: can you call the instance of a template function if its not in the executable(type not used in it) 20:40:20 ctors wont work, but regular functions should 20:40:29 #topic namespaces 20:41:22 four functions doing different scoping of variables and "using" statements 20:42:45 fully scoped works 20:43:35 and now gdb will pick up on using declarations 20:43:54 so if namespace A has a member x 20:44:00 and a function does using A::x 20:44:09 priint x in that function will print A::x 20:44:24 it used to always need the full scoping 20:44:51 similar with doing using namespace A importing variables 20:45:51 question: how does it work with different gcc versions 20:45:52 ? 20:46:07 older versions may not export the necessary information for gdb 20:46:20 #topic Archer project/team 20:46:33 objective: improve debugging support in Fedora 20:46:41 uses a branch of gdb 20:46:54 patch review process upstream is slower than development speed 20:47:02 but patches are being upstreamed 20:47:20 Fedora uses Archer's gdb 20:48:00 question: is it in F12? 20:48:12 its been here since F11, not sure exactly when the cutoff was in F11 20:48:42 eclipse support is underway 20:48:56 #info http://sourceware.org/gdb 20:49:02 #info http://sourceware.org/gdb/wiki/ProjectArcher 20:49:07 please file bugs 20:49:24 #topic questions 20:49:39 dave: how is gdb on OOo these days? 20:49:49 on the TODO list 20:50:47 ben: are Qt retty printers shipped? 20:51:03 not by default 20:51:47 adam jackson: shipping pretty printers with libraries? 20:51:56 /usr/lib/libfoo.so.0-gdb.py 20:51:59 should work 20:52:09 its a packaging thing 20:52:26 its in the manual 20:52:48 Archer mailing list is open as well for questions 20:53:49 dave: maybe writing python to know about C++ objects is a weak point 20:53:59 how to deal with python backtraces from the pretty printers 20:54:53 its up t developers to write pretty printers for their libraries 20:55:24 wiki pages need written about what maintainers need to do 20:55:52 question: ther languages than python? 20:56:00 possible, but python is what has been worked on 20:56:02 #endmeeting