This is the mail archive of the frysk@sourceware.org mailing list for the frysk project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [patch] Accept symbolic addresses in spin button, bug 4673.


Pearly,
Hi,
This is a new patch. It adds getSymbol(task, name) method to
SymbolFactory. The BreakpointManager and FunctionBreakpoint are changed
to use this method instead of using the one defined by themselves.

Any suggestions are welcomed.

Pearly
On Wed, 2007-09-12 at 08:33 -0500, PEARLY.ZHAO@oracle.com wrote:
> Actually, retrieving symbol addresses in the classes implementing the disssembly and memory windows is a wrong way to implement this functionality. Maybe it should be designed at core. The classes handling the windows merely use it to obtain the information.
Yes, agreed; but rather than assuming the string is a symbol, would it be more robust to evaluate the string as an expression? Thus allowing arbitrary expressions and symbols vis:
foo+10
and not limiting things to symbols (See DisassembleCommand for how it evaluates its parameters).


BTW,

+ + /**
+ * Get address list by symbol name
+ * @param task
+ * @param name
+ * @return address list
+ */
+ public static LinkedList getSymbol(Task task, String name) {
+ Dwfl dwfl = DwflCache.getDwfl(task);
+ DwflModule[] modules = dwfl.getModules();
+ final LinkedList addrs = new LinkedList();


is for searching out duplicate symbols so that a breakpoint can be inserted at all locations; since here only a single location (based on the current pc and elf/c scope rules) is needed, using it and discarding all but the first address isn't correct. You can assume that the expression evaluator will get this right, and if it doesn't we've an expression evaluation bug.

In refactoring getSymbol to frysk.symtab.SymbolFactory did you take the opportunity to add a test case?

Andrew


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]