From: Daniel Jacobowitz <drow@mvista.com>
To: Sunil Alankar <sunil.alankar@coware.com>
Cc: gdb@sources.redhat.com
Subject: Re: GDB 5.2/5.3 breakpoint bug
Date: Wed, 08 Jan 2003 00:52:00 -0000 [thread overview]
Message-ID: <20030108005220.GA30387@nevyn.them.org> (raw)
In-Reply-To: <IMEGIEBLGLIOEGOLAFIEGENJCEAA.sunil.alankar@coware.com>
On Tue, Jan 07, 2003 at 03:49:31PM -0800, Sunil Alankar wrote:
> Hi,
>
> While debugging this in function, find_pc_sect_line (CORE_ADDR pc, struct
> sec *section, int notcurrent)
> I found there were two line items in a line table with the same value of PC.
> First one gets picked as the best match. But this had item->line == 0. The
> next line item with the same value for item->pc, but a valid item->line ( >
> 0) does not get picked as the best match.
> I put in the following check to correct this. My question is,
> Is it valid to have have more than one line item with same value faor PC and
> possibly 0 for line in one of them? What causes this?
> Would this be an appropriate fix? Or is the problem more deep rooted in
> creating the symbol table?
I'll look at this more precisely later (tomorrow, I hope...) but what
that means is that a function ends exactly where another one starts.
Very interesting; we probably should ignore the ending marker in that
case, but I'm not sure you're doing it the best way.
>
> --- ../original/gdb-5.3/gdb/symtab.c Thu Aug 29 20:24:00 2002
> +++ gdb-5.3/gdb/symtab.c Tue Jan 7 14:42:34 2003
> @@ -1950,6 +1950,21 @@
> best_end = 0;
> }
>
> + /* Handle the case where the prev->pc == best->pc due to more than
> one line
> + items for a pc, but the best->line == 0. grab a better match if one
> exists
> + that has a non zero line number */
> +
> + else if (prev && (!best || ((prev->pc == best->pc) && (best->line ==
> 0)
> + && (prev->line != 0))))
> + {
> + best = prev;
> + best_symtab = s;
> +
> + /* Discard BEST_END if it's before the PC of the current BEST. */
> + if (best_end <= best->pc)
> + best_end = 0;
> + }
> +
> /* If another line (denoted by ITEM) is in the linetable and its
> PC is after BEST's PC, but before the current BEST_END, then
> use ITEM's PC as the new best_end. */
>
>
> -----Original Message-----
> From: gdb-owner@sources.redhat.com
> [mailto:gdb-owner@sources.redhat.com]On Behalf Of Sunil Alankar
> Sent: Sunday, January 05, 2003 3:11 PM
> To: Daniel Jacobowitz
> Cc: gdb@sources.redhat.com
> Subject: RE: GDB 5.2/5.3 breakpoint bug
>
>
> Correction to the link for the systemc library sources:
>
> http://www.systemc.org/download.php/systemc/13/19/systemc-2.0.1.tgz
>
> Thx
>
> Sunil
>
> -----Original Message-----
> From: gdb-owner@sources.redhat.com
> [mailto:gdb-owner@sources.redhat.com]On Behalf Of Sunil Alankar
> Sent: Sunday, January 05, 2003 3:07 PM
> To: Daniel Jacobowitz
> Cc: gdb@sources.redhat.com
> Subject: RE: GDB 5.2/5.3 breakpoint bug
>
>
> I guess the e-mail with the attachment of library and include files was not
> delivered. Here it is without attachments.
> The sources for the systemc library/include files are at
> http://www.systemc.org/download.php/systemc/1/4/systemc-1.0.2.tar.gz
> Sunil
>
> -----Original Message-----
> From: Sunil Alankar [mailto:sunil.alankar@coware.com]
> Sent: Sunday, January 05, 2003 2:48 PM
> To: Daniel Jacobowitz
> Cc: gdb@sources.redhat.com
> Subject: RE: GDB 5.2/5.3 breakpoint bug
>
>
> Hi,
> I have a detailed description of the problem here. Hope this would help. I
> appreciate your help.
>
> Thank you
>
> Sunil
>
>
> Problem:
> Unable to set class method breakpoints in solaris with gdb 5.3 while using
> systemc
> library in the program.
>
> Platform:
> SunOS tesla 5.7 Generic_106541-23 sun4u sparc SUNW,Ultra-4
>
> g++ version:
> Reading specs from
> /eng/devtools/SunOS_5.7/lib/gcc-lib/sparc-sun-solaris2.7/2.95.2/specs
> gcc version 2.95.2 19991024 (release)
>
> gdb version:
> GNU gdb 5.3
> Copyright 2002 Free Software Foundation, Inc.
> GDB is free software, covered by the GNU General Public License, and you are
> welcome to change it and/or distribute copies of it under certain
> conditions.
> Type "show copying" to see the conditions.
> There is absolutely no warranty for GDB. Type "show warranty" for details.
> This GDB was configured as "sparc-sun-solaris2.7".
>
>
> Test program:
>
> This error occured while I am debugging a systemC (c++ library for system
> design) program.
> Here is a small example program that demonstrates the problem. ( I have
> attached the
> required library for solaris and include files with the e-mail)
>
> //-------------------------------------------------------------
> #include <systemc.h>
>
> SC_MODULE(top)
> {
> public:
>
> sc_in_clk iclk;
>
> void func()
> {
> printf (".");
> }
>
> SC_CTOR(top)
> {
> SC_METHOD(func);
> sensitive_pos << iclk;
> dont_initialize();
> }
> };
>
> int sc_main (int argc , char *argv[])
> {
> sc_clock clk("clk", 20);
> top *top1 = new top("Top1");
> top1->iclk(clk);
> sc_start(20000);
> return 0;
> }
>
> //-------------------------------------------------------------
>
> Build the example with:
> % g++ -g -I./include -L./ -lm test1.cpp -lsystemc -o tx
>
> %/home1/gdb-5.3/gdb/gdb tx
> GNU gdb 5.3
> Copyright 2002 Free Software Foundation, Inc.
> GDB is free software, covered by the GNU General Public License, and you are
> welcome to change it and/or distribute copies of it under certain
> conditions.
> Type "show copying" to see the conditions.
> There is absolutely no warranty for GDB. Type "show warranty" for details.
> This GDB was configured as "sparc-sun-solaris2.7"...
> (gdb) b top::func
> the class top does not have any method named func
> Hint: try 'top::func<TAB> or 'top::func<ESC-?>
> (Note leading single quote.)
> (gdb)
>
>
> In some systemC programs, gdb attempts to set breakpoints at invalid
> addresses.
>
> This works without a problem in gdb 5.1 with proper breakpoint being set.
>
>
>
> I hope this test case can provide sufficient ground to get at the problem.
>
>
>
>
> -----Original Message-----
> From: Daniel Jacobowitz [mailto:drow@mvista.com]
> Sent: Friday, January 03, 2003 6:23 PM
> To: Sunil Alankar
> Cc: gdb@sources.redhat.com
> Subject: Re: GDB 5.2/5.3 breakpoint bug
>
>
> On Fri, Jan 03, 2003 at 06:15:26PM -0800, Sunil Alankar wrote:
> > Hi,
> >
> > Attempting to set a class member function breakpoint (say break
> > myClass::funcOne) fails to set a proper break point in solaris 2.7.
> > This happens with GDB 5.2 and 5.3. Bug does not occur in GDB 5.1. Anybody
> > has any idea where to look?. I would appreciate any help.
>
> What _does_ happen if it isn't a proper breakpoint? Can you provide a
> transcript?
>
> What version of what compiler are you using?
>
> --
> Daniel Jacobowitz
> MontaVista Software Debian GNU/Linux Developer
>
>
--
Daniel Jacobowitz
MontaVista Software Debian GNU/Linux Developer
next prev parent reply other threads:[~2003-01-08 0:52 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <IMEGIEBLGLIOEGOLAFIEGELNCEAA.sunil.alankar@coware.com>
2003-01-05 23:10 ` Sunil Alankar
2003-01-05 23:14 ` Sunil Alankar
2003-01-07 23:55 ` Sunil Alankar
2003-01-08 0:52 ` Daniel Jacobowitz [this message]
2003-01-08 17:39 ` Daniel Jacobowitz
2003-01-08 18:16 ` Daniel Jacobowitz
2003-01-08 19:22 ` Sunil Alankar
2003-01-08 19:32 ` Daniel Jacobowitz
2003-01-08 19:43 ` Sunil Alankar
2003-01-08 20:42 ` Sunil Alankar
2003-01-08 20:46 ` Daniel Jacobowitz
2003-01-08 22:46 ` Ching Lai
2003-01-09 3:40 ` Daniel Jacobowitz
2003-01-09 5:18 ` Ching Lai
2003-01-08 17:30 ` Daniel Jacobowitz
2003-01-08 18:14 ` Sunil Alankar
2003-01-08 18:24 ` Daniel Jacobowitz
2003-01-29 3:56 ` Daniel Jacobowitz
2003-01-02 20:59 how to access show/set data Kris Warkentin
2003-01-04 2:19 ` GDB 5.2/5.3 breakpoint bug Sunil Alankar
2003-01-04 2:23 ` Daniel Jacobowitz
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20030108005220.GA30387@nevyn.them.org \
--to=drow@mvista.com \
--cc=gdb@sources.redhat.com \
--cc=sunil.alankar@coware.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox