Mirror of the gdb mailing list
 help / color / mirror / Atom feed
* add-symbol-file parsing
@ 2002-11-29  2:54 Mark Santcroos
  2002-12-02 21:29 ` Daniel Jacobowitz
  0 siblings, 1 reply; 7+ messages in thread
From: Mark Santcroos @ 2002-11-29  2:54 UTC (permalink / raw)
  To: gdb

Unlike the documentation says the 'address' argument to 'add-symbol-file'
is not parsed as an expression but directly as an address.

The following commands ...

(gdb) set $text_addr = 0xdeadc0de
(gdb) add-symbol-file /dir/symbol.file $text_addr

.. will end up setting the address to 0 by strtoul down in the code path.

The above will therefor not work. Is there another way I can achieve this?

If this is not possible (in another way) will patches be accepted to make
this an expression?

Mark

-- 
Mark Santcroos                    RIPE Network Coordination Centre
http://www.ripe.net/home/mark/    New Projects Group/TTM


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

* Re: add-symbol-file parsing
  2002-11-29  2:54 add-symbol-file parsing Mark Santcroos
@ 2002-12-02 21:29 ` Daniel Jacobowitz
  2002-12-02 21:43   ` Richard Sharpe
  2002-12-02 23:49   ` Mark Santcroos
  0 siblings, 2 replies; 7+ messages in thread
From: Daniel Jacobowitz @ 2002-12-02 21:29 UTC (permalink / raw)
  To: Mark Santcroos; +Cc: gdb

On Fri, Nov 29, 2002 at 11:54:48AM +0100, Mark Santcroos wrote:
> Unlike the documentation says the 'address' argument to 'add-symbol-file'
> is not parsed as an expression but directly as an address.
> 
> The following commands ...
> 
> (gdb) set $text_addr = 0xdeadc0de
> (gdb) add-symbol-file /dir/symbol.file $text_addr
> 
> .. will end up setting the address to 0 by strtoul down in the code path.
> 
> The above will therefor not work. Is there another way I can achieve this?
> 
> If this is not possible (in another way) will patches be accepted to make
> this an expression?

The problem is, add-symbol-file takes more than a $text_addr.  It also
takes a series of -s SECNAME $sec_addr.  We could:

 - split the command line at -s options and parse anything before the
   next -s option as an expression, assuming people will not foolishly
   use -s in their expression;
 - allow only convenience variables

Option 2 may be the way to go... What do others think about allowing
integer-or-convenience-variable there?

-- 
Daniel Jacobowitz
MontaVista Software                         Debian GNU/Linux Developer


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

