public inbox for gdb@sourceware.org
 help / color / mirror / Atom feed
* Compilation directories
@ 2004-10-05 11:52 José Miguel
  2004-10-06  2:00 ` Andrew Cagney
  0 siblings, 1 reply; 6+ messages in thread
From: José Miguel @ 2004-10-05 11:52 UTC (permalink / raw)
  To: gdb


Hi, friends!

My name is Jose Miguel and I am trying to get the value of cdir. I mean, if I 
type

show directories

I get

Source directories searched: $cdir:$cwd

but, I cannot find out the way to get the values of those directories. The 
print command doesn't seem to work. Any idea?
Thank you indeed.

PD: sorry if I made mistakes with my English.

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

* Re: Compilation directories
  2004-10-05 11:52 Compilation directories José Miguel
@ 2004-10-06  2:00 ` Andrew Cagney
  2004-10-06  2:59   ` Daniel Jacobowitz
  0 siblings, 1 reply; 6+ messages in thread
From: Andrew Cagney @ 2004-10-06  2:00 UTC (permalink / raw)
  To: José Miguel; +Cc: gdb

> Hi, friends!
> 
> My name is Jose Miguel and I am trying to get the value of cdir. I mean, if I 
> type
> 
> show directories
> 
> I get
> 
> Source directories searched: $cdir:$cwd
> 
> but, I cannot find out the way to get the values of those directories. The 
> print command doesn't seem to work. Any idea?
> Thank you indeed.

I just hit the same problem:
	(gdb) print $cdir
	$1 = void
doesn't help.  Anyone?

Andrew


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

* Re: Compilation directories
  2004-10-06  2:00 ` Andrew Cagney
@ 2004-10-06  2:59   ` Daniel Jacobowitz
  2004-10-06 10:01     ` José Miguel
  0 siblings, 1 reply; 6+ messages in thread
From: Daniel Jacobowitz @ 2004-10-06  2:59 UTC (permalink / raw)
  To: Andrew Cagney; +Cc: José Miguel, gdb

On Tue, Oct 05, 2004 at 09:57:22PM -0400, Andrew Cagney wrote:
> >Hi, friends!
> >
> >My name is Jose Miguel and I am trying to get the value of cdir. I mean, 
> >if I type
> >
> >show directories
> >
> >I get
> >
> >Source directories searched: $cdir:$cwd
> >
> >but, I cannot find out the way to get the values of those directories. The 
> >print command doesn't seem to work. Any idea?
> >Thank you indeed.
> 
> I just hit the same problem:
> 	(gdb) print $cdir
> 	$1 = void
> doesn't help.  Anyone?

There is no way to do it.  $cdir isn't a convenience variable, because
there's no way for convenience variables to represent strings today. 
It's just text substitution in the source path searching.

-- 
Daniel Jacobowitz

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

* Re: Compilation directories
  2004-10-06  2:59   ` Daniel Jacobowitz
@ 2004-10-06 10:01     ` José Miguel
  2004-10-06 13:40       ` Daniel Jacobowitz
  0 siblings, 1 reply; 6+ messages in thread
From: José Miguel @ 2004-10-06 10:01 UTC (permalink / raw)
  To: gdb

On Wednesday 06 October 2004 04:18, Daniel Jacobowitz wrote:
> There is no way to do it.  $cdir isn't a convenience variable, because
> there's no way for convenience variables to represent strings today.
> It's just text substitution in the source path searching.

So, is there any way to work with absolute paths? I mean, if I'm debugging a 
program
 mcore-elf-gdb sample.elf
and I type
 info sources
I get no information about paths
 main.c, set_led.c
This is always that way although executable file and sources are in different 
directories. I know gdb knows where to find the source files because if I 
type
 info source main
gdb asks me
 Current source file is main.c
 Compilation directory is /home/matt/proyecto/gnusample
 Located in /home/matt/proyecto/gnusample/main.c
Then, my question is if there's a way to get something like
 info sources
 /home/matt/proyecto/gnusample/main.c, /home/matt/proyecto/gnusample/set_led.c
I'm trying to make a front end for gdb, so if I want to show the source files 
I need to know where to find them.
Thanks.
Jose Miguel


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

* Re: Compilation directories
  2004-10-06 10:01     ` José Miguel
@ 2004-10-06 13:40       ` Daniel Jacobowitz
  2004-10-07 12:23         ` José Miguel
  0 siblings, 1 reply; 6+ messages in thread
From: Daniel Jacobowitz @ 2004-10-06 13:40 UTC (permalink / raw)
  To: José Miguel; +Cc: gdb

On Wed, Oct 06, 2004 at 10:36:49AM +0200, José Miguel wrote:
> On Wednesday 06 October 2004 04:18, Daniel Jacobowitz wrote:
> > There is no way to do it.  $cdir isn't a convenience variable, because
> > there's no way for convenience variables to represent strings today.
> > It's just text substitution in the source path searching.
> 
> So, is there any way to work with absolute paths? I mean, if I'm debugging a 
> program
>  mcore-elf-gdb sample.elf
> and I type
>  info sources
> I get no information about paths
>  main.c, set_led.c
> This is always that way although executable file and sources are in different 
> directories. I know gdb knows where to find the source files because if I 
> type
>  info source main
> gdb asks me
>  Current source file is main.c
>  Compilation directory is /home/matt/proyecto/gnusample
>  Located in /home/matt/proyecto/gnusample/main.c
> Then, my question is if there's a way to get something like
>  info sources
>  /home/matt/proyecto/gnusample/main.c, /home/matt/proyecto/gnusample/set_led.c
> I'm trying to make a front end for gdb, so if I want to show the source files 
> I need to know where to find them.

I recommend you use GDB 6.2, and the MI command
-file-list-exec-source-files.  You want the "fullname" portion of the
output.

-- 
Daniel Jacobowitz

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

* Re: Compilation directories
  2004-10-06 13:40       ` Daniel Jacobowitz
@ 2004-10-07 12:23         ` José Miguel
  0 siblings, 0 replies; 6+ messages in thread
From: José Miguel @ 2004-10-07 12:23 UTC (permalink / raw)
  To: gdb

On Wednesday 06 October 2004 15:39, Daniel Jacobowitz wrote:
> On Wed, Oct 06, 2004 at 10:36:49AM +0200, José Miguel wrote:
> > On Wednesday 06 October 2004 04:18, Daniel Jacobowitz wrote:
> > > There is no way to do it.  $cdir isn't a convenience variable, because
> > > there's no way for convenience variables to represent strings today.
> > > It's just text substitution in the source path searching.
> >
> > So, is there any way to work with absolute paths? I mean, if I'm
> > debugging a program
> >  mcore-elf-gdb sample.elf
> > and I type
> >  info sources
> > I get no information about paths
> >  main.c, set_led.c
> > This is always that way although executable file and sources are in
> > different directories. I know gdb knows where to find the source files
> > because if I type
> >  info source main
> > gdb asks me
> >  Current source file is main.c
> >  Compilation directory is /home/matt/proyecto/gnusample
> >  Located in /home/matt/proyecto/gnusample/main.c
> > Then, my question is if there's a way to get something like
> >  info sources
> >  /home/matt/proyecto/gnusample/main.c,
> > /home/matt/proyecto/gnusample/set_led.c I'm trying to make a front end
> > for gdb, so if I want to show the source files I need to know where to
> > find them.
>
> I recommend you use GDB 6.2, and the MI command
> -file-list-exec-source-files.  You want the "fullname" portion of the
> output.

That's exactly what I want. Thank you very much.

Jose Miguel

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

end of thread, other threads:[~2004-10-07 10:56 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-10-05 11:52 Compilation directories José Miguel
2004-10-06  2:00 ` Andrew Cagney
2004-10-06  2:59   ` Daniel Jacobowitz
2004-10-06 10:01     ` José Miguel
2004-10-06 13:40       ` Daniel Jacobowitz
2004-10-07 12:23         ` José Miguel

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).