public inbox for gdb@sourceware.org
 help / color / mirror / Atom feed
* gdb refuses to 'break'
@ 2003-04-16 18:18 Markus Brandner
  2003-04-16 19:51 ` return type of a fucntion Smita
  2003-04-17  9:13 ` gdb refuses to 'break' Markus Brandner
  0 siblings, 2 replies; 13+ messages in thread
From: Markus Brandner @ 2003-04-16 18:18 UTC (permalink / raw)
  To: gdb

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi!

Either I missed the point when reading the gdb documentation or
I'm just experiencing some strange behaviour in gdb.
Im running a Slackware 8.1 system on kernel 2.4.18 with
libc-2.2.5

When I compile the following code:

test.c:
#include <stdio.h>

int main(int argc, char **argv)
{
	printf("Breakpoint test\n");
	return 0;
}

using "gcc -g test.c -o test" (my gcc is 2.95.3)
and try to set a break-point with gdb 5.2:

(gdb) break main
Breakpoint 1 at 0x80483f6: file test.c, line 5.
(gdb) run
Starting program: /home/home_PCs105/brandner/tmp/test 
Breakpoint test

Program exited normally.
You can't do that without a process to debug.
(gdb) 

gdb seems to run straight through ignoring the break.
I tried break: line number - same result
I even get the same results using gdb 5.3.

However, compiling the same source using the same gcc
on a libc-2.2.3 machine (kernel 2.2.21) and trying to
do the same thing using gdb 5.0 works perfectly
(but not with any more recent gdb version)

What am I missing?

Thanks for your help,

Markus
- -- 
- -----------------------------------------------------------------
Markus Brandner               Institute of Electrical Measurement
                                and Measurement Signal Processing
phone: +43 316 873 7773             Graz University of Technology
fax:   +43 316 873 4279                     Schiessstattgasse 14B
email: brandner@emt.tugraz.at                 A8010 Graz, Austria
- -----------------------------------------------------------------
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (GNU/Linux)
Comment: For info see http://www.gnupg.org

iD8DBQE+nZ5BjjwO/+h9egkRAtf5AKCPC8DmjWw4L4ktKIMppsMvH+PSmQCglfUw
otygkEI0FAtE7vh6FVvLr4o=
=2tWf
-----END PGP SIGNATURE-----

^ permalink raw reply	[flat|nested] 13+ messages in thread

* return type of a fucntion
  2003-04-16 18:18 gdb refuses to 'break' Markus Brandner
@ 2003-04-16 19:51 ` Smita
  2003-04-16 19:59   ` gdb's communication to a process/libgdb? Smita
  2003-04-17  3:37   ` return type of a fucntion Peter Barada
  2003-04-17  9:13 ` gdb refuses to 'break' Markus Brandner
  1 sibling, 2 replies; 13+ messages in thread
From: Smita @ 2003-04-16 19:51 UTC (permalink / raw)
  To: Markus Brandner; +Cc: gdb

Hi,
When I print $r3 on returning from a function, I get the return value. But
is there a way to get the type of the return value (eg. whether it is a
pointer or an interger)??

Thanks!
Smita

^ permalink raw reply	[flat|nested] 13+ messages in thread

* gdb's communication to a process/libgdb?
  2003-04-16 19:51 ` return type of a fucntion Smita
@ 2003-04-16 19:59   ` Smita
  2003-04-16 20:04     ` Daniel Jacobowitz
  2003-04-16 22:07     ` libgdb Smita
  2003-04-17  3:37   ` return type of a fucntion Peter Barada
  1 sibling, 2 replies; 13+ messages in thread
From: Smita @ 2003-04-16 19:59 UTC (permalink / raw)
  To: Smita; +Cc: gdb

Hi,
 I am spawing a gdb process from my process and feeding to gdb an input
script.
I want the parent process to be able to control this gdb process. For this
to happen, I want to communicate to the parent process that a breakpoint
has occurred when gdb stops at a breakpoint? Is it possible to to this?
There is something called libgdb. I am not sure if that can be used for
this purpose.

Any feedback on this would be greatly appreciated.
Thanks
Smita

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: gdb's communication to a process/libgdb?
  2003-04-16 19:59   ` gdb's communication to a process/libgdb? Smita
@ 2003-04-16 20:04     ` Daniel Jacobowitz
  2003-04-16 22:07     ` libgdb Smita
  1 sibling, 0 replies; 13+ messages in thread
From: Daniel Jacobowitz @ 2003-04-16 20:04 UTC (permalink / raw)
  To: Smita; +Cc: gdb

