From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jim Blandy To: Richard Henderson Cc: egcs@egcs.cygnus.com, gdb@sourceware.cygnus.com Subject: Re: IA32: printing FP register variables Date: Mon, 26 Jul 1999 11:43:00 -0000 Message-id: References: <9500.931826533@upchuck.cygnus.com> <19990719234100.C17063@cygnus.com> X-SW-Source: 1999-q3/msg00098.html > On Mon, Jul 19, 1999 at 03:26:18PM -0500, Jim Blandy wrote: > > Once the other internal work is done, would the EGCS folks be willing > > to experiment with both, and give us some sense of how much difference > > it makes? > > Yes. It seems a reasonable thing to try. Okay. So the current plan is: 1) EGCS folks get regstack to actually propagate the variable/register mapping to its output accurately. 2) EGCS folks make sure accurate LRS information is generated. 3) EGCS folks compare output size using base-relative and top-relative numberings. Unless the space savings are persuasive, we stick with the more intuitive and more widely used top-relative numbering. 4) Once EGCS is generating the information correctly, GDB folks implement support for whatever numbering system the EGCS folks recommend. >From jimb@cygnus.com Mon Jul 26 11:55:00 1999 From: Jim Blandy To: Neal Cardwell Cc: gdb@sourceware.cygnus.com Subject: Re: signals at breakpoints in Linux Date: Mon, 26 Jul 1999 11:55:00 -0000 Message-id: References: X-SW-Source: 1999-q3/msg00099.html Content-length: 979 > I'm trying to build a minimal debugger under Linux that maintains a set of > breakpoints and prints out some information each time a breakpoint is hit. > It works fine, except for the case where the child process executes a > breakpoint instruction and wait(2) tells me that a (non-SIGTRAP) signal is > pending. I can't seem to handle this case correctly, no matter what i try. > What is the correct course of action when a breakpoint and signal are > encountered simultaneously? I've tried looking at the sources for GDB, but > they're pretty tough to wade through. I'm not positive about this, but I think you're misunderstanding the results from ptrace. Not that they're wonderfully clear to begin with. The result from wait tells you why the program stopped. As I understand it, it either stopped because of a breakpoint, or it stopped because of a signal --- it can't stop for both reasons. What exactly is wait returning? Where exactly is the PC when wait returns? >From rogerc@ignitus.com Mon Jul 26 13:01:00 1999 From: Roger Cruz To: gdb@sourceware.cygnus.com Subject: How do I type cast an array of strings in GDB? Date: Mon, 26 Jul 1999 13:01:00 -0000 Message-id: <379CBFBC.6164B1CA@ignitus.com> X-SW-Source: 1999-q3/msg00100.html Content-length: 1158 I have the following definition in a file, compiled without the -g switch: LOCAL char * semTypeMsg [MAX_SEM_TYPE] = { "BINARY", "MUTEX", "COUNTING", "OLD", "\0", "\0", "\0", "\0" }; I want to index this array to get to the different strings: (gdb) p semTypeMsg[0] cannot subscript something of type `' (gdb) whatis semTypeMsg type = But because it was compiled without the -g switch, I can't do this directly. How do I cast this variable name to allow me access to the strings? I've tried a bunch of compinations and they are all unsuccessful (gdb) p ((char *)semTypeMsg) $19 = 0xfdd8c "BINARY" (gdb) p ((char *)semTypeMsg)[0] $20 = 66 'B' (gdb) p ((char **)semTypeMsg)[0] $21 = 0x42494e41Requested target address (0x42494e41) is outside the valid memory range: 0x0-0x1000000 (gdb) p ((char **)semTypeMsg)+1 $22 = (char **) 0xfdd90 (gdb) p *(((char **)semTypeMsg)+1) $23 = 0x52590000Requested target address (0x52590000) is outside the valid memory range: 0x0-0x1000000 (gdb) p (char *)(((char **)semTypeMsg)+1) $24 = 0xfdd90 "RY" (gdb) p (char *)(((char **)semTypeMsg)+1)