* Re: add-symbol-file parsing
  2002-12-02 21:29 ` Daniel Jacobowitz
@ 2002-12-02 21:43   ` Richard Sharpe
  2002-12-02 23:49   ` Mark Santcroos
  1 sibling, 0 replies; 7+ messages in thread
From: Richard Sharpe @ 2002-12-02 21:43 UTC (permalink / raw)
  To: Daniel Jacobowitz; +Cc: Mark Santcroos, gdb

On Tue, 3 Dec 2002, Daniel Jacobowitz wrote:

> On Fri, Nov 29, 2002 at 11:54:48AM +0100, Mark Santcroos wrote:
> > Unlike the documentation says the 'address' argument to 'add-symbol-file'
> > is not parsed as an expression but directly as an address.
> > 
> > The following commands ...
> > 
> > (gdb) set $text_addr = 0xdeadc0de
> > (gdb) add-symbol-file /dir/symbol.file $text_addr
> > 
> > .. will end up setting the address to 0 by strtoul down in the code path.
> > 
> > The above will therefor not work. Is there another way I can achieve this?
> > 
> > If this is not possible (in another way) will patches be accepted to make
> > this an expression?
> 
> The problem is, add-symbol-file takes more than a $text_addr.  It also
> takes a series of -s SECNAME $sec_addr.  We could:
> 
>  - split the command line at -s options and parse anything before the
>    next -s option as an expression, assuming people will not foolishly
>    use -s in their expression;
>  - allow only convenience variables
> 
> Option 2 may be the way to go... What do others think about allowing
> integer-or-convenience-variable there?

I would love to be able to use convenience variables for the file name and 
the text_addr. I started looking at it in 5.2.1, but quickly got bogged 
down in a twisty maze of code.

Regards
-----
Richard Sharpe, rsharpe[at]ns.aus.com, rsharpe[at]samba.org, 
sharpe[at]ethereal.com, http://www.richardsharpe.com


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

* Re: add-symbol-file parsing
  2002-12-02 21:29 ` Daniel Jacobowitz
  2002-12-02 21:43   ` Richard Sharpe
@ 2002-12-02 23:49   ` Mark Santcroos
  2002-12-05 17:02     ` Fernando Nasser
  1 sibling, 1 reply; 7+ messages in thread
From: Mark Santcroos @ 2002-12-02 23:49 UTC (permalink / raw)
  To: gdb

Hi Daniel,

On Tue, Dec 03, 2002 at 12:29:39AM -0500, Daniel Jacobowitz wrote:
> The problem is, add-symbol-file takes more than a $text_addr.  It also
> takes a series of -s SECNAME $sec_addr.  We could:
> 
>  - split the command line at -s options and parse anything before the
>    next -s option as an expression, assuming people will not foolishly
>    use -s in their expression;
>  - allow only convenience variables
> 
> Option 2 may be the way to go... What do others think about allowing
> integer-or-convenience-variable there?

Option 2 would at least enable us to do everything. In the worst case you
would have to add another line to your macro that does the
expression-to-convinience-variable-translation.

Please let me know if you don't have time and would prefer me to tackle
this.

Thanks

Mark

-- 
Mark Santcroos                    RIPE Network Coordination Centre
http://www.ripe.net/home/mark/    New Projects Group/TTM


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

* Re: add-symbol-file parsing
  2002-12-02 23:49   ` Mark Santcroos
@ 2002-12-05 17:02     ` Fernando Nasser
  2002-12-05 17:10       ` Daniel Jacobowitz
  2002-12-05 17:13       ` Richard Sharpe
  0 siblings, 2 replies; 7+ messages in thread
From: Fernando Nasser @ 2002-12-05 17:02 UTC (permalink / raw)
  To: Mark Santcroos; +Cc: gdb

We have been talking of an eval command in another thread that would also solve 
this problem.

eval add-symbol-file /dir/symbol.file $text_addr

would cause

add-symbol-file /dir/symbol.file 0xdeadc0de

to be executed.


Fernando

-- 
Fernando Nasser
Red Hat - Toronto                       E-Mail:

Mark Santcroos wrote:> Hi Daniel,
> 
> On Tue, Dec 03, 2002 at 12:29:39AM -0500, Daniel Jacobowitz wrote:
> 
>>The problem is, add-symbol-file takes more than a $text_addr.  It also
>>takes a series of -s SECNAME $sec_addr.  We could:
>>
>> - split the command line at -s options and parse anything before the
>>   next -s option as an expression, assuming people will not foolishly
>>   use -s in their expression;
>> - allow only convenience variables
>>
>>Option 2 may be the way to go... What do others think about allowing
>>integer-or-convenience-variable there?
> 
> 
> Option 2 would at least enable us to do everything. In the worst case you
> would have to add another line to your macro that does the
> expression-to-convinience-variable-translation.
> 
> Please let me know if you don't have time and would prefer me to tackle
> this.
> 
> Thanks
> 
> Mark
> 


@redhat.com
2323 Yonge Street, Suite #300
Toronto, Ontario   M4P 2C9


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

* Re: add-symbol-file parsing
  2002-12-05 17:02     ` Fernando Nasser
@ 2002-12-05 17:10       ` Daniel Jacobowitz
  2002-12-05 17:13       ` Richard Sharpe
  1 sibling, 0 replies; 7+ messages in thread