On Wed, Apr 16, 2003 at 12:59:14PM -0700, Smita wrote:
> Hi,
>  I am spawing a gdb process from my process and feeding to gdb an input
> script.
> I want the parent process to be able to control this gdb process. For this
> to happen, I want to communicate to the parent process that a breakpoint
> has occurred when gdb stops at a breakpoint? Is it possible to to this?
> There is something called libgdb. I am not sure if that can be used for
> this purpose.
> 
> Any feedback on this would be greatly appreciated.

You should probably be reading the documentation for "MI".  Check the
manual, available online under http://sources.redhat.com/gdb/.

-- 
Daniel Jacobowitz
MontaVista Software                         Debian GNU/Linux Developer

^ permalink raw reply	[flat|nested] 13+ messages in thread

* libgdb
  2003-04-16 19:59   ` gdb's communication to a process/libgdb? Smita
  2003-04-16 20:04     ` Daniel Jacobowitz
@ 2003-04-16 22:07     ` Smita
  2003-04-16 23:58       ` is libgdb okay to use? Smita
  2003-04-17  1:44       ` libgdb Elena Zannoni
  1 sibling, 2 replies; 13+ messages in thread
From: Smita @ 2003-04-16 22:07 UTC (permalink / raw)
  To: gdb

Hi,
 I am new to libgdb. Could someone please give me a pointer to its usage
documentaion?
Thanks
Smita


^ permalink raw reply	[flat|nested] 13+ messages in thread

* is libgdb okay to use?
  2003-04-16 22:07     ` libgdb Smita
@ 2003-04-16 23:58       ` Smita
  2003-04-17  1:44       ` libgdb Elena Zannoni
  1 sibling, 0 replies; 13+ messages in thread
From: Smita @ 2003-04-16 23:58 UTC (permalink / raw)
  To: gdb

Hi,
 I read somewhere that libgdb project was scrapped. Is that true?

Thanks
Smita


^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: libgdb
  2003-04-16 22:07     ` libgdb Smita
  2003-04-16 23:58       ` is libgdb okay to use? Smita
@ 2003-04-17  1:44       ` Elena Zannoni
  2003-04-17  2:06         ` libgdb Smita
  2003-04-17  2:11         ` finish for nested function calls Smita
  1 sibling, 2 replies; 13+ messages in thread
From: Elena Zannoni @ 2003-04-17  1:44 UTC (permalink / raw)
  To: Smita; +Cc: gdb

Smita writes:
 > Hi,
 >  I am new to libgdb. Could someone please give me a pointer to its usage
 > documentaion?
 > Thanks
 > Smita
 > 


http://sources.redhat.com/gdb/current/onlinedocs/gdb_25.html#SEC207

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: libgdb
  2003-04-17  1:44       ` libgdb Elena Zannoni
@ 2003-04-17  2:06         ` Smita
  2003-04-17  2:12           ` finish implementation Smita
  2003-04-17 12:57           ` libgdb Elena Zannoni
  2003-04-17  2:11         ` finish for nested function calls Smita
  1 sibling, 2 replies; 13+ messages in thread
From: Smita @ 2003-04-17  2:06 UTC (permalink / raw)
  To: Elena Zannoni; +Cc: gdb

Where can I get libgdb from?

Thanks!
Smita

On Wed, 16 Apr 2003, Elena Zannoni wrote:

> Smita writes:
>  > Hi,
>  >  I am new to libgdb. Could someone please give me a pointer to its usage
>  > documentaion?
>  > Thanks
>  > Smita
>  >
>
>
> http://sources.redhat.com/gdb/current/onlinedocs/gdb_25.html#SEC207
>

^ permalink raw reply	[flat|nested] 13+ messages in thread

* finish for nested function calls
  2003-04-17  1:44       ` libgdb Elena Zannoni
  2003-04-17  2:06         ` libgdb Smita
@ 2003-04-17  2:11         ` Smita
  1 sibling, 0 replies; 13+ messages in thread
From: Smita @ 2003-04-17  2:11 UTC (permalink / raw)
  To: gdb

Hi,
 What is the expected behavior of finish when it is called from multiple
nested funtions?
e.g:
f1() calls f2():
f1()
{
  f2()
}

i do this in gdb:
b f1
finish
end
b f2
finish
end

finish takes effect only for f2() (the innermost function)
So, I get return value from f2() and gdb stops after it returns from f2().
I don't get the return value for f1().
Is that the expected beahvior?

Thanks
Smita



^ permalink raw reply	[flat|nested] 13+ messages in thread

* finish implementation
  2003-04-17  2:06         ` libgdb Smita
@ 2003-04-17  2:12           ` Smita
  2003-04-17 12:57           ` libgdb Elena Zannoni
  1 sibling, 0 replies; 13+ messages in thread
From: Smita @ 2003-04-17  2:12 UTC (permalink / raw)
  To: gdb

Hi,
 How is finish implemented? Is it an internal breakpoint for gdb which is
not visible to user?

Thanks
Smita


^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: return type of a fucntion
  2003-04-16 19:51 ` return type of a fucntion Smita
  2003-04-16 19:59   ` gdb's communication to a process/libgdb? Smita
@ 2003-04-17  3:37   ` Peter Barada
  1 sibling, 0 replies; 13+ messages in thread
From: Peter Barada @ 2003-04-17  3:37 UTC (permalink / raw)
  To: smita; +Cc: brandner, gdb


>Hi,
>When I print $r3 on returning from a function, I get the return value. But
>is there a way to get the type of the return value (eg. whether it is a
>pointer or an interger)??

If you know which function you're in, you could always 'ptype
functionName' where 'fuctionName' is replaced with the function's name
and you'll see the type that the function returns. Then you could cast
$r3 to that type.  Of course this doesn't works so well with
float/double as well as structures.

-- 
Peter Barada
peter@baradas.org

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: gdb refuses to 'break'
  2003-04-16 18:18 gdb refuses to 'break' Markus Brandner
  2003-04-16 19:51 ` return type of a fucntion Smita
@ 2003-04-17  9:13 ` Markus Brandner
  1 sibling, 0 replies; 13+ messages in thread
From: Markus Brandner @ 2003-04-17  9:13 UTC (permalink / raw)
  To: Markus Brandner; +Cc: gdb

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Wednesday 16 April 2003 20:17, you wrote:

[...]

> gdb seems to run straight through ignoring the break.
> I tried break: line number - same result
> I even get the same results using gdb 5.3.

This issue is resolved.
The no-'break' problem was not at all related to gdb :)
I ran the test on different machines - every single on (except
the one with the 2.2.21 kernel) having installed the no-ptrace 
kernel patch!

Markus
- -- 
- -----------------------------------------------------------------
Markus Brandner               Institute of Electrical Measurement
                                and Measurement Signal Processing
phone: +43 316 873 7773             Graz University of Technology
fax:   +43 316 873 4279                     Schiessstattgasse 14B
email: brandner@emt.tugraz.at                 A8010 Graz, Austria
- -----------------------------------------------------------------
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (GNU/Linux)
Comment: For info see http://www.gnupg.org

iD8DBQE+nnAQjjwO/+h9egkRAnduAJ9WBCTFODlmqFXyuvAo5zu3cVV2RACfUgdy
+eCEg9lDk1yy/af1g34I4/M=
=oMRO
-----END PGP SIGNATURE-----

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: libgdb
  2003-04-17  2:06         ` libgdb Smita
  2003-04-17  2:12           ` finish implementation Smita
@ 2003-04-17 12:57           ` Elena Zannoni
  1 sibling, 0 replies; 13+ messages in thread
From: Elena Zannoni @ 2003-04-17 12:57 UTC (permalink / raw)
  To: Smita; +Cc: Elena Zannoni, gdb

Smita writes:
 > Where can I get libgdb from?
 > 

there is no libgdb entity per se. The Mi interface is included with the
regular gdb sources.

 > Thanks!
 > Smita
 > 
 > On Wed, 16 Apr 2003, Elena Zannoni wrote:
 > 
 > > Smita writes:
 > >  > Hi,
 > >  >  I am new to libgdb. Could someone please give me a pointer to its usage
 > >  > documentaion?
 > >  > Thanks
 > >  > Smita
 > >  >
 > >
 > >
 > > http://sources.redhat.com/gdb/current/onlinedocs/gdb_25.html#SEC207
 > >

^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2003-04-17 12:57 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-04-16 18:18 gdb refuses to 'break' Markus Brandner
2003-04-16 19:51 ` return type of a fucntion Smita
2003-04-16 19:59   ` gdb's communication to a process/libgdb? Smita
2003-04-16 20:04     ` Daniel Jacobowitz
2003-04-16 22:07     ` libgdb Smita
2003-04-16 23:58       ` is libgdb okay to use? Smita
2003-04-17  1:44       ` libgdb Elena Zannoni
2003-04-17  2:06         ` libgdb Smita
2003-04-17  2:12           ` finish implementation Smita
2003-04-17 12:57           ` libgdb Elena Zannoni
2003-04-17  2:11         ` finish for nested function calls Smita
2003-04-17  3:37   ` return type of a fucntion Peter Barada
2003-04-17  9:13 ` gdb refuses to 'break' Markus Brandner

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).