From: Daniel Jacobowitz @ 2002-12-05 17:10 UTC (permalink / raw)
  To: Fernando Nasser; +Cc: Mark Santcroos, gdb

Mostly as a workaround for this...

Which would you prefer - changing add-symbol-file or a more general
eval command?  What would you think natural to evaluate - just
convenience variables?  Parsing expressions out of such a thing is hard
in the general case.  Hmm... we could allow (EXPR), i.e. require the
parentheses.

Honestly, rather than adding an eval command, I'd prefer to see $var
and (EXPR) accepted _everywhere_ the CLI looks for an integer.  Some
unified functions to parse command lines is all it would take.

On Thu, Dec 05, 2002 at 08:02:14PM -0500, Fernando Nasser wrote:
> We have been talking of an eval command in another thread that would also 
> solve this problem.
> 
> eval add-symbol-file /dir/symbol.file $text_addr
> 
> would cause
> 
> add-symbol-file /dir/symbol.file 0xdeadc0de
> 
> to be executed.
> 
> 
> Fernando
> 
> -- 
> Fernando Nasser
> Red Hat - Toronto                       E-Mail:
> 
> Mark Santcroos wrote:> Hi Daniel,
> >
> >On Tue, Dec 03, 2002 at 12:29:39AM -0500, Daniel Jacobowitz wrote:
> >
> >>The problem is, add-symbol-file takes more than a $text_addr.  It also
> >>takes a series of -s SECNAME $sec_addr.  We could:
> >>
> >>- split the command line at -s options and parse anything before the
> >>  next -s option as an expression, assuming people will not foolishly
> >>  use -s in their expression;
> >>- allow only convenience variables
> >>
> >>Option 2 may be the way to go... What do others think about allowing
> >>integer-or-convenience-variable there?
> >
> >
> >Option 2 would at least enable us to do everything. In the worst case you
> >would have to add another line to your macro that does the
> >expression-to-convinience-variable-translation.
> >
> >Please let me know if you don't have time and would prefer me to tackle
> >this.
> >
> >Thanks
> >
> >Mark
> >
> 
> 
> @redhat.com
> 2323 Yonge Street, Suite #300
> Toronto, Ontario   M4P 2C9
> 
> 

-- 
Daniel Jacobowitz
MontaVista Software                         Debian GNU/Linux Developer


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

* Re: add-symbol-file parsing
  2002-12-05 17:02     ` Fernando Nasser
  2002-12-05 17:10       ` Daniel Jacobowitz
@ 2002-12-05 17:13       ` Richard Sharpe
  1 sibling, 0 replies; 7+ messages in thread
From: Richard Sharpe @ 2002-12-05 17:13 UTC (permalink / raw)
  To: Fernando Nasser; +Cc: Mark Santcroos, gdb

On Thu, 5 Dec 2002, Fernando Nasser wrote:

> We have been talking of an eval command in another thread that would also solve 
> this problem.
> 
> eval add-symbol-file /dir/symbol.file $text_addr
> 
> would cause
> 
> add-symbol-file /dir/symbol.file 0xdeadc0de
> 
> to be executed.

The problem I saw was that it seemed that all of the routines that dealt 
with evaluating variables were tuned to the printf command and writing 
them to the output descriptor ... :-)

Regards
-----
Richard Sharpe, rsharpe[at]ns.aus.com, rsharpe[at]samba.org, 
sharpe[at]ethereal.com, http://www.richardsharpe.com


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

end of thread, other threads:[~2002-12-06  1:13 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-11-29  2:54 add-symbol-file parsing Mark Santcroos
2002-12-02 21:29 ` Daniel Jacobowitz
2002-12-02 21:43   ` Richard Sharpe
2002-12-02 23:49   ` Mark Santcroos
2002-12-05 17:02     ` Fernando Nasser
2002-12-05 17:10       ` Daniel Jacobowitz
2002-12-05 17:13       ` Richard Sharpe

